Page 1 of 1

3ds max maxscript guide

Posted: Fri Jan 15, 2010 2:26 pm
by j_man
Hi guys,

I'm looking for maxscript details. I can work out a lot by myself, but there are a few things that are bothering me.

In V2 i see the way to add emitters and displacement to materials has changed. Can someone help?

I'm looking for reference for both V1.7 and V2

Josh.

Re: 3ds max maxscript guide

Posted: Fri Jan 15, 2010 3:14 pm
by Bogdan Coroi
There's a bug with displacement, emitters, masks and coating that prevents them for being created from Maxscript. We'll fix it for the next update.

A not so good workaround is to create a template material (that is, a material created in Material Editor), copy entities from it and modify their values.

Eg. Having a MaxwellMaterial on slot 10 you can't copy the emitter directly from layer1 due to our bug, but you can copy the entire layer (assuming this layer has only an emitter in it).
mxMaterial = Maxwell_Material()
mxMaterial.layers[1] = copy meditMaterials[10].layers[1]


After we fix the bug, you will be able to copy only the emitter like this:
mxMaterial.layers[1].emitter = copy meditMaterials[10].layers[1].emitter

Eg. Copy the displacement
mxMaterial = Maxwell_Material()
mxMaterial.displacement = copy meditMaterials[10].displacement

Re: 3ds max maxscript guide

Posted: Fri Jan 15, 2010 4:21 pm
by j_man
Hi Bogdan

I like your lateral thinking. It's a good workaround.

Thanks for your quick response.

Josh.

Re: 3ds max maxscript guide

Posted: Mon Jun 03, 2013 9:11 am
by stir
I wasn't sure if i should bring this thread up from the grave or ask again. But I am also looking for some maxscript documentation for maxwell renderer. Mostly for creating materials and editing them. Sorry if i have missed it, but i tried a search and this thread was the most relevant.


The reason i ask is that i have multiple materials in this scene. They all have sequenced bitmaps, something that slows down the performance big time when working. So im looking for a way to access the sequence toggle and turn it on and off trough maxscript. So i can easy decide when to have it on and off.

Re: 3ds max maxscript guide

Posted: Mon Jun 03, 2013 10:36 am
by Mihnea Balta
showproperties is your friend. :) You can use this command to explore the structure of the material, layers, maps and other components:
Code: Select all
showProperties meditmaterials[2].layers[1]

Result:
  .Emitter : material
  .Mask : texturemap
  .Bsdfs : material array
  .Opacity : float
  .BlendMode : integer
  .Enabled : boolean

showProperties meditmaterials[1].layers[1].bsdfs[1].reflectedcolortexture

Result:
  .FileName : filename
  .Channel : integer
  .TileType : integer
  .TileUnit : integer
  .TileX : float
  .TileY : float
  .OffsetX : float
  .OffsetY : float
  .Invert : boolean
  .Interpolation : boolean
  .Brightness : float
  .Contrast : float
  .Saturation : float
  .RGBClampMin : integer
  .RGBClampMax : integer
  .FlipX : boolean
  .FlipY : boolean
  .WideZ : boolean
  .Sequence : boolean
  .SequenceType : integer
  .SeqFirstFrame : integer
  .SeqLastFrame : integer
  .FrameOffset : integer
  .AlphaOnly : boolean
  .FramePadding : integer
  .FrameExt : integer
The sequence flag of the MX bitmap is exposed through the "Sequence" attribute in maxscript, so, for example, if you want to turn it on for the reflectance 0 texture of the first BSDF of the first layer, you do this:
Code: Select all
meditmaterials[1].layers[1].bsdfs[1].ReflectedColorTexture.Sequence = true
This uses the material that's assigned to the first slot of the material editor; in your code, you will probably have to obtain the material in some other way (by walking the scene, examining an object etc.).

Re: 3ds max maxscript guide

Posted: Fri Jun 07, 2013 12:10 pm
by stir
Thats great stuff :D Thanks alot!


showProperties is my new friend now hehe