Move Points on Z-axis?

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
TheChewanater
Posts: 134
Joined: Fri Feb 27, 2009 1:25 am

Move Points on Z-axis?

Post by TheChewanater »

Is it possible to write a script that allows you to move individual points on the z-axis, instead of an entire layer? I'm using AS Standard 5.6, but I'm considering getting Pro.
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

No, any movement on the z-axis would be 'outside' of the layer's 2D plane. While layers can move on the z-axis in the 3D space, they are only 2D planes.
User avatar
TheChewanater
Posts: 134
Joined: Fri Feb 27, 2009 1:25 am

Post by TheChewanater »

No, any movement on the z-axis would be 'outside' of the layer's 2D plane. While layers can move on the z-axis in the 3D space, they are only 2D planes.
Well, could a script make it look like they're moving on the z axis, so when the layer is moved, certain points move faster?
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

The only thing that comes close to this is a set of scripts that Genete created (you can find this in the script forum).

It's more complicated than "a few points" and involves each point bound to a bone and the script "turns" and moves the bones in "3D".

It would help to know what you need to achieve. There may be easier ways to get the effect you want that doesn't require z axis movement of points.

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

Post by synthsin75 »

So like a virtual z-axis offset? It would be very hard to have a variable offset, but it might be possible to translate a named point group some multiple of the layer's translation. It would have to be a layer script though, so you'd need Pro.

If you could explain (possibly with an AS file and/or pictures) where this might be needed. I can't think of any real need for it, but if you could make the case well enough, I'd look into writing it.

I'd bet that there are other solutions though.

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

Post by heyvern »

synthsin75 wrote:It would have to be a layer script though, so you'd need Pro.
Layer scripts work in standard. I too thought this was a pro feature. The only scripting that is Pro only are menu scripts.

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

Post by synthsin75 »

Well slap me twice and hand me to my mother! :shock:
User avatar
TheChewanater
Posts: 134
Joined: Fri Feb 27, 2009 1:25 am

Post by TheChewanater »

If you could explain (possibly with an AS file and/or pictures) where this might be needed. I can't think of any real need for it, but if you could make the case well enough, I'd look into writing it.
For example, I could make the front of someone's nose, and other facial details, closer to the camera than the rest of it, then when they move, it would create a 3d-looking illusion without having to move every point (in a more complicated face). Also, it would still be full animate-able, unlike if you just imported a 3d model.

http://www.freeimagehosting.net/uploads/ab0a9f9e76.jpgImage
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Scripting is way to much work (even just to use one) for this task. The simplest thing to do would be to assign these key points as a named point group. Then you can select them in the drop down and translate them over. If you use single splines connecting these to the rest of the face, like your example seems to indicate, it should give you the effect.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Actually that very technique of "sliding" a nose to create depth has and can be done using layers. Put the nose on a layer above the face. You could then move the nose layer in the z axis and by turning the layers or panning the camera create a shifting of the nose.

There is an animation on that old samples page from lost marble that I recall from a long time ago that uses this technique. I remember the person who created the animation explaining how it was done and that it was a very quick and easy way to create a sort of 3D turning face.

The face was created using several layers spaced apart on the z axis. I believe all the layers were then put in a group layer. When the group was rotated it made the face appear to turn. It's hard to remember exactly how it was done because it was from a long time ago.

The animation is the first one on this page with the blue "cat" character:

http://www.lostmarble.com/moho/gallery/psa.shtml

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

Post by synthsin75 »

You could then move the nose layer in the z axis and by turning the layers or panning the camera create a shifting of the nose.
:lol: No layer rotation or camera panning in AS Standard. Boy we're just taking turns forgetting what is and is not in Standard.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Here is the link to the awesome animation from Barry Baker.
viewtopic.php?t=855
Very educational and inspiring.
-G
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

synthsin75 wrote: :lol: No layer rotation or camera panning in AS Standard. Boy we're just taking turns forgetting what is and is not in Standard.
Okay... uh... vector layers are in standard right? ;)

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

Post by synthsin75 »

:lol: Yeah, vector layers are still in there, but I have no idea how people manage without Pro.
User avatar
TheChewanater
Posts: 134
Joined: Fri Feb 27, 2009 1:25 am

Post by TheChewanater »

synthsin75 wrote::lol: Yeah, vector layers are still in there, but I have no idea how people manage without Pro.
I manage by using the included examples with Pro-only stuff and editing them, which is still rather limited.
ImageImage
Post Reply