Shows all v-layers.
3DCoat allows to create multiple layers in the scene. And each layer can contain another layers.
Here's the code:
You'll get the tree:
Check it!)
Do you see the groups of methods? append()
, appendToParent()
, appendToRoot()
, forEach()
, forRootEach()
, ... - self-explanatory titles: "parent", "root", "for each". Simply compare this code with result image, and you'll get everything :)
Are you familiar with JQuery? Then you'll easily understand how 3DCoat works with trees.
Consider that class Vox
interacts with 3DCoat's UI, that's why Vox-methods select layers before they do anything with them.
Lets add some to the code above.
There are two ways. First:
Second:
Which way to choose? You decide.
The building of vox-layers tree see here
Vox& moveToIndex(const string& name, int index);
Move v-layer name
as child of parent's selected v-layer into the relative index . V-layer becomes selected.
Vox& moveCurrentToIndex(int idx);
Move the current v-layer as child of parent's selected v-layer into the relative index. v-layer with index equals to idx becomes selected
idx | v-layer index |
int getIndex();
Gets the index of current v-layer
string names();
Gets all volumes for brunch.
string namesQuotes();
Gets all volumes for brunch (comma separated).
string name();
Gets the current volume name.
Vox& rename(const string& newName);
Rename the current volume.
newName | name to rename |
Vox& to(const string& name);
Switch to v-layer named like name
.
name | new layer name |
Vox& parent();
Selected a parent if parent isn't root. #! We can't selecting a root's v-layer (don't selecting really in the 3D-Coat UI). Use appendToParent() for add a new v-layer to root.
bool hasParent();
Check if volume layer has parent
Vox& firstForRoot();
Move to a first v-layer among childs of root's v-layer.
Vox& first();
Move to a first v-layer among childs of selected v-layer.
Vox& firstForParent();
Move to a first v-layer among childs of parent's selected v-layer.
Vox& nextForParent();
Move to a next v-layer among childs of parent's selected v-layer. Stops when parent is last.
bool hasChildren();
Check the children layers for current volume.
bool hasNextForParent();
Check the next layer for parent volume.
bool next();
Select the next volume. Move through all v-layers ignoring depths.
Vox& lastForRoot();
Move to a last v-layer among childs of root's v-layer.
Vox& last();
Move to a last v-layer among childs of selected v-layer.
Vox& lastForParent();
Move to a last v-layer among childs of parent's selected v-layer.
Vox& remove();
Remove the current v-layer from vox branch tree.
Vox& forRootEach(const string& func);
Move through all v-layers and run func
for every.
Vox& forEach(const string& func);
Move through all parents v-layers (relative selected) and run func
for every.
Vox& call(const string& func);
Run func
for selected v-layer
Vox& atForRoot(int i);
Select a child of root's v-layer by index.
Vox& at(int i);
Select a child of current v-layer by index.
Vox& atForParent(int i);
Select a child of parent for current v-layer by index.
Vox& showAllHidden();
Vox& showHiddenSubtree();
Shows hidden subtree v-layers for current vox tree branch.
Mat4 transform();
Gets the transform matrix from current volume object.
Vox& setTransform(const Mat4& m);
Sets the transform matrix for the current volume object.
bool visible();
Gets the visibility of the current volume object.
Vox& setVisible(bool v);
Sets the visibility of the current volume object.
bool ghost();
Gets the ghost mode of the current volume object.
Vox& setGhost(bool v);
Sets on/off the ghost mode of the current volume object.
string nameShader();
Gets the shader name of the current volume object.
Vox& setShaderProperty(const string& name, const string& vs);
Sets the shader property of the current volume object.
name | property id |
vs | string value |
Vox& setOpacity(float v);
Sets the opacity for current volume object.
v | opacity value |
Vox& setColor(int v);
Sets the color for current volume object.
v | color 32-bits(argb) value |
Vox& setColorRGB(int r, int g, int b);
Sets the RGB color for current volume object.
r | red channel |
g | green channel |
b | blue channel |
Vox& toSurface();
Sets the current volume to surface mode.
Vox& toVoxel();
Sets the current volume to voxel mode.
Vox& toVoxelSuggestPoly(int suggestPoly);
Sets the current volume to voxel mode with corresponding number of polygons.
suggestPoly | polygon count. |
Vox& decreaseObject2X();
Decreminate the dencity of volume object's by 2 times
Vox& increaseObject2X();
Increminate dencity of volume object's by 2 times.
Vox& toGlobalSpace();
Sets the volume objects to the global space.
Vox& toUniformSpace();
Sets the volume objects to the uniform space.
Vox& resample();
Change resolution of the volume object.
Vox& applyAxialSymmetry();
Sets the radially array the object with any number of slices.
Vox& extrude();
Extrude the volume object.
Vox& turnToShell();
Thickens the surface of volume object. Only for surface mode.
Vox& makeVoxelHull();
Make a shell mesh using the voxel algorithm. It takes more time to calculate but works well for complex topology. Only for voxel mode.
Vox& makeSurfaceHull();
Thickens the mesh object using surface extrusion. Only for surface mode.
Vox& closeSurfaceHoles();
Close the surface holes in mesh. Only for surface mode.
Vox& fillVoids();
Fills inner voids or hollows in the model. Only for voxel mode.
Vox& closeInvisibleHulls();
Close invisible hulls inside the object. Even if hull is not completely closed it may be closed by this tool because only small outer part of the hull is visible. Only for voxel mode.
Vox& decompose();
Creates an object in the VoxTree for each separated piece of geometry, and places the geometry into those objects. Only for surface mode.
Vox& save3B();
Save Volume as 3B.
Vox& saveSubtree3B();
Save Volume w/ Sub-Tree as 3B.
Vox& merge3B();
Import external 3B file in scene.
Vox& mergeCloud();
Import set of points as a sequence of small spheres.
Vox& mergeObject();
Import 3D object.
Vox& exportScene();
Export entire scene as a multi-object file.
Vox& exportObject();
Export current object to a file on disk.
Vox& exportPatternForMerge();
Export current object to be used as a preset in the Meshes panel.
Vox& exportCurveProfile();
Export current object to be used as a preset in the Meshes panel.
Vox& autopoQuadrangulate();
Run AUTOPO and switch to Retopo room.
Vox& autopoQuadrangulateAndMergePtex();
Run AUTOPO and bake using PTEX technology.
Vox& autopoQuadrangulateAndMerge();
Run AUTOPO to begin texturing in Paint room.
Vox& autopoQuadrangulateAndMergeDP();
AUTOPO for Per Pixel.
Vox& putOnGround();
Snap object to ground (zero). Only vertical parallel motion will be used.
Vox& layOnGround();
Lay object on ground. Object will be moved and rotated to get physically stable position on the ground.
Vox& cloneInstance();
Clone instances.
Vox& clone();
Clone and transform volume object.
Vox& cloneInstanceWithSymmetry();
Clone instances with symmetry.
Vox& cloneSymmetry();
Clone with symmetry and transform.
Vox& cloneDegrade();
Clone and decrease level of details twice.
Vox& cloneSpace();
Create space with identical density and transformation. It is important if you want to use copy tool without losing quality. Create new space and use copy tool.
Vox& flipX();
Flip object along X.
Vox& flipY();
Flip object along Y.
Vox& flipZ();
Flip object along Z.
Vox& flipNormals();
Flip object normals. Only for surface mode.
Vox& bakeColors();
Bake color from all visible volumes to the current one. The volume will turn to surface mode.
Vox& plainMergeVisible();
Merge Visible (no booleans)
Vox& plainMergeSubtree();
Merge Sub-Tree (no booleans).
Vox& plainMergeTo(const string& with);
Copy & Merge (no booleans).
Vox& plainMoveTo(const string& with);
Merge (move, no booleans).
Vox& mergeVisible();
Combine current layer with all child layers.
Vox& mergeSubtree();
Merge the Sub-Tree of current volume. All child layers will be deleted.
Vox& mergeTo(const string& with);
Merge copy of the object to other object.
with | name of the destination volume |
Vox& moveTo(const string& with);
Move object to other object space.
with | name of the destination object |
Vox& subtractFrom(const string& with);
Subtract object from other object.
with | name of the object to subtract from |
Vox& intersectWith(const string& with);
Intersect volume with other one.
with | name of the object to intersect with |
Vox& removeIntersectionWith(const string& with);
Subtract current volume from the destination but leave both volumes. In so way intersecting part will be removed from the destination object.
with | name of the object to intersect with |
Vox& splitWith(const string& with);
Split volume in two parts(volumes) with destination volume.
with | name of the object to split with |
Vox& changeParent(const string& with);
Change parent of the object.
with | name of the object to change |
void addObject(const string& name);
Add the sub object to poly mesh.
name | sub object name |
int objectIndex(const string& name);
Gets index of object by name ID.
name | object name ID |
string objectName(int index);
Get the object name ID by index
index | object index |
void renameObject(const string& oldName, const string& newName);
Rename the sub object.
oldName | old object name |
newName | new objejct name |
bool visibleObject(const string& name);
Get the object visibility.
name | object name |
void setVisibleObject(const string& name, bool v);
Get the object visibility.
name | object name |
v | visibility flag |
void lockObject(const string& name, bool b);
Set the lock mode for named object.
name | object name |
b | lock flag |
int uvsetIndex(const string& name);
Gets the retopo UVsets index by name.
name | retopo uvsets name |
string uvsetName(int index);
Gets the retopo uvsets name by index.
index | index value |
void renameUVSet(const string& oldName, const string& newName);
Rename the old uvset name by new name
oldName | old name |
newName | new name |
bool isEmpty();
Checks whether a volume is empty.
bool isSurface();
Checks whether a current volume mode is surface.
bool isVoxel();
Checks whether a current volume mode is voxel.
void addPaintLayer(const string& name);
Add the paint layer.
name | layer's name |
void deletePaintLayers();
Delete the current paint layer.
string paintLayer();
Gets the current layer name.
bool setPaintLayer(const string& name);
Select the paint layer.
name | layer's name |
void renamePaintLayer(const string& newName);
Rename the current paint layer.
newName | layer's name |
void firstPaintLayer();
Select the first paint layer.
bool nextPaintLayer();
Select the next paint layer.
bool visiblePaintLayer();
Gets the visibility of the current paint layer.
void setVisiblePaintLayer(bool v);
Gets the visibility mode of the current paint layer.
v | visible value |
float opacityPaintLayer();
Gets the opacity of the current paint layer.
void setOpacityPaintLayer(float v);
Sets the opacity of the current paint layer.
v | opacity value(0..1) |
float depthOpacityPaintLayer();
Gets the depth opacity of the current paint layer.
void setDepthOpacityPaintLayer(float v);
Sets the depth opacity of the current paint layer.
v | opacity value(0..1) |
void setBlendingPaintLayer(const string& name);
Set blending mode of the current paint layer.
name | id's of the color blending mode |
void setDepthBlendingPaintLayer(const string& name);
Sets depth blending mode of the current paint layer.
name | id's of the depth blending mode |
void deleteRetopoLayer();
Delete the current retopo layer.
string retopoLayer();
Gets the current retopo layer.
bool setRetopoLayer(const string& name);
Select retopo layer with name ID.
name | id of layer name |
void renameRetopoLayer(const string& newName);
Rename the current retopo layer.
newName | name to rename |
void firstRetopoLayer();
Select first retopo layer.
bool nextRetopoLayer();
Select next retopo layer.
bool visibleRetopoLayer();
Gets visibility of the current retopo layer.
void setVisibleRetopoLayer(bool v);
Set visibility of current retopo layer.
v | visibility mode. |
void addMaterial(const string& name);
Add the material to poly mesh materials.
name | material name |
void deleteMaterial(const string& name);
Delete the material from poly mesh materials.
name | material to delete |
int materialIndex(const string& name);
Gets the material index by name.
name | material name |
string materialName(int index);
Gets the material name by index.
index | material index |
void renameMaterial(const string& oldName, const string& newName);
Rename the old material name on the new name.
oldName | old name |
newName | new name |
bool visibleMaterial(const string& name);
Gets the visibility of material.
name | material name |
void setVisibleMaterial(const string& name, bool v);
Sets the visibility of material.
name | material name |
v | visibility |
void lockMaterial(const string& name, bool b);
Set the lock mode of the material.
name | material name |
b | locked flag (true/false) |
Vox& clearScene();
Clear a scene.
int count();
Calculate of child object's count for current voxel tree branch.
float square();
Gets a current volume square.
float volume();
Gets a volume of the current volume.
int polycount();
Gets the number of polygons of the current volume.
int polycountScene();
Gets polygons count of scene volumes
int countPaintLayer();
Gets a layers count of the poly mesh.
int countRetopoLayer();
Gets amount of retopo layers.
int countMaterial();
Gets amount of poly mesh materials.
int countObject();
Gets amount of poly mesh objects.
int countUVSet();
Gets amount of uvsets.
If you prefer a functional programming, take a look at this list of available functions:
Also check this full list of functions: