Skip to content
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

Fix for error when getting sgtk alembic nodes. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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