Skip to content

Commit d72ce07

Browse files
committed
docs: add model-container py example
1 parent c52ac6b commit d72ce07

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: ModelContainer
3+
layout: default
4+
parent: Attributes
5+
grand_parent: Python Library
6+
---
7+
8+
# Model Container
9+
10+
Overrides absolute size for a 3D model. The model can be a glTF, glb, obj, or any other supported format. The model will be rescaled to fit to the sizes specified for each axes.
11+
12+
This example scales the Duck model into a 10 x 10 x 10 box.
13+
14+
`arena-py` API Reference for [ModelContainer](/content/python-api/attributes/model_container).
15+
16+
```python
17+
from arena import *
18+
19+
scene = Scene(host="arenaxr.org", scene="example")
20+
21+
model_container = ModelContainer(
22+
x=10,
23+
y=10,
24+
z=10,
25+
)
26+
27+
@scene.run_once
28+
def make_model_container():
29+
scene.add_object(
30+
GltfModel(
31+
object_id="gltf-model-duck",
32+
url="store/models/Duck.glb",
33+
position=(0, 1, -5),
34+
model_container=model_container,
35+
persist=True,
36+
)
37+
)
38+
39+
scene.run_tasks()
40+
```

0 commit comments

Comments
 (0)