PDA

View Full Version : maya api: uv to world and mr issues


tciny
04-25-2005, 10:37 AM
Hi,

currently writing a plugin, I came to the point where I have to convert UV to world (XYZ) Coordinates. Is there any funciton Maya provides to do so, or do I have to write my own solution?

My second question is:
What changes do I have to make to a 2d texture Node in order to make it work with MentalRay?
Greets,

Jan

playmesumch00ns
04-25-2005, 11:15 AM
I wrote a plugin to do this... hang on while I dig it out...


Ok found it. MItMeshPolygon provides a pointAtUv function, but you have to give it a face first.

Looks like I just went through and brute-forced it. It might be better if you're doing lots of these queries to write a node that you could hook your mesh shape up to. Then you'd put your mesh's uv space in a grid structure for fast searching. You could then just query the node for fast lookups.

tciny
04-25-2005, 11:30 AM
Great! Thanks.

Although I already had a look at MItMeshPolygon... damn, I'm getting blind... :)

tciny
04-25-2005, 06:09 PM
Mind if I ask just one more thing? :)

How to I get the MObject of a node? Meaning: In the Nodes compute function, how do I get an MObject for it? Is there some simple way to do this?

tweeeker
04-25-2005, 07:09 PM
How to I get the MObject of a node? Meaning: In the Nodes compute function, how do I get an MObject for it? Is there some simple way to do this?

try:

MObject myMO = thisMObject();

thisMObject() is a member of MPxNode, just like compute().

T

tciny
04-26-2005, 02:26 PM
I tried the following to pinpoint the problem I'm having, but it seems to me that the fuction just isnt working...

MObject thisNode = thisMObject();
MDGModifier dgmod;
dgmod.renameNode(thisNode, MString("blah"));

The node isnt renamed tho... any ideas?

tweeeker
04-26-2005, 08:28 PM
You have to call the doIt() method of MDGModifier to actually make the changes.

MObject thisNode = thisMObject();
MDGModifier dgmod;
dgmod.renameNode(thisNode, MString("blah"));
dgmod.doIt();

T

CGTalk Moderation
04-26-2005, 08:28 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.