-
Notifications
You must be signed in to change notification settings - Fork 1
add support for scene #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
transformation = ( | ||
sceneobject.transformation | ||
if sceneobject.transformation is not None | ||
else Transformation() | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bit convoluted syntax, why not plain:
transformation = ( | |
sceneobject.transformation | |
if sceneobject.transformation is not None | |
else Transformation() | |
) | |
transformation = sceneobject.transformation | |
if transformation is None: | |
transformation = Transformation() |
else Transformation() | ||
) | ||
|
||
prim = prim_from_transformation(stage, "/" + "/".join(path), transformation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this path concat using /
work on Windows also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we not use pathlib
or at least os.path
for this?
return prim | ||
|
||
|
||
def prim_from_item(stage: Usd.Stage, item: Data, parent_path=[]) -> Usd.Prim: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use []
empty list as default arg value, this has nasty consequences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parent_path = parent_path or []
if isinstance(item, Box): | ||
prim = prim_from_box(stage, "/" + "/".join(path), item) | ||
elif isinstance(item, Sphere): | ||
prim = prim_from_sphere(stage, "/" + "/".join(path), item) | ||
elif isinstance(item, Mesh): | ||
prim = prim_from_mesh(stage, "/" + "/".join(path), item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question about whether these paths using the unix slash work on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about using pathlib
add support to convert a compas scene to a usd stage.
plz see example added at
scripts/scene.py