All posts related to V2
User avatar
By deadalvs
#354203
Code: Select all
from pymaxwell import *
scene = Cmaxwell(mwcallback);
material = scene.createMaterial( 'mxm_test', False );
layer = material.addLayer();
bsdf = layer.addBSDF();
VAL = Cmap();
MAP = Cmap();
reflectance = bsdf.getReflectance();

VAL.type = MAP_TYPE_VALUE;
VAL.value = 100
layer.setWeight(VAL)

MAP.type = MAP_TYPE_BITMAP;
MAP.pFileName = "D:/DATA/weightMap.jpg";
layer.setWeight(MAP)
layer.setActiveWeight(MAP)

material.write('C:/Users/username/Desktop/mxm_test.mxm');
I am trying to assign both a weight value and a weight texture to the layer. I can drive both individually, but not both at the same time .. What am I missing ?
User avatar
By deadalvs
#354239
got it ! [this took a long time playing]

1] Cmap(); can have 3 inputs : a value, an rgb a bitmap
2] both value and bitmap have 'value' entries
3] thus --> to set the layer weight with value AND mask, one has to use the MAP_TYPE_BITMAP, then set BOTH the value and the pFileName of this 'Cmap()'

tricky .. :idea:
Code: Select all
from pymaxwell import *
scene = Cmaxwell(mwcallback);
material = scene.createMaterial( 'mxm_test', False );
layer = material.addLayer();
bsdf = layer.addBSDF();
reflectance = bsdf.getReflectance();

MAP = Cmap();
MAP.type = MAP_TYPE_BITMAP;
MAP.value = 100
MAP.pFileName = "D:/DATA/weightMap.jpg";
layer.setWeight(MAP)
layer.setActiveWeight(MAP)

material.write('C:/Users/userName/Desktop/mxm_test.mxm');
Help with swimming pool water

I think you posted a while back that its best to u[…]

Sketchup 2026 Released

Considering how long a version for Sketchup 2025 t[…]

Greetings, One of my users with Sketchup 2025 (25[…]

Maxwell Rhino 5.2.6.8 plugin with macOS Tahoe 26

Good morning everyone, I’d like to know if t[…]