1
votes

I'm trying to insert through maxscript some photometric lights but I can't understand where I should write the path for the ies file.

looks like the parameter ".webFile" is encrypted, it gives me values like this one {4C36723C-0D23-4D8A-9E17-151C8149D179} which in this case should be "D:\User\Desktop\ies\1.ies"

What can I do?

Thanks

1

1 Answers

0
votes

The .webfile parameter is an AssetID, which is a type of GUID (globally unique ID). In MaxScript, this can be obtained from an AssetUser object, which represents a single bitmap or asset file, and AssetUser objects can be obtained from the AssetManager.

Note that some assets are accessed by filename, and others by AssetID, in MaxScript. IES files for Photometric Lights, such as Target Lights and Free Lights (applicable when their Light Distribution is set to Photometric Web) are referred to by AssetID. Bitmaps for BitmapTextures are referred to by filename.

Example in MaxScript:

-- Create a photometric light and define the path to the IES file
exampleLight = Target_Light()
iesDir = "C:/Program Files/Autodesk/3ds Max 2018/sceneassets/photometric/"
iesFile = "point_recessed_wallwash_250W.ies"
iesFilepath = (iesDir + iesFile)
-- Set Light Distribution parameter to "Photometric Web"
exampleLight.Distribution = 3
-- Fetch the AssetUser value from AssetManager
iesAssetUser = AssetManager.getasset iesFilepath #Photometric
-- Fetch the AssetID value from the AssetUser
exampleLight.webfile = iesAssetUser.getAssetID()