Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

glTFMaterial() undefined in macro

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
jmdvella
128 Views, 5 Replies

glTFMaterial() undefined in macro

Previously this was working fine, now after the latest 3dsmax2024 updates I cannot assign a variable a glTFMaterial(). For example this will crash any script that uses the glTFMaterial():

 

macroScript GLBTest
    tooltip:""
    buttonText:""
(
    newMat = glTFMaterial()
    show newMat
)
 
How is this fixable? If I run the command when its not in a macro it works just fine.
5 REPLIES 5
Message 2 of 6
jmdvella
in reply to: jmdvella

For those testing this, it works only the first time its evaluated. Put the button on the toolbar and restart 3dsmax and try again, it will fail

Message 3 of 6
denisT.MaxDoctor
in reply to: jmdvella


@jmdvella wrote:

Previously this was working fine, now after the latest 3dsmax2024 updates I cannot assign a variable a glTFMaterial(). For example this will crash any script that uses the glTFMaterial():

 

macroScript GLBTest
    tooltip:""
    buttonText:""
(
    newMat = glTFMaterial()
    show newMat
)
 
How is this fixable? If I run the command when its not in a macro it works just fine.

do 

(
    if iskindof (gltf_mat = execute "glTFMaterial") Material do
	(
		newmat = gltf_mat()
		show newmat
	)
)

 

instead.


At the time the macro was loaded, the glTFMaterial class had not yet been defined.

Message 4 of 6
jmdvella
in reply to: denisT.MaxDoctor

Thank you Denis!

 

Why does this work differently than every other current material?

 

Every other material type works like this including StandardMaterial (legacy), Physical Material, VrayMtl, CoronaMtl, etc

Message 5 of 6
denisT.MaxDoctor
in reply to: jmdvella


@jmdvella wrote:

Why does this work differently than every other current material?

 

Every other material type works like this including StandardMaterial (legacy), Physical Material, VrayMtl, CoronaMtl, etc


 

... different order of loading plugins. Some additional classes or third-party dlls may be loaded after all built-in ones.

Message 6 of 6
jmdvella
in reply to: denisT.MaxDoctor

Ah I see, very unforgiving lol...

 

Thank you! 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report