本文整理汇总了Python中pymel.core.scriptJob函数的典型用法代码示例。如果您正苦于以下问题:Python scriptJob函数的具体用法?Python scriptJob怎么用?Python scriptJob使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scriptJob函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: killJob
def killJob(self):
try:
pm.scriptJob(kill=self.jid)
io.warn("Killed {0} job: {1}".format(self.event, self.jid))
self.jid = None
except Exception:
raise
开发者ID:satishgoda,项目名称:programmingusingpython,代码行数:7,代码来源:manager.py
示例2: _dock_closed
def _dock_closed(s, *loop):
visible = s._dock_query(vis=True)
if not visible and loop:
pmc.scriptJob(ie=s._dock_closed, p=s._dock, ro=True)
elif not visible:
pmw.deleteUI(s._dock, control=True)
print "Window closed."
开发者ID:internetimagery,项目名称:OutOfControlRig,代码行数:7,代码来源:__init__.py
示例3: __init__
def __init__(s, **kwargs):
s.callback = None
s.ids = ids = []
kwargs["e"] = ("PostSceneRead", s._changed)
ids.append(pmc.scriptJob(**kwargs))
kwargs["e"] = ("NewSceneOpened", s._changed)
ids.append(pmc.scriptJob(**kwargs))
开发者ID:internetimagery,项目名称:OutOfControlRig,代码行数:7,代码来源:track.py
示例4: addUIElement
def addUIElement(uiType, attribute, uiLabel, callback, renderGlobalsNodeName):
ui = None
if uiType == 'bool':
ui = pm.checkBoxGrp(label=uiLabel)
if callback is not None:
pm.checkBoxGrp(ui, edit=True, cc=callback)
if uiType == 'int':
ui = pm.intFieldGrp(label=uiLabel, numberOfFields = 1)
if callback is not None:
pm.intFieldGrp(ui, edit=True, cc = callback)
if uiType == 'float':
ui = pm.floatFieldGrp(label=uiLabel, numberOfFields = 1)
if callback is not None:
pm.floatFieldGrp(ui, edit=True, cc= callback)
if uiType == 'enum':
ui = pm.attrEnumOptionMenuGrp(label = uiLabel, at=attribute, ei = getEnumList(attribute))
# attrEnumOptionGrp has no cc callback, so I create a script job
if callback is not None:
attribute = pm.Attribute(renderGlobalsNodeName + "." + attribute)
pm.scriptJob(attributeChange=[attribute, callback], parent=ui)
if uiType == 'color':
ui = pm.attrColorSliderGrp(label=uiLabel, at=attribute)
if uiType == 'string':
ui = pm.textFieldGrp(label=uiLabel)
if callback is not None:
pm.textFieldGrp(ui, edit=True, cc=callback)
if uiType == 'vector':
ui = pm.floatFieldGrp(label=uiLabel, nf=3)
if callback is not None:
pm.floatFieldGrp(ui, edit=True, cc=callback)
return ui
开发者ID:MassW,项目名称:OpenMaya,代码行数:31,代码来源:uiUtils.py
示例5: __init__
def __init__(self):
title = 'pbRenderableCurve'
version = 1.02
if pm.window('pbRCurve', exists=True):
pm.deleteUI('pbRCurve')
with pm.window('pbRCurve', title='{0} | {1}'.format(title, version), s=False) as window:
with pm.columnLayout():
with pm.frameLayout(l='Selection:', cll=True, bs='out'):
with pm.columnLayout():
self.selField = pm.textFieldGrp(text='No Curves Selected', ed=False, l='Curve:', cw2=[72, 192])
with pm.rowLayout(nc=2):
self.bRenderable = pm.checkBox(l='Renderable', cc=self.bcRenderable)
with pm.frameLayout(l='Mesh Settings:', cll=True, bs='out') as self.meshUI:
with pm.columnLayout():
with pm.rowLayout(nc=4):
self.useNormal = pm.checkBox(l='Use Normal', cc=self.bcUseNormal)
self.normalVector = [pm.intField(width=62, en=False, value=0, cc=self.setNormal),
pm.intField(width=62, en=False, value=1, cc=self.setNormal),
pm.intField(width=62, en=False, value=0, cc=self.setNormal)]
self.meshAttrs = [AttrSlider(maxValue=128, name='Thickness', obj=getCurves, type_='float', fmn=0.0001),
AttrSlider(value=3, minValue=3, maxValue=64, name='Sides', obj=getCurves, fmn=3, fmx=100),
AttrSlider(minValue=1, maxValue=32, name='Samples', obj=getCurves, fmn=1, fmx=128)]
with pm.frameLayout('Shell Settings:', cll=True, bs='out') as self.shellUI:
with pm.columnLayout():
self.bShell = pm.checkBox(l='Enable Shell', cc=self.bcShell)
self.shellAttrs = [AttrSlider(value=1, minValue=-64, maxValue=64, name='ShellThickness', obj=getCurves, type_='float'),
AttrSlider(value=1, minValue=1, maxValue=64, name='ShellDivisions', obj=getCurves, fmn=1, fmx=32)]
window.show()
pm.scriptJob(event=['SelectionChanged', self.refresh], protected=True, p=window)
self.refresh()
开发者ID:cmcpasserby,项目名称:pbRenderableCurve,代码行数:35,代码来源:pbRenderableCurve.py
示例6: register
def register(self):
""" Register the dock in maya """
self.deleteViews()
# Dock
if pm.dockControl(self.dockName, ex=True):
pm.deleteUI(self.dockName)
# Window
if pm.window(self.winName, ex=True):
pm.deleteUI(self.winName)
self._win = None
self.applyMetrics()
# For a dockControl, we've got to go create the ui this way
# otherwise when we create the dockControl it doesn't see the main layout
self._win = pm.window(self.winName, title=self.title)
with pm.frameLayout('mainForm', lv=False, bv=False, p=self._win) as self._mainLayout:
self.mainControl = self._mainLayout
# Create the dockControl
self._dockControl = pm.dockControl(self.winName+"Dock",
con=self._win, aa=['left', 'right'], a=self.area, fl=int(self.floating), l=self.title,
vcc=Callback(self.dockVisibleChanged), vis=False,
)
self._win = self._mainLayout
self.showDefaultView()
pm.scriptJob(uid=(self._win, Callback(self.winClosed)))
开发者ID:bohdon,项目名称:viewGui,代码行数:30,代码来源:gui.py
示例7: __init__
def __init__(self, *args, **kwargs ):
# Make sure that the bakeLayer plugin is loaded
if not ( pmc.pluginInfo( 'bake_layer_init.py', q = True, loaded = True ) ):
raise Exception( 'Bake Layer Plugin is not currently loaded' )
# Create the MEL Global var for the currently selected bake layer
pmc.MelGlobals.initVar('string[]', 'selected_bake_layers')
self.__window = pmc.window( self,
title = "Bake Layer Editor" )
pmc.scriptJob( permanent = True,
parent = self.__window,
event = [ 'NewSceneOpened', self.new_scene ] )
pmc.scriptJob( permanent = True,
parent = self.__window,
event = [ 'SceneOpened', self.open_scene ] )
self.menu_dict = { }
self.build( )
self.refresh( )
self.__window.show( )
开发者ID:hunnybear,项目名称:xnormal_maya_plugin,代码行数:31,代码来源:bake_layer_window.py
示例8: __init__
def __init__(self, rigObject, callback):
self._rig = rigObject
self._callback = callback
self._row = FluidRowLayout(numberOfChildren = 3, separation = Format.SEPARATION)
with self._row:
NameField(node = self._rig.node, type = pm.nt.Transform, width = Format.Text.WIDTH)
pm.button(label = 'Edit', width = Format.Button.WIDTH / 2 - Format.SEPARATION / 2, command = lambda *args: self.editRig())
pm.button(label = 'Delete', width = Format.Button.WIDTH / 2 - Format.SEPARATION / 2, command = lambda *args: self.deleteRig())
self._deleteDialog = ConfirmationDialog(
title = 'Rig Editor | Delete',
message = 'Do you want to delete {0}?'.format(self._rig.node),
confirm = 'Delete',
deny = 'Cancel',
icon = Window.Icon.WARNING
)
pm.scriptJob(
nodeDeleted = [self._rig._node, self._callback],
parent = self._row,
replacePrevious = True
)
开发者ID:jenosavel,项目名称:jhRigBuilder,代码行数:25,代码来源:gui.py
示例9: __init__
def __init__(s, meshes=missing, start=missing, stop=missing, click=missing, drag=missing):
s.name = "OutOfControlPicker"
s.active = False # tool state
s.meshes = meshes # Return an MSelectonList of objs
s.start = start # Callback
s.stop = stop # Callback
s.click = click # Callback
s.drag = drag # Callback
s.watch_tools() # Initialize tool watching
s.kill() # Clear out last tool if there
pmc.context.draggerContext(
s.name,
name=s.name,
prePressCommand=s.initialize_click,
releaseCommand=s.tool_click,
dragCommand=s.tool_drag,
initialize=s.tool_start,
finalize=s.tool_end,
cursor="hand",
image1="hands.png",
undoMode="sequence",
)
# Track tool changes, allowing us to track previous tool
pmc.scriptJob(e=("PostToolChanged", s.watch_tools),p=s.name)
开发者ID:internetimagery,项目名称:OutOfControlRig,代码行数:26,代码来源:tool.py
示例10: setAttribute
def setAttribute(self, attribute):
self.attribute = attribute
if self.type not in self.UI_TYPES:
return
self.UI_TYPES[self.type](self.control, edit=True, attribute=self.attribute)
if self.callback:
pm.scriptJob(attributeChange=[self.attribute, self.callback],
replacePrevious=True, parent=self.control)
开发者ID:Quazo,项目名称:breakingpoint,代码行数:8,代码来源:utils.py
示例11: closeEvent
def closeEvent(self, event):
pm.scriptJob(kill=self.scriptJobID)
self.settings.beginGroup("MainWindow")
self.settings.setValue("libSeq", QVariant(self.animLibComboBox.currentText()))
self.settings.setValue("pubSeq", QVariant(self.seqComboBox.currentText()))
self.settings.setValue("pubShot", QVariant(self.shotComboBox.currentText()))
self.settings.setValue("pos", QVariant(self.pos()))
self.settings.endGroup()
开发者ID:davidkaplan,项目名称:tippett-codesamples,代码行数:8,代码来源:animLib.py
示例12: closeEvent
def closeEvent(self, *args, **kwargs):
"""
Try to kill the script job when the window is closed
"""
try:
pymel.scriptJob(kill=self.iJobNum, force=True)
except:
pass
开发者ID:renaudll,项目名称:dpAutoRigSystem,代码行数:8,代码来源:dpSpaceSwitcher.py
示例13: flushScript
def flushScript( *args ):
if( script_job_id != -1 ):
pm.scriptJob( kill=script_job_id, force=True )
pm.lockNode( 'light_probe', lock=False )
pm.delete('light_probe')
pm.makeLive(none=True)
开发者ID:kzchen,项目名称:Maya_TD_tools,代码行数:8,代码来源:placeHlighLight_v16.py
示例14: refresh
def refresh(self):
if self._refreshEvent and pm.scriptJob(exists = self._refreshEvent):
return
self._refreshEvent = pm.scriptJob(
idleEvent = self.refreshActions,
runOnce = True
)
开发者ID:jenosavel,项目名称:jhRigBuilder,代码行数:9,代码来源:gui.py
示例15: __init__
def __init__(self, value, min, max, name, ceObj):
self.name = name
self.ceObj = ceObj
self.undoState = False
self.attr = pm.floatSliderGrp(field=True, l=self.name, value=value, pre=3, enable=False,
minValue=min, maxValue=max, dc=lambda *args: self.set(cc=False),
cc=lambda *args: self.set(cc=True), cw3=[96, 64, 128])
pm.scriptJob(event=['Undo', self.get], protected=True, p=self.attr)
开发者ID:cmcpasserby,项目名称:curvyEdges,代码行数:10,代码来源:curvyEdges.py
示例16: _create_scriptjobs
def _create_scriptjobs(self):
"""Create scriptjobs and stores their ids."""
self._scriptjobs = (
pmc.scriptJob(
nodeNameChanged=(self.node_master.name(), self._on_node_renamed)
),
pmc.scriptJob(
nodeDeleted=(self.node_master.name(), self.close), runOnce=True
)
)
开发者ID:Vimkxi,项目名称:vmTools,代码行数:10,代码来源:sol_ui.py
示例17: AppleseedEnvironmentCreateTab
def AppleseedEnvironmentCreateTab(self):
self.createGlobalsNode()
parentForm = pm.setParent(query=True)
pm.setUITemplate("attributeEditorTemplate", pushTemplate=True)
scLo = self.rendererName + "AOScrollLayout"
envDict = {}
self.rendererTabUiDict['environment'] = envDict
uiDict = envDict
with pm.scrollLayout(scLo, horizontalScrollBarThickness=0):
with pm.columnLayout(self.rendererName + "ColumnLayout", adjustableColumn=True, width=400):
with pm.frameLayout(label="Environment Lighting", collapsable=False):
with pm.columnLayout(self.rendererName + "ColumnLayout", adjustableColumn=True, width=400):
attr = pm.Attribute(self.renderGlobalsNodeName + ".environmentType")
envDict['environmentType'] = pm.attrEnumOptionMenuGrp(label="Environment Type", at=self.renderGlobalsNodeName + ".environmentType", ei=self.getEnumList(attr))
with pm.frameLayout(label="Environment Colors", collapsable=False) as envDict['commonEnvFrame']:
with pm.columnLayout(self.rendererName + "ColumnLayout", adjustableColumn=True, width=400):
ui = pm.floatFieldGrp(label="Environment Intensity:", value1=1.0, numberOfFields=1)
pm.connectControl(ui, self.renderGlobalsNodeName + ".environmentIntensity", index=2)
envDict['environmentColor'] = pm.attrColorSliderGrp(label="Environment Color:", at=self.renderGlobalsNodeName + ".environmentColor")
envDict['gradientHorizon'] = pm.attrColorSliderGrp(label="Gradient Horizon Color:", at=self.renderGlobalsNodeName + ".gradientHorizon")
envDict['gradientZenit'] = pm.attrColorSliderGrp(label="Gradient Zenith Color:", at=self.renderGlobalsNodeName + ".gradientZenit")
envDict['environmentMap'] = pm.attrColorSliderGrp(label="Environment Map:", at=self.renderGlobalsNodeName + ".environmentMap")
self.addRenderGlobalsUIElement(attName='latlongHoShift', uiType='float', displayName='Lat-Long Horizontal Shift:', uiDict=uiDict)
self.addRenderGlobalsUIElement(attName='latlongVeShift', uiType='float', displayName='Lat-Long Vertical Shift:', uiDict=uiDict)
with pm.frameLayout(label="Physical Sky", collapsable=False) as envDict['pysSkyFrame']:
with pm.columnLayout(self.rendererName + "ColumnLayout", adjustableColumn=True, width=400):
attr = pm.Attribute(self.renderGlobalsNodeName + ".skyModel")
envDict['pskModel'] = pm.attrEnumOptionMenuGrp(label="Sky Model:", at=self.renderGlobalsNodeName + ".skyModel", ei=self.getEnumList(attr))
uiDict['sunLightOptionMenu'] = pm.optionMenuGrp(label="Sun Light:", changeCommand=self.updateSunLightOptionMenu)
envDict['pskGrAlbedo'] = pm.floatFieldGrp(label="Ground Albedo:", value1=1.0, numberOfFields=1)
pm.connectControl(envDict['pskGrAlbedo'], self.renderGlobalsNodeName + ".ground_albedo", index=2)
envDict['pskGrHShit'] = pm.floatFieldGrp(label="Horizon Shift:", value1=1.0, numberOfFields=1)
pm.connectControl(envDict['pskGrHShit'], self.renderGlobalsNodeName + ".horizon_shift", index=2)
envDict['pskLumMulti'] = pm.floatFieldGrp(label="Luminance Multiplier:", value1=1.0, numberOfFields=1)
pm.connectControl(envDict['pskLumMulti'], self.renderGlobalsNodeName + ".luminance_multiplier", index=2)
envDict['pskSatMulti'] = pm.floatFieldGrp(label="Saturation Multiplier:", value1=1.0, numberOfFields=1)
pm.connectControl(envDict['pskSatMulti'], self.renderGlobalsNodeName + ".saturation_multiplier", index=2)
envDict['pskTurb'] = pm.floatFieldGrp(label="Turbidity:", value1=1.0, numberOfFields=1)
pm.connectControl(envDict['pskTurb'], self.renderGlobalsNodeName + ".turbidity", index=2)
envDict['pskTurbMin'] = pm.floatFieldGrp(label="Turbidity Min:", value1=1.0, numberOfFields=1)
pm.connectControl(envDict['pskTurbMin'], self.renderGlobalsNodeName + ".turbidity_min", index=2)
envDict['pskTurbMax'] = pm.floatFieldGrp(label="Turbidity Max:", value1=1.0, numberOfFields=1)
pm.connectControl(envDict['pskTurbMax'], self.renderGlobalsNodeName + ".turbidity_max", index=2)
with pm.frameLayout(label="OSL", collapsable=False) as envDict['oslFrame']:
with pm.columnLayout(self.rendererName + "ColumnLayout", adjustableColumn=True, width=400):
envDict['environmentOSL'] = pm.attrColorSliderGrp(label="OSL Background", at=self.renderGlobalsNodeName + ".environmentOSL")
pm.setUITemplate("attributeEditorTemplate", popTemplate=True)
pm.formLayout(parentForm, edit=True, attachForm=[ (scLo, "top", 0), (scLo, "bottom", 0), (scLo, "left", 0), (scLo, "right", 0) ])
pm.scriptJob(attributeChange=[self.renderGlobalsNode.environmentType, pm.Callback(self.uiCallback, tab="environment")])
pm.scriptJob(attributeChange=[self.renderGlobalsNode.skyModel, pm.Callback(self.uiCallback, tab="environment")])
self.updateEnvironment()
开发者ID:dictoon,项目名称:appleseed-maya,代码行数:55,代码来源:initialize.py
示例18: update_velocity_grid_export
def update_velocity_grid_export(self, param_name):
grp = "OpenVDBVelocityGrids"
attr_value = pm.getAttr(param_name)
pm.textFieldGrp(grp, edit=True,
text="" if attr_value is None else attr_value,
changeCommand=lambda val: pm.setAttr(param_name, val))
pm.scriptJob(parent=grp,
replacePrevious=True,
attributeChange=[param_name,
lambda: pm.textFieldGrp(grp, edit=True,
text=pm.getAttr(param_name))])
self.setup_velocity_grid_popup(grp, param_name)
开发者ID:redpawfx,项目名称:openvdb-render,代码行数:12,代码来源:AEvdb_visualizerTemplate.py
示例19: placeHighLight
def placeHighLight(*args):
### UI setup
global UI_name
UI_name = [ 'txtBtn_light', 'txtBtn_camera', 'txtBtn_object', 'txtBtn_HLitPoint', 'btn_placeHLit', 'chk_interaction' ]
if pm.window( 'winPlaceHLit', exists=True ):
pm.deleteUI( 'winPlaceHLit', window=True )
ui_layout['window'] = pm.window( 'winPlaceHLit', title='Place Highlight', sizeable=False, h=100, w=250 )
ui_layout['mainLayout'] = pm.columnLayout( columnAlign='left', columnAttach=['left', 0] )
#// get active camera
activeViewCamera = getActiveCam()
'''loc_light_probe = pm.createNode('locator', name='light_probe')
pm.lockNode(loc_light_probe, lock=False)'''
#// sub layout
#// sub1
ui_layout['ui_sub1'] = pm.rowLayout(nc=2, cw=[(1, 210), (2, 40)], p=ui_layout['mainLayout'] )
pm.textFieldButtonGrp( UI_name[0], label='Light: ', text='', buttonLabel='Pick',editable=False, buttonCommand='pickLit()', cw=[(1,50), (2,120), (3,40)], p=ui_layout['ui_sub1'] )
pm.button( 'btn_sel_light' ,label='Sel', command=pm.Callback( doSelItem, UI_name[0] ), p=ui_layout['ui_sub1'] )
#// sub2
ui_layout['ui_sub2'] = pm.rowLayout(nc=2, cw=[(1, 210), (2, 40)], p=ui_layout['mainLayout'] )
pm.textFieldButtonGrp( UI_name[1], label='Camera: ', text=activeViewCamera, buttonLabel='Pick', editable=False, buttonCommand='pickCam()', cw=[(1,50), (2,120), (3,40)], p=ui_layout['ui_sub2'] )
pm.button( 'btn_sel_camera' ,label='Sel', command=pm.Callback( doSelItem, UI_name[1] ), p=ui_layout['ui_sub2'] )
#// sub3
ui_layout['ui_sub3'] = pm.rowLayout(nc=2, cw=[(1, 210), (2, 40)], p=ui_layout['mainLayout'] )
pm.textFieldButtonGrp( UI_name[2], label='Object: ', text='', buttonLabel='Pick', editable=False, buttonCommand='pickTgtObj()', cw=[(1,50), (2,120), (3,40)], p=ui_layout['ui_sub3'] )
pm.button( 'btn_sel_obj' ,label='Sel', command=pm.Callback( doSelItem, UI_name[2] ), p=ui_layout['ui_sub3'] )
#// sub4
ui_layout['ui_sub4'] = pm.rowLayout(nc=2, cw=[(1, 210), (2, 40)], p=ui_layout['mainLayout'] )
pm.textFieldButtonGrp( UI_name[3], label='Point: ', text='', buttonLabel='Pick', editable=False, buttonCommand='pickHLitPt()', cw=[(1,50), (2,120), (3,40)], p=ui_layout['ui_sub4'] )
pm.button( 'btn_sel_point' ,label='Sel', command=pm.Callback( doSelItem, UI_name[3] ), p=ui_layout['ui_sub4'] )
#// sub5
ui_layout['ui_sub5'] = pm.rowLayout(nc=2, cw=[(1, 70), (2, 50)], p=ui_layout['mainLayout'] )
pm.button( UI_name[4] ,label='Place Light!', command='doPlaceHLight()', p=ui_layout['ui_sub5'] )
pm.checkBox( UI_name[5], label='interactive mode', onCommand=pm.Callback( doInteractionON ), offCommand=pm.Callback( doInteractionOFF ), p=ui_layout['ui_sub5'] )
pm.showWindow( ui_layout['window'] )
pm.spaceLocator( name='light_probe' )
pm.lockNode( 'light_probe', lock=True )
pm.textFieldButtonGrp( 'txtBtn_HLitPoint', edit=True, text='light_probe' )
#// clean make live and scriptJob after exit script
pm.scriptJob( uiDeleted=[ ui_layout['window'], pm.Callback( flushScript ) ] )
开发者ID:kzchen,项目名称:Maya_TD_tools,代码行数:52,代码来源:placeHlighLight_v16.py
示例20: updateNode
def updateNode(self, *args):
self.updateName()
if self._nameWatch and pm.scriptJob(exists = self._nameWatch):
pm.scriptJob(kill = self._nameWatch)
if self._attribute.get():
self._nameWatch = pm.scriptJob(
nodeNameChanged = [self._attribute.get(), self.updateName],
parent = self._field
)
开发者ID:jenosavel,项目名称:jhRigBuilder,代码行数:13,代码来源:gui.py
注:本文中的pymel.core.scriptJob函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论