ScriptSpot

Forum topic · General Scripting

Adding object ID to element name

By j_forrester · 2012-02-05

Description

selection[i].gbufferchannel = i
element = MatteRenderElement()
element.elementName = (selection[i].name)
element.gbufID = i

I am looking to convert a piece of code to give the element name as the object ID + the object name. The rest works fine. I have tried this below as well as other variations with no luck. I have looked through the maxscript help files but not being very experienced scripter cant figure it out.

element.elementName = (selection[i].gbufID + _ + selection[i].name)

I would like it to read something like "51_box001"

Any help would be much appreciated.

Comments (1)

selection[1].gbufferchannel =

miauu · 2012-02-05


selection[1].gbufferchannel = 1
element = MatteRenderElement()
element.elementName = (selection[1].name)
element.gbufID = 1
element.elementName = ((element.gbufID as string)+ "_" + selection[1].name)

gbufID is a properti of MatRenderElement(). It is not a properti of geometry object.