Greken
05-14-2007, 11:40 AM
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?
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?
