mirror of
https://github.com/deepmodeling/Uni-Lab-OS
synced 2026-04-27 08:50:01 +00:00
修改角度读取方式
This commit is contained in:
@@ -593,7 +593,7 @@ def resource_ulab_to_plr(resource: dict, plr_model=False) -> "ResourcePLR":
|
||||
"size_y": resource["config"].get("size_y", 0),
|
||||
"size_z": resource["config"].get("size_z", 0),
|
||||
"location": {**resource["position"], "type": "Coordinate"},
|
||||
"rotation": {"x": 0, "y": 0, "z": 0, "type": "Rotation"}, # Resource如果没有rotation,是plr版本太低
|
||||
"rotation": {resource["config"].get("rotation", {"x": 0, "y": 0, "z": 0, "type": "Rotation"})}, # Resource如果没有rotation,是plr版本太低
|
||||
"category": resource["type"],
|
||||
"model": resource["config"].get("model", None), # resource中deck没有model
|
||||
"children": (
|
||||
|
||||
@@ -244,6 +244,12 @@ class ResourceDictInstance(object):
|
||||
height= content["config"].get("size_y", 0),
|
||||
depth= content["config"].get("size_z", 0),
|
||||
)
|
||||
if "rotation" not in pose:
|
||||
pose["rotation"] = ResourceDictPositionObjectType(
|
||||
x=content["config"].get("rotation", {}).get("x", 0),
|
||||
y=content["config"].get("rotation", {}).get("y", 0),
|
||||
z=content["config"].get("rotation", {}).get("z", 0),
|
||||
)
|
||||
content["pose"] = pose
|
||||
try:
|
||||
res_dict = ResourceDict.model_validate(content)
|
||||
|
||||
Reference in New Issue
Block a user