Author Topic: 3D Studio Max - macro recording  (Read 1970 times)

2020-02-08, 17:30:47

3dboomerang

  • Active Users
  • **
  • Posts: 214
  • Head of 3D
    • View Profile
    • 3DFLOW
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!

2020-02-09, 04:06:40
Reply #1

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
meditMaterials[1].levelTranslucency = 0.25

2020-02-09, 04:32:50
Reply #2

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
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

2020-02-09, 07:39:00
Reply #3

3dboomerang

  • Active Users
  • **
  • Posts: 214
  • Head of 3D
    • View Profile
    • 3DFLOW
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!

2020-02-09, 09:57:11
Reply #4

sprayer

  • Active Users
  • **
  • Posts: 794
    • View Profile

2020-02-09, 10:22:59
Reply #5

3dboomerang

  • Active Users
  • **
  • Posts: 214
  • Head of 3D
    • View Profile
    • 3DFLOW
Not for what we have in mind no, we already checked

2020-02-12, 08:18:30
Reply #6

3dboomerang

  • Active Users
  • **
  • Posts: 214
  • Head of 3D
    • View Profile
    • 3DFLOW
So again, if there is anyone with the ability to write scripts, we'd be more then happy to compensate?