Jump to content
3D Coat Forums
ajz3d

"To uniform space" for every VoxTree layer

Recommended Posts

Hello.

I have two short questions:

1. What is the script command for "to uniform space".

2. How to iterate through every layer of the VoxTree?

I did a quick search of the Scripting Manual, but it doesn't seem to mention any of the above.

 

Any help is appreciated.

Share this post


Link to post
Share on other sites

Hey !!

 

1)

Have no idea how to run "to uniform" via script :(

 

2)

Only option is to choose:

SelectFirstVolume(false); // false - if you want to select visible and nonvisible layers
 
Than you can select next layers in a loop with:
SelectNextVolume(false); // false - if you want to select visible and nonvisible layers

Share this post


Link to post
Share on other sites

Thank you.
But what if I need to put the SelectNextVolume(bool)call in a for loop when I don't know how many volumes are in a tree? Is there something like Python's for s in list in C++ or AngelScript? Or is subtree iteration possible only by hiding volumes one doesn't want to iterate through and running the bool SelectNextVolume(bool) function multiple times with true as its argument?
 
Also, I have a question about bool SelectNextVolume(bool OnlyVisible).
The manual states that:
 

Select next volume after current in tree, if OnlyVisible==true then next visible volume will be selected. Returns false
if current volume is last in list

 
So from what I understand, if OnlyVisible is true then if the function encounters the first hidden volume or the last volume in the VoxTree, it should return false. However, this doesn't happen. SelectNextVolume seems to always return false, no matter what volume it encounters. Take this script for example:

void main(){
    bool isNotLast = true;
    while (isNotLast){
        isNotLast = SelectNextVolume(true);
        ModalDialog("isNotLast = "+isNotLast+"\nCurVolume = "+GetCurVolume()," "); //Debug
        //Some operations on volume here
    }
}

After iterating through currently selected volume, SelectNextVolume immediately returns false and ends the while loop, even if there are more non-hidden volumes below the current layer.

 

I don't know. Maybe I'm doing something wrong here.

Share this post


Link to post
Share on other sites

To uniform space in current volume:

 

cmd("$ToUniformSpace");/*To uniform space*/

 

And rule:

 

 

Any RMB item accessible through same rule via RMB+MMB (copy item to clipboard)

 

iterating seems to be buggy. Generally this should work:

 

SelectFirstVolume(true);
do{
       cmd("$ToUniformSpace");/*To uniform space*/
}while(SelectNextVolume(true));
 
I will correct it in today's build.

Share this post


Link to post
Share on other sites

 

To uniform space in current volume:

 

cmd("$ToUniformSpace");/*To uniform space*/

 

And rule:

 

 

Any RMB item accessible through same rule via RMB+MMB (copy item to clipboard)

Yeah I know, but it doesn't worked for me while i clicked RMB at Vox Layer and then RMB + MMB at "To uniform space".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×