Bone Point binding from switch layers

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

I think there is also a missing bracket on the 2]

Code:
vec.Set(tab[p][1],tab[p]2])) ---<<< This fills the 2D vector with the proper values
I put the missing [ which fixed the error that was stll coming up but unfortunately the swf output is still not working.

D.K
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Sorry for the typos guys, I wrote that without testing on AS.

Regarding to the swf output, does it work for other output? If so are the keyframes created in the dup layer? try to remove both scripts and play the file again and see if the movements were grabbed.

Vern, is that code modification what you suggested?

DK, good luck :)

-G
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

DK, you should take the scripts out AFTER running it through once to set the key frames.

Genete, I suggested that this should work with SWF output but I never got a chance to even look at the script. I just noticed the typo on line 72.

-vern
User avatar
synthsin75
Posts: 10271
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Mmm, if your using the script to set keyframes, aren't you better off just not using the script? Maybe I'm missing something (like the script not working for SWF :oops: ). I'm not sure how useful it is to have an instance that doesn't update. It seems like duplicating the layer after animating it is the same thing as this script mod.

Please explain the benefits to me. Like I said, I may be missing something. :wink:


Sorry to have misled you on a solution DK. :oops:
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

The supposed workflow should be:

1) Animate the original layer
2) The embedded scripts would create a keyframe on each duplicated layer on every frame.
3) Remove the scripts and the duplciate layers should keep the original movements.
4) Render to swf.

I've not tested

-G
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

synthsin75 wrote:Mmm, if your using the script to set keyframes, aren't you better off just not using the script? Maybe I'm missing something (like the script not working for SWF :oops: ). I'm not sure how useful it is to have an instance that doesn't update. It seems like duplicating the layer after animating it is the same thing as this script mod.

Please explain the benefits to me. Like I said, I may be missing something. :wink:


Sorry to have misled you on a solution DK. :oops:
Basically the script is keying a layer that normally would not move that way. Also that layer could never have keys added because it is moved by bones. So the magic script copies that motion and transfers it to another duplicate layer.

This copied bone motion is not exported to swf. The only way to export it would be to have the script add keys to the duplicated layer's points. Normally there would never be point motion from bone motion. So there is no other way to copy the motion.

-vern
User avatar
synthsin75
Posts: 10271
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Yes, but you've already got keyframes on the original layer, so wouldn't just duplicating that layer......Mmm, but I guess it would key bone motion as point motion.



I just tested this, and it doesn't seem to be creating any keyframes. Removing the script kills the instance.

Even tried to render to SWF, and got lua error for line 68: attempt to call method 'newlocal' (a nil value).

Line 68

Code: Select all

                        local vec = LM.Vector2:newlocal() ---<<< This create a needed 2D vector
Well this error only occurs if rendering with script embedded.



But really, unless this can keyframe bone motion of points in the point motion channel, I don't understand what advantage this mod could have.

:? :?: :wink:
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

That is what it has to do. It has to convert bone motion to point motion keys. If it doesn't do that it won't help with exporting to SWF.

I am certain there is a script that does this. I know it because I remember asking for it. I wanted to create switch layers derived from point motion of bones on vectors. There is another script somewhere that turns bone motion into point motion.

I just have to think hard where it might be or what it might be called. I'll search my computer.

-vern
User avatar
synthsin75
Posts: 10271
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

It doesn't seem to work. :(

I never knew you could use SWF output for quick render tests. That's great!! :shock: I was working on something else, Genete's 3Drig script and auto-sort both work in SWF output! I assume these run on every frame like any other layer script. :?: If so, then there must be some difference in the scripts that cause the trouble.

Fazek used a lot of utility calls I think. Could that be the culprit?
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Well I did a quick test that is revealing. Using the original script I keyed the points on an instance layer and then removed the script. Technically that should have put keys in on the points that would still be there after the script is removed.

The keys are there but the motion wasn't captured. There is something else moving those points.

I think the reason the 3D scripts work is that all of the motion is bone motion. The scripts move the bones, change their locations. I think the scripted point motion is different somehow with SWF.

-vern
User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Yes....same here I embedded the script, ran through the animation, removed the script and then tried to output to SWF but still no difference.

D.K
User avatar
synthsin75
Posts: 10271
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

The original positions of the copy layers are unused
(even their bone transformations)
This is from the meshinstance read me. This means that any keyframes on the copy layer are ignored. I'm really doubting you can get this to work. Maybe a whole new script. :wink:
User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

One other question befor this thread dies....would I be right in assuming that most scripts available on the forum for AS are not created SWF output friendly?

D.K
User avatar
synthsin75
Posts: 10271
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Actually I think most work for SWF. I think SWF works directly from the keyframes, which an instance doesn't provide. But as long as the layer script provides keyframes for what it does, it should be compatible for SWF output.

I think. :wink:
Post Reply