修改sample_uuid的返回值

This commit is contained in:
zhangshixiang
2025-12-06 01:33:04 +08:00
parent b1cdef9185
commit 91aadba4ef
9 changed files with 44334 additions and 32 deletions

View File

@@ -146,8 +146,20 @@ class ResourceDictInstance(object):
content["data"] = {}
if not content.get("extra"): # MagicCode
content["extra"] = {}
if "pose" not in content:
content["pose"] = content.pop("position", {})
if "position" in content:
pose = content["config"].get("pose",{})
if "position" not in pose :
if "position" in content["position"]:
pose["position"] = content["position"]["position"]
else:
pose["position"] = {"x": 0, "y": 0, "z": 0}
if "size" not in pose:
pose["size"] = {
"width": content["config"].get("size_x", 0),
"height": content["config"].get("size_y", 0),
"depth": content["config"].get("size_z", 0)
}
content["pose"] = pose
return ResourceDictInstance(ResourceDict.model_validate(content))
def get_plr_nested_dict(self) -> Dict[str, Any]: