User avatar
By j_man
#317723
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.
By Bogdan Coroi
#317728
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
User avatar
By stir
#368298
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.
User avatar
By Mihnea Balta
#368305
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.).
Sketchup 2025 Released

Thank you Fernando!!!!!!!!!!!!!!!!!!!!!!!!!!! hwol[…]

I've noticed that "export all" creates l[…]

hmmm can you elaborate a bit about the the use of […]

render engines and Maxwell

Funny, I think, that when I check CG sites they ar[…]