Jump to content
3DCoat Forums

"To uniform space" for every VoxTree layer


ajz3d
 Share

Recommended Posts

  • Contributor

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.

Link to comment
Share on other sites

  • 2 weeks later...
  • Member

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
Link to comment
Share on other sites

  • Contributor

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.

Link to comment
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.
Link to comment
Share on other sites

  • Member

 

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".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...