ScriptSpot

Forum topic · General Scripting

Turn off Highlights+FG (Only)

By tassel · 2012-04-11

Description

Hi,

I have some trouble with turning Highlights+FG (Only) "on" and "off".
It works with single A&D materials, but not with A&D materials in a multisub/multimat material.

Here is a couple of example of what i have done so far:

EXAMPLE1:


			for materials in 1 to (sceneMaterials.count) where classof sceneMaterials[materials] == Arch___Design__mi do
			(
				sceneMaterials[materials].refl_hlonly = off
			)

EXAMPLE2:


			for mat in scenematerials where hasProperty mat "refl_hlonly" do
			(
				format "%\n" (mat)
				mat.refl_hlonly = off
			)

All tips received with great thanks...

Best regards,
Raymond H.Ingebretsen

Comments (3)

tassel · 2012-04-24

I forgot about this post, Thank you barigazy.

barigazy · 2012-04-24

Recently, I came across with a similar problem.
Anzwaz, you have nice "Lazy" scripts on site.
Just keep it up, man.

This is it

barigazy · 2012-04-23

fn turnOnOffHighlights turn:off =
(
local gnsm = getNumSubMtls
for mat in scenematerials do
(
if gnsm mat == 0 then (if classof mat == Arch___Design__mi do mat.refl_hlonly = turn) else
(
case classof mat of (
(Multimaterial): (for m in mat.materialList where classof m == Arch___Design__mi do setProperty m "refl_hlonly" turn)
(Blend): (
if classof mat.map1 == Arch___Design__mi do mat.map1.refl_hlonly = turn
if classof mat.map2 == Arch___Design__mi do mat.map2.refl_hlonly = turn
)
(Shellac): (
if classof mat.shellacMtl1 == Arch___Design__mi do mat.shellacMtl1.refl_hlonly = turn
if classof mat.shellacMtl2 == Arch___Design__mi do mat.shellacMtl2.refl_hlonly = turn
)
--etc.
)
)
)
)
turnOnOffHighlights()