Maxwell Render

Maxwell Render Information Repository
It is currently Wed May 22, 2013 11:10 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Mar 25, 2012 6:49 pm 
User avatar

Joined: Sun Mar 20, 2005 5:44 pm
Posts: 2298
Location: plains of fucking gorgoroth !
Code:
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 ?

_________________
Death Metal Team

http://www.esri.com/software/cityengine/


Top
 Profile  
 
PostPosted: Mon Mar 26, 2012 6:25 pm 
User avatar

Joined: Sun Mar 20, 2005 5:44 pm
Posts: 2298
Location: plains of fucking gorgoroth !
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:
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');

_________________
Death Metal Team

http://www.esri.com/software/cityengine/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group