예제 #1
0
def createViewerStateTemplate():
    """ Mandatory entry point to create and return the viewer state
        template to register. """

    #state_typename = kwargs["type"].definition().sections()["DefaultState"].contents()
    state_typename = "crowdGuideBrush_state"
    state_label = "Crowd Guide Brush"
    state_cat = hou.sopNodeTypeCategory()

    template = hou.ViewerStateTemplate(state_typename, state_label, state_cat)
    template.bindFactory(CrowdGuideBrush)
    #template.bindIcon(kwargs["type"].icon())

    template.bindMenu(create_menu(state_typename))

    # selector #1
    template.bindGeometrySelector(name="selector1",
                                  prompt="Select Path Points",
                                  quick_select=True,
                                  use_existing_selection=True,
                                  geometry_types=[hou.geometryType.Points],
                                  auto_start=False,
                                  allow_other_sops=False)

    return template
예제 #2
0
def createViewerStateTemplate():
    # Choose a name and label 
    state_name = "drawpoints.pystate"
    state_label = "Draw Points"
    category = hou.sopNodeTypeCategory()

    template = hou.ViewerStateTemplate(state_name, state_label, category)
    template.bindFactory(DrawPoints)


    return template
def createViewerStateTemplate():
    """ Mandatory entry point to create and return the viewer state
        template to register. """

    # state_typename = kwargs["type"].definition().sections()["DefaultState"].contents()
    state_typename = "crowdTrajectoryTrimBrush_state"
    state_label = "Crowd Trajectory Trim Brush"
    state_cat = hou.sopNodeTypeCategory()

    template = hou.ViewerStateTemplate(state_typename, state_label, state_cat)
    template.bindFactory(crowdTrajectoryTrimBrush)
    return template
def createViewerStateTemplate():
    state_name = "qLib::camera_zoom_vertigo_ql_sop"
    state_label = "Camera Zoom/Vertigo (sop) [qL]"
    template = hou.ViewerStateTemplate(
        state_name,
        state_label,
        hou.sopNodeTypeCategory(),
        #contexts = [ hou.sopNodeTypeCategory(), hou.dopNodeTypeCategory(), hou.lopNodeTypeCategory(), ],
    )
    template.bindFactory(qLibCameraZoomVertigo.State)

    return template
예제 #5
0
def createViewerStateTemplate():
    """ Mandatory entry point to create and return the viewer state 
        template to register. """

    state_typename = kwargs["type"].definition().sections(
    )["DefaultState"].contents()
    state_label = "PythonStateTest"
    state_cat = hou.sopNodeTypeCategory()

    template = hou.ViewerStateTemplate(state_typename, state_label, state_cat)
    template.bindFactory(State)
    template.bindIcon(kwargs["type"].icon())

    return template
예제 #6
0
def createViewerStateTemplate():
    # Choose a name and label
    state_name = "mystate"
    state_label = "My New State"
    category = hou.sopNodeTypeCategory()

    # Create the template
    template = hou.ViewerStateTemplate(state_name, state_label, category)
    template.bindFactory(MyState)

    # Other optional bindings will go here...

    # returns the 'mystate' template
    return template
예제 #7
0
파일: ruler.py 프로젝트: mokchira/ruler
def createViewerStateTemplate():
    """ Mandatory entry point to create and return the viewer state 
        template to register. """

    state_typename = "mb::ruler"
    state_label = "Ruler"
    state_cat = hou.sopNodeTypeCategory()

    template = hou.ViewerStateTemplate(state_typename, state_label, state_cat)
    template.bindFactory(State)
    template.bindIcon("MISC_python")

    template.bindParameter(hou.parmTemplateType.Menu,
                           name="text_size_menu",
                           label="Text Size",
                           menu_items=text_size_item_info,
                           default_value='1')

    return template