View Full Version : robthebloke.org source code
03 March 2005, 12:56 AM
Hello, I downloaded the Graph Attribute from http://www.robthebloke.org/mayaapi.html (http://www.robthebloke.org/mayaapi.html).
I added some error checking to make sure the attributes where being created successfully. The node compiles fine but I get these error messages after creating the node:
// m_aTime successfully added attribute...
// addChild succeeded to add oPosition...
// addChild succeeded to add oFloatinfo...
// addChild succeeded to add oEnumValue...
// addAttribute successfully added m_aGraph...
$node = `createNode "simpleNode"`;
// Result: simpleNode1 //
// Error: Could not find attribute named simpleNode1.graph[-1].graph_FloatValue //
// Error: Could not find attribute named simpleNode1.graph[-1].graph_Position //
// Error: No object matches name: simpleNode1.graph[-1].graph_Interp //
I'm guessing the problem lies in the AETemplate Mel proc supplied with the source code:
/// \brief This file defines the attribute editor for our simpleNode.
/// \param $nodeName - the name of the node instance to display.
global proc AEsimpleNodeTemplate( string $nodeName )
// the following controls will be in a scrollable layout
// add a bunch of common properties
editorTemplate -beginLayout "Simple Node Attributes" -collapse 0;
// add ramp control for our compound attribute
AEaddRampControl "graph" ;
// include/call base class/node attributes
// add any extra attributes that have been added
I really want/need this attribute in my node :bounce: . Would anyone like to compile and give the node a try? You can downloade from the link (TOP) towards the bottom of the page.
03 March 2005, 09:51 PM
yup, it does actually work - it's just that the initial values are not set. Basically to get round the problem you'll have to add two initial entries into the attribute for the start and end of the graph within the nodes post constructor. even though it generates errors, the attribute editor should still display the graph, and you should be able to edit it.....
I assume that Alias assumed there would always be a couple of entries in the attribute hence it looking for index -1....
03 March 2005, 06:28 PM
Thank you for your response.
"Basically to get round the problem you'll have to add two initial entries into the attribute for the start and end of the graph within the nodes post constructor."
Can you specify what you mean by "initial entries"?
03 March 2005, 08:37 AM
normally when you create a node with some form of ramp attribute, the attribute is initialised to have two elements in the array. (each array position just holds info about each curve point : ie, the value, position and tangent type). Normally these attributes are created with a simple curve in place, that is when you enter the attribute editor the graph displays 0 to 1. For it to display a default curve for the parameter, there must be a start point and end point of the curve. ie, you need to add two elements into the ramp attribute in the post constructor so that the curve has a start and end point. hope that helps.... ;)
03 March 2005, 09:47 PM
Thank you Robert.
03 March 2005, 09:47 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.