Notifications
Clear all

[Closed] change "lighting mode" attribute of FlightStudio hierarchy with maxscript

Dear all,
I am trying to change one property of my geometry before exporting to Flight Studio using maxscript. Exporting is not a problem, I can access the functions and create the object and xref nodes, but I want to be able to change the attribute “Lighting Mode” of the geometry to “Face Color Smooth” programmatically.

Whenever a file is exported to .flt format, an .attr file is created. But it is in machine language, so you cannot change anything there.

Any ideas?
Thanks

2 Replies

Got this workaround:
create the flt object/xref node, and immediately after, look for any dummies in the scene which begins with x* (in the case of xref flt nodes) or o* (in the case of object nodes). After you have found it, you can access its properties just as with any max object.


-- create the Flight dummy
FlightStudio.CreateObject()

--look for it in all the objects in the scene
local allobjs = $*
 
fltStudio.CreateExternalRef()
 
for o in allobjs do 
(
if (classOf o == Dummy) then 
(
if (matchPattern o.name pattern:"x*" ignoreCase:false) then (
 
--put the xref path
fltStudio.PutExternalRefFilename o (fileextToFLT fPath)
 
--rename
o.name = fName
 
-- align it to the parent object PIVOT (not center)
o.rotation = rot o.position = pos o.boxsize = [0.5, 0.5, 0.5]
 
-- put in object's layer 
If (objLayer == undefined) then objLayer = "0"
local target = LayerManager.getLayerFromName 
objLayer target.addNode o 
append createdDummies o 
) 
) 
)

Hi glBeatriz. Can you share with me how is the External Reference Node in 3Dmax Flight Studio tool been use? I can find any information on how this Xref node is used.