Copy / Paste bones | Update : RC2

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Tha Narie
Posts: 16
Joined: Sat May 13, 2006 2:13 pm
Location: The Netherlands
Contact:

Post by Tha Narie »

Can you tell me what your screen resolution is? :)
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

I have 1024x768
Tha Narie
Posts: 16
Joined: Sat May 13, 2006 2:13 pm
Location: The Netherlands
Contact:

Post by Tha Narie »

I will make it wider instead of higher then :)
A big disadvantage of working with a screen resolution of 1920x1200 :P
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

Tha Narie wrote: 1920x1200 :P
:!: --> :x :x :x
Tha Narie
Posts: 16
Joined: Sat May 13, 2006 2:13 pm
Location: The Netherlands
Contact:

Post by Tha Narie »

Ramón López wrote:
Tha Narie wrote: 1920x1200 :P
:!: --> :x :x :x
Alienware notebook
LCD Panel
* 17” WideUXGA 1900x1200 LCD Display
* 17” WideXGA 1400x900 LCD Display
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

Okay, I've finally tried it out. Tha Narie - you have just increased the value of Moho by a significant degree. Thank you! This is such an important feature, it's hard to believe it wasn't possible until now.

3 things I noticed:

1 - I screwed up my first try, deleted the layer and tried again... the bones never seemed to past properly again, until I hit ctrl-f5 to clear the Moho cache...

2 - it doesn't seem to copy the degrees of control when it comes to control bone relationships

3 - not a bug, but a curiosity: I noticed in the copybones window a checkbox for fAngleControlScale... is there a way to for bone angle to control bone scale that I've never known about? Please enlighten me...
Create cartoon characters and comics in minutes: www.bitstrips.com
Tha Narie
Posts: 16
Joined: Sat May 13, 2006 2:13 pm
Location: The Netherlands
Contact:

Post by Tha Narie »

Thanks BA :)

I'm dealing with a little 'RSI' at the moment, so I wasn't able to work on this (or any other) script(s) lately.

Let me answer your questions:

1) When I copy the bones, I don't store the values, only the reference to that bone, and when pasting I read the values from the reference that still exists on the other layer. It saves me some typing, but maybe it's a better idea to store the values when I copy the bones. And I will take a look at the 'cache issue' :)

2) Hmmz, will take a look :)

3) There are 6 properties (3 pairs) in the 'bone constraints' dropdownpanel in Moho for the 'parenting':

fAngleControlParent (int)
fAngleControlScale (float)

fPosControlParent (int)
fPosControlScale (LM_Vector2)

fScaleControlParent (int)
fScaleControlScale (float)

The first one is the 'parent bone id', and the second one is the value. I don't know why it is 'postfixed' with Scale :)
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

About the crash problems, you should look into the tools/lm_select_bone.lua file to see how LM handles these variables. For example, if you set fBoneDynamics, you should do it this way:

Code: Select all

					nb.fBoneDynamics.value = ob.fBoneDynamics.value
					nb.fBoneDynamics:StoreValue()
					layer:UpdateCurFrame(true)
					MOHO.NewKeyframe(CHANNEL_BONE_DYNAMICS)
					MOHO.NewKeyframe(CHANNEL_BONE_SEL_DYNAMICS)
LUA variables are actually POINTERS to their contents in the heap area, so with the old code, I think you redirected the nb.fBoneDynamics POINTER into the ob.fBoneDynamics (or a new copy of it), and MOHO can't tolerate this. It needs to keep the original structure. You should do similar things with the other variables.
- - - Fazek
Tha Narie
Posts: 16
Joined: Sat May 13, 2006 2:13 pm
Location: The Netherlands
Contact:

Post by Tha Narie »

Thanks a lot, I will give it a try!
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

Hey,

I'm now getting lots of use out of this handy script. It's invaluable. But I'm running into a serious problem:

The rig I'm working on is quite complex, with hundreds of bones. Now when I go in to copy a small selection of bones, I have to do it by name, and the list is so long it goes off the bottom of the screen and i can't even see the controls at the bottom. there doesn't seem to be any way to rescale the dialog window, rendering the whole thing unusable in this situation.

very frustrating, since a complex rig like this is exactly where i need to copy lots of bones!

any chance this could be fixed any time soon?
Create cartoon characters and comics in minutes: www.bitstrips.com
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

Tha Narie wrote:Only 1 controll-script needed, no copy>replace anymore, and some loops and stuff removed.
ONLY ONE?? ...Oh, P-L-E-A-S-E!!! That is something that I have dreamed so much times... What more things could you tell us about all this issue? Some/any news? :) Well, anyway THANKS FOR ALL (to both) & CIAO!

PS: I'll continue enjoying and learning so much with all that work... THANK YOU (again)! :D
wizaerd
Posts: 415
Joined: Fri Aug 25, 2006 7:08 pm
Location: Gilbert, AZ

Post by wizaerd »

I'm intrigued by this, and everybody's enthusiatic response makes it seem as if this is certainly a must have tool, but since I'm just now coming to grips with bones it's way way way over my head...

Could somebody post some examples of 1) How to use this script, and 2) Why would you use this script. What are the advantages, etc...

Preferably in a visual format (I understand video and pictures way better than long verbose paragraphs of written text...) :oops:
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

Here's one example of how useful this is.

I was in the process of building a body rig, and within the same bone layer as the rest of the body, built an intricate hand.

then, once the hand was complete, I realized that it would work better if that hand was in a separate switch layer. also the fact that I needed another hand (of course), and didn't want to go through the trouble of recreating the exact same hand, which took a long time.

so, with this script, I was able to copy the hand bones from the body rig, and paste them into their own new layer. Without the script I would have been stuck re-creating the same rig in another layer, which would be really tricky.

so right there, this script has already saved dozens of hours of work.
Create cartoon characters and comics in minutes: www.bitstrips.com
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

I hadn't seen this thread and I tried the menu script copypastebones and it worked like a charm. What a time saver! Thanks, Tha Narie.
wizaerd
Posts: 415
Joined: Fri Aug 25, 2006 7:08 pm
Location: Gilbert, AZ

Post by wizaerd »

I interested in learning more about the copy/paste bones and the master control bone layer scripts, working in conjunction. I've done more reading (and searching in the forums) about both of these.

Initially, the master control bone layer was daunting, but as I read more and more, I found that it's most likely a very desirable thing. The thing that was daunting initially was all the different instances of the master/control scripts, which TheNarie says she's modififed so it only requires 1 now.

So my questions are:

1) How do I now use (and get) the master/control scripts, which only require one embedded instance (unless I read that incorrectly)

2) How do I use it in conjuction with the copy/paste script?

Thanx
Post Reply