Exemplo n.º 1
0
    def onMenuPreOpen(self, kwargs):

        ### Set all the values of the menu items from node parms or internal vars.
        menu_id = kwargs['menu']
        node = kwargs['node']
        menu_states = kwargs['menu_states']
        menu_item_states = kwargs['menu_item_states']

        ### Radio menus come through as their own menu id. Set to string values
        if menu_id == 'radio_brushMode':
            menu_states['value'] = self._currentBrushMode

        elif menu_id == 'radio_xformOp':
            menu_states['value'] = self._currentXformOp

        elif menu_id == 'radio_brushType':
            menu_states['value'] = self._currentBrushType

        ### other items on the base level have the base menu name id
        elif menu_id == 'crowdGuideBrush_menu':
            menu_item_states['toggle_selectAllPrimPoints'][
                'value'] = pu.evalNodeParm(self._node, 'selectAllPrimPoints')
            menu_item_states['toggle_affectAhead']['value'] = pu.evalNodeParm(
                self._node, 'affectAhead')
            menu_item_states['toggle_affectBehind']['value'] = pu.evalNodeParm(
                self._node, 'affectBehind')

        return kwargs
Exemplo n.º 2
0
 def initFromNodeParms(self):
     self._brushSize = pu.evalNodeParm(self._node, "brush_size")
     self._currentAddRemoveOp = self.ADDREMOVEOPS[pu.evalNodeParm(
         self._node, "addremove_op")]
     self._currentXformOp = self.XFORMOPS[pu.evalNodeParm(
         self._node, "xform_op")]
     self._currentBrushMode = self.BRUSHMODES[pu.evalNodeParm(
         self._node, "brush_mode")]
     self._currentBrushType = self.BRUSHTYPES[pu.evalNodeParm(
         self._node, "brush_type")]
     pass
    def onEnter(self, kwargs):
        self.log("onEnter")
        self._node = kwargs["node"]

        self._stasherTrajPoints = self._node.node("OUT_STASH_TRAJ_POINTS")
        self._geometryTrajHandles = self._node.node(
            "OUT_HANDLE_PRIMS").geometry()
        self._geometryTrajPaths = self._node.node("IN_Trajectories").geometry()
        self._drawTextGlobalFrame.updateTextPoints(self._geometryTrajHandles,
                                                   "global_frame")
        self._drawTextGlobalFrame.show(True)

        geobrush = self._node.node("OUT_GUIDE_BRUSH").geometry()
        self._guideBrush = hou.SimpleDrawable(self._scene_viewer, geobrush,
                                              "my_guidebrush_TrimBrush")
        self._guideBrush.setDisplayMode(
            hou.drawableDisplayMode.CurrentViewportMode)
        self._guideBrush.enable(True)

        geoHdaGuides = self._node.node("OUT_GUIDES").geometry()
        if pu.evalNodeParm(self._node, "guideDisplay") == 1:
            self._guideHda = hou.SimpleDrawable(self._scene_viewer,
                                                geoHdaGuides,
                                                "guidehda_TrimBrush")
            self._guideHda.setDisplayMode(
                hou.drawableDisplayMode.CurrentViewportMode)
            self._guideHda.enable(True)
            self._guideHda.show(True)

        self.showGuides(True)
        self._scene_viewer.setPromptMessage(self.MSG)
Exemplo n.º 4
0
    def onEnter(self, kwargs):
        """ Called on node bound states when it starts
        """
        # state_parms = kwargs["state_parms"]
        self.log("onEnter")
        self._node = kwargs["node"]
        self.initFromNodeParms()

        self._classPosition.onEnter(kwargs)
        self._classTiming.onEnter(kwargs)
        '''
        if self._pathMode == 'position':
            self._classPosition.onEnter(kwargs)
        elif self._pathMode == 'timing':
            self._classTiming.onEnter(kwargs)
        else:
            self.log("pathMode not set")
        '''
        self.setPathMode(self._pathMode)

        geoHdaGuides = self._node.node("OUT_GUIDES").geometry()
        if pu.evalNodeParm(self._node, "guideDisplay") == 1:
            self._guideHda = hou.SimpleDrawable(self._scene_viewer,
                                                geoHdaGuides,
                                                "guidehda_GuideBrush")
            self._guideHda.setDisplayMode(
                hou.drawableDisplayMode.CurrentViewportMode)
            self._guideHda.enable(True)

        self.showGuides(True)
Exemplo n.º 5
0
    def onEnter(self, kwargs):
        self.log("onEnter")
        self._node = kwargs["node"]

        self._stasherTimingPoints = self._node.node("OUT_TIMING_POINT_EDITED")
        self._geometryPosPaths = self._node.node(
            "OUT_SMOOTH_POSITION_PATHS").geometry()
        self._geometryTimeHandles = self._node.node(
            "OUT_TIMING_HANDLE_GEO").geometry()

        geobrush = self._node.node("OUT_GUIDE_BRUSH").geometry()
        self._guideBrush = hou.SimpleDrawable(self._scene_viewer, geobrush,
                                              "my_guidebrush2")
        self._guideBrush.setDisplayMode(
            hou.drawableDisplayMode.CurrentViewportMode)
        self._guideBrush.enable(True)

        geoGuideAgents = self._node.node("OUT_GUIDE_AGENTS").geometry()
        if pu.evalNodeParm(self._node, "guideDisplay") == 1:
            self._guideAgents = hou.SimpleDrawable(self._scene_viewer,
                                                   geoGuideAgents,
                                                   "guideAgents_GuideBrush")
            self._guideAgents.enable(True)
            self._guideAgents.show(True)

        self.showGuides(True)
        self._scene_viewer.setPromptMessage(self.MSG)
Exemplo n.º 6
0
    def stashEditedPoints(self):

        if pu.evalNodeParm(self._node, 'autoslideDist') == True:
            self._parent.timingStashEditedPoints()

        stashPoints = self._stasherAllPoints.geometry().freeze(True, True)
        pu.setNodeParm(self._node, 'stash_all_points', stashPoints, True)
        #self.log(self._currentBrushOp)

        if self._isSelectionEvent:
            self.setIsSelectionEvent(False)
            pu.setNodeParm(self._node, 'selectedPointsGroup', "")
Exemplo n.º 7
0
 def initFromNodeParms(self):
     self._pathMode = self.PATHMODES[pu.evalNodeParm(
         self._node, "path_mode")]
Exemplo n.º 8
0
 def incMouseBrushFalloff(self, mouseX):
     value = pu.evalNodeParm(self._node, 'brush_falloff')
     value += self.getMouseDeltaX(mouseX) * -0.01
     value = hou.hmath.clamp(value, 0, 1)
     pu.setNodeParm(self._node, 'brush_falloff', value)