def build_options_menu( self ): pmc.setParent( menu = True ) menu = pmc.menu( label = 'Options', allowOptionBoxes = True ) pmc.menuItem( label = 'Set xNormal Location', command = self.set_xn_location ) pmc.menuItem( divider = True ) enable = utils.get_bake_normals( ) if enable == None: utils.set_bake_normals( True ) enable = True pmc.menuItem( label = 'Bake Normal Map', cb = enable, command = pmc.CallbackWithArgs( self.map_cbx_callback, 'normal' ) ) enable = utils.get_bake_ao( ) if enable == None: utils.set_bake_ao( False ) enable = False pmc.menuItem( optionBox = True ) pmc.menuItem( label = 'Bake Ambient Occlusion Map', cb = enable, command = pmc.CallbackWithArgs( self.map_cbx_callback, 'ao' ) ) pmc.menuItem( optionBox = True )
def map_cbx_callback( self, map, evt ): """ Callback for when user clicks on the "bake normal map" Check Box in the options menu """ if map == 'normal': utils.set_bake_normals( evt ) elif map == 'ao': utils.set_bake_ao( evt )