ZV Parent Master 1.3.3 for Maya (maya script)
Animate interacting objects with ease
Bugs
Baking constraint
| Status | closed |
|---|---|
| Priority | medium |
| Date | 09/26/2013 |
| Submitted by |
|
| Modify this bug | edit |
Found a problem with some scenes dont bake correctly. Basically the anim curves from the locator, doesnt get named correctly. Solution is below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
def _applyBakedAnimation(obj): '' 'Connect bake the animation of the locator object.''' # If the locator is not 'created (nothing to Bakare) exit locatorName = obj + _locSfx locExists = cmds.ls(locatorName) if not locExists: return # If this exists deletes the node rigidBody and the solver try: rb = _getRigidBody(obj) if rb: solver = cmds.listConnections(rb + '.generalForce', s=False)[0] cmds.delete(rb) # If a non-rigid solver and 'delete used if not cmds.listConnections(solver + '.generalForce', d=False): cmds.delete(solver) # If the node rigidBody and 'referenced only then disconnect the choice by the attributes of the object except: for choice in cmds.listConnections(obj, d=False, s=True, t='choice'): cmds.disconnectAttr(choice + '.output', cmds.listConnections(choice + '.output', p=True)[0]) # Delete any keys in the node object's transformation cmds.cutKey(obj, at=['t', 'r']) # Find the animation curves of the locator animCurves = cmds.listConnections(locatorName, d=False, type='animCurve') # rinominale for crv in animCurves: newName=obj+'_'+crv.split('_')[-1] cmds.rename(crv,newName) # Connect the animation curves of the object attrs = cmds.listAttr([obj + '.t', obj + '.r'], u=True, s=True) if not attrs: return for attr in attrs: curveNameAttr = '%s_%s.output' % (obj, attr) cmds.connectAttr(curveNameAttr, '%s.%s' % (obj, attr)) # pulisci le curve sys.stdout.write('Optimizing translation and rotation keys...\n') _cleanCurves(['%s.%s' % (obj, s) for s in ['tx', 'ty', 'tz', 'rx', 'ry', 'rz']]) # cancella il locator cmds.delete(locatorName) |
Comments on this bug:
leevice said about 13 years ago:
Toke Jepsen said about 13 years ago:
leevice said about 13 years ago:
Toke Jepsen said about 13 years ago:
leevice said about 13 years ago:
Toke Jepsen said about 13 years ago: