Skip to content

Commit

Permalink
Merge pull request #274 from BigRoy/enhancement/houdini_load_alembic_…
Browse files Browse the repository at this point in the history
…no_unpack

Houdini: Alembic Load do not create `unpack`, `normal` and `null`
  • Loading branch information
antirotor authored Apr 22, 2024
2 parents 01fa343 + 993da4e commit c663a32
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions client/ayon_core/hosts/houdini/plugins/load/load_alembic.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,11 @@ def load(self, context, name=None, namespace=None, data=None):
alembic = container.createNode("alembic", node_name=node_name)
alembic.setParms({"fileName": file_path})

# Add unpack node
unpack_name = "unpack_{}".format(name)
unpack = container.createNode("unpack", node_name=unpack_name)
unpack.setInput(0, alembic)
unpack.setParms({"transfer_attributes": "path"})
# Position nodes nicely
container.moveToGoodPosition()
container.layoutChildren()

# Add normal to points
# Order of menu ['point', 'vertex', 'prim', 'detail']
normal_name = "normal_{}".format(name)
normal_node = container.createNode("normal", node_name=normal_name)
normal_node.setParms({"type": 0})

normal_node.setInput(0, unpack)

null = container.createNode("null", node_name="OUT")
null.setInput(0, normal_node)

# Ensure display flag is on the Alembic input node and not on the OUT
# node to optimize "debug" displaying in the viewport.
alembic.setDisplayFlag(True)

# Set new position for unpack node else it gets cluttered
nodes = [container, alembic, unpack, normal_node, null]
for nr, node in enumerate(nodes):
node.setPosition([0, (0 - nr)])

self[:] = nodes
nodes = [container, alembic]

return pipeline.containerise(
node_name,
Expand Down

0 comments on commit c663a32

Please sign in to comment.