HeyVern's scripts and tools - (focus on bones)

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

Post by heyvern »

Please download the new version of the Rename Bones script in the first post. Just redownload and replace the old one.

There is a very strange bug that I can't track down in the bone renamer script.

I have "fixed" it so it doesn't crash AS but I had to disable the pop up window displaying the number of bones changed and the alert if no bone names were changed.

I also made some other changes that were incorrect having to do with escaping "special" characters in bone names like; "!@#$%^&*()_+" etc etc that might cause trouble.

I will keep trying to track down the bug but for now this is the best I can do. I apologize if anyone has had AS crash on them using this script. It only shows up if you do very very specific things or if you run the menu script several times in a row very quickly. It might even be limited to my machine only. But I don't want to take that chance.

If you have encountered this problem or continue to with the new version I uploaded please let me know.

-vern
User avatar
Víctor Paredes
Site Admin
Posts: 5664
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Heyvern, i have been played with your script and it's very useful. thanks.
but i have had some problems.

- in a new file, i create a group of bones, play around, save and close it. but no one _bgrps.tbl file have been created. i open the file and there is no group or color.
the creation of the _bgrps.tbl file only works when i reopen the file, create again a bones group and save the file.

- i had to replace Fazek's tools, but i had to replace LM's tools too to work with bones groups.

- i can see the colors using manipulate bones tools.

- in the vector layer of the sample, the points are setted noisy.


i hope don't be unpleasant, i have loved your scripts and the way you rig the characters (the leg and heel bones of the sample are one of the simplest and smartest things i ever seen in moho), but i know you are a perfectionist and want that your scripts works on a 100%.

thanks again.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Thanks Selgin!

I knew there would be some bugs. I need help tracking them down.
- in a new file, i create a group of bones, play around, save and close it. but no one _bgrps.tbl file have been created. i open the file and there is no group or color.
I just noticed that one. Until I fix it just save 2 times. When you create bone groups with a new document and then you save, don't close it right away. Just hit the save again before closing.
- i had to replace Fazek's tools, but i had to replace LM's tools too to work with bones groups.
Can you explain this one a little more? You had to replace both to work with bone groups?
- i can see the colors using manipulate bones tools.
I haven't modified that tool yet. I have to add code to each tool so it works. I just picked a few to start with first.

Thanks for the feedback.

-vern
magicwand
Posts: 39
Joined: Wed Nov 24, 2004 5:22 am

Post by magicwand »

Heyvern, the script works like a charm.

I however faced a problem, when I used the offset bone tool to bring the pieces of a character together. The colored bones seem to get scattered on frame 1 and above.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Dagnabbit!

Forgot to test for offset!!!!!

Good catch.

Yes you are correct this is a HUGE bug. Will work on it immediately. I have to include offset in the matrix calculation... darnit.

;)

-vern
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Magicwand!

Thanks for that catch. I guess someone would have found it eventually but I am glad I got it out of the way so quick.

I have updated the zip files but here is the new script to replace the existing one in your scripts/utility/ folder:

http://www.lowrestv.com/moho_stuff/scri ... dutils.lua

You can just click this link and just save to scripts/utility/ overwriting the existing one.

Phew! This was a HUGE GIGANTIC DEAL BREAKING BUG. Without bone offset this script is useless.

-vern
Ovjeh
Posts: 26
Joined: Tue Nov 07, 2006 11:53 pm

Post by Ovjeh »

The problem is that LM tools 'needs' something from fa_sharedutils
On clicking Bone_Groups icon this error pops up:

attempt to index global 'Fa_SharedUtils' (a nil value)
attempt to index field 'btDelete' (a nil value)

Everyone should install Fazek's tools anyway.

About hiding, I assume this is hardcoded, you can't totally hide bones ?
Ovjeh
Posts: 26
Joined: Tue Nov 07, 2006 11:53 pm

Post by Ovjeh »

Ah, sorry, false alarm.

I messed up. :oops:
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

About hiding, I assume this is hardcoded, you can't totally hide bones ?
The way I see this script working is that you could put all the bones in a rig into groups. Then you would turn off construction curves which "hides" the bones with the application. (I am thinking of adding a "default" group for "ungrouped" bones. This would save effort).

Then use the bone groups tool to hide or show bone groups as needed. I am thinking of including an option to shut off bone coloring but leave the outlines... sort of like a turning off construction curves but only for a subset of the bones. Then it would look just like the "standard" bone interface with construction curves turned on but with more options.

What I did in the past with large bone rigs was to painstakingly draw bone shapes on a vector layer and bind them to the bone, then turn off construction curves. I found this to work but it was time consuming and had no other options or features as far as hiding or showing bone groups, unless I put bone group "vectors" on different layers.

That was my motivation for this script when I discovered how to draw shapes in the UI.

----------

At the moment I have to figure out how to get the bone offset tool to work properly. For some odd reason I can't get the bone positioning to redraw MY bone shapes for children of offset bones. It works fine on frames above 0 for the manipulate bone tool, but the bone offset tool is "weird" too me in how it displays or moves the bones.

I also need to add in the option for multiple bone layers. Different groups for each layer. This is simple enough I just have to code it in. Unfortunately it will probably mess up and existing group settings since I would be adding a new field to the group file table indicating layer name.

That will be another requirement. You will need to get into the habit of giving layers unique names. If two or more bone layers have groups and they both have the same name all heck will break loose. No way around it.
magicwand
Posts: 39
Joined: Wed Nov 24, 2004 5:22 am

Post by magicwand »

Thanks Vern,

The script looks great, plus the implementation is so simple, will play with it further it later on in the day.

Thanks again for this amazing script.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

selgin wrote:(the leg and heel bones of the sample are one of the simplest and smartest things i ever seen in moho),
Selgin! You noticed! Thanks!

I wasn't sure anyone would notice it since I didn't explain how it works. I really like this set up. I was kind of embarrassed by the rest of this sample file but I really like those legs. ;)

I started using this when I came up with the "aim bone" script and needed to have a "reversible" leg for my Lion character.

---

I am still having trouble with the bone offset tool. So annoying. I got the manipulate bone tool working but not on frame 0. I just can't figure out why MY bones don't just follow along with the "real" bones. The code is so weird to me I can't figure it out. Lots of matrix inversing... that math stuff hurts my head. ;)

-vern
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Added new tools to the set:

You need to replace this one in the utility folder:
hv_sharedutils.lua

These are the new tools:
lm_bone_strength.lua
lm_manipulate_bones.lua
lm_offset_bone.lua

It think this leaves the reparent bone tool and the add bone tool.... well... plus all the layer tools... and the rest of the draw tools <sigh>.

-vern
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I made a really big mistake and I apologize for it.

I was using references to the utility script from Fazeks custom tools in the bone groups tool. I completely forgot about it.

This means that the tool doesn't work at all and you will get lua console errors all over the place if you don't have fazek's tools installed.

:oops:

What a total goof on my part.

Download this script and place it in the scripts/utility/ folder.

http://www.lowrestv.com/moho_stuff/scri ... dutils.lua


-vern
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I have taken the bone group scripts off line temporarily due to so many issues and problems.

Most of them are fixed now and it's working great but I won't make the same mistake I made before. I want to make absolutely sure this set of tools is fully functional before posting again. I have created a whole new set of replacement tools... all of them. I am using them myself everyday so I can find anymore problems. I updated the first post in this thread if you want to see what I have been doing.

I made a lot of mistakes up to this point. I apologize for that. I will try to make sure the big issues are fixed before posting the new scripts. I hope some of you will give it another shot when it's ready. I really think it will be worth it. I am really loving the ability to have grouped bones.

-vern
slice11217
Posts: 279
Joined: Thu Mar 30, 2006 6:12 pm
Location: Verona, New Jersey

Post by slice11217 »

Hello again, Heyvern!

So I've noticed an unnoticed (I think it's unnoticed) limitation to the "copy/flip bones" script. I'm fully willing to admit that perhaps I'm not doing things properly, but it seems that the script won't work on bones that are on a switch layer. It's grayed out in the pulldown menu when I'm on a switch layer.

If it turns out that I am doing things correctly, is there a way to fix this? I could use it for a project I'm working on.

Thanks,

Slice
Post Reply