Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: 3dboomerang on 2020-02-08, 17:30:47

Title: 3D Studio Max - macro recording
Post by: 3dboomerang on 2020-02-08, 17:30:47
Hi,

I'm trying to generate a script from a macro recording in 3D Studio Max - for materials

We use a general base-setup for our greenery, for example translucency "0,25"

In the macro recording however, I'm getting the following:

sceneMaterials["forest_automat_34549BD0"][#_4____VP_Japanese_Sedge_Grass_Leaf_Front_04____CoronaMtl].levelTranslucency = 0.25

Is there a written definition to have this more "generalized" in the following sense:

sceneMaterials["SELECTED MATERIAL SLOT"].levelTranslucency = 0.25

I reckon this question might be better posted in the area forums, but I wanted to try it here as well, you never know :)

Grts!
Title: Re: 3D Studio Max - macro recording
Post by: Njen on 2020-02-09, 04:06:40
meditMaterials[1].levelTranslucency = 0.25
Title: Re: 3D Studio Max - macro recording
Post by: Njen on 2020-02-09, 04:32:50
But if you don't already have the material you need in a material slot, you can collect all the materials in an array, search for the material by name, then put it into a slot. Then you can do what ever you want with it.

Code: [Select]
allMats = #()
matToGet = "NAME_OF_MATERIAL"
for mat in scenematerials do
(
    allMats = append allMats mat.name
)

selMat = findItem allMats matToGet
foundMat = scenematerials[selMat]
meditMaterials[1] = foundMat
Title: Re: 3D Studio Max - macro recording
Post by: 3dboomerang on 2020-02-09, 07:39:00
Thanks a bunch! I checked into it and I realise I'm a long way from home here. Now the macro script recorder is giving me different input from yesterday when I try to record some lines. This will take forever.

If anyone is capable of writing a small script for compensation, please contact me. Reckon this will go faster and easier :)
We made a screen-capture of what we want to do. Goal is to have it in a one-click-button in the UI.

Warm regards!
Title: Re: 3D Studio Max - macro recording
Post by: sprayer on 2020-02-09, 09:57:11
Can't you use material batch editor? http://www.scriptspot.com/3ds-max/scripts/batch-material-editor
Title: Re: 3D Studio Max - macro recording
Post by: 3dboomerang on 2020-02-09, 10:22:59
Not for what we have in mind no, we already checked
Title: Re: 3D Studio Max - macro recording
Post by: 3dboomerang on 2020-02-12, 08:18:30
So again, if there is anyone with the ability to write scripts, we'd be more then happy to compensate?