mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
set up the shelf creation in the _set_context_settings function
This commit is contained in:
parent
5b559fd28d
commit
a006b5df63
2 changed files with 34 additions and 0 deletions
|
|
@ -460,3 +460,35 @@ def reset_framerange():
|
|||
hou.playbar.setFrameRange(frame_start, frame_end)
|
||||
hou.playbar.setPlaybackRange(frame_start, frame_end)
|
||||
hou.setFrame(frame_start)
|
||||
|
||||
|
||||
def create_shelf():
|
||||
hou.shelves.beginChangeBlock()
|
||||
|
||||
custom_shelf = hou.shelves.newShelf(
|
||||
file_path='',
|
||||
name="custom_shelf",
|
||||
label="Custom Shelf"
|
||||
)
|
||||
|
||||
new_tool = hou.shelves.newTool(
|
||||
file_path='',
|
||||
name='new_tool',
|
||||
label='New Tool',
|
||||
script='',
|
||||
language=hou.scriptLanguage.Python,
|
||||
icon='',
|
||||
help='This is a new tool'
|
||||
)
|
||||
|
||||
if new_tool not in custom_shelf.tools():
|
||||
custom_shelf.setTools(list(custom_shelf.tools()) + [new_tool])
|
||||
|
||||
shelf_set = [
|
||||
shelf for shelf in hou.shelves.shelfSets().values()
|
||||
if shelf.label() == "Create and Refine"
|
||||
][0]
|
||||
|
||||
shelf_set.setShelves(shelf_set.shelves() + (custom_shelf,))
|
||||
|
||||
hou.shelves.endChangeBlock()
|
||||
|
|
|
|||
|
|
@ -309,6 +309,7 @@ def _set_context_settings():
|
|||
fps
|
||||
resolution
|
||||
renderer
|
||||
shelves
|
||||
|
||||
Returns:
|
||||
None
|
||||
|
|
@ -320,6 +321,7 @@ def _set_context_settings():
|
|||
lib.set_scene_fps(fps)
|
||||
|
||||
lib.reset_framerange()
|
||||
lib.create_shelf()
|
||||
|
||||
|
||||
def on_pyblish_instance_toggled(instance, new_value, old_value):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue