Embedded Scripts

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

Moderators: Víctor Paredes, Belgarath, slowtiger

janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

we all are scripters anyway ! (I mean if we had time in the past to spend learning scripting)
User avatar
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

I'd want to be a scripter too... :(
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

i'll be very happy to help!

tell me if i can
User avatar
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

...Jaja, THANK YOU VERY MUCH janimatic but I'm sure that you'd be as good teacher as I a bad pupil... Definitely I've not born to make programing of scripting works :(
User avatar
MarkBorok
Posts: 184
Joined: Sat Aug 14, 2004 8:45 pm
Location: Providence, RI
Contact:

Post by MarkBorok »

So would it be possible to make a script that causes a layer to become attached to a bone/another layer dynamically (as with a person picking up an object and giving it to another person, where the object becomes attached first to one hand then another). Right now there's no way to link two objects together in any kind of easy way. There doesn't seem to be a way to change parameters for these scripts on the fly (i.e. attach object A to object B at frame X, then attach it to object C at frame Y). Then again I know nothing about Lua scripting at all and don't have time to learn it.
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

MarkBorok wrote:So would it be possible to make a script that causes a layer to become attached to a bone/another layer dynamically...
Yes, this should be possible. Take a look at the "Bind Layer" tool. This will show you how to bind a layer to a bone by script. Then, your embedded script just needs to change the binding at different frames depending on your specific need.
User avatar
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

:!: :!: :!: ...THE EMBEDDED SCRIPT FUNCTION CAN DO SOMETHINGS LIKE THAT??? WOW! :shock: Really it is a POWERFULL feature! :| :) :D :mrgreen: ...Pity that we can not enjoy of all that possibilities yet :mrgreen: :D :) :| :( :cry:
janimatic
Posts: 136
Joined: Sat Mar 26, 2005 12:22 am
Contact:

Post by janimatic »

hey!

i am very sorry LM,
i asked for this feature so strong, and you did it so quickly, but know i don't have time to use it...
But i'll be back soon!

sincerly yours
User avatar
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

janimatic wrote:But i'll be back soon!
...AND I'LL BE WAITING!!! :D :D :D GOOD LUCK WITH YOUR TIME! :wink: *CIAO*
User avatar
MarkBorok
Posts: 184
Joined: Sat Aug 14, 2004 8:45 pm
Location: Providence, RI
Contact:

Post by MarkBorok »

Lost Marble wrote:
MarkBorok wrote:So would it be possible to make a script that causes a layer to become attached to a bone/another layer dynamically...
Yes, this should be possible. Take a look at the "Bind Layer" tool. This will show you how to bind a layer to a bone by script. Then, your embedded script just needs to change the binding at different frames depending on your specific need.
But is it possible to bind a layer to a bone in a bone layer that is not its parent? I mean if you have two characters with bone rigs and one throws a ball to another (the ball being on its own layer), is it possible to bind the ball layer to a bone in rig 1 and then bind it to another bone in rig 2?
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

No, that wouldn't be possible, but it's just a simple matter of two balls - one attached to one character, and one attached to the other. Then, just animate the visibility of the two so that you only see one at a time.
User avatar
MarkBorok
Posts: 184
Joined: Sat Aug 14, 2004 8:45 pm
Location: Providence, RI
Contact:

Post by MarkBorok »

Lost Marble wrote:No, that wouldn't be possible, but it's just a simple matter of two balls - one attached to one character, and one attached to the other. Then, just animate the visibility of the two so that you only see one at a time.
Yes, that's what I thought (how I've been doing it so far). It can result in a bit of clutter, though, if you have a lot of objects being manipulated. In my case I only had one, so it was no big deal.

(Incidentally, I presume that turning off an object's visibility saves quite a bit on rendering time? I've been doing it whenever the camera pulls in on a scene in such a way that certain objects end up outside the frame or hidden by other objects in the foreground. Does Moho discard invisible objects, or do they still take up some time in the rendering process?)

Still, the idea of dynamically binding a layer to different bones at different times is a useful one, as with a character passing an object from hand to hand or putting it on top of his head.
User avatar
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

MarkBorok wrote:Still, the idea of dynamically binding a layer to different bones at different times is a useful one, as with a character passing an object from hand to hand or putting it on top of his head.
I'd like to see something like this into Moho too. The other visibility way works, yes... But seems like a way to "get by", not a "professional" solution, and the posibility of binding a layer to different bones at different times it'd be a more simple, compreensive, versatile and QUICK solution for animators life... :)
Postality
Posts: 248
Joined: Sat Aug 07, 2004 3:21 am
Location: Toronto, Ontario
Contact:

Post by Postality »

I like the hanging script.

Thanx LM.
Anime Studio - Ultimate Game Graphics
User avatar
maxic
Posts: 64
Joined: Wed Sep 22, 2004 8:24 am
Location: Moscow, Russian Federation
Contact:

Post by maxic »

The excellent idea, very useful function. However it would be desirable to see not a direct way to a file, and relative.

The direct way leads to mistakes at moving the project or scripts:

Code: Select all

layer_script "D:/ANIMO/test_script/layer_script.lua"
Better relative:

Code: Select all

layer_script "../layer_script.lua"
Too most it would be desirable to see and for images. For example such way Necessarily will cause a mistake at loading a file:

Code: Select all

image "C:/Documents and Settings/Seliverstov.LANDOMAIN/Рабочий стол/image/3485725koh.jpg"
If I compulsorily edit a file by means of "notebook", the mistake disappears.

Better so

Code: Select all

image "../../../image/3485725koh.jpg"
Post Reply