Man, I love me some lua scripting

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
DK
Posts: 2896
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

I was looking at the guts of the script and it's still beyond me how you can understand it but I'm glad you do:)

Thanks again.
D.K
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Post by chucky »

It would be great to see a couple of lua tutes for noobs.
Like really basic stuff for all of us who have no freaking idea of what is what.
What do you think Synthsin75?
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

http://www.mediafire.com/?ayz9ja2tdl0

Here's one with left and right naming, DK. Select what bones you want to name or rename, and run this menu script. It will give you check boxes for left and right extensions for the names, and it will always rename the first bone created as 'root' whether it is selected or not.

So as long as you create both sides of your skeleton in the same order, you can then select one side and give them the right extension and the other side left. By same order I mean if you created them in this order :root, hip waist, chest, left collar, left upper arm, left forearm, left hand, right collar, right upper arm, right forearm, right hand, left thigh, left shin, left foot, right thigh, right, shin, right foot; then each side has the bones created in the same order relative the to the other bones on that side regardless of any intervening bone creation.

The number of bones and the order created doesn't matter, just that the bones of one side are created in the same relative order as the other side.



Chucky, yeah I've pondered doing that. The only problem is that you'd first have to explain lua, which has been done in many other places. And only then could lua in AS be easily explained. I've thought of doing a dissection of a simple script, but I'm not so sure that would help.

I may do one eventually though.
User avatar
DK
Posts: 2896
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Hi synthsin75....i just ran te script and it worked but it did not create the first bones as "root" for some reason.

Cheers
D.K
User avatar
DK
Posts: 2896
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

oops...wait it just worked fine then???? That was strange? The first time I ran it the root bone was named 1_left....seems to be working fine now.

Manymany thanks synthsin75

Cheers
D.K
User avatar
DK
Posts: 2896
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Sorry....there IS something going haywire with the script. It names the first bone created as root and the last bone created as left_1 when both check bxes are selected.

EDIT: The other bones are left nameless.

D.K
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Ooops. No that was my fault, DK. It was only renaming the first bone as root if it wasn't selected. This should fix that. Let me know if you have any more problems with it. The simpler the script the less I think I need to test it, I guess.

http://www.mediafire.com/?ml52zdolj2t

:wink:
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

It only renames selected bones except for the first, root bone. I'm guessing you only had that last bone selected? And it only registers the first checked box.
User avatar
DK
Posts: 2896
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Hey, it works great!!! Thanks synthsin75. This will be really handy and quite time saving only naming selected bones. Ripper script mate ;)

Cheers and well done!
D.K
Post Reply