PDA

View Full Version : How do i create imagePlane within mel?


montujj
05-03-2006, 12:02 AM
May be this is simple and easy question but i struggled to look through mel command reference and i couldn't figure out... I need help.

I am writing a procedure which can create camera with ImagePlane on by default instead of hitting create Button under Environment in Attribute Editor.

1. How do i create imagePlane within melscript?
2. How do i attach that imageplane to a particular camera?

when i hit this button in my UI, I want to create camera which will have imageplane by default.

Any help would be greatly appreciated...
Thanks.........

A_New_Hope
05-03-2006, 08:11 AM
you can do like this to create and assign a imagePlane to a camera.


// from the AEcameraImagePlaneCommand in the AEcameraImagePlaneNew.mel script

// create a new camera
string $cameraName[] = `camera`;

// create a new image plane
string $imagePlaneName = `createNode imagePlane`;

// assign the imageplane to the camera
cameraImagePlaneUpdate $cameraName[0] $imagePlaneName;



check out the AEcameraImagePlaneNew.mel script to see what maya does when you hit the create button under Environment in the Attribute Editor.

montujj
05-03-2006, 04:56 PM
thanks a lot...
that did helped. i have another question i forgot to mention in my earlier post.

how do i set image sequence for this imagePlane by melscript ?

Thanks again...
Montu

A_New_Hope
05-03-2006, 06:21 PM
here we go :)


// the name of the imagePlane
string $imagePlaneName = "imagePlane1";

// the path to the image File sequence
string $myImageFileSequence = "images\\test.001.iff";

// assign images to the imagePlane
setAttr ( $imagePlaneName + ".imageName" ) -type "string" $myImageFileSequence;

// makes the imagesPlane use a image sequence
setAttr ( $imagePlaneName + ".useFrameExtension" ) 1;

CGTalk Moderation
05-03-2006, 06:21 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.