Skip to content

Commit

Permalink
focus null better ux (needs placement!)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonreeves committed Jan 13, 2023
1 parent 4afa833 commit 43fc0b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion scripts/python/bee/focus_null.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

def main():
nodes = hou.selectedNodes()
# Init to record if a camera was selected at all
any_camera_selected = False

for node in nodes:
if node.type().name() != 'cam':
continue

# A camera was found!
any_camera_selected = True

# create null
focus_null = node.parent().createNode('null', node.name() + '_focus')
Expand All @@ -16,4 +21,9 @@ def main():
focus_null.parm('shadedmode').set(1)
focus_null.parm('controltype').set(2)
focus_null.parm('geoscale').set(0.1)
focus_null.parmTuple('dcolor').set((0,0.1,1))
focus_null.parmTuple('dcolor').set((0, 0.1 ,1))

if not any_camera_selected:
message = "There were no cameras found in selection! Please select camera(s)"
hou.ui.setStatusMessage(message=message, severity=hou.severityType.ImportantMessage)
return
2 changes: 1 addition & 1 deletion toolbar/bee.shelf
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bee.list_materials.main()]]></script>
</keywordList>
</tool>

<tool name="bee_focus_null" label="Focus Null (Bee)" icon="$BEE_HOU/icons/align.svg">
<tool name="bee_focus_null" label="Camera Focus Null (Bee)" icon="$BEE_HOU/icons/align.svg">
<toolMenuContext name="network">
<contextNetType>OBJ</contextNetType>
</toolMenuContext>
Expand Down

0 comments on commit 43fc0b4

Please sign in to comment.