本文整理汇总了Python中maya.cmds.progressWindow函数的典型用法代码示例。如果您正苦于以下问题:Python progressWindow函数的具体用法?Python progressWindow怎么用?Python progressWindow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了progressWindow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: Cas_MCW_restoreMisc
def Cas_MCW_restoreMisc(undoState , texWindowState):
if undoState == 1:
cmds.undoInfo(swf=1)
if texWindowState == 1:
texWin = cmds.getPanel(sty ="polyTexturePlacementPanel")
cmds.textureWindow(texWin[0],e=1,id=1)
cmds.progressWindow(ep=1)
开发者ID:kotchin,项目名称:mayaSettings,代码行数:7,代码来源:Cas_massCopyWeight_python.py
示例2: updateProgressWindow
def updateProgressWindow(i, maxSize):
if cmds.progressWindow(q=True, ic=True):
return False
else:
cmds.progressWindow(e=True, pr=i, st=("Building: " +
str(i) + "/" + str(maxSize)))
return True
开发者ID:agentqwerty,项目名称:python_scripts,代码行数:7,代码来源:quickCity.py
示例3: makeSnowflakes
def makeSnowflakes(number,size,sizeVar,rgb1,rgb2,transparency,glow):
'''
Creates a number of snowflakes
number : Number of particles to create
size : Radius of the snowflakes
sizeVar : Variation in the radius
rgb1 : One end of the colour range in the form (r,g,b)
rgb2 : The other end of the colour range in the form (r,g,b)
transparency : Alpha value for the shader
glow : Glow value for the shader
The progress window is updated and the shading group list is created.
A while loop is initiated to create snowflakes, add them to the list
and assign shaders. The list of objects is returned.
'''
cmds.progressWindow(e=1,progress=0,status='Making Snowflakes...')
SGList = createColourList(rgb1,rgb2,transparency,glow,5)
list=[]
count=0
while count<number:
radius = size+random.uniform(-(size*sizeVar*0.01),(size*sizeVar*0.01))
list[len(list):] = [makeFlake(random.randint(5,8),radius)]
cmds.sets(list[-1], e=1, forceElement=SGList[random.randint(0,4)])
cmds.progressWindow(e=1,step=100/number)
count += 1
return list
开发者ID:philrouse,项目名称:snowFX,代码行数:27,代码来源:makeSnowflakes.py
示例4: func
def func( *args, **kwargs ):
try:
cmd.progressWindow( **dec_kwargs )
except: print 'error init-ing the progressWindow'
try:
return f( *args, **kwargs )
finally:
cmd.progressWindow( ep=True )
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:9,代码来源:mayaDecorators.py
示例5: __exit__
def __exit__(self, exc_type, exc_value, traceback):
if not self.disable:
if self.ismain:
cmds.progressBar(self._gMainProgressBar, edit=True, endProgress=True)
else:
cmds.progressWindow(endProgress=True)
if exc_type:
log.exception('%s : %s'%(exc_type, exc_value))
del(self)
return False # False so that the exception gets re-raised
开发者ID:satishgoda,项目名称:Red9_StudioPack,代码行数:10,代码来源:Red9_General.py
示例6: planeEmit
def planeEmit(sourcePlane,start,emitTime,particleList,maxDistance,minDistance,maxAngle,forceTime,lifeTime,lifeTimeVar,fadeOut,turbulenceAmp,turbulencePer,drift):
'''
Emits particles from a plane
sourcePlane : Name of the plane particles will emit from
start : Frame to start emission
emitTime : Number of frames to emit for
particleList : List containing names of all the particles to be animatied
maxDistance : Maximum distance particles will be emitted from at the middle of the curve
minDistance : Maximum distance particles will be emitted from at the start and end of the curve
maxAngle : Maximum angle to emit particles at
forceTime : Number of frames particles will be affected by the emission force
lifeTime : Average lifetime of a particle
lifeTimeVar : Variation from average lifetime as a percentage
fadeOut : Number of frames to scale down particles at the end of their lifetime
turbulenceAmp : Amplitude of the turbulence animation graph
turbulencePer : Period of the turbulence animation graph
drift : Distance a particle will drift 10 frames. Contains (x,y,z)
Updates the progress window and assigns all the elements in particleList to the class particles.
Constrains particle to plane to copy its location and orientation then deletes the constraint
and adds a random rotation in the object y axis and moves the particle a random distance away
from the plane centre along its surface. Emission angle is randomly chosen and applied to object
z axis so that all particles move in line with the plane centre. Runs the relevant class specific
procedures to animate the particle.
'''
cmds.progressWindow(e=1,progress=0,status='Animating Particles...')
for i in range(0,len(particleList)):
particleList[i]=particles(particleList[i])
count=0
for x in particleList:
x.born = start+random.randint(0,emitTime)
constraint = cmds.parentConstraint(sourcePlane,x.name)
cmds.delete(constraint)
rotation = random.uniform(0,360)
cmds.rotate(0,rotation,0,x.name,r=1,os=1)
[x0,y0,z0,x1,y1,z1]=cmds.xform(sourcePlane+'.vtx[0:1]',t=1,q=1,ws=1)
sideLength=((x0-x1)**2+(y0-y1)**2+(z0+z1)**2)**0.5
distance=random.uniform(0,sideLength/2)
cmds.move(distance,0,0,x.name,r=1,os=1)
angle=random.uniform(-maxAngle,maxAngle)
cmds.rotate(0,0,angle,x.name,r=1,os=1)
x.explode(x.born,forceTime,random.uniform(minDistance,maxDistance))
x.drift(x.born,drift,turbulenceAmp*random.random(),turbulencePer+random.randint(-2,2))
x.lifeTime=int(lifeTime+random.uniform(-lifeTime*lifeTimeVar*0.01,lifeTime*lifeTimeVar*0.01))
x.fadeOut=random.randint(fadeOut-2,fadeOut+2)
x.bake()
cmds.keyframe(x.name,at='visibility',a=1,vc=0)
count+=1
cmds.progressWindow(e=1,progress=int((100.0/len(particleList))*count))
for x in particleList:
x.birth()
x.death()
return
开发者ID:philrouse,项目名称:snowFX,代码行数:54,代码来源:particleFX.py
示例7: loadCharacter
def loadCharacter(self, x=None) :
''' TODO: Stub '''
item = self.getSelectedCharacter()
print item
self.loadTemplate(item)
return
print "Loading Character: " + str(x)
m.progressWindow("peelMocap_progressWindow", st="Loading Character", progress=0)
loadChar = "%s/character/%s/%s" % (self.pathPrefix, item['group']['title'], item['file'])
print "load character: %s" % loadChar
self.cache.importUrl(loadChar)
m.progressWindow(endProgress=True)
开发者ID:mocap-ca,项目名称:cleanup,代码行数:12,代码来源:loader.py
示例8: emitCurve
def emitCurve(sourceCurve,curveStart,duration,particleList,maxDistance,minDistance,emitTime,lifeTime,lifeTimeVar,fadeOut,turbulenceAmp,turbulencePer,drift):
'''
Emits particles from a curve
sourceCurve : Name of the curve particles will emit from
curveStart : Frame to start emission
duration : Number of frames to emit for
particleList : List containing names of all the particles to be animatied
maxDistance : Maximum distance particles will be emitted from at the middle of the curve
minDistance : Maximum distance particles will be emitted from at the start and end of the curve
emitTime : Number of frames particles will be affected by the emission force
lifeTime : Average lifetime of a particle
lifeTimeVar : Variation from average lifetime as a percentage
fadeOut : Number of frames to scale down particles at the end of their lifetime
turbulenceAmp : Amplitude of the turbulence animation graph
turbulencePer : Period of the turbulence animation graph
drift : Distance a particle will drift 10 frames. Contains (x,y,z)
Updates the progress window and assigns all the elements in particleList to the class particles.
Creates a locator and keys it to follow the curve linearly over the emission time. At the emit
time, copies the coordinates of the locator and moves particle to that location and add a random
rotation. The distance is calculated depending on the time the particle is emitted. Runs the
relevant class specific procedures to animate the particle.
'''
cmds.progressWindow(e=1,progress=0,status='Animating Particles...')
for i in range(0,len(particleList)):
particleList[i]=particles(particleList[i])
count=0
[emitter] = [cmds.spaceLocator(n='emitter')[0]]
motionPath = cmds.pathAnimation(fm=1, stu=curveStart,etu=curveStart+duration,c=sourceCurve)
cmds.keyTangent(motionPath,at='uValue',itt='Linear',ott='Linear')
for x in particleList:
launchTime=random.uniform(0,duration)
[(emitX,emitY,emitZ)]=cmds.getAttr(emitter+'.translate',t=curveStart+launchTime)
cmds.move(emitX,emitY,emitZ,x.name)
cmds.rotate(random.uniform(0,360),random.uniform(0,360),random.uniform(0,360),x.name)
if launchTime/duration <=0.5:
distance=(launchTime/duration)*2*(maxDistance-minDistance)+minDistance
else:
distance=(1-(launchTime/duration))*2*(maxDistance-minDistance)+minDistance
x.born = int(curveStart+launchTime+random.randint(-1,1))
x.explode(x.born,emitTime,distance)
x.drift(x.born,drift,turbulenceAmp*random.random(),turbulencePer+random.randint(-2,2))
x.lifeTime=int(lifeTime+random.uniform(-lifeTime*lifeTimeVar*0.01,lifeTime*lifeTimeVar*0.01))
x.fadeOut=random.randint(fadeOut-2,fadeOut+2)
x.bake()
cmds.keyframe(x.name,at='visibility',a=1,vc=0)
count+=1
cmds.progressWindow(e=1,progress=int((100.0/len(particleList))*count))
for x in particleList:
x.birth()
x.death()
return
开发者ID:philrouse,项目名称:snowFX,代码行数:53,代码来源:particleFX.py
示例9: func
def func(*args, **kwargs):
try:
cmd.progressWindow(**dec_kwargs)
except: print 'error init-ing the progressWindow'
try: ret = f(*args, **kwargs)
except:
#end the progressWindow on any exception and re-raise...
raise
finally:
cmd.progressWindow(ep=True)
return ret
开发者ID:BGCX261,项目名称:zootoolbox-svn-to-git,代码行数:13,代码来源:api.py
示例10: do
def do(self, *args):
try:
sel = mc.ls(sl=1)
sum = 0.0
sum = len(sel)
amount = 0.0
for item in sel:
mc.progressWindow(
title="Removing References", progress=amount, status="Removing: 0%", isInterruptable=True
)
if mc.progressWindow(query=True, isCancelled=True):
break
if mc.progressWindow(query=True, progress=True) >= 100:
break
RN = mc.referenceQuery(item, referenceNode=1)
Nodes = mc.referenceQuery(RN, referenceNode=True, topReference=True)
referenceFile = mc.referenceQuery(Nodes, f=1)
reLoaded = mc.referenceQuery(referenceFile, il=True)
if reLoaded == 1:
mc.file(referenceFile, unloadReference=1)
amount = float((sel.index(item) + 1)) / float(len(sel)) * 100.0
mc.progressWindow(edit=True, progress=amount, status=("Removing: " + ` amount ` + "%"))
# mc.pause( seconds=1 )
mc.progressWindow(endProgress=1)
except:
pass
开发者ID:chuckbruno,项目名称:Python_scripts,代码行数:26,代码来源:removeReferences_01.py
示例11: parse_rib_archives
def parse_rib_archives(self):
queue = Queue()
self._enqueue_rib_files(queue)
if queue.empty():
return
for file in self._process_rib_queue(queue):
yield file
if cmds.progressWindow(query=1, isCancelled=1):
cmds.progressWindow(endProgress=1)
raise maya_common.MayaZyncException("Submission cancelled")
cmds.progressWindow(endProgress=1)
开发者ID:zync,项目名称:zync-maya,代码行数:14,代码来源:renderman_maya.py
示例12: __enter__
def __enter__(self):
if not self.disable:
if self.ismain:
cmds.progressBar(self._gMainProgressBar,
edit=True,
beginProgress=True,
step=self.step,
isInterruptable=self._interruptable,
maxValue=self._maxValue)
else:
cmds.progressWindow(step=self.step,
title=self.title,
isInterruptable=self._interruptable,
maxValue=self._maxValue)
开发者ID:satishgoda,项目名称:Red9_StudioPack,代码行数:14,代码来源:Red9_General.py
示例13: defaultButtonPush08
def defaultButtonPush08(*args):
cmds.progressWindow(isInterruptable = 1)
while True:
WindowCheck = cmds.window(title = '"Press Esc"', widthHeight = (400, 200))
cmds.paneLayout()
cmds.scrollField(wordWrap=True, text='"Press Esc"')
cmds.showWindow(WindowCheck)
cmds.showSelectionInTitle(WindowCheck)
cmds.deleteUI(WindowCheck)
if cmds.progressWindow(query = 1, isCancelled = 1):
cmds.progressWindow(endProgress = 1)
break
cmds.refresh()
开发者ID:ChengJiunHao,项目名称:BBB_stuff,代码行数:16,代码来源:BBB_FX.py
示例14: _parse_rib_archive
def _parse_rib_archive(self, ribArchivePath):
"""Parses RIB archive file and tries to extract texture file names and other .rib files to parse.
It read the file line by line with buffer limit, because the files can be very big.
RIB files can be binary, in which case parsing them would be possible, but hacky,
so we won't do that.
We also check if the user has cancelled."""
fileSet = set()
# Please see the link to easily see what those regex match: https://regex101.com/r/X1hBUJ/1
patterns = [(r'\"((?:(?!\").)*?\.rib)\"', 'rib'),
(r'\"string fileTextureName\" \[\"((?:(?!\").)*?)\"', 'tex'),
(r'\"string lightColorMap\" \[\"((?:(?!\").)*?)\"', 'tex'),
(r'\"string filename\" \[\"((?:(?!\").)*?)\"', 'tex')]
with open(ribArchivePath, 'r') as content_file:
line = content_file.readline(10000)
while line != '' and not cmds.progressWindow(query=1, isCancelled=1):
for (pattern, t) in patterns:
for file in re.findall(pattern, line):
if os.path.exists(file):
fileSet.add((file, t))
line = content_file.readline(10000)
for (f, t) in fileSet:
yield (f, t)
开发者ID:zync,项目名称:zync-maya,代码行数:25,代码来源:renderman_maya.py
示例15: refresh
def refresh( self, message = None ):
"""Finally show the progress window"""
mn,mx = ( self.isRelative() and ( 0,100) ) or self.range()
p = self.get()
myargs = dict()
myargs[ "e" ] = 1
myargs[ "min" ] = mn
myargs[ "max" ] = mx
myargs[ "pr" ] = p
myargs[ "status" ] = message or ( "Progress %s" % ( "." * ( int(p) % 4 ) ) )
try:
cmds.progressWindow( **myargs )
except RuntimeError,e:
log.warn(str( e ))
pass # don't know yet why that happens
开发者ID:adamcobabe,项目名称:mrv,代码行数:17,代码来源:dialog.py
示例16: batchResizeTexture
def batchResizeTexture(*args):
imgPathList = getImgPath()
sizeScale = cmds.optionMenu('TR_sizeScale', q= 1, v= 1)
maxValue = len(imgPathList.keys())
cmds.progressWindow( title= 'TextureResize', progress= 0, max= maxValue, status= 'Scaling...', isInterruptable= 1 )
processStop = 0
for i, tex in enumerate(imgPathList.keys()):
if cmds.progressWindow( query= 1, isCancelled= 1 ):
processStop = 1
break
newPath = resizeTexture(imgPathList[tex], sizeScale)
#print newPath
if not cmds.checkBox('TR_modify', q= 1, v= 1):
cmds.setAttr(tex + '.fileTextureName', newPath, typ= 'string')
cmds.progressWindow( e= 1, step= 1, status= str(i) + ' / ' + str(maxValue) )
cmds.progressWindow(endProgress=1)
# refresh
fileNodeSelect()
开发者ID:davidpower,项目名称:MS_Research,代码行数:26,代码来源:textureResize.py
示例17: dump
def dump():
path = mc.fileDialog2(dialogStyle=1, fileMode=2)
path = path and path[0]
if not path:
return
mc.progressWindow(
title='Geo.D Export',
status='Initializing...',
progress=0,
isInterruptable=True,
)
scene = Scene(path, object_class=Object)
selection = mc.ls(selection=True, long=True) or []
transforms = mc.listRelatives(selection, allDescendents=True, fullPath=True, type='transform') or []
transforms.extend(x for x in selection if mc.nodeType(x) == 'transform')
for transform in transforms:
scene.add_object(Object(transform))
scene.finalize_graph()
for i, total, path, obj in scene.iter_dump():
mc.progressWindow(e=True, progress=int(100 * i / total), status=obj.transform.split('|')[-1])
if mc.progressWindow(q=True, isCancelled=True):
break
mc.progressWindow(endProgress=True)
开发者ID:sitg,项目名称:geod,代码行数:30,代码来源:commands.py
示例18: isCancelled
def isCancelled(self):
'''
fixed naming but previous left for legacy calls
'''
if not self.disable:
if self.ismain:
return cmds.progressBar(self._gMainProgressBar, query=True, isCancelled=True)
else:
return cmds.progressWindow(query=True, isCancelled=True)
开发者ID:markj3d,项目名称:Red9_StudioPack,代码行数:9,代码来源:Red9_General.py
示例19: _process_rib_queue
def _process_rib_queue(self, queue):
files_parsed = 0
cmds.progressWindow(title='Parsing rib files for dependencies...',
progress=files_parsed, maxValue=files_parsed + queue.qsize(),
status='Parsing: %d of %d' % (files_parsed, files_parsed + queue.qsize()), isInterruptable=True)
while not queue.empty() and not cmds.progressWindow(query=1, isCancelled=1):
(file, node, file_type) = queue.get()
files_parsed += 1
cmds.progressWindow(edit=True, progress=files_parsed, maxValue=files_parsed + queue.qsize(),
status='Parsing: %d of %d' % (files_parsed, files_parsed + queue.qsize()))
scene_file = file.replace('\\', '/')
print 'found file dependency from %s node %s: %s' % ('RenderManArchive', node, scene_file)
yield scene_file
if file_type == 'rib':
for (f, t) in self._parse_rib_archive(file):
queue.put((f, node, t))
开发者ID:zync,项目名称:zync-maya,代码行数:19,代码来源:renderman_maya.py
示例20: runFlakeGen
def runFlakeGen(self,state):
'''
Executes the code to generate snowflakes and starts the progress window using the variables defined in snowflakeUI.flakeGenUI and starts the progress window
'''
cmds.progressWindow(title='SnowFX',
progress=0,
status='Starting up...')
try:
particles=makeSnowflakes.makeSnowflakes(cmds.intField(self.flakeNumber,v=1,q=1),
cmds.floatField(self.flakeRadius,v=1,q=1),
cmds.intField(self.flakeRadiusVar,v=1,q=1),
cmds.canvas(self.colour1,rgb=1,q=1),
cmds.canvas(self.colour2,rgb=1,q=1),
cmds.floatField(self.transparency,v=1,q=1),
cmds.floatField(self.glow,v=1,q=1))
for i in range(0,len(particles)):
cmds.move(0,0,cmds.floatField(self.flakeRadius,v=1,q=1)*2*i,particles[i])
group = cmds.group(em=1,n='snowFX')
for x in particles:
cmds.parent(x,group)
cmds.progressWindow(ep=1)
except Exception, err:
sys.stderr.write('ERROR: %s\n' % str(err))
cmds.progressWindow(ep=1)
errorPopup('Something went wrong :( \n Check the script editor for detials')
开发者ID:philrouse,项目名称:snowFX,代码行数:25,代码来源:snowflakeGUI.py
注:本文中的maya.cmds.progressWindow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论