PDA

View Full Version : Modifying existing AEtemplate issue


Greken
05-14-2007, 12:40 PM
Hello everyone

My goal is to modify the AEtemplate for the mental ray texture node so it can read an image sequence. So far I have added a few extra controls connected to some new attributes that I created, in what I believe is the creation procedure for the node (note: see attachment for full code):


global proc AEmentalrayTextureTemplate ( string $nodeName )
{
// Additional attributes created by Greken
addAttr -ln useSequence -at bool $nodeName;
addAttr -ln imageNumber -at long $nodeName;
setAttr -e -keyable true ($nodeName + ".imageNumber");
addAttr -ln frameOffset -at long $nodeName;
setAttr -e -keyable true ($nodeName + ".frameOffset");

AEswatchDisplay $nodeName;

editorTemplate -beginScrollLayout;

editorTemplate -beginLayout "File Texture Attributes" -collapse 0;

editorTemplate -label "Texture Type" -addControl "miTextureType" ;
editorTemplate -label "Filter" -addControl "miFilter" "updateFilterSize" ;
editorTemplate -label "Filter Size" -addControl "miFilterSize" ;
editorTemplate -label "Writable" -addControl "miWritable" "updateMiWritable" ;
editorTemplate -label "File Size Width" -addControl "miWidth" ;
editorTemplate -label "File Size Height" -addControl "miHeight" ;
editorTemplate -label "File Size Depth" -addControl "miDepth" ;
editorTemplate -label "Local" -addControl "miLocal" ;

editorTemplate -addSeparator;

editorTemplate -callCustom "AEmentalrayTextureNameNew"
"AEmentalrayTextureNameReplace"
"fileTextureName";
editorTemplate -callCustom "AEmentalrayTextureReload"
"AEmentalrayTextureReloadReplace"
"fileTextureName";

editorTemplate -addSeparator;

// Greken makes some additional controls
editorTemplate -label "Use Image Sequence" -addControl "useSequence" "updateSequenceControls";
editorTemplate -label "Image Number" -addControl "imageNumber";
editorTemplate -label "Frame Offset" -addControl "frameOffset";

editorTemplate -endLayout;

// include/call base class/node attributes
AEdependNodeTemplate $nodeName;

// suppressed attributes
editorTemplate -suppress "fileTextureName";
editorTemplate -suppress "miFileSize";

editorTemplate -endScrollLayout;

}

When I try the code (see attachment) it works pretty well with the first mental ray texture node created. However, when the next texture node is created I get an error saying that my custom created attributes doesn't exist. This is a bit confusing since I create and connect them within the same procedure, and it's inside that one that I get the error.
Has anyone encountered this before?

Greken
05-14-2007, 04:29 PM
Since it was only my attributes that didn't seemse to be added, I was forced to make a rather ugly solution by moving them inside the updateMiWritable procedure. The reasons why I chose that were because it had to be launched everytime the user created a new texture node and it had to carry the $nodeName variable.

Very well, it works now yahoo ! :D

CGTalk Moderation
05-14-2007, 04:29 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.