-
Richard 1,943 posts
Hey gang, because reviving the forum also means creating new topics, here is my contribution:
I've been wanting to learn mel for a while, and figured that learning it while creating an autorig setup would be interesting and challenging enough. Turns out, it's as hard as I thought, but it's soooo much fun!
For some reason it feels like scripting is right for me. It feels like i'm using my full brain power and having lots of fun doing so. I not felt that exited and challenged about 3D in a loooong while. And even though it's just been 24 hours, I feel extremely comfortable! weird right?
So far i actually hand wrote 730 line of mel with no auto rig reference.
i've strugled here and there as i did not speak mel 24 hours ago, but averall it's going fine.
here is the UI:
i'm almost finished with the template skeleton that you use to reposition over your model,
and this is what you get when you click on the create template rig button:
Most of the spheres are not just spheres, i made attributes and other things so that it takes just a few minutes to place them correctly
as you see it's still missing the spline, hands and feet. but i needed to stop and make the UI first as they will depend on the user's selection.
once I'll be finished with that, i will move on and create the skeleton. using values from the template skeleton.
-
Cameron 2,374 posts
wow thats very impressive, you're going places sir.
Be careful though, using your full brain is great at first, but do that for 2 years solid and you'll need to book yourself in for at least 10 years remedial tropical island therapy!
-
Richard 1,943 posts
wow cool! that sounds like fun!
-
Richard 1,943 posts
hey mel scripters, care to help?
because when change options in the ui, i then need to query it to use it during the script
so i declared this
string $name = `textField -query -text autorigName`;
int $sym = `checkBoxGrp -query -value1 autorigSym`;
so that i can find the name and use it down the line, and so that i can see if a symmetry checkbox is checked (new option since screenshot)
further down the line, in the creation of the sphere i have this
if ($sym = 1){
expression -e -s "rig_rt_clav.translateX = -rig_lf_clav.translateX;\rrig_rt_clav.translateY = rig_lf_clav.translateY;\rrig_rt_clav.translateZ = rig_lf_clav.translateZ;" -n "symm_clav_rt_exp" -o rig_rt_clav -ae 1 -uc all ;
}
all i'm saying:
if $sym =1, then create an expression so that the clavicle spheres move symmetrically.
yesterday i just had the name string, and it worked great, renamed controlers accordingly during the script. But since i added the new integer it tells me this
// Error: Only one expression allowed for edit/query. //
// Error: Unable to parse command argument list. //
can you only do one query?
am i doing something wrong?
-
Richard 1,943 posts
found it,
i had to use
if ==1
rather than
if =1
cause in the above I was telling it that it was equal to one
also, i had a problem in my expression, i used a -e flag for no reason as i was creating the expression
-
JayG 1,164 posts
Lookin' good man, off to a great start!
I subscribed to this topic so I can help you with any MEL issues you run into.
Personally I would use a buffer node/multiplyDivide setup to mirror your sides, instead of expressions...but both work, your preference of course.
Expressions are just messy in Maya in general so I tend to avoid them altogether.
Another suggestion, having had this beat into me at work all day everyday: Don't hard-code the amount of toes, fingers, etc. he's allowed to have. Make it dynamic so you can tell it exactly what you want. What if they want 15 toes on each foot? How about 64 bones in his spine? It might never happen, but if it does you won't have to re-write your auto-build.
-
Richard 1,943 posts
thx for the thumbs up man, and i'm sure that you'll come in very handy down the line! ^^
- great call for the multiply divide node! i ended up using them for all the symmetry! it works great and it's super duper fast!
- i have no idea what the buffer node is
- how could i make the fingers and all that stuff dynamic? how would i go about doing that?
-
JayG 1,164 posts
By Buffer Node I'm just referring to parenting your object to an empty transform (group) node and connect to that which makes it generally a bit more clean. Sometimes your objects will already have incoming connections so you can't connect to them, so you create a buffer as it's parent at the same location/orientation and connect to that instead.
To make it dynamic is a tough question. It essentially requires a lot of planning and being creative to make it work. Example my auto-rig has an attribute to change the amount of spine bones on the fly (at the skeletal stage). The way I coded it was to have the top of the spine and the bottom stay constant, and then wrote a proc to basically "split" the distance between the joints to a certain number of joints. So if I want say 7 joints in the spine, it will add 5 in between them at equal distance.
You can do the same sort of thing with toes and fingers. Allot it a certain amount of space, teach it how to make a finger, and then for however many they want you fit them in there somehow haha. I'm not saying it's easy by any means, but it WILL come up in your rig building future.
One option to consider is using "templates". So you have like a basic humanoid template to start, that you can add to and modify to work with the mesh you're rigging. Then as time goes on you save out new templates and can import them to save yourself time. Need to rig a quadruped? Save out a template when you do so next time half the work is done for you. Enabling you're auto-rigging system to do as much work for you as possible is in essence it's purpose.
Just some more ideas for ya.
-
JayG 1,164 posts
-
Richard 1,943 posts
-
Richard 1,943 posts
-
Richard 1,943 posts
-
JayG 1,164 posts
-
JayG 1,164 posts
-
Richard 1,943 posts
-
Richard 1,943 posts
-
Richard 1,943 posts
-
JayG 1,164 posts
-
JayG 1,164 posts
-
JayG 1,164 posts
-
Richard 1,943 posts
-
JayG 1,164 posts
-
Richard 1,943 posts
-
Richard 1,943 posts
-
Richard 1,943 posts