Controled Sub-Bone Layer Bones By Embedded Script?? (HELP!)

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
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Controled Sub-Bone Layer Bones By Embedded Script?? (HELP!)

Post by Rai López »

...HOLA A TODOS! :) Bueno, that is my problem: I always have needed can control certain Sub-Bone Layer bone based in the Position of certain bone situated in the parent Bone Layer... (I don't know if I can explain it in English) Well, actually that is not possible by software (I HOPE SOMEDAY! :D), because you only can control bones situated in the same Bone Layer... and I've been wondered if something like that could be done by the new function "Embedded Script", I mean, a simple named bone situated in a child Bone Layer of the parent Bone Layer that "imitate" the movement of the certain named bone of the parent Bone Layer... (Uf... 8) ) For simplicity, I think that with can control only one bone could be enough, because with this you can then control another bones based in the movement of this only scripted bone... Can be possible something like that by Embedded Scripting? Or it's beyond of the possibilities of this feature? I'd like to know because this would be a very USEFULL & IMPORTANT feature for me (and probably for others) and I'd like to know (at least) if something like that would be very difficult to progam with LUA... *CIAO*

PS1: (jaja)...too much time without asking for nothing, isn't?? :wink:
PS2: THANK YOU (very much) FOR ANY HELP!!! :D
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

...Nobody has any clue?? :D :D :D ...EJEM! I want to say --> :cry: :cry: :cry: (sniff...)
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

What I might do given the time and need:

As I think you said, create a duplicate bone in the target layer. And give the sub layer and duplicate bone a name. Make that the control bone (okay, I know that's your plan, but let's spell it out).

The script is just for this layer and this bone, so you would modify each instance of the script to look for just them. If you want to get more flexible, make a text file with the layer and bone names in it and have the script read which layer and bone you want to work with only at frame 1.

The script can find out which layer it is in pretty simply.

Okay, simpler. Make the bone a specific name, say "Master Control Bone". The script looks through all of the sub bone layers, and looks for one named "Sub Contolled Bone". Assign the settings from the Master to the Sub, done.
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

...THANK YOU LM!!! I mean... 7feet! Jaja :lol: (is the habit :wink: ), you have spend your time giving your help and that is very apreciated :), the problem is that although it seems not too hard to do :D , I've not examples yet :( and that makes the job a little hard (to me) ...I hope that we can have some little examples of embedded scripts soon for take examples and code parts, that is the one way to get results in a scripting works (to me again :roll: ) ...But well, I''ll go on with the idea and will try to do some experiments with the "knowledges" that I have... THANKS!!! :D
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

HI! :) As I'm very interested in this script I think is time to know how can I get it (if I can... :roll:) , I'll see what can I learn about the only too Embedded Scripts available for now... Well, I think that "targeting" embedded script can show me how can I copy movements of one sub-layer (bone in my case), to another sub-layer (bone) inside the SAME group... The other, "hanging", could show me how apply parameters to a bone by embedded script, yes... hmmm... :? but the info that I can obtain is very limited, I think... I'll go on working on this, but as you know... If someone knows something and can give me any HELP, it'd be very VERY apreciated (really) and, of course, I'll be very (VERY) GRATEFUL! :D (you know) ...CIAO! :D

PS: ...THANKS! :D
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

...Uf, I've spend ALL my sunday on this and finally I have... :x NOTHING!!! :x I've been searching and investigating, very well... and when I try to start with something... I can't, I don't know how can I start, no idea... Guys, I dislike that you can see at me in this way b-but... but... :cry:

PS: :cry:
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Gimme a sec, I'm workin' on it. Not the whole thing, but I could give you come direction. If you post what you've tried so far, I might just be able to tweak it, which is better for me.
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

7feeeeeet!!! I almost go to the bed without see this last post!!! Uf... a little hope for your part :) cause for the mine... the worst thing is that finally I have nothing! I've been all day treating to understand and take it apart "hanging_bone" and "target_object" embedded scripts to see what parts could be useful for me, I've been too "studing" the Scripting Documentation (even I've PRINTED whole it! :!: ) but when I treated to do something or start to work I had not idea for where begin, or how to make the next step, a mess... You don't know about the FAVOUR that you will made to me if you can, as you say, give me some direction... It can save my life and I'll be GRATEFUL for ever and ever and ever, for the century of the centurys... Amen! :) Uf... CIAO! and THANKS!!! and GOOD NIGHT 8) (again)
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

I hope you guys figure this one out, and share it when you do...

Here's an example of how this is not only useful, but would solve a certain deficiency of Moho's:

Let's say you have a face which is going to be very animated in itself, doing lots of squashing and stretching. And a big mouth. You put bones in the face, and at first it all bends together nicely. But then, you put the mouth into a switch layer for lipsynching, and now it no longer bends with the rest of the head. It might move as a solid whole while the rest of the head bends, which just looks weird.

The same problem goes for eyes if you've put them in a group or switch.

The only solution I can think of at the moment for this is to have an identical skeleton in each sublayer, programmed to match exactly every movement of the parent skeleton. Unless there's another answer I haven't thought of.

I seem to recall that recently someone posted a script for copying keyframes from one layer to another. Maybe this would be part of the solution? I think the effect needs to be 'live', though, to be effective...
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Worked out mostly. It ended up using a similar technique to the hanging bone script. Still working on optimizing it. I'd rather leave it up to Ramón to post them, as he (holy s***, that was cool) gave me some dinero to work out the scheme, but I'm sure he'll share.

One bone anywhere in the project controls one bone anywhere else in the project. Each bone layer has it's own embedded script. I need to work on the mod to work in switch layers, but that shouldn't be hard as they are technically specialized bone layers. Unless you need to mimic entire bone chains (still possible, but I figure it's going to get slow), not so hard.

My initial solution was just that, essentially copying keyframes and interpolating the moves onto the controlled bone. And you're right, live is much better. The keyframes will update in a fairly "live" kinda fashion, but it's way too much overhead. The only problem I've found is that I've had difficulty transfering dynamics settings, and haven't found a way to set the bone constraints, which would help. I think I can figure it out. Perhaps a mod of the Clone Bone script that would also copy the constraints and any control/limiting bones along with the bone you want to mimic.

With permission, I'll be happy to post things as they go. As I said, it does work now, but I got some ideas. Really, if there was access to everything that Moho does from the script interface, I can think of some truly insane stuff you can do. There are a few holes in the interface, though, but not so terrible.
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

how hard would it be to adapt this script to work for a chain of bones?

I like the sound of truly insane stuff.
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

HELLO! :) ...A good moment to continue with the "discussion" here! Well, I hope that you can do all that marvelous things that you have in mind 7feet, but anyway the scripts are now working as never before and, as you can see here --> :D , I'm very happy with all the work! So I take advantage of this post to say you THANK YOU (again) for all that dedication and for have started with this an effecient and real time method to avoid, for me (and probably BA) at least, one of the most important limitations of the program. Plus, I'm very HAPPY too that other users be interested in all this issue cause this is always a very good thing for the good evolution of the tool, so (and OF COURSE) you are totally free to share this GREAT scripts for the well being of the comunity too :)
...Only one thing more that maybe you want checked before sharing is that I've observed, in the last version of the scripts, that now the master bone only can work over one sub-bone layer at a time (just the last sub-bone layer that you apply the control script), this seems weird cause never happend before... plus, something strange can occurs too after Undo (i.e. moving bones or deleting some keyframes and undo then) but seems that all works fine again when you go to frame 0 and then go to any other frame so seems be not a real problem... Otherwise all have been INCREDIBLY improved and "fasterized" now and seems incredible can take this kind of control into the program at last :D , definitely yes... this can be one small step for the program, but one giant leap for Moho animators :) ...CIAO!
Post Reply