RTTGroup forum

www.rendertotexture.com

You are not logged in.

#1 2008-05-22 16:40:15

Perry
New member
Registered: 2008-05-22
Posts: 3

RTTGroup and MaxScript

Hi,
I am tring to make a script that use RenderToTexture.
I muddy when i try to add a rendere elemento to an RttGrop i created:

Example:

-- Create an RTTGroup
RttObj = RTTGroup()
-- Add texture element Complete map
RttObj.AddBakeElement (RttObj.CreateBakeElement "CompleteMap")

The last istruction return true but the textture element list is empty...

Any tips?

Perry

Offline

 

#2 2008-05-22 23:17:57

Andrzej Chomiak
Administrator
From: Poland
Registered: 2007-10-12
Posts: 73
Website

Re: RTTGroup and MaxScript

Hi,

It is necessary to use this form:
RttObj.IRTTGroup.AddBakeElement (RttObj.IRTTGroup.CreateBakeElement "CompleteMap")

The node's interface INodeBakeProperties already have a method with the same name (AddBakeElement).

Some time ago I wrote a small example script that show how to use RTTGroup API, will may be useful for you.
This script (RTTExample.ms) outputs to MAXScript Listener window the mesh material IDs channel - primary and assigned by RTTGroup, and the bitmap filenames for bake elements.

http://www.rendertotexture.com/files/sc … xample.rar

Andrzej

Offline

 

#3 2008-05-23 11:44:30

Perry
New member
Registered: 2008-05-22
Posts: 3

Re: RTTGroup and MaxScript

Thank you very much for the answer!!

But i have another strange problem :p

now i do this:
-----
RttObj = RTTGroup()
cm=RttObj.IRTTGroup.CreateBakeElement "CompleteMap";
cm.enabled=true;
cm.targetMapSlotName = "diffuseMap"
RttObj.IRTTGroup.AddBakeElement cm
------

now add the bake element, if i go in tool and start the render it do it...
but it don't assing the diffuse map...
The really strange think is: If i press texture Elements and close the dialog, in the next render it assign the diffuse map...

strange. Any ideas for this?

Thank you again
Perry

Offline

 

#4 2008-05-23 14:00:37

Andrzej Chomiak
Administrator
From: Poland
Registered: 2007-10-12
Posts: 73
Website

Re: RTTGroup and MaxScript

To set the "TargetMapSlotName" you should use this:

mat = standardMaterial() -- or other material, for example the material from some node
RttObj.IRTTGroup.SetTargetMapSlot cm mat "Diffuse Color"

for every used material type/class.

Thanks,
Andrzej

Offline

 

#5 2008-05-23 15:23:15

Perry
New member
Registered: 2008-05-22
Posts: 3

Re: RTTGroup and MaxScript

Thank you very much!

i am ok for now smile

Perry

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson