poplabirthday.blogg.se

Maya python setattr visibility false
Maya python setattr visibility false












Mc.connectAttr(“Sine_CNTRL.Amplitude”,”sineValue_loc_1.tx”) Mc.connectAttr(MultDiv+”.outputX”,”sineValue_grp_1.rz”) Mc.connectAttr(“Sine_CNTRL.Frequency”,MultDiv+”.input1X”) Mc.setAttr(MultDiv + “.input2X”, FrequencyAmt) MultDiv = mc.shadingNode(“multiplyDivide”, asUtility=True, n=”MultDiv_Frequency_1″) Mc.parent(“sineValue_loc_1″,”sineValue_grp_1”) Mc.setAttr(“sineValue_loc_1.overrideColor”, 6) Mc.setAttr(“sineValue_loc_1.overrideEnabled”, 1) Mc.setAttr(“sineOutput_grp.visibility”,False) Mc.connectAttr(“Sine_CNTRL.ShowValueLocators”,”sineValue_grp.visibility”) Mc.connectAttr(“Sine_CNTRL.ShowGraphObjects”,”sineResult_grp.visibility”) Mc.parentConstraint(“Sine_CNTRL”,”sineOutput_grp”) Mc.parentConstraint(“Sine_CNTRL”,”sineResult_grp”) Mc.setAttr(“Sine_CNTRL.ShowGraphObjects”, True,k=True) Mc.addAttr(“Sine_CNTRL”,ln=”ShowGraphObjects”,at=”bool”) Mc.setAttr(“Sine_CNTRL.ShowValueLocators”, k=True) Mc.addAttr(“Sine_CNTRL”,ln=”ShowValueLocators”,at=”bool”) Mc.addAttr(“Sine_CNTRL”, ln=”Offset”, at=”double”, dv=False) Mc.setAttr(“Sine_CNTRL.Amplitude”, k=True) Mc.addAttr(“Sine_CNTRL”, ln=”Amplitude”, at=”double”, dv=False) Mc.setAttr(“Sine_CNTRL.Frequency”, k=True) Mc.addAttr(“Sine_CNTRL”, ln=”Frequency”, at=”double”, dv=False) Mc.setAttr(“Sine_CNTRL.overrideColor”, 17) Mc.setAttr(“Sine_CNTRL.overrideEnabled”, 1) # create a control, call it sineController Mc.parent(“sineOutput_grp”,”Sine_Master”) Mc.parent(“sineResult_grp”,”Sine_Master”) # paste into a python tab and run via CreateSineViaNodes(64) (change 64 to however many output cubes you’d like)

maya python setattr visibility false

based on a tutorial by Jorn-Harald Paulsen # CreateSineViaNodes by Mike McReynolds automates creation of a sine function, via nodes.

#Maya python setattr visibility false code

Paste the following code into a python tab in the script editor, hit Cntrl-A and Cntrl-Enter to run

maya python setattr visibility false

Just change the ’64’ in the last line to any number you want. With this, you can choose any number of result nodes you want. Great tutorial, and really novel approach! I went a bit further, making it into a small python script. I’m using the translateY to output the sine in the tutorial, but remember that if you for example use this on a joint-chain, you could just connect the output to the rotate of the joints instead. Here’s an interesting example Disney Research Lab released a little more than a year ago:Ĭomputational Design of Mechanical Characters Instead of dealing with just the math to get this to work (which you do with expressions), you’re dealing with a more practical setup, which easily can be modified to behave however you want it to. So as long as you know the “pattern” of the mathematical function, let your rigging brain take over and do a practical setup in Maya that lets you extract the behaviour of the function. This is very basic, and the concept is very well demonstrated here, the tutorial just shows you how it can be applied to several objects in a way that lets you control the entire chain of objects affected by the sine with one controller of the games, since animation is used for different games for computers or phones, and you can get this type of games in sites like AndroidHackers online and others.Įven if you know how a sine works, there’s still something to take out of doing it this way in Maya. Also, nodes evaluate way faster than expressions 🙂 The main reason you would want to do things with nodes instead of using expressions is that expressions doesn’t always evaluate when you want them to, some times you have to scrub the timeline or playback the scene to force an evaluation of the expression. That can be really cumbersome if you need to adjust attributes that affects the result of the expression without seeing the changes instantly. The ribbon turned out totally different from this tutorial though, but I thought this could still be a useful technique to share.įirst off, there’s several tutorials out there on how to create a sine-function in Maya, but I’ve never seen anyone do them with nodes. My first thought was to start with getting the sine-function to work with nodes, and then work my way from there. This however, is actually the thing that got me started on the procedural ribbon in the first place. Wow! It’s been more than a year since my last post here… Time flies 😕 Anyway, I’ve gotten a lot of questions about the procedural ribbon from my rigging reel, and I promised I’d do a tutorial on that, I’ll try to get that done next week or so 🙂

maya python setattr visibility false

Tutorial: Create a Sine with Nodes in Maya












Maya python setattr visibility false