Skip to content

Fix for error when getting sgtk alembic nodes.#9

Open
reformstudios wants to merge 1 commit intoshotgunsoftware:masterfrom
reformstudios:patch-1
Open

Fix for error when getting sgtk alembic nodes.#9
reformstudios wants to merge 1 commit intoshotgunsoftware:masterfrom
reformstudios:patch-1

Conversation

@reformstudios
Copy link

The following methods are failing :-
hou.nodeType(hou.ropNodeTypeCategory(), tk_node_type).instances()
hou.nodeType(hou.sopNodeTypeCategory(), tk_node_type).instances()

This is because if there are no nodes of that type, the first part of the line returns None, and raises an error as it has no "instances()" method.

The nodes need to be gathered first, and if there are are any, THEN get their instances.

The following methods are failing :-
hou.nodeType(hou.ropNodeTypeCategory(), tk_node_type).instances()
hou.nodeType(hou.sopNodeTypeCategory(), tk_node_type).instances()

This is because if there are no nodes of that type, the first part of the line returns None, and raises an error as it has no "instances()" method. 

The nodes need to be gathered first, and if there are are any, THEN get their instances.
tk_alembic_nodes.extend(
rop_nodes.instances()
)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

sop_nodes = hou.nodeType(hou.sopNodeTypeCategory(), tk_node_type)
rop_nodes = hou.nodeType(hou.ropNodeTypeCategory(), tk_node_type)
if sop_nodes:
tk_alembic_nodes.extend(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

sop_nodes = hou.nodeType(hou.sopNodeTypeCategory(), tk_node_type)
rop_nodes = hou.nodeType(hou.ropNodeTypeCategory(), tk_node_type)
if sop_nodes:
tk_alembic_nodes.extend(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace


sop_nodes = hou.nodeType(hou.sopNodeTypeCategory(), cls.HOU_SOP_ALEMBIC_TYPE)
rop_nodes = hou.nodeType(hou.ropNodeTypeCategory(), cls.HOU_ROP_ALEMBIC_TYPE)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

hou.ropNodeTypeCategory(), cls.HOU_ROP_ALEMBIC_TYPE
).instances()
)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black would make changes.
blank line contains whitespace

@pscadding pscadding added the Logged logged in Jira label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Logged logged in Jira

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants