Rotate a 3D object on Z Axis with no re-scaling

Discussion of Automation, Image Workflow and Raw Image Workflow

Moderators: Tom, Kukurykus

Limey

Rotate a 3D object on Z Axis with no re-scaling

Post by Limey »

Mike, as always you are freekin' awesome! Works like a charm and renders automatically. It rotates the cylinder perfectly without altering anything else.

I'm diving in and breaking the process down. I am convicted to learn this one way or another. I have to learn the "Lingo" first. I spoke to our web programmers here at work that program in all kinds of languages as well as Java Script but they said that it was hard to understand the Photoshop JS.
Do you think if I was to invest in a Java Script course at a junior college or online it would help me understand creating the functions and understand enough of the terminology, like what a descriptor, key, class and object are and do. I think understanding the principles and syntax are going to be key my understanding how to script PS.

Again, thanks for the help and inspiration,

Limey
Mike Hale

Rotate a 3D object on Z Axis with no re-scaling

Post by Mike Hale »

For basic javascript I would suggest you have a look at 'JavaScript Essential Training' and 'Foundations of Programming: Fundamentals' by Simon Allardice on lynda.com. What I like about those two courses is he covers the JavaScript language without going to much into the web browser Document Object Model. Most other videos and books seems to spend most of the time covering the web DOM and that is only helpful if you also want to script web pages.

But I don't think you will find anything that covers the Action Manager API used by Photoshop. If you look at the scriptlistener logs you will see that there are two, one of JS and one for VBS. You will notice that both use the same Action Descriptor, Reference, and List structure with the same keys for the classes, events, etc. The only real difference is the language 'glue' that hold it together.

Even Adobe doesn't have any documentation for using Action Manager this way with JavaScript. They do cover it in the Photoshop SDK but that is in C. And they do cover how to use the scriptlistener plug-in.

But I am not trying to discourage you from learning Action Manager. I think that once you get past the strangeness of the way it looks with it's nested descriptor, keyIDs, etc you will find that is really not that hard to work with. In this example I spent much more time creating the example post than I did coming up with the final function.

So I would say spend the time you would have spent going to a JS class playing around with Action Manager. An example would be to expand the function to accept X and Y angles in addition to Z with each being optional( if undefined used existing values ). Or to change the X,Y,Z position. Or to change the X,Y,Z scale. Any of those setting are in the two descriptor that are extracted from the layer.

When you need help or advice make a post here. Between Xbytor, Paul, and myself - one of us should be able to help or tell you that it looks like it can't be done. Because there are still a lot of things that can't be scripted even with Action Managers help.
Limey

Rotate a 3D object on Z Axis with no re-scaling

Post by Limey »

Many thanks Mike, That gives me a starting place on which to build.
I will be playing around with it which is usually the best way to learn things. I'll check out Lynda.com too.

Paul