PDA

View Full Version : Message attribute and Maya API !


chuong
10-13-2005, 10:38 AM
Hi,

I have to questions and hope you'll help me ;)

First: What is the message attribute of a node ? I read some tutorials and there are somethings like connecting lightshape1.message to ...., somethings that i miss :sad:

Second: How do i create...a sphere using C++, not mel, and query, change its attributes like radius. If you have source code, please show me.

Thank for your help.

Robert Bateman
10-13-2005, 11:07 AM
First: What is the message attribute of a node ? I read some tutorials and there are somethings like connecting lightshape1.message to ...., somethings that i miss :sad:


It's just an attribute that defines a connection to another node - no message is actually sent (or data of any form). Basically you can use MFnMessageAttribute to create your own, but they are only useful for defining a relationship between 2 nodes - they don't actually do anything....


Second: How do i create...a sphere using C++, not mel, and query, change its attributes like radius. If you have source code, please show me.

yeah, use mel !!!

MGlobal::executeCommand("polySphere");

Create the sphere, look in the hypergraph. There will be a few nodes conneted together, eg a polySphere node connected to a mesh node, which in turn is connected to a surface shader - and everything is parented under a transform for the shape.

To create that under the API you'd need to manually create each node in the setup, and then connect each attribute. Getting / setting any attribute in the API can be done via the MPlug returned from MFnDependencyNode::findPlug().

chuong
10-14-2005, 07:43 AM
Thank you, your site is greate ! :thumbsup:

CGTalk Moderation
10-14-2005, 07:43 AM
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.