ScriptSpot

Forum topic · General Scripting

Altering bitmap output

By vincentvincent · 2014-07-01

Description

 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 (5)

3DV · 2014-10-06

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 · 2014-07-02

Fantastic! Many thanks Barigazy!!

barigazy · 2014-07-03

U welcome

;)

vincentvincent · 2014-07-01

render of scene attached

Attachments

barigazy · 2014-07-01

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