ScriptSpot

Forum topic · General Scripting

Render element active or not ?

By titane357 · 2018-01-29

Description

Hi,
I can activate or deactivate render elements but I don't know how to check if render elements is active or not.
Anybody can help ? Thanks.

Comments (5)

.

miauu · 2018-01-29


(
	elementMgr = maxOps.GetCurRenderElementMgr()	
	numOfElements = elementMgr.NumRenderElements()
	if numOfElements != 0 then
	(
		for index = 0 to (numOfElements - 1) do
		(
			element = elementMgr.getRenderElement index		
			active = element.enabled
			format "element: % active: %\n" 	element	active	
		)
	)
)

titane357 · 2018-01-30

Hi Miauu, thanks for helping ! :-)
My apologies, I wasn't precise enough in my question...
In fact it is the render element MANAGER that I have in mind.
I made a check button "CELEMENTS":
---------------------------------------------------------------------
on CELEMENTS changed theState do
(
if CELEMENTS.checked==1 do
(
local reMgr = maxOps.getCurRenderElementMgr()
reMgr.SetElementsActive true
)
if CELEMENTS.checked==0 do
(
local reMgr = maxOps.getCurRenderElementMgr()
reMgr.SetElementsActive false
)
---------------------------------------------------------------------
I want to update its state checking if render element MANAGER is active or not...

Attachments

.

miauu · 2018-01-30


(
	elementMgr = maxOps.GetCurRenderElementMgr()		
	res = elementMgr.GetElementsActive()
	format "Active: % \n" res
)

titane357 · 2018-01-30

yesssss !!! Thank you very much, works fine ! :-)

.

miauu · 2018-01-30

I am glad to help. :)