07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

3D: Controlling appearance<br />

You cannot create a new modelResource of the type #fromFile from within <strong>Director</strong>. However, you can duplicate the<br />

modelResource of an existing model, using the node.cloneDeep() function. If you require, you can then modify the<br />

structure of the cloned modelResource by adding the #meshDeform modifier to the cloned model. For more details,<br />

see “Manipulating a mesh resource” on page 182.<br />

While creating a new modelResource, provide a unique name for the modelResource. A unique name means that no<br />

other modelResource with the given name already exists.<br />

Note: If you try to create a new modelResource with the same name as an existing modelResource, a script error occurs:<br />

“Object with duplicate name already exists”.<br />

See “3D namespace” on page 85 for more details. A model can, however, have the same name as a modelResource.<br />

Deleting model resources<br />

To delete a model, use the member3D.deleteModel() function. You can identify the model either by its name or its<br />

index number. When you delete a model, the index number of other models may change. If you attempt to delete a<br />

non-existent model, no error occurs.<br />

-- Lingo<br />

put member("3D").deleteModelResource("NoLongerRequired")<br />

-- 1<br />

put member("3D").deleteModelResource("NoLongerRequired")<br />

-- 0<br />

put member("3D").deleteModelResource(2)<br />

-- 1<br />

// JavaScript<br />

trace(member("3D").deleteModelResource("NoLongerRequired"));<br />

// 1<br />

member("3D").deleteModelResource("NoLongerRequired");<br />

0<br />

member("3D").deleteModelResource(2);<br />

1<br />

Primitives<br />

<strong>Director</strong> provides seven types of Primitive resources that can be generated on the fly at runtime in <strong>Director</strong>.<br />

#sphere: Sphere properties<br />

#plane: Plane properties<br />

#cylinder: Cylinder properties<br />

#box: Box properties<br />

#extruder: “Creating an extruder resource” on page 166<br />

#mesh: “Creating a mesh resource” on page 170<br />

#particle: “Particles” on page 197<br />

Extruder, mesh, and particle resources are more complex than #sphere, #plane, #cylinder, and #box resources. This<br />

section explains the first four geometrical types.<br />

Creating a regular primitive resource<br />

To create a new modelResource of the type #sphere, #plane, #cylinder or #box, use the<br />

member3D.newModelResource() function.<br />

Last updated 8/26/2011<br />

165

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!