Genete! Shape ordering script question...

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Genete! Shape ordering script question...

Post by heyvern »

I have a situation that involves teeth and a big tongue.

I would like to sort these shapes (tongue and teeth) based on a bone's position or scale and reorder the teeth shapes and the tongue shape so the shapes are in the correct order based on the head turn or on the position or length of the tongue.

For instance if a tongue bone is scaled past a certain point it would be outside of the mouth and would cover some of the teeth and the teeth and tongue shapes would need to be reordered.

You mentioned the possibility of creating a "universal" shape order script?

Right now I had to "over complicate" my layers by creating several extra teeth layers and use layer reordering to allow the tongue to work properly. It isn't working too well and I could simplify this and have the tongue and teeth on the same layer and just reorder those shapes.

Just wondering if you have any thoughts. In the meantime I may look at that shape reordering script to see if I can just "hack" some of it for my needs.

It would be fairly similar to how the shape reordering is done in the 3D script set you did... the difference is I want to drive this using the current rig in a much simpler way. There are only a few teeth shapes involved (fangs and front teeth as a "unit") and one tongue shape.

-vern
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

I think you have loose this post from my side. (In fact I'm very confused because no one have commented nothing on the thread. :( )
I have a embedded script that automatically sort the shapes based on bones position and names!!!!
The bad new is that you have to have one bone per shape. If there is no bone then a good mess would happen.

BUT WAIT!! I have a new version that prevent for useless computation.
The new version only run the script if there is a keyframe on the bones that are connected to the shapes. If no keyframe then the script returns. It saves a lot of performance and also prevent for some buggy sorting on the previous version script.
Please read the post and download when I update it with the new script version. I'll do it now :)

Please let me know what do you think.
-G
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Yeeehaaaa!

Thanks! I will post additional comments on the script page. This is just what I need. One bone per shape is not a problem at all... I expected it. Very few shapes only a few bones.

I completely missed that new script somehow.


-vern
Post Reply