What is the SDK equivalent of the MaxScript function <node>.isNodeHidden ?

What is the SDK equivalent of the MaxScript function <node>.isNodeHidden ?

miauuuu
Collaborator Collaborator
138 Views
7 Replies
Message 1 of 8

What is the SDK equivalent of the MaxScript function <node>.isNodeHidden ?

miauuuu
Collaborator
Collaborator

In maxscript we can use <node>.isNodeHidden to get the node's hidden flag only.

 

For example, if a node is visible in the viewport, then $.isNodeHidden returns FALSE. If we hide the layer, all nodes in that layer become invisible in the viewport, but testing the same node with $.isNodeHidden still returns FALSE, which is exactly what I want.

 

 

In the SDK documentation, I have only found this:

 

IsNodeHidden()
virtual int IsNodeHidden 	( 	BOOL  	forRenderer = FALSE	) 	
	inlinevirtual

Returns nonzero if the node is hidden in any way.

This method takes into account both the node hidden attribute and the 'Hide By Category' flags. 

 

IsHidden()
virtual int IsHidden 	( 	DWORD  	hflags = 0,
		BOOL  	forRenderer = FALSE 
	) 		
	inlinevirtual

Determines if the node is hidden in the scene.

Parameters
    hflags	If you pass 0, you will get the hidden state of the node. If you pass one or more of the flags shown below, the method checks the Class_ID of the node to see if it's hidden by the specified category. You may specify one or more of the following values:

 

When I hide the layer, IsNodeHidden() returns TRUE (nonzero), while $.isNodeHidden returns FALSE. IsHidden(0) or just IsHidden() also returns TRUE (nonzero).

 

Is there an SDK equivalent of $.isNodeHidden ?

 

 

https://miauu-maxscript.com/
0 Likes
139 Views
7 Replies
Replies (7)
Message 2 of 8

A娘
Advocate
Advocate

usually,you can convert the result int to binary , and test which byte control the state what you need 

for a set of bool values , use binary num to save state will be  save space and parse fast , when set ABCD=true\true\true\true,just save binary 1111 , set to int is 15 , if int is 14 then the 1st check is false

you can check this rule 

0 Likes
Message 3 of 8

miauuuu
Collaborator
Collaborator

Thank you. I will try to do what you suggested.

https://miauu-maxscript.com/
0 Likes
Message 4 of 8

denisT.MaxDoctor
Advisor
Advisor

MXS <node>.isNodeHidden corresponds to <inode*>->IsHidden(0, FALSE)
<node>.isHiddenInVpt corresponds to <inode*>->IsHidden(0, TRUE)

<node>.isHidden corresponds to <inode*>->IsNodeHidden(FALSE)

 

That's the paradox. Why it was made and named that way has always been a question for me. 😁

0 Likes
Message 5 of 8

miauuuu
Collaborator
Collaborator

This:

 

MXS <node>.isNodeHidden corresponds to <inode*>->IsHidden(0, FALSE)

 

works correctly when the layer of the node is not turned Off. When the layer is off, and all of its objects are not visible in the viewport the    <inode*>->IsHidden(0, FALSE)    will return that the objects are hidden.

https://miauu-maxscript.com/
0 Likes
Message 6 of 8

denisT.MaxDoctor
Advisor
Advisor

What is the specific interest in this issue? Why is the exact MXS equivalent needed at all?

0 Likes
Message 7 of 8

miauuuu
Collaborator
Collaborator

I wanted to check how fast C++ is compared to MXS. Then I found that this exact MXS command doesn't exist in C++, or at least I can't find it.

https://miauu-maxscript.com/
0 Likes
Message 8 of 8

denisT.MaxDoctor
Advisor
Advisor

@miauuuu wrote:

I wanted to check how fast C++ is compared to MXS. Then I found that this exact MXS command doesn't exist in C++, or at least I can't find it.


The methods themselves are the same by performance.