Request: A "face to camera" option in all directions.

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Lychee
Posts: 136
Joined: Mon Dec 24, 2012 12:59 pm

Request: A "face to camera" option in all directions.

Post by Lychee »

Hi.

I do not understand why AS9 has no option to help the objects to face the camera both on the X and Y axis but only limited to one axis.
I have difficulties to realize my ideas just because of this forgotten, and i think we can do great things with it.

Is there a script that can add this option in the program menu, or otherwise, is there a kind soul able to create it?

Here an exemple of why i need this option in my researchs, it is an experimentation to simulate 3D forms with 2D shapes.

Image

Here i used follow path to attach objects named inersection to the others parts of my robotic arm.
By this way, the intersections can follow the others part of the arm in a 3d depth but will always face to the camera in any directions.
The problem? It is a complicated construction without this forgotten option and when i want to bind some bones to my arm, i have some bugs, some parts of the arm goes everywhere.
The follow path is visibly not made for that kind of use.
Test it, use rotate layer tool on the arm and forearm folders, have fun with it and tell me if you have an idea to put bones on it without bugs.

https://www.dropbox.com/s/tz6iad0368djk ... R%26D.anme#

Best regards.
User avatar
Maestral
Posts: 531
Joined: Tue Jan 27, 2009 5:44 pm
Location: Belgrade, Serbia

Re: Request: A "face to camera" option in all directions.

Post by Maestral »

Extrude and Animated layer order perhaps?
Lychee
Posts: 136
Joined: Mon Dec 24, 2012 12:59 pm

Re: Request: A "face to camera" option in all directions.

Post by Lychee »

thanks for the reply Maestral, but i think you dont understand what is my problem.
I know extrusion can easely create a 3d form, and i dont need to play with animated layer order, because in my exemple the forms switch automaticaly with sort layers by depth and true distance option.
Perhaps my exemple is not good to illustrate my request, then, here another one more explicit.

Image

I put in a folder all the forms of my teddy bear, they are placed in differants 3d depth and they face the camera on the Y axis with the appropriate option. As you can see, my teddy headturn work well in the Y axis, but when i try a X rotation of the folder, that's not work.
The rotate to face camera option on X and Y at the same time is really missing.

Image
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Request: A "face to camera" option in all directions.

Post by dkwroot »

They already have this functionality, it's called "FREE PIVOT".

This is taken directly from the manual:
Free Pivot: Rotates the layer on both its X
(horizontal) and Y (vertical) axis as best it can to
make the layer’s Z axis point at the camera.
Lychee
Posts: 136
Joined: Mon Dec 24, 2012 12:59 pm

Re: Request: A "face to camera" option in all directions.

Post by Lychee »

Thanks dkwroot, but you can be sure that i have tried all options in the menu, and free pivot did not work as it must.
Like the example above, the forms will always do an unwanted rotation at a moment.
So, either i have not understood the functioning of free pivot, either this option is not working as it should.
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Request: A "face to camera" option in all directions.

Post by dkwroot »

I think if you fiddle with "Face Image Plane Free Rotate", you'll get what you want. The problem with Free Pivot is that when the camera goes behind the object it's orbiting, the program compares their z axis locations and then flips the direction that the object is rotating. This is what's causing the weird flip to occur. You can fix this problem by using face image plane free rotate which ensures that the same face of the object continues to point at the camera regardless of the camera position. I did a few tests with this and it's working for me, so give it a whirl and fiddle with it.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Re: Request: A "face to camera" option in all directions.

Post by heyvern »

dkwroot wrote:I did a few tests with this and it's working for me, so give it a whirl and fiddle with it.
In my testing the layer faces the camera correctly as long as the X rotation is between -90 and 90. Go past those two rotations and the layer stops facing the camera and starts to rotate. Y axis rotation, layer faces camera at ANY rotation. In my opinion this is not correct. The layer should face the camera at ANY rotation of X and Y.

However it would work as long as the layer X rotation is between -90 and 90 degrees.
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Request: A "face to camera" option in all directions.

Post by dkwroot »

Okay, I see what he's doing now. I thought he was having trouble rotating the camera around the object, not rotating the parent folder while having child layers rotating to face the camera (I wasn't even aware that this feature existed). Anyway, my guess is that the developers figured that we'd create switch layers to deal with this problem. You should add this to feature request.
Post Reply