ok so im creating this auto rigger, ive currently got it so it can create several joints each at its own object,I want to try and get it so it names the joints after the object it is created on and add _Joint to the end of its name.
Also as the title says, I want to add skinning, I cant get my head around it.
thanks for any help !
Replies
(The % is a quick way to concatenate strings in python). Not sure about the skinning.
Should have just bumped this one up than make a new thread haha.
Thanks for any help !
John.
ps - these two websites are what I am going from to learn what to put into my script but some parts, im finding harder to figure out.
http://download.autodesk.com/global/docs/maya2012/en_us/CommandsPython/index.html
http://docs.python.org/2.6/index.html
and this is the rest
after this part i was looking at firstly parenting the joints to the chassis joint, then he joints to their relevant parts of the vehicle.
etc
so in
pSphere2 will the child and pSphere1 joint will be the parent. Also should edit your window code to this:
That way you dont have multiple windows showing up.
Out of curiosity is this for a school project?
when I first execute the script above that creates the joints at the pivots (this will be button 1 on my UI)
then I execute this script the bind the joints (button 2)
i get this error after executing the bind joints
this is the script I came upwith, I remembered that I used smooth bind when I created the original rig, after the rig is bound, I then parent bones to the chassis_bone
for the UI do I put these two scripts in with the UI script then have the buttons execute them or do the scripts all have to be separate? if that makes sense.
Sorry if im asking alot of questions, I am currently reading the two websites I mentioned earlier as well as this book - Maya Python for Games and Film.
that book is helping me alot (for those who are learning python for Maya and reading this thread) hence why I have been able to come up with the bind skin script myself. I cant seem to figure out the error though. also any help with the menu is greatly appreciated, the menu seems more confusing then it should me.
thanks again,
john.
I changed that by having a button in my menu change Chassis_joint to Root_Bone.
I have created a few buttons that function properly but there are two buttons which I can't get to work and thats because they are using a string I think its called ? here is the button -
now I know for a fact that this bit of code works outside of the button, but I believe because the is commented it gives me this error
now when I just put a single bone in the command button instead of the string like so it works perfectly for that single joint and creates the bone.
Basically, what i'm asking is, is there a way to get this working, I was thinking of perhaps naming it outside of the button to call it, if that makes sense eg
but I know that doesn't work, I can't figure out how to set that up properly, if someone understands what i'm actually trying to achieve
Thanks in advance !!
John.
Also another thing to watch out is that you do checks on say what you are selecting or if the rootbone exists etc.
is this possible ? would help to stop people pressing the buttons in the wrong order and stuff
Yeah. You can use another built in module called partial from functools and send arguments to the function. You would have to do something like:
This is what I was using.
What I have been trying to find out is if maybe I could create some sort of string in the address maybe? i'm not sure if thats the right way to go about it. What I need to do is maybe send the exported file to the users "my documents" or maybe just the desktop. but I can't seem to achieve this because of the users computer obviously has different user name which changes the address.
Just wondered if you could point me in the right direction ( thats if im making any sense :P )
Thanks
I also wondered if I could put a text field so the user could type / copy and paste their desired save location and then it reads that texts and inputs that string into the -f flag string? if the previous method isn't doable perhaps this method is ?
That should return DriveLetter:\Users\Username
the commented out mel.eval was what I was running before.
I just don't understand what you mean by the textfield and the os module. cant find what I need in the maya python commands page so im guessing its from a different library or something like the functools ?
Thanks.
The os Module is like functools where its a built in module for python. Using the command userhome = os.path.expanduser('~') would give us their user folder so for Windows it would be like C :\Users\Username and then you can appent whatever folder you want so if you wanted Desktop you could do userhome + "\Desktop" and there you go. Will export out to desktop. I would highly suggest doing either option as this makes your export process foolproof.
Basically, I want a box for the root_bone to be inserted into by the user having the object selected and then hitting a button next to the non editable text box where the name of the object will appear. then a similar thing will occur for the child bones except I wanted there to be a + button to add more boxes for children, as well as another button to add a child bone to the children for stuff like turrets, the names that will be added to this text box, I want to be added to the selected list (cmds.ls ('blah') ) which will then be rigged.
Ive figured out how to add more textboxes but not sure how to make these boxes none editable, also they get added onto the end of my script, but I want them to be added to a specific place, before the rigging buttons.
hopefully this makes sense, this is the add text box script that ive figured out -
ive been looking on the autodesk and python documentation but cant seem to find how to add a selected objects name into the box by a click of a button.
im guessing im going to need some kind of string to get the object names from the box's to the selected list, this is the part that confuses me the most, strings are my weak point atm
I edited your add button command to:
and the function is
I dont think this is the right approach to this and maybe something like a treeView ()http://download.autodesk.com/us/maya/2010help/CommandsPython/treeView.html) might help though I dont have much experience using it. When I get some time I'll try and something quick for you.
Best.
Joe