Create GameObject. Args: name: Name for the new GameObject primitive_type: Primitive type (e.g., "Cube", "Sphere") parent: Parent GameObject name parent_id: Parent GameObject instance ID position: Initial position [x, y, z]
(
self,
name: str,
primitive_type: str | None = None,
parent: str | None = None,
parent_id: int | None = None,
position: list[float] | None = None,
rotation: list[float] | None = None,
scale: list[float] | None = None,
)
| 36 | return self._conn.send_request("gameobject", params) |
| 37 | |
| 38 | def create( |
| 39 | self, |
| 40 | name: str, |
| 41 | primitive_type: str | None = None, |
| 42 | parent: str | None = None, |
| 43 | parent_id: int | None = None, |
| 44 | position: list[float] | None = None, |
| 45 | rotation: list[float] | None = None, |
| 46 | scale: list[float] | None = None, |
| 47 | ) -> dict[str, Any]: |
| 48 | """Create GameObject. |
| 49 | |
| 50 | Args: |
| 51 | name: Name for the new GameObject |
| 52 | primitive_type: Primitive type (e.g., "Cube", "Sphere") |
| 53 | parent: Parent GameObject name |
| 54 | parent_id: Parent GameObject instance ID |
| 55 | position: Initial position [x, y, z] |
| 56 | rotation: Initial rotation [x, y, z] |
| 57 | scale: Initial scale [x, y, z] |
| 58 | |
| 59 | Returns: |
| 60 | Dictionary with created GameObject info |
| 61 | """ |
| 62 | params: dict[str, Any] = {"action": "create", "name": name} |
| 63 | if primitive_type: |
| 64 | params["primitive"] = primitive_type |
| 65 | if parent: |
| 66 | params["parent"] = parent |
| 67 | if parent_id is not None: |
| 68 | params["parentId"] = parent_id |
| 69 | if position: |
| 70 | params["position"] = position |
| 71 | if rotation: |
| 72 | params["rotation"] = rotation |
| 73 | if scale: |
| 74 | params["scale"] = scale |
| 75 | return self._conn.send_request("gameobject", params) |
| 76 | |
| 77 | def modify( |
| 78 | self, |