[Closed] getClassInstances Autodesk_Map and Parameters_Source
This is for Autodesk Bitmaps.
Could anyone please help me sort this out:
mAtdskBM = getClassInstances Autodesk_Map
for m in mAtdskBM do
(
m.Parameters_Source = “”
)
I get a Type error: set property requires BitMap, got: ""
edit: is there a way to check what properties there are on things? I am sure I got the wrong property and since I don’t know how to check what there are, its stumbling in the dark for me.
That should work.
Can you give me any example? How shall I interpret <Bitmaptexture>.bitmap Bitmap default: Bitmap:
? Where does the path fit in, or is it even the right thing to use? Or is it rather <Bitmaptexture>.filename Filenamedefault: ""
I learn far better from examples.
edit: when I wrote show $.material.Generic_Image
on an object that uses Autodesk Bitmap, I get this output among others: .Parameters_Source : bitmap
The formatting is new to me, I have no clue how to set an own value, eg path.
Sorry, I linked the wrong object.
The error tells you the class type it is expecting, a Bitmap http://help.autodesk.com/view/MAXDEV/2021/ENU/?guid=GUID-9F6ABEE1-0728-4B39-8903-D909634C1304 , so create one and assign it:
bMap = BitMap FileName: <texture path>
m.Parameters_Source = bMap
-- or if you should be able to set it as Undefined:
m.Parameters_Source = Undefined
Untested, but it should work.
It didn’t work unfortunately. This seems trickier than it looks.
I tried bMap = bitmap filename: "C:\\Program Files (x86)\\Common Files\\Autodesk Shared\\Materials\\Textures\\3\\Mats\\american_cherry.png"
and got
– Error occurred in anonymous codeblock; filename: ; position: 249; line: 2
– Argument count error: bitmap wanted 2, got 0
I tried this:
mAtdskBM = getClassInstances Autodesk_Map
for m in mAtdskBM do
(
show m.Parameters_Source
)
Where there was a path set, I got this
Map #13:Autodesk Bitmap
No Info Found on: BitMap:3\Mats\124.png
And where there was already no path, which is what I want to achieve in this particular case (some other time, I might however want to set a path)
Map #5:Autodesk Bitmap
No Info Found on: undefined
So it seems to me that the path is already part of .Parameters_Source
Now, could it be that I need to set the property of .Parameters_Source?
I tried setProperty m.Parameters_Source Undefined
and got Argument count error: setProperty wanted 3, got 2
So I tried setProperty m.Parameters_Source "Filename:" Undefined
and got Unknown property: "Filename:" in BitMap:3\Mats\124.png
– I am not getting the properties right.
Unknown property: "Filename" in BitMap:3\Mats\124.png
(without the colon) and got Unable to convert: undefined to type: FileName
¯\_(ツ)_/¯
I will take a look tomorrow when I can test in max.
I have used bitmaps quite recently but my memory is shite these days so I cannot remember properly.