- Thu May 01, 2008 6:15 pm
#268318
Hi - I need a quick working MAXScript example, please, of how to use this method
--- maxwellMaterialImport <material:maxwell_material_node> <input:mxm_file_name>
which is listed on page 32 of the documentation file maxwell-3dsmaxv1-1.pdf
For quick short-file-path testing I copied a material shipped with the Maxwell library to C:\orangediffuseplastic.mxm
Success happens when I start a new scene,
--- hit "m" to bring up the materials UI,
--- click Standard,
--- choose MaxwellMaterial in the resulting list,
--- click OK,
--- then click Import MXM in the main "m" UI window,
--- and import C:\orangediffuseplastic.mxm to the first material slot.
The preview shows up fine, I can use the UI to assign the material to a sphere or whatever, and the following MAXScript runs successfully
--- sphereX = Sphere radius:1.75 smooth:on segs:32 chop:0 name:"TestSphere"
--- sphereX.material = meditMaterials[1]
But the goal of course is to import C:\orangediffuseplastic.mxm and then assign it to an object *without* having to use the UI
I tried
--- maxwellMaterialImport meditMaterials[1] "C:\orangediffuseplastic.mxm"
but the error
--- #Maxwell import error: A destination material is required in order to perform the import.
appears in the Listener.
I also tried
--- sphereX = Sphere radius:1.1 smooth:on segs:32 chop:0 name:"TestSphere"
--- maxwellMaterialImport sphereX.material "C:\orangediffuseplastic.mxm"
but the same error appears in the Listener. The test sphere is created and is assigned a default 3ds material.
The specific way I run thses test is:
--- Fire up new instance of 3ds,
--- start new scene,
--- open Listener and MaxScript editor,
--- copy the test code into editor
--- and do Tools\Evaluate All in the editor
The MAXScript plugin doc says to give a <material:maxwell_material_node> as the first argument. My two guesses on "What is a <material:maxwell_material_node>?" were those I tested above
1) meditMaterials[1] because some type of material thingie got picked out of there and used as an assignment source.
2) sphereX.material because some type of material thingie got assigned into there as assignment destination.
But neither of my guesses succeeded, and I'm out of guesses; so what's an example please, of a successful call to maxwellMaterialImport?
I'm new to MAXScript so I'm light on the exact semantics of stuff like what is a node of the flavor <material:maxwell_material_node>
Trying to save forum bandwidth I Googled on maxwellMaterialImport, no useful hits; and searched the forums here, no hits. Also text-searched caseys_maxwell_tools.ms, no hits.
Can anyone help, please, with one working example?
Seems like it might be as short as one line of MAXScript, but then I'm light on 3ds node semantics...
Thanks!
--- maxwellMaterialImport <material:maxwell_material_node> <input:mxm_file_name>
which is listed on page 32 of the documentation file maxwell-3dsmaxv1-1.pdf
For quick short-file-path testing I copied a material shipped with the Maxwell library to C:\orangediffuseplastic.mxm
Success happens when I start a new scene,
--- hit "m" to bring up the materials UI,
--- click Standard,
--- choose MaxwellMaterial in the resulting list,
--- click OK,
--- then click Import MXM in the main "m" UI window,
--- and import C:\orangediffuseplastic.mxm to the first material slot.
The preview shows up fine, I can use the UI to assign the material to a sphere or whatever, and the following MAXScript runs successfully
--- sphereX = Sphere radius:1.75 smooth:on segs:32 chop:0 name:"TestSphere"
--- sphereX.material = meditMaterials[1]
But the goal of course is to import C:\orangediffuseplastic.mxm and then assign it to an object *without* having to use the UI
I tried
--- maxwellMaterialImport meditMaterials[1] "C:\orangediffuseplastic.mxm"
but the error
--- #Maxwell import error: A destination material is required in order to perform the import.
appears in the Listener.
I also tried
--- sphereX = Sphere radius:1.1 smooth:on segs:32 chop:0 name:"TestSphere"
--- maxwellMaterialImport sphereX.material "C:\orangediffuseplastic.mxm"
but the same error appears in the Listener. The test sphere is created and is assigned a default 3ds material.
The specific way I run thses test is:
--- Fire up new instance of 3ds,
--- start new scene,
--- open Listener and MaxScript editor,
--- copy the test code into editor
--- and do Tools\Evaluate All in the editor
The MAXScript plugin doc says to give a <material:maxwell_material_node> as the first argument. My two guesses on "What is a <material:maxwell_material_node>?" were those I tested above
1) meditMaterials[1] because some type of material thingie got picked out of there and used as an assignment source.
2) sphereX.material because some type of material thingie got assigned into there as assignment destination.
But neither of my guesses succeeded, and I'm out of guesses; so what's an example please, of a successful call to maxwellMaterialImport?
I'm new to MAXScript so I'm light on the exact semantics of stuff like what is a node of the flavor <material:maxwell_material_node>
Trying to save forum bandwidth I Googled on maxwellMaterialImport, no useful hits; and searched the forums here, no hits. Also text-searched caseys_maxwell_tools.ms, no hits.
Can anyone help, please, with one working example?
Seems like it might be as short as one line of MAXScript, but then I'm light on 3ds node semantics...
Thanks!