3D switch bug

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
nab
Posts: 203
Joined: November 29th, 2005, 3:00 am
Location: Royan
Contact:

Hey guys,

I'm not sure whether it is a bug or if I misunderstand something, but I observed the same behavior on both CS3 and CS4 (Mac & Win).

Setting the 3D flag to true, when the layer is already 3D, resets the Z position to 0. It seems that internally the 3D switch is first disabled, and then it is (re)enabled. This could explain why the former Z value is lost.

To test the snippet below, create a new solid, enable its 3D switch, and change the Z position.

Code: Select all

var comp = app.project.activeItem;
var layer = app.project.activeItem.layer(1); // assume 3D layer
var prevZ = layer.position.value[2];
layer.threeDLayer = true;
var curZ = layer.position.value[2];
alert("Previous Z: " + prevZ + "\r Current Z: " + curZ);
Of course this can be avoided by replacing layer.threeDLayer = true; with if (!layer.threeDLayer) layer.threeDLayer = true;.
Yenaphe
Posts: 84
Joined: February 3rd, 2009, 6:30 pm
Location: Paris - France
Contact:

Nice find !
davestewart
Posts: 114
Joined: March 10th, 2005, 5:50 am
Location: London, UK
Contact:

Not sure if you can file a bug report or not. Maybe check the adobe site or the scripting reference.
Post Reply