maxscript插入光度计

时间:2018-03-18 02:30:42

标签: 3dsmax maxscript

我正试图通过maxscript插入一些光度计灯,但我无法理解我应该在哪里写ies文件的路径。

看起来参数".webFile"已加密,它为我提供了类似{4C36723C-0D23-4D8A-9E17-151C8149D179}的值,在这种情况下应为"D:\User\Desktop\ies\1.ies"

我该怎么办?

由于

1 个答案:

答案 0 :(得分:0)

.webfile参数是AssetID,它是一种GUID(全局唯一ID)。在MaxScript中,这可以从AssetUser对象获得,该对象表示单个位图或资产文件,AssetUser对象可以从AssetManager获得。

请注意,某些资源是由文件名访问的,而其他资产是由AssetID在MaxScript中访问的。适用于光度学光源的IES文件,例如目标灯光和自由灯(适用于其光分布设置为Photometric Web时),由AssetID引用。 BitmapTextures的位图由文件名引用。

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()