All-in-one bone tool *Updated september 2010*

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

Moderators: Víctor Paredes, Belgarath, slowtiger

ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

All-in-one bone tool *Updated september 2010*

Post by ponysmasher »

Update*******************************************************

http://www.dauid.com/tools/scripts/ds_m ... _bones.zip

Some more features, more stable. Still doesn't work on frame 0.

*************************************************************


Just started writing LUA scripts today and man it's fun!

My first ever tool is a combinated manipulate, rotate, translate and scale bones tool with some extras.

Image

It works great except for two things.

1. Scale bone keyframes don't always show up, but I'll probably figure this out.

2. I can't get it to behave like the standard manipulate bone tool on frame 0. I can't move bones and they stay offset.
I tried just making a copy of the standard manipulate bones tool and did some renaming but the copy didn't work either.

Is there some rule that there can only be one tool that acts like manipulate bones on frame 0?
Last edited by ponysmasher on Wed Sep 22, 2010 7:37 pm, edited 1 time in total.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

If you make copies of scripts make sure you change the variables that might be "hanging around". Sometimes a tool will create global variables that contain information for that tool However that information is available to other tools. Sometimes you can get conflicts.

The key is to make sure that the main name of the script is changed in the code.

For example

Code: Select all

LM_ManipulateBones = {}
If you make a copy make sure you change that table variable. DO a global search for: "LM_ManipulateBones" and change it to your own variable or tool name:

for me it would be:

Code: Select all

HV_ManipulateBones
I use my initials.

Another issue is the utilities script and OTHER tools. For example many tools do the same thing as other tools but they do not have that code in them. They just reference the other tools functions or they all reference a function in the utilities script that returns a value.

If you post your code here I could probably tell you quickly what's wrong.

-vern
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

Thanks, you can have a look at it here: http://dauid.com/stuff/ds_manipulate_bones.lua

Please keep in mind though that i just started learning scripting so it's not going to be pretty....

There's alot to be cleaned up/fixed.
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

I had forgot I even uploaded this script to this site until I saw it listed in the "Scripts all in one Post" thread, but here is the finished version that I've been using: http://www.dauid.com/tools/scripts/ds_m ... _bones.zip
User avatar
Onionskin
Posts: 253
Joined: Wed Mar 04, 2009 2:01 pm

Post by Onionskin »

Hi Ponysmasher,
have you ever written script for all-in-one layer tool, or I mixed something?
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Onionskin wrote:Hi Ponysmasher,
have you ever written script for all-in-one layer tool, or I mixed something?
Check here
viewtopic.php?t=16862
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
User avatar
Onionskin
Posts: 253
Joined: Wed Mar 04, 2009 2:01 pm

Post by Onionskin »

Thanks Selgin,
Ramons tool is one of my favorite but this is not what I meant. I thought that Ponysmasher was made a tool for layer translation/rotation/scale. Perhaps I mixed with Mike Kelli's SwissArmyKnife tool, but somehow I think that Ponismasher made such a tool, like manipulate bones, but for layers. Maybe I am wrong, I don't know, please somebody tell me.

I asked for that because I love that manipulate bone tool, so I delete default tools bone translate, rotate and scale. I don't need them in my tools window no more. Actually I didn't delete them, just remove them from tools folder to utility folder, because ds_manipulate_bones wont work if default tools are just deleted. I wanted to do same thing with layer translate, rotate and scale, but like I sad, I don't know is such tool exist.
User avatar
Onionskin
Posts: 253
Joined: Wed Mar 04, 2009 2:01 pm

Post by Onionskin »

rajlostmarble wrote:go to (Modify-->break apart) this will make the piece look like it's covered in a bunch or dots
where is that Modify option?
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Post by jahnocli »

Onionskin wrote:
rajlostmarble wrote:go to (Modify-->break apart) this will make the piece look like it's covered in a bunch or dots
where is that Modify option?
rajlostmarble is a spammer -- I wouldn't give his 'advice' any credence.
You can't have everything. Where would you put it?
User avatar
Onionskin
Posts: 253
Joined: Wed Mar 04, 2009 2:01 pm

Post by Onionskin »

Thanks Jahnocli, I will keep that in my mind, I notice that his advice does not make sense
Animark
Posts: 49
Joined: Wed Sep 02, 2009 9:07 am
Location: Berlin, Germany
Contact:

Post by Animark »

Hello,

I've used this manipulate_bones tool for some hours and started to love it. But I got some problems and it's caused maybe in a bug or in something I am doing wrong.

I am animating three characters on a timeline with a length of 900 frames. When I use the 2 key all functions I get often some more unwanted keyframes about 100 frames away on the timeline. For example, I am working around frame 100 I get some more keys around 250.

Maybe this helps to improve the script.

Anyway I want to use something similar to the "Key All" all function. Is there a way to do that, maybe another script/tool? (I will post this request in a special topic in the "How Do I" section, so it would be nice to get some hints for alternatives there.)
Animark
Posts: 49
Joined: Wed Sep 02, 2009 9:07 am
Location: Berlin, Germany
Contact:

Post by Animark »

Hi again,

I've tested the keyframing also with another tool (Key Skeleton) and got the same problems, so I can say, it is a bug somewhere, but not in this All-in-one bone tool.

strange thing: when I am animating and press a "key all bones" function, I get all the keys, but excactly 136 frames away. :shock:
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Animark wrote:strange thing: when I am animating and press a "key all bones" function, I get all the keys, but excactly 136 frames away. :shock:
That 136 frames offset maybe could be because you have moved the layer 136 frames on the sequencer. Probably this could be easy to repair it in the script. Anyway, it's just a theory.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
Animark
Posts: 49
Joined: Wed Sep 02, 2009 9:07 am
Location: Berlin, Germany
Contact:

Post by Animark »

Yes, that is the problem. I imported my characters from time to time i needed them and didn't recognised, that they are started at another position in the sequenzer then 1. I never used the sequenzer before. So, I moved my animations to frame one in the sequenzer and the keyframes to their origin position, and now, both tools are working fine.

Selgin, you helped me a lot today. Thanks!
HardikLakhalani
Posts: 19
Joined: Mon Jan 18, 2016 9:32 am

Re: All-in-one bone tool *Updated september 2010*

Post by HardikLakhalani »

It manipulate bone without any special key, But while holding CTRL / ALT / SHIFT, It show this: and nothing happens:

LUA Console Box:
attempt to index global 'LM_RotateBone' (a nil value)
attempt to index global 'LM_TranslateBone' (a nil value)
attempt to index global 'LM_ScaleBone' (a nil value)

I am using Anime Studio Pro 10.0 x64
Post Reply