- #Maya python setattr of list how to
- #Maya python setattr of list pro
- #Maya python setattr of list code
setAttr (m圜ube+ ".translate", cubePosX, cubePosY, cubePosZ ) Explainations sel = OpenMaya. pol圜ube (width=voxelStep, height=voxelStep, depth=voxelStep ) cmds. z/voxelStep ) *voxelStepĬubeId = "%s%s%s" % (cubePosX, cubePosY, cubePosZ ) if cubeId in voxelIdList : y/voxelStep ) *voxelStepĬubePosZ = round (pointArray. x/voxelStep ) *voxelStepĬubePosY = round (pointArray. length ( ) ) :ĬubePosX = round (pointArray. VoxelIdList = list ( ) for i in xrange (pointArray. The only dificulty with this implementation is, once the vertex position recovered, to know where must be the center of the cube.
![maya python setattr of list maya python setattr of list](https://mightybeargames.com/wp-content/uploads/2020/04/1lyH14CTF22hTqn0FeacxHA.png)
The method chosen here is simple: For each vertex of the geometry, we find the position "in cube unit" and generates a cube.
#Maya python setattr of list pro
There are a thousands of ways to solve it and each method has these pro and con. Very very useful!īut back to my previous question.Before we begin, know that this problem is a textbook case. Whether it be a new attribute or what have you. I follow along, then try and change something after. But ya, its been a killer tutorial so far. You set up the array differently than how you did it earlier, and I think that was just because you`re so use to doing it. So I had to isolate the code, and create an array. Since MEL keeps a history, when I jumped into a later section, it wasnt working, since it didnt have the history. For example, I had to reinstall maya mid way through the MEL teachings. Ive run into a problem here or there, but you taught enough that I could problem solve and figure it out. Honestly, I’ve had a BIT of action script 3 experience before, but that was 6 years ago. =)Īhhh! Thank you for making the tutorial.
![maya python setattr of list maya python setattr of list](https://welseykeeling.files.wordpress.com/2015/03/ssds.png)
ListAttr is another good heavy hitter in Maya.Īnd thanks for supporting Eat3D! Hope you’re enjoying the video and my overly nasal voice isn’t too distracting. Wish I saw this thread sooner, I love how in Maya you get 3 commands to do similar tasks =) If cmds.listAttr(myAttrName, v=True, u=True, k=True):
![maya python setattr of list maya python setattr of list](https://i2.wp.com/www.chrisevans3d.com/pub_blog/wp-content/uploads/2017/11/msg.png)
#build the attribute name using the control name, the attribute name, and the axis #imports all of mayas MEL commands for me to use
#Maya python setattr of list code
Here’s my code before taking out the visible/unlocked check. So, my question for you all is if there are any situations where I would need to check for unlocked or visible, or would it just be faster / cleaner to check for only keyable? If i get rid of the other 2, it still works, even if i have something locked and hidden. The script worked, but I just checked, and it seems like the only thing I need to check is if its keyable. I actually got help from a friend with it as well, and he told me to check for visible, unlocked and keyable. Hey all, long delay, but thanks for all the replies! I ended using the listAttr command like suggested and it definitely worked. Forum seems to automatically get rid of it)
#Maya python setattr of list how to
(not sure how to add indentation in the forum. If not cmds.getAttr(myAttrName, lock=True): If not cmds.attributeQuery(myAttrName, typ="choice", h=True): MyAttrName = m圜ontrol + "." + attribute + axis
![maya python setattr of list maya python setattr of list](https://images.squarespace-cdn.com/content/v1/589da5fad482e9ffb151be4f/1529525386620-MZFF5NUQXNHFDD7DGJR5/infl.jpg)
If I take out the if statement about the hidden, it all works, if none of the controls have a hidden attr.įor m圜ontrol in m圜ontrols: for attribute in attributes: What am I suppose to put there? Here’s my code. I don’t get the “choice” thing in the attributeQuery. I’ve added an if statement to look for if the attribute is hidden, but it’s coming back as attribute name not recognized. It says the control doesnt have that attribute. I was able to add in the translate as well, but my problem has come to when the controls have hidden attributes. The tutorial shows you how to zero out rotation on controls, and avoid the locked ones so it doesn’t crash. I finally dove in to learn scripting, and although I`m understanding some things while following along Eat3d’s Intro to maya scripting tutorial, I’m struggling with using the command reference to do things that aren’t in the tutorial.