Altering bitmap output

 Hello,

This is my first attempt at scripting, so please excuse any ignorance.

I have a scene populated with silhouettes of people on plane objects, all with a look at constraint, i.e. billboard people.

The silhouettes are defined through a VRay material, with a .png as an opacity map.

I want to be able to adjust the transparency of the billboards by altering the RGB output level in the output setting for that bitmap. I’ve come up with the following script:

for obj in (selection as array)
where classof obj == plane do
(
$.material.texmap_opacity.output.rgb_level = 0.8
)

However it only works when I have one object selected. If I have two or more selected I get the message, “—Unknown property: “material” in $selection”

Where am I going wrong?

Also, I was hoping that, once I got this script right I would be able to alter it to uniformly change the diffuse colour of each material.

Thank you!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
3DV's picture

Is it possible to make this

Is it possible to make this work for all (multi/sub)materials in a selection (and not limited to planes ofcourse)? That would be very handy!

vincentvincent's picture

Fantastic! Many thanks

Fantastic! Many thanks Barigazy!!

barigazy's picture

...

U welcome

;)

barigazy

vincentvincent's picture

render of scene attached

render of scene attached

AttachmentSize
people.jpg 2.78 MB
barigazy's picture

...

Don't use "$" in for-loop. You already have "obj" variable

for obj in selection where isKindOf obj plane do
   obj.material.texmap_opacity.output.rgb_level = 0.8

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.