3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
CoreAPI.h
1#pragma once
2#include <stdafx.h>
3#ifdef PYBIND11_DEF
4#include <Python.h>
5#include <pybind11/pybind11.h>
6#include <pybind11/numpy.h>
7#endif
8
9
21class ItemsTree;
22class ItemsFolder;
23class ClusteredMesh;
24
25#ifndef PY_PARSER
26#ifdef PYBIND11_DEF
27
28#define PY_BYTE_ARRAY pybind11::array_t<unsigned char, pybind11::array::c_style>
29#define PY_WORD_ARRAY pybind11::array_t<WORD, pybind11::array::c_style>
30#define PY_DWORD_ARRAY pybind11::array_t<dword, pybind11::array::c_style>
31#define PY_INT_ARRAY pybind11::array_t<int, pybind11::array::c_style>
32#define PY_FLOAT_ARRAY pybind11::array_t<float, pybind11::array::c_style>
33#define PY_DOUBLE_ARRAY pybind11::array_t<double, pybind11::array::c_style>
34
35#endif
36#endif
37
38#pragma pack(push, 1)
43namespace coat {
44 class Model;
45 class Volume;
47 typedef comms::cVec4 vec4;
48
50 typedef comms::cVec3 vec3;
51
53 typedef comms::cVec3i vec3i;
54
56 typedef comms::cVec2 vec2;
57
59 typedef comms::cMat4 mat4;
60
62 typedef comms::cMat3 mat3;
63
64 typedef comms::cMath math;
65
67 typedef comms::cStr str;
68
70 template <class X> using list = comms::cList<X>;
71
73 typedef comms::cRect rect;
74
75 typedef comms::cQuat quat;
76
77 typedef comms::cRotation rotation;
78
79 typedef comms::cAngles angles;
80
81 // axis-aligned bound box
82 typedef comms::cBounds boundbox;
83
97 class prim;
98
99
104 void start_main_menu(const char* id);
105
111 void menu_item(const char* id);
112
117 void menu_info(const char* id);
118
124 bool menu_submenu(const char* id);
125
129 void menu_exit();
130
135
143 void menu_hotkey(const char* id, int Shift, int Ctrl, int Alt);
144
151 bool iconic_submenu(const char* id, int size);
152
158
164
170
175 bool is_ppp();
176
181 bool is_proxy();
182
188
194
200 bool IsInRoom(const char* name);
201
207 bool RoomExists(const char* name);
208
214 bool CheckIfExists(const char* path);
215
216
222
223
228 bool is_mv();
229
234 bool is_ptex();
235
240
246 void show_space_panel(const char* Subset, int NumColumns);
247
253
259
264 void menu_insert_extensions(const char* id);
265
270
275
281
286 void SetAutoSnapDefaults(bool value);
287
293 bool menu_property(const char* id);
294
299 void tools_section(const char* id);
300
305 void tools_item(const char* id);
306
311 void page_suffix(const char* suffix);
312
317 void default_tool(const char* tool);
318
323 bool IsDebug();
324
329
333 void menu_sort();
334
340
346 bool IsInTool(const char* ToolID);
347
353
359
365
371
377 int GetCurrentToolSubmode(const char* id);
378
383 void tools_comment(const char* id);
384
389 bool doc_mode();
390
395
401
402
408
413 void run_extension(const char* extension_name, bool auto_start = false);
414
418 class APICALL Mesh {
419 protected:
420 friend class Model;
421 static std::vector<std::pair<comms::cMeshContainer*, int>> allocated_meshes;
422 comms::cMeshContainer* allocate();
423 void inc_ref(comms::cMeshContainer* m);
424 void dec_ref(comms::cMeshContainer* m);
425
426 comms::cMeshContainer* MeshData;
427 list<int> raw_start;
428 int raw_count;
429 void validate_raws();
430 public:
431 Mesh();
432 ~Mesh();
433
434 Mesh(const Mesh& m);
435 Mesh(const Model& m);
436 Mesh& operator = (const Mesh& m);
437 Mesh& operator = (const Model& m);
438 Mesh MakeCopy();
439
445 bool Read(const char* name);
446
452 bool Write(const char* name);
453
458 bool valid() const;
459
464 comms::cMeshContainer* geometry();
465
466 comms::cMeshContainer* geometry() const;
467
471 void clear();
472
477 Mesh& operator +=(const Mesh& m);
478
483 Mesh& operator +=(const Model& m);
484
490 void addTransformed(const Mesh& m, const mat4& t);
491
496 void boolean(const Mesh& m, BoolOpType op);
497
502 void transform(const mat4& transform);
503
509 void rotateToXYAxis(const vec3& axisX, const vec3& axisY);
510
516 void rotateToYZAxis(const vec3& axisY, const vec3& axisZ);
517
523 void rotateToZXAxis(const vec3& axisZ, const vec3& axisX);
524
529 int vertsCount() const;
530
535 int vertsUvCount() const;
536
541 int vertsNormalCount() const;
542
548
554 vec3 getVertex(int idx) const;
555
561 void setVertex(int idx, const vec3& v);
562
568 int createNewVertex(const vec3& position);
569
575 vec2 getVertexUV(int idx) const;
576
582 void setVertexUV(int idx, const vec2& v);
583
590
596 vec3 getVertexNormal(int idx) const ;
597
603 void setVertexNormal(int idx, const vec3& v);
604
609
614
620 int getFaceVertsCount(int face);
621
627 int getFaceUvVertsCount(int face);
628
635 int getFaceVertex(int faceIndex, int faceVertexIndex);
636
642 std::vector<int> getFaceVerts(int face);
643 void getFaceVerts(int face, list<int>& vertices);
644
650 void setFaceVerts(int face, const std::vector<int>& vertices);
651 void setFaceVerts(int face, const list<int>& vertices);
652
659 int getFaceUvVertex(int faceIndex, int faceVertexIndex);
660
667 void setFaceUvVertex(int faceIndex, int faceVertexIndex, int uvVertexIndex);
668
675 int getFaceNormalVertex(int faceIndex, int faceVertexIndex);
676
683 void setFaceNormalVertex(int faceIndex, int faceVertexIndex, int normalVertexIndex);
684
690 std::vector<int> getFaceUvVerts(int face);
691 void getFaceUvVerts(int face, list<int>& vertices);
692
698 int getFaceObject(int faceIndex);
699
705 void setFaceObject(int faceIndex, int objectIndex);
706
712 int getFaceMaterial(int faceIndex);
713
719 void setFaceMaterial(int faceIndex, int materialIndex);
720
726
732 std::string getObjectName(int idx);
733
739 void setObjectName(int idx, const std::string& name);
740
746 int addObject(const char* name);
747
752 void removeObject(int idx);
753
758 void unifyAllObjects(const std::string& name = "");
759
765
771 int addMaterial(const char* name);
772
777 void removeMaterial(int idx);
778
784 std::string getMaterialName(int idx);
785
791 void setMaterialName(int idx, const std::string& name);
792
799 std::string getMaterialTexture(int idx, int texture_layer);
800
807 void setMaterialTexture(int idx, int texture_layer, const std::string& texture_path);
808
815 void fromVolume(Volume& v, bool with_subtree = false, bool all_selected = false);
816
824 void fromReducedVolume(Volume& v, float reduction_percent, bool with_subtree = false, bool all_selected = false);
825
833 void fromVolumeWithMaxPolycount(Volume& v, int max_polycount, bool with_subtree = false, bool all_selected = false);
834
841 void toVolume(Volume& v, const mat4& transform = mat4::Identity, BoolOpType op = BOOL_MERGE);
842
848 void insertInVolume(Volume& v, const mat4& transform = mat4::Identity);
849
855 void addToVolume(Volume& v, const mat4& transform = mat4::Identity);
856
862 void subtractFromVolume(Volume& v, const mat4& transform = mat4::Identity);
863
869 void intersectWithVolume(Volume& v, const mat4& transform = mat4::Identity);
870
875
880
885 void reduceToPolycount(int destination_triangles_count);
886
891
897 void booleanOp(Mesh& With, BoolOpType op);
898
903 std::vector<vec3> getMeshVertices();
904
909 std::vector<vec3> getMeshNormals();
910
915 std::vector<vec2> getMeshUVs();
916
921 void setMeshVertices(const std::vector<vec3>& positions);
922
927 void setMeshNormals(const std::vector<vec3>& normals);
928
933 void setMeshUVs(const std::vector<vec2>& uvs);
934
942 void setMeshFaces(const std::vector<int>& faces);
943
948 void addMeshVertices(const std::vector<vec3>& positions);
949
954 void addMeshNormals(const std::vector<vec3>& normals);
955
960 void addMeshUVs(const std::vector<vec2>& uvs);
961
969 void addMeshFaces(const std::vector<int>& faces);
970
975
980
985
990
995 void removeFaces(const std::vector<int>& faces);
996
1001
1006
1011
1017 int addObject(const std::string& name);
1018
1024 int addMaterial(const std::string& name);
1025
1030
1035
1040
1046 void cutByPlane(const vec3& start, const vec3& NormalDirection);
1047
1056 void cutByDistortedPlane(const vec3& start, const vec3& NormalDirection, float noise_degree, float noise_scale, int seed = 0);
1057
1065 void distortByPerlinNoise(float noise_degree, float noise_scale, bool anisotropic = false, int seed = 0);
1066
1071 std::vector<Mesh> splitDisconnectedParts();
1072
1079 void symmetry(const vec3& start, const vec3& NormalDirection, bool resultInQuads);
1080
1085 std::vector<comms::cPlane> autodetectSymmetryPlanes();
1086
1091 void weld(float minimal_relative_distance = 0.0001f);
1092
1097 boundbox getBounds() const;
1098
1103 float getVolume() const;
1104
1111 float getOpenSurfaceVolume(const vec3& start, const vec3& dir) const;
1112
1117 float getSquare() const;
1118
1124 float getFaceSquare(int face);
1125
1131 float getFaceUVSquare(int face);
1132
1139
1146 void relax(float degree, bool tangent, float crease_angle = 180);
1147
1162 static Mesh box(const vec3& center = vec3::Zero, const vec3& size = vec3::One, const vec3& xAxis =vec3::Zero, const vec3& yAxis = vec3::Zero, const vec3& zAxis = vec3::Zero, float detail_size = 1, float fillet = 0.0f, int nx=0, int ny=0, int nz=0);
1163
1171 static Mesh sphere(const vec3& center = vec3::Zero, float radius = 1.0f, float detail_size = 1);
1172
1185 static Mesh cylinder(const vec3& center = vec3::Zero, float radius = 1, float height = 2, float detail_size = 1, int slices = 0, int caps = 0, int rings = 0, float fillet = 0);
1186
1196 static Mesh cone(const vec3& center = vec3::Zero, float radius = 1, float height = 2, float detail_size = 1, const vec3& topAxis = vec3::AxisY);
1197
1209 static Mesh plane(const vec3& center = vec3::Zero, float sizeX = 2, float sizeY = 2, int divisionsX = 2, int divisionsY = 2, const vec3& xAxis = vec3::AxisX, const vec3& yAxis = vec3::AxisY);
1210
1222 static Mesh hexagonal_plane(const vec3& center = vec3::Zero, float sizeX = 2, float sizeY = 2, int divisionsX = 2, int divisionsY = 2, const vec3& xAxis = vec3::AxisX, const vec3& yAxis = vec3::AxisY);
1223
1236 static Mesh text(const char* string, const char* font = "tahoma", float height = 10.0f, const vec3 & center = vec3::Zero, const vec3& text_direction = vec3::AxisX, const vec3& text_normal = vec3::AxisY, float thickness = 1, int align = 1);
1237
1248 void createVDM(int side, const char* path_to_exr, const vec3& center = vec3::Zero, float radius = 1, const vec3& up = vec3::AxisZ, const vec3& x = vec3::AxisX, const vec3& y = vec3::AxisY);
1249
1256 void shell(float thickness_out, float thickness_in, int divisions = 1);
1257
1264 std::vector<int> extrudeOpenEdges(float distance, vec3 direction = vec3::Zero);
1265
1271 std::vector<int> expandOpenEdges(float distance);
1272
1277 std::vector<int> getOpenEdges();
1278
1284 float getLengthAlongDirection(const vec3& dir) const;
1285
1291
1292
1293 protected:
1294 void setMesh(const comms::cMeshContainer& mesh) {
1295 if (MeshData) {
1296 MeshData->Clear();
1297 MeshData->Copy(mesh);
1298 }
1299 else {
1300 MeshData = new comms::cMeshContainer(mesh);
1301 inc_ref(MeshData);
1302 }
1303 }
1304 friend class prim;
1305 };
1306
1310 class APICALL Image : public comms::cImage {
1311 public:
1312 Image();
1313 Image(const Image& im);
1319 bool Read(const char* name);
1320
1326 bool Write(const char* name);
1327
1333 bool FromTexture(int texture_id);
1334
1340#ifdef PYBIND11_DEF
1353 int Paste(PY_BYTE_ARRAY src_data, int pasteLeft = 0, int pasteTop = 0, int cropLeft = 0, int cropTop = 0, int cropRight = 0, int cropBottom = 0, bool flipY = false);
1354
1359 size_t Pointer();
1360
1366 bool FromArray(PY_BYTE_ARRAY src_data);
1367 bool FromArray(PY_DWORD_ARRAY src_data);
1368 bool FromArray(PY_FLOAT_ARRAY src_data);
1369
1370 pybind11::buffer_info _py_buffer_info();
1371#endif
1372 };
1373
1374 class Volume;
1375
1376 class APICALL symm {
1377 public:
1383 static symm& enable(bool _enable = true);
1384
1385 static bool enabled();
1386
1391 static symm& disable();
1392
1400 static symm& xyz(bool x, bool y, bool z);
1401
1406 static bool is_xyz();
1407
1412 static bool& x();
1413
1418 static bool& y();
1419
1424 static bool& z();
1425
1433 static symm& axial(int n, bool extraMirror = false, bool stepSymmetry = false);
1434
1439 static bool is_axial();
1440
1445 static int& axialOrder();
1446
1451 static bool& extraMirror();
1452
1457 static bool& stepSymmetry();
1465 static symm& axialMirror(int n, bool extraMirror = false, bool stepSymmetry = false);
1466
1471 static bool isAxialMirror();
1472
1483 static symm& translation(int numX, float stepX, int numY, float stepY, int numZ, float stepZ);
1484
1489 static bool is_translation();
1490
1495 static int& numX();
1496
1501 static float& stepX();
1502
1507 static int& numY();
1508
1513 static float& stepY();
1514
1519 static int& numZ();
1520
1525 static float& stepZ();
1526
1532
1538
1543 static symm& toGeneral();
1544
1550 static symm& set_start(const vec3& pos);
1551
1556 static vec3& start();
1557
1563 static symm& set_end(const vec3& pos);
1564
1569 static vec3& end();
1570
1576 static symm& showSymmetryPlane(bool show = true);
1577
1583 static symm& setCustomSymetryTransforms(list<mat4>& symmetryTransforms);
1584#ifdef PYBIND11_DEF
1590 static symm& setCustomSymetryTransforms(pybind11::list& symmetryTransforms);
1591#endif
1592
1597 static bool isCustomSymmetry();
1598
1603 static symm& getCurrentTransforms(list<mat4>& symmetryTransforms);
1604
1609 static std::vector<mat4> getCurrentTransforms();
1610
1616
1621 static std::vector<comms::cPlane> getCurrentPlanes();
1622
1626 static void disableGlobally();
1627
1631 static void enableGlobally();
1632
1633
1634 };
1638 class APICALL SceneElement {
1639 protected:
1640 ItemsTree* el;
1641 VoxTreeBranch* tb() const;
1642 OneCurveObject* cu() const;
1643 friend class Scene;
1644 friend class Curve;
1645 friend class Volume;
1646 public:
1647 SceneElement();
1648 SceneElement(VolumeObject* vo);
1649 SceneElement(ItemsTree* c);
1650 SceneElement(const SceneElement& other);
1651
1652 ~SceneElement();
1653
1654 const bool operator==(const SceneElement& other) const;
1655 const bool operator!=(const SceneElement& other) const;
1656
1662
1667 int childCount() const;
1668
1674 SceneElement child(int index) const ;
1675
1680 bool isSculptObject() const;
1681
1686 bool isCurve() const;
1687
1693 const SceneElement& setTransform(const mat4& Transform) const ;
1694
1700 const SceneElement& transform(const mat4& Transform) const ;
1701
1706 const SceneElement& density(float density_value) const;
1707
1713 const SceneElement& transform_single(const mat4& Transform) const;
1714
1720
1725 const SceneElement& clear() const ;
1726
1731 const char* name() const;
1732
1737 const char* getLinkedPath(int id) const;
1738
1744
1749 void addLinkedPath(const char* path) const;
1750
1756 const SceneElement& rename(const char* name) const;
1757
1763 SceneElement addChild(const char* name) const;
1764
1770 SceneElement findInSubtree(const char* name) const;
1771
1777 bool iterateSubtree(const std::function<bool(SceneElement)>& fn) const;
1778#ifdef PYBIND11_DEF
1791 bool iterateSubtree(const pybind11::object& fn) const;
1792#endif
1793
1799 bool iterateVisibleSubtree(const std::function<bool(SceneElement)>& fn) const;
1800#ifdef PYBIND11_DEF
1813 bool iterateVisibleSubtree(const pybind11::object& fn) const;
1814#endif
1815
1821 void mergeSubtree(bool booleanMerge = false) const;
1822
1828 void mergeTo(const SceneElement& dest, BoolOpType op);
1829
1836
1840 void removeSubtree() const;
1841
1846 void removeSubtreeItem(int index) const;
1847
1851 void remove() const;
1852
1858
1864
1869 void changeParent(SceneElement newParent) const;
1870
1876 void moveTo(SceneElement newParent, int indexInParent) const;
1877
1883 bool isParentOf(SceneElement child) const;
1884
1889 bool& visible() const;
1890
1895 void setVisibility(bool visible) const;
1896
1901 bool ghost() const;
1902
1907 void setGhost(bool ghost) const;
1908
1914
1919 void setReferenceColor(const vec4& color);
1920
1923
1925 void select() const;
1926
1928 void selectOne() const;
1929
1931 void unselectAll() const;
1932
1934 bool selected();
1935
1938
1940 std::vector<SceneElement> collectSelected();
1941 };
1942
1944 public:
1945 VolumeCache();
1946 tri_DWORD CellID;
1947 VolumeCell* pCell;
1948 };
1949
1953 class APICALL Volume {
1954 protected:
1955 VoxTreeBranch* tb;
1956 VolumeObject* Obj;
1957 friend class SceneElement;
1958 public:
1959 Volume();
1960 Volume(VoxTreeBranch* tb);
1961 Volume(VolumeObject* vo);
1962 Volume(const Volume& vol);
1967 bool valid() const;
1968
1973 bool isSurface() const;
1974
1979 bool isVoxelized() const;
1980
1985
1989 void toVoxels();
1990
1995 static void enableVoxelsColoring(bool enable = true);
1996
2000 static void color(DWORD CL);
2001
2009 static void color(float r, float g, float b, float a);
2010
2017 static void color(float r, float g, float b);
2018
2024 static void color(const char* colorid);
2025
2030 static void gloss(float value);
2031
2036 static void roughness(float value);
2037
2042 static void metal(float value);
2043
2050 void mergeMesh(Mesh& mesh, const mat4& transform = mat4::Identity, BoolOpType op = BOOL_MERGE);
2051
2057 void insertMesh(Mesh& mesh, const mat4& transform = mat4::Identity);
2058
2064 void addMesh(Mesh& mesh, const mat4& transform = mat4::Identity);
2065
2071 void subtractMesh(Mesh& mesh, const mat4& transform = mat4::Identity);
2072
2078 void intersectWithMesh(Mesh& mesh, const mat4& transform = mat4::Identity);
2079
2086 void mergeMeshWithTexture(Mesh& mesh, const mat4& transform = mat4::Identity, BoolOpType op = BOOL_MERGE);
2087
2099 Volume& makeVoxelFigure(std::function<float(vec3)> densityFunction, const list<vec3>& growCenters, bool Subtract = false, bool useTempLocation = false, bool overHidden = false, bool useColor = false);
2100
2110 float getExactDencity(int x, int y, int z, bool fromBackup, VolumeCache& cache_ref);
2111
2118 float getInterpolatedValue(const vec3& pos, bool fromBackup);
2119
2125 void scanCells(const std::function<void(VolumeCell* vc)>& fn, bool multithreaded = false);
2126
2132 void scanCells(const std::function<void(VolumeCellAttrib* vc)>& fn, bool multithreaded = false);
2133
2139 void scanCells(const std::function<void(VolumeCellAttrib* vc, const tri_DWORD& T)>& fn, bool multithreaded = false);
2140
2146 void scanCells(const std::function<void(VolumeCell* vc, const tri_DWORD& T)>& fn, bool multithreaded = false);
2147
2153 void scanTriangles(const std::function<void(const MCVertex& v1, const MCVertex& v2, const MCVertex& v3)>& fn, bool multithreaded = false);
2154
2160 void scanTriangles(const std::function<void(const Vector3D& v1, const Vector3D& v2, const Vector3D& v3)>& fn, bool multithreaded = false);
2161
2167
2172 float getVolume();
2173
2178 float getSquare();
2179
2185
2191
2196 VoxTreeBranch* tree();
2197
2202 VolumeObject* vo();
2203
2213 VolumeCell* cell(int cx, int cy, int cz, bool create, bool backup);
2214
2224 VolumeCellAttrib* attributes(int cx, int cy, int cz, bool create, bool backup);
2225
2232 void dirty(int cx, int cy, int cz);
2233
2238 void setOpacity(float Opacity);
2239
2246 void relaxGpu(const vec3& center, float Radius, float degree);
2247
2252 void relaxVoxels(int count);
2253
2260 void relaxSurface(float degree, bool tangent = false, bool keep_sharp_boolean_edges = false);
2261
2266 void relaxOpenEdges(int nTimes);
2267
2273
2277 void clear();
2278
2283
2288 void assignShader(const char* shaderName);
2289
2290 void setBoolShaderProperty(const char* property, bool value);
2291 void setFloatShaderProperty(const char* property, float value);
2292 void setColorShaderProperty(const char* property, DWORD value);
2293
2299 void removeFacesByWeight(std::function<float(const vec3&)> weight);
2300
2305 void closeHoles(int maxSize);
2306
2312
2321 static void setMoldingParams(const vec3& direction, float tapering_angle = 0, float undercuts_density = 1.0f, float decimation_limit_millions = 10, bool perform_subtraction = true);
2322
2327
2332 void basRelief(const vec3& start_point = vec3::Zero);
2333
2338
2345 static void setMoldingBox(float width, float length, float thickness);
2346
2351 static void setMoldingBorder(float width = 0);
2352
2357
2362
2367
2372
2378
2384
2390
2396
2401
2406 void assignLiveBooleans(int operation);
2407
2412 };
2413
2414 inline coat::VolumeCache::VolumeCache() {
2415 pCell = nullptr;
2416 CellID.V1 = CellID.V2 = CellID.V3 = 100000;
2417 }
2418
2419 class APICALL settings {
2420 public:
2426 static bool valueExists(const char* ID);
2427
2433 static bool getBool(const char* ID);
2434
2440 static std::string getString(const char* ID);
2441
2447 static float getFloat(const char* ID);
2448
2454 static int getInt(const char* ID);
2455
2462 static bool setBool(const char* ID, bool value);
2463
2470 static bool setString(const char* ID, const char* value);
2471
2478 static bool setFloat(const char* ID, float value);
2479
2486 static bool setInt(const char* ID, int value);
2487
2491 static void saveSettings();
2492
2503 static void resetSettings(bool ResetGeneralSettings = true, bool ResetHiddenSet = true, bool ResetHotkeys = true, bool RestNavigation = true, bool ResetPresets = true, bool ResetTheme = true, bool ResetWindows = true);
2504
2509 static std::vector<std::string> listAllSettings();
2510
2515 static void pressButton(const char* button_name);
2516 };
2517
2521 class APICALL Scene {
2522 public:
2527 static void clearScene(bool askUser = false);
2533
2539
2545
2552 static int getLayer(const char* name, bool addIfNotExists = true);
2553
2559 static const char* getLayerName(int LayerID);
2560
2566 static void setLayerName(int LayerID, const char* name);
2567
2573 static int getLayerBlending(int LayerID);
2574
2580 static void setLayerBlending(int LayerID, int mode);
2581
2586 static int getCurrentLayer();
2587
2592 static void setCurrentLayer(int LayerID);
2593
2597 static void mergeVisibleLayers();
2598
2603 static void mergeLayerDown(int LayerID);
2604
2609 static void applyLayerBlending(int LayerID);
2610
2615 static void invalidateLayer(int LayerID);
2616
2621 static void setActiveLayer(int LayerID);
2622
2627 static void removeLayer(int LayerID);
2628
2634 static bool layerIsEmpty(int layerID);
2635
2639 static void removeEmptyLayers();
2640
2644 static bool layerVisible(int LayerID);
2645
2650 static void setLayerVisibility(int LayerID, bool Visible);
2651
2657 static void setLayerColorOpacity(int LayerID, float Opacity);
2658
2664 static void setLayerDepthOpacity(int LayerID, float Opacity);
2665
2671 static void setLayerMetalnessOpacity(int LayerID, float Opacity);
2672
2678 static void setLayerGlossOpacity(int LayerID, float Opacity);
2679
2685 static int assignLayerMask(int LayerID);
2686
2691 static void removeLayerMask(int LayerID);
2692
2697 static void extractMaskAsLayer(int LayerID);
2698
2704 static void setMaskForTheLayer(int LayerID, int MaskLayerID);
2705
2711 static void enableLayerMask(int LayerID, bool enable);
2712
2718 static bool isLayerMaskEnabled(int LayerID);
2719
2724 static void invertLayerMask(int LayerID);
2725
2731 static int getLayerMaskLayer(int LayerID);
2732
2737 static void disableLayerMask(int LayerID);
2738
2743 static void enableLayerMask(int LayerID);
2744
2750 static bool maskEnabled(int LayerID);
2751
2756 static void setClippingLayer(int LayerID);
2757
2762 static void disableClippingLayer(int LayerID);
2763
2764
2769 static int PaintObjectsCount();
2770
2776
2781 static int PaintUVSetsCount();
2782
2787 static void RemovePaintObject(int idx);
2788
2793 static void RemovePaintMaterial(int idx);
2794
2799 static void RemoveUVSet(int idx);
2800
2806 static const char* PaintObjectName(int idx);
2807
2813 static const char* PaintMaterialName(int idx);
2814
2820 static const char* PaintUVSetName(int idx);
2821
2827 static SceneElement importMesh(const char* filename, const mat4& transform = mat4::Identity);
2828
2833 static void ScaleSceneVisually(float scale);
2834
2839 static void ScaleSceneUnits(float scale);
2840
2845 static float GetSceneScale();
2846
2851 static const char* GetSceneUnits();
2852
2858 static bool setSceneUnits(const char* units);
2859
2865
2870 static void setSceneShift(const vec3& shift);
2871
2876 static std::vector<std::string> getAvailableUnits();
2877
2883 static bool convertSceneUnits(const char* destination_unit_name);
2884
2889 static void stackUndo(int nStack);
2890
2895 static void resetTexTransform(int type);
2896
2902 static void scaleTex(int type, float scale);
2903
2909 static void scaleTexNonUniform(int type, const vec2& scale);
2910
2916 static void rotateTex(int type, float angle);
2917
2923 static void moveTex(int type, const vec2& offset);
2924
2929 static void flipTexX(int type);
2930
2935 static void flipTexY(int type);
2936
2942 static void setTexTiled(int type, bool tiled);
2943
2949 static void setTexPivot(int type, const vec2& pivot);
2950
2956 };
2957
2958 class APICALL RenderRoom {
2959 public:
2963 static void toRenderRoom();
2964
2968 static void restartRendering();
2969
2975 static void setCustomRenderSize(int width, int height);
2976
2981 static void setRenderResult(const char* filename);
2982
2986 static void renderFrame();
2987
2992 static void enableRealtimeRendering(bool enable);
2993
2999
3004 static void setExposure(float exposure);
3005
3010 static float getExposure();
3011
3016 static void setEnvironmentLight(float envlight);
3017
3022 static float getEnvironmentLight();
3023
3028 static void setDOFDegree(float degree);
3029
3034 static float getDOFDegree();
3035
3040 static int getLightsCount();
3041
3046 static int addLight();
3047
3052 static void removeLight(int idx);
3053
3057 static void removeAllLights();
3058
3064 static void setLightDirection(int idx, const vec3& dir);
3065
3071 static vec3 getLightDirection(int idx);
3072
3078 static void setLightScattering(int idx, float scattering);
3079
3085 static float getLightScattering(int idx);
3086
3092 static void setLightColor(int idx, const vec3& color = vec3::One);
3093
3099 static vec3 getLightColor(int idx);
3100
3106 static void setLightIntensity(int idx, float intensity);
3107
3113 static float getLightIntensity(int idx);
3114
3119 static void setRaysPerFrame(int count);
3120
3125 static int getRaysPerFrame();
3126
3131 static void setAA(bool AA);
3132
3137 static bool getAA();
3138
3139 };
3140
3141 class APICALL Curve:public SceneElement {
3142 OneCurveObject* cu;
3143 bool allocated;
3144 friend class SceneElement;
3145 void validate();
3146 public:
3151 ~Curve();
3152
3157 Curve(OneCurveObject* ob);
3158
3164 Curve& operator = (SceneElement& el);
3165
3171
3177 OneSelPoint* point(int idx);
3178
3184 void removePoints(int index, int count);
3185
3190 OneCurveObject* curve();
3191
3197
3203 OneSelPoint* renderPoint(int idx);
3204
3210
3215 bool& closed();
3216
3223 void add(const Vector3D& p, const Vector3D& normal, float Radius);
3224
3231 void addSharp(const Vector3D& p, const Vector3D& normal, float Radius);
3232
3239 void addSmooth(const Vector3D& p, const Vector3D& normal, float Radius);
3240
3249 void addBothTangents(const Vector3D& p, const Vector3D& normal, const Vector3D& inTangent, const Vector3D& outTangent, float Radius);
3250
3258 void addWithTangent(const Vector3D& p, const Vector3D& normal, const Vector3D& inOutTangent, float Radius);
3259
3265 void tubeToMesh(Mesh& mesh, bool hemisphere);
3266
3272 std::tuple<vec3, vec3, vec3, vec3, float> getPoint(int idx);
3273
3279 void setPointPosition(int idx, const vec3& p);
3280
3286 void setPointNormal(int idx, const vec3& n);
3287
3294 void setPointTangents(int idx, const vec3& t1, const vec3& t2);
3295
3301 void setPointRadius(int idx, float r);
3302
3306 bool isOpen();
3307
3311 void setOpen();
3312
3317
3322
3327 void selectPoint(int idx);
3328
3337 void fill(Mesh& mesh, float thickness, float relax_count = 0, float details_level = 1, float extrusion = 0);
3338 };
3339
3344 class APICALL SphericalCollision {
3345 list<vec4> spheres;
3346 uni_hash<int, tri_int> cells;
3347 float unit;
3348 public:
3350
3355 SphericalCollision(float cellsize);
3356
3358
3363 void setUnit(float u);
3364
3368 void clear();
3369
3376 int addSphere(const vec3& p, float radius);
3377
3384 vec3 collides(const vec3& p, float radius);
3385
3391 vec4 sphere(int idx);
3392 };
3393
3397 class APICALL ui {
3398 public:
3409 static bool cmd(const char* id, std::function<void()> process_in_modal_dialog = 0);
3410#ifdef PYBIND11_DEF
3425 static bool cmd(const char* id, pybind11::object fn = pybind11::none());
3426#endif
3433 static bool wait(const char* id, float max_seconds);
3434
3440 static bool presentInUI(const char* id);
3441
3447 static void highlight(const char* id, float milliseconds);
3448
3454 static void enablePenChannel(int i, bool enabled);
3455
3461 static bool isEnabledPenChannel(int i);
3462
3469 static bool setSliderValue(const char* id, float value);
3470
3476 static float getSliderValue(const char* id);
3477
3484 static bool setEditBoxValue(const char* id, const char* value);
3485
3492 static bool setEditBoxValue(const char* id, int value);
3493
3500 static bool setEditBoxValue(const char* id, float value);
3501
3508 static bool getEditBoxValue(const char* id, str& result);
3509 static const char* getEditBoxValue(const char* id);
3510
3514 static void apply();
3515
3523 static void setFileForFileDialog(const char* filename);
3524
3530 static bool getBoolField(const char* id);
3531
3538 static bool setBoolValue(const char* id, bool value);
3539
3544 static const char* currentRoom();
3545
3551 static bool isInRoom(const char* name);
3552
3558 static void toRoom(const char* name, bool Force = false);
3559
3564 static int roomsCount();
3565
3571 static const char* roomName(int index);
3572
3578 static const char* roomID(int index);
3579
3584 static void toolParam(BaseClass* B);
3585
3590 static void removeToolParam(BaseClass* B = nullptr);
3591
3597 static const char* getOption(const char* id);
3598
3605 static bool setOption(const char* id, const char* value);
3606 static bool setOption(const char* id, bool value);
3607 static bool setOption(const char* id, float value);
3608
3613 static void hideDontShowAgainMessage(const char* id);
3614
3620 static void showInfoMessage(const char* infoID, int milliseconds);
3621
3630 static void insertInMenu(const char* Menu, const char* ID_in_menu, const char* script_path);
3631
3644 static void insertInToolset(const char* roomID, const char* section, const char* toolID, const char* script_path = "");
3645
3650 static void removeCommandFromMenu(const char* ID_in_menu);
3651
3657 static bool checkIfMenuItemInserted(const char* ID_in_menu);
3658
3659#ifdef PYBIND11_DEF
3668 static void addExtension(const char* roomID, const char* section, pybind11::object& obj);
3669#endif
3675 static bool checkIfExtensionPresent(const char* extension_ID);
3676
3682 static void addTranslation(const char* id, const char* text);
3683
3689 static const std::string getIdTranslation(const char* id);
3690
3695 static const std::string getCurrentLanguage();
3696
3701 static void switchToLanguage(const char* language);
3702
3707 static float scale();
3708
3715 static std::string inputString(const char* text, int min_length = 0);
3716
3717 static void nomodalInput(str* text, std::function<void()> on_change = nullptr, int dx = 0, int dy = 0);
3718
3719 static bool nomodalInputActive();
3720
3726 static int inputInt(int initial_value);
3727
3733 static float inputFloat(float initial_value);
3734 };
3735
3736 class APICALL Camera
3737 {
3738 public:
3743 static void rotateToGradually(const vec3& destination_dir);
3744
3750
3755 static vec3 getUp();
3756
3761 static vec3 getRight();
3762
3767 static bool isOrtho();
3768
3773 static void setOrtho(bool ortho);
3774
3779 static vec3 getPivot();
3780
3785 static void setPivot(const vec3& pivot);
3786
3792
3798 static vec3 getWorldToScreenSpace(const vec3& world_pos);
3799
3805 static vec3 getScreenToWorldSpace(const vec3& screen_pos);
3806
3815 static void setCamera(const vec3& position, const vec3& lookAt, float fovY, const vec3& up = vec3::Zero);
3816 };
3817
3821 class APICALL dialog {
3822#ifndef DOXYGEN_SHOULD_SKIP_THIS
3823 bool _modal;
3824 bool _topright;
3825 str _buttons;
3826 std::function<void()> _process;
3827 std::function<void(int)> _press;
3828 int _width;
3829 int _icon;
3830 bool _undoWorks;
3831 bool _dontshowagain;
3832 BaseClass* _bc;
3833 str _text;
3834 str _caption;
3835 bool _transparentbg;
3836 BaseWidget* _widget;
3837#endif //DOXYGEN_SHOULD_SKIP_THIS
3838 public:
3839 dialog();
3845 dialog& text(const char* id);
3846
3852 dialog& caption(const char* id);
3853
3859 dialog& width(int w);
3860
3866
3872
3878 dialog& buttons(const char* list);
3879
3885
3891
3897
3903
3909
3915
3921
3927
3933
3939
3945
3952#ifdef PYBIND11_DEF
3958 dialog& params(pybind11::object params);
3959
3965 dialog& process(pybind11::object callback);
3966#endif
3972 dialog& process(std::function<void()> process);
3973
3979 dialog& onPress(std::function<void(int)> press);
3980#ifdef PYBIND11_DEF
3991 dialog& onPress(pybind11::object press);
3992#endif
3993
3998 int show();
3999
4000 dialog& widget(BaseWidget* w);
4001 };
4002
4006 class APICALL resource {
4007 ItemsFolder* folder;
4008 public:
4015 resource(const char* id);
4016
4021 static std::vector<std::string> listAllResourcesTypes();
4022
4027 std::vector<std::string> listFolders();
4028
4033 std::string currentFolder();
4034
4040
4045 std::string rootPath();
4046
4051 std::vector<std::string> supportedExtensions();
4052
4057 void setCurrentFolder(const char* folder);
4058
4063 void createFolder(const char* folderName);
4064
4069 void removeFolder(const char* folderName);
4070
4075 std::vector<std::string> listCurrentFolderItems();
4076
4081 void addItem(const char* itemPath);
4082
4087 void removeItem(const char* itemName);
4088
4093 void selectItem(const char* itemName);
4094
4100 void moveItemToFolder(const char* itemName, const char* destFolderName);
4101
4106 std::string getCurrentItem();
4107 };
4108
4112 class APICALL io {
4113 public:
4118 static const char* installPath();
4119
4124 static const char* dataPath();
4125
4131 static const char* documents(const char* path);
4132
4139 static bool fileExists(const char* path);
4140
4146 static void copyFile(const char* src, const char* dest);
4147
4153 static void copyFolder(const char* src, const char* dest);
4154
4160 static void removeFile(const char* filename);
4161
4166 static void removeFolder(const char* folder);
4167
4174 static std::string toFullPathInDataFolder(const char* path);
4175 static void toFullPathInDataFolder(str* path);
4176
4183 static std::string toFullPathInInstallFolder(const char* path);
4184 static void toFullPathInInstallFolder(str* path);
4185
4191 static std::string convertToWritablePath(const char* path);
4192 static void convertToWritablePath(str* path);
4193
4200 static std::string convertToWritablePathIfFileExists(const char* path);
4201 static void convertToWritablePathIfFileExists(str* path);
4202
4208 static std::string getExtension(const char* filepath);
4209
4215 static std::string getFileName(const char* filepath);
4216
4222 static std::string getFilePath(const char* filepath);
4223
4229 static std::string getFileNameWithoutExtension(const char* filepath);
4230
4237 static std::string strFromFile(const char* filename);
4238
4244 static void strToFile(const char* text, const char* filename);
4245
4251 static size_t getFileSize(const char* filename);
4252
4257 static vec2 cursorPos();
4258
4264
4270
4275 static rect workArea();
4276
4283 static void progressBar(float stage, float max_stage, const char* message);
4284
4291 static void progressBarInWindowHeader(float stage, float max_stage, const char* message);
4292
4298 static void setWindowTitle(const char* text, float seconds);
4299
4304 static void step(int count = 1);
4305
4311 static void exec(const char* command, const char* arguments = nullptr);
4312
4319 static const char* execAndWait(const char* command, const char* arguments = nullptr);
4320
4321
4326 static void updateCoatPyi(const char* folderOrFile);
4327
4335 static void ListFiles(const char* folder, const char* mask, coat::list<coat::str>& result, bool recursive = true);
4336
4344 static std::vector<std::string> ListFiles(const char* folder, const char* mask, bool recursive = true);
4345
4351 static void ListFolders(const char* startFolder, coat::list<coat::str>& result);
4352
4358 static std::vector<std::string> ListFolders(const char* startFolder);
4359
4364 static const char* supportedImagesFormats();
4365
4370 static const char* supportedMeshesFormats();
4371
4378 static bool openFileDialog(const char* extensions, str& fileName);
4379 static std::string openFileDialog(const char* extensions);
4380
4387 static bool openFilesDialog(const char* extensions, list<str>& fileNames);
4388
4394 static std::vector<std::string> openFilesDialog(const char* extensions);
4395
4402 static bool saveFileDialog(const char* extensions, str& fileName);
4403 static std::string saveFileDialog(const char* extensions);
4404
4408 static const char* currentSceneFilepath();
4409
4414 static void pipInstall(const char* requirements);
4415 static void pipUninstall(const char* requirements);
4416
4421 static std::string pythonPath();
4422
4426 static void showPythonConsole();
4427
4432 static void executeScript(const char* path);
4433
4434
4439 static void installRequirements(const char* path_to_requirements_txt);
4440#ifdef PYBIND11_DEF
4447 static std::string toJson(const pybind11::object& obj, const char* filename = "");
4448
4454 static void fromJsonFile(pybind11::object& obj, const char* filename);
4455
4461 static void restoreObjectFormJsonString(pybind11::object& obj, const char* data);
4462#endif
4463
4471 static void createRedistributablePackageFromFolder(const char* folder, const char* package_name, const char* excluded_folders_names = "", const char* excluded_extensions = "");
4472
4478 static void download(const char* url, std::function<void(const char*, const char*)> report_success);
4479
4485
4494 static void post_request(const char* url, const char* data, const char* headers, const std::function<void(const char*)>& report_success = nullptr, const std::function<void(const char*)>& report_error = nullptr);
4495
4503 static void get_request(const char* url, const char* headers, const std::function<void(const char*)>& report_success = nullptr, const std::function<void(const char*)>& report_error = nullptr);
4504
4509 static std::vector<std::string> listBlenderInstallFolders();
4510
4519 static void saveScreenshot(const char* filename, int x = 0, int y = 0, int width = 0, int height = 0);
4520
4521 static void removeBackground(const char* image1, const char* image2, const char* result);
4522 };
4523
4524 class APICALL utils {
4525 public:
4531 static vec4 dwordToVec4(unsigned int d);
4532
4538 static unsigned vec4ToDword(const vec4& v);
4539
4544 static void randomize(int seed);
4545
4550 static float random01();
4551
4558 static float random(float min, float max);
4559
4565
4572 static vec3 perlin3d(vec3 p, float seed = 0);
4573
4580 static float perlin(vec3 p, float seed = 0);
4581
4588 static const char* getEnumValueByIndex(const char* enumID, int index);
4589
4596 static int getEnumValue(const char* enumID, const char* key);
4597
4604 static int getEnumValueIndex(const char* enumID, const char* key);
4605
4611 static int getEnumValuesCount(const char* enumID);
4612
4617 static void clearEnum(const char* enumID);
4618
4625 static void addEnumValue(const char* enumID, const char* key, int value = - 1);
4626
4630 static void quit();
4631
4635 static void testSuccessful();
4636
4641 static void testFailed(const char* message);
4642
4647 static void signal(const char* message);
4648
4653 static std::vector<std::string>& last_signals();
4654
4659 static float getFPS();
4660
4665 static float getFrameTimeMs();
4666
4671 static bool inRenderProcess();
4672
4678 static void set(const char* key, const char* value);
4679
4685 static const char* get(const char* key);
4686 };
4687
4691 class APICALL uv {
4692 public:
4697 static int uvSetsCount();
4698
4703 static void setUnwrapIslandsDistance(float distance);
4704
4710
4715 static int currentUvSet();
4716
4722 static int islandsCount(int uv_set);
4723
4730 static Mesh islandToMesh(int uv_set, int island_index);
4731
4738 static Mesh islandToMeshInSpace(int uv_set, int island_index);
4739
4746 static std::vector<int> getIslandVertexMapping(int uv_set, int island_index);
4747
4754 static std::vector<int> getIslandBorder(int uv_set, int island_index);
4755
4764 static std::vector<int> getBorderBetweenIslands(int uv_set1, int island_index1, int uv_set2, int island_index2);
4765
4773 static vec2 getIslandVertexUv(int uv_set, int island_index, int vertex_index);
4774
4783 static Mesh flattenSingleIsland(const Mesh& mesh, int method, bool optimize_rotation = true, bool scale_to_geometry = true);
4784
4791 static void meshToIsland(const Mesh& mesh, int uv_set, int island_index);
4792
4799 static void pack(int uv_set, bool rotate, bool shuffle);
4800
4805 static void unwrap(int uv_set);
4806
4812 static void toAbf(int uv_set, int island_index);
4813
4819 static void toLscm(int uv_set, int island_index);
4820
4826 static void toGu(int uv_set, int island_index);
4827
4833 static void toPlanar(int uv_set, int island_index);
4834
4840 static void toStripe(int uv_set, int island_index);
4841
4848 static void toUvSet(int uv_set, int island_index, int destination_uv_set);
4849
4855
4861
4866 static std::vector<int> getSeams();
4867
4873 static void addSeam(DWORDS2 start_vertex_index, int end_vertex_index);
4874
4880 static void removeSeam(int start_vertex_index, int end_vertex_index);
4881
4886 static std::vector<int> getSharpEdges();
4887
4893 static void addSharpEdge(int start_vertex_index, int end_vertex_index);
4894
4900 static void removeSharpEdge(int start_vertex_index, int end_vertex_index);
4901
4905 static void unwrapUnassigned();
4906
4910 static void applyUVSet();
4911 };
4912
4913
4918 {
4919 Uniform_Scaling = 0,
4920 Axial_Normal = 1,
4921 Axial_X = 2,
4922 Axial_Y = 3,
4923 Axial_Z = 4,
4924 Radial_Normal = 5,
4925 Radial_X = 6,
4926 Radial_Y = 7,
4927 Radial_Z = 8
4928 };
4934 class APICALL Model {
4935 protected:
4936 friend class Mesh;
4937 ClusteredMesh* _mesh;
4938 bool _from_retopo;
4939 bool _from_uv;
4940 ClusteredMesh& _mctx();
4941 ClusteredMesh* _pmctx() const;
4942 static void inc_ref(ClusteredMesh* m);
4943 static void dec_ref(ClusteredMesh* m);
4944 static bool has_ref(ClusteredMesh* m);
4945 static ClusteredMesh* allocate();
4946 static ClusteredMesh* allocate(ClusteredMesh* src);
4947 static std::vector<std::pair<ClusteredMesh*, int>> allocated_meshes;
4948 public:
4953
4958 Model(const Model& source);
4959
4964 Model(const Mesh& source);
4965
4971 Model & operator=(const Model& source);
4972
4973 Model & operator=(const Mesh& source);
4974
4975 Model & operator += (const Model& source);
4976
4977 Model & operator += (const Mesh& source);
4978
4985
4990
4995
5001
5007
5012 static Model fromUv();
5013
5022 void displayOptions(bool showWireframe = true, bool showColored = true, bool showSeams = true, bool showSharpEdges = true, bool smoothView = false);
5023
5029
5035
5040 void setCurrentObject(int index);
5041
5047 const char* getObjectName(int group_index);
5048
5052 void removeObject(int group_index);
5053
5059 void setObjectName(int index, const char* name);
5060
5066 void setObjectVisibility(int index, bool visible);
5067
5073 bool getObjectVisibility(int index);
5074
5080 int addObject(const char* name);
5081
5087 int addMaterial(const char* name);
5088
5093
5100
5106 void setObjectReferenceColor(int group_index, vec4 color);
5107
5112 void selectedToObject(int group_index);
5113
5119
5125
5131
5140 void addTransformed(const Mesh& mesh, const mat4& Transform = mat4::Identity, BoolOpType b = BOOL_MERGE, bool select = false, bool snap_to_existing = false);
5141
5147 Mesh getObjectMesh(int group_index);
5148
5155 void setObjectMesh(int group_index, Mesh& mesh, const mat4& transform = mat4::Identity);
5156
5165 int duplicateObject(int group_index, const char* name = nullptr, const mat4& transform = mat4::Identity, bool select = false);
5166
5172 std::string generateName(const char* base);
5173
5178 void clearObjectMesh(int group_index);
5179
5183 void clear();
5184
5188 void dropUndo();
5189
5194 std::vector<int> getSelectedFaces();
5195 void getSelectedFaces(list<int>& faces);
5196
5201 void setSelectedFaces(std::vector<int>& faces);
5202 void setSelectedFaces(list<int>& faces);
5203
5208 void selectFace(int face);
5209
5214 void selectObject(int group_index, bool add_to_selected = true);
5215
5221 std::vector<int> getObjectFaces(int group_index);
5222 void getObjectFaces(int group_index, list<int>& faces);
5223
5229 bool isFaceSelected(int face);
5230
5235
5240
5245
5250
5255
5260
5265 std::vector<int> getSelectedEdges();
5266 void getSelectedEdges(list<int>& edges);
5267
5272 void setSelectedEdges(std::vector<int>& edges);
5273 void setSelectedEdges(list<int>& edges);
5274
5280 void selectEdge(int vertex1, int vertex2);
5281
5288 bool isEdgeSelected(int vertex1, int vertex2);
5289
5294
5299 std::vector<int> getSelectedVertices();
5300 void getSelectedVertices(list<int>& vertices);
5301
5306 std::vector<float> getSelectedVerticesWeights();
5307
5313 void setSelectedVertices(const std::vector<int>& vertices, const std::vector<float>& weights);
5314 void setSelectedVertices(const list<int>& vertices, const list<float>& weights);
5315
5321 void selectVertex(int vertex, float weight = 1.0f);
5322
5328 bool isVertexSelected(int vertex);
5329
5334
5340
5346
5352
5357 void removeFace(int face);
5358
5365 int createNewFace(int Group, int UVSet);
5366
5372 int getFaceVertsCount(int face);
5373
5380 int getFaceVertex(int face, int vertex_index);
5381
5387 std::vector<int> getFaceVerts(int face);
5388 void getFaceVerts(int face, list<int>& vertices);
5389
5395 void setFaceVerts(int face, const std::vector<int>& vertices);
5396 void setFaceVerts(int face, const list<int>& vertices);
5397
5403 bool getFaceVisibility(int face);
5404
5410 void setFaceVisibility(int face, bool visibility);
5411
5417 float getFaceSquare(int face);
5418
5424 float getFaceUVSquare(int face);
5425
5432
5438 int getFaceObject(int face);
5439
5445 void setFaceObject(int face, int group);
5446
5452 int getFaceMaterial(int face);
5453
5459 void setFaceMaterial(int face, int uv_set);
5460
5466 int getFaceUvVertsCount(int face);
5467
5474 int getFaceUvVertex(int face, int vertex_index);
5475
5481 std::vector<int> getFaceUvVerts(int face);
5482 void getFaceUvVerts(int face, list<int>& vertices);
5483
5489 void setFaceUvVerts(int face, const std::vector<int>& vertices);
5490 void setFaceUvVerts(int face, const list<int>& vertices);
5491
5497 vec3 getVertex(int vertex);
5498
5504 void setVertex(int vertex, const vec3& position);
5505
5511 int createNewVertex(const vec3& position);
5512
5518 vec2 getVertexUV(int uv_vertex);
5519
5525 void setVertexUV(int uv_vertex, const vec2& uv);
5526
5533
5540
5545 void updateNormals(bool for_snapping = true);
5546
5551
5555 void cleanup();
5556
5562 std::vector<int> getVertsNearVertex(int vertex);
5563 void getVertsNearVertex(int vertex, list<int>& vertices);
5564
5570 std::vector<int> getFacesNearVertex(int vertex);
5571 void getFacesNearVertex(int vertex, list<int>& faces);
5572
5578 std::vector<int> getFaceNeighbors(int face);
5579 void getFaceNeighbors(int face, list<int>& faces);
5580
5587 std::vector<int> getFacesNearEdge(int vertex1, int vertex2);
5588 void getFacesNearEdge(int vertex1, int vertex2, list<int>& faces);
5589
5596 bool isOpenEdge(int vertex1, int vertex2);
5597
5604 bool isSharpEdge(int vertex1, int vertex2);
5605
5612 void setEdgeSharpness(int vertex1, int vertex2, bool sharp);
5613
5620 bool isSeam(int vertex1, int vertex2);
5621
5628 void setEdgeSeam(int vertex1, int vertex2, bool seam);
5629
5635 void collapseEdge(int vertex1, int vertex2);
5636
5642 int islandsCount(int uv_set);
5643
5650 Mesh islandToMesh(int uv_set, int island_index);
5651
5658 Mesh islandToMeshInSpace(int uv_set, int island_index);
5659
5666 std::vector<int> getIslandVertexMapping(int uv_set, int island_index);
5667
5674 std::vector<int> getIslandBorder(int uv_set, int island_index);
5675
5684 std::vector<int> getBorderBetweenIslands(int uv_set1, int island_index1, int uv_set2, int island_index2);
5685
5693 vec2 getIslandVertexUv(int uv_set, int island_index, int vertex_index);
5694
5703 static Mesh flattenSingleIsland(const Mesh& mesh, int method, bool optimize_rotation = true, bool scale_to_geometry = true);
5704
5711 void meshToIsland(const Mesh& mesh, int uv_set, int island_index);
5712
5719 void pack(int uv_set, bool rotate, bool shuffle);
5720
5725 void unwrap(int uv_set);
5726
5732 void toAbf(int uv_set, int island_index);
5733
5739 void toLscm(int uv_set, int island_index);
5740
5746 void toGu(int uv_set, int island_index);
5747
5753 void toPlanar(int uv_set, int island_index);
5754
5760 void toStripe(int uv_set, int island_index);
5761
5766
5771 void moveSelectedFacesAlongFacesNormals(float displacement);
5772
5777 void moveSelectedFacesAlongVertexNormals(float displacement);
5778
5783 void subdivideSelectedFaces(bool apply_catmull_clark = false);
5784
5789 void subdivide(bool apply_catmull_clark = true);
5790
5796 void transformSelected(const mat4& transform, bool apply_symmetry);
5797
5802 void scaleSelectedFacesClusters(float scale, ClusterScale method = Uniform_Scaling);
5803
5809
5815 void bevelOverSelectedEdges(float size, int segments = 1, bool OldVariant = false);
5816
5824 int splitEdge(int vertex1, int vertex2, float position);
5825
5832 bool connect(int vertex1, int vertex2);
5833
5840 bool checkConnectivity(int vertex1, int vertex2);
5841
5846
5851
5855 void inset(float distance);
5856
5861 void shell();
5862
5867 void intrude();
5868
5873
5879 void selectPath(int vertex1, int vertex2);
5880
5886 std::vector<int> getPath(int vertex1, int vertex2);
5887
5888 };
5889 class APICALL logger {
5890 FILE* out;
5891 void* tempTimer;
5892 str filename;
5893 str _accum;
5894 int precission;
5895 void append(const char*);
5896 void close();
5897
5898 public:
5904
5909 logger(const char* filename);
5910
5911
5912 ~logger();
5916 void open();
5917
5922
5928 logger& directTo(const char* filename);
5929
5935
5940 logger& operator << (const char*);
5941
5946 logger& operator << (str&);
5947
5952 logger& operator << (const wchar_t*);
5953
5958 logger& operator << (int);
5959
5964 logger& operator << (float);
5965
5970 logger& operator << (double);
5971
5976 logger& operator << (const vec2&);
5977
5982 logger& operator << (const vec3&);
5983
5988 logger& operator << (const vec4&);
5989
5994 logger& operator << (BaseClass*);
5995
6002 logger& format(const char* format, ...);
6003
6009
6015
6021
6027
6033
6038 logger& floatPrecission(int signs = 2);
6039 };
6040}
6041
6042
6043#include "CorePrimAPI.h"
6044#pragma pack(pop)
6045
6046#ifdef COMMS_OPENGL
6047#include <ui.h>
6048#include <ui_definition.h>
6049#define EXPORT(x) \
6050 static int Main();\
6051 __defineui(xxx) {\
6052 ui_element(#x, Main);\
6053 } static
6054#define EXPORT_COMMAND(x) \
6055 static void x();\
6056 __defineui(x) {\
6057 ui_element(#x, x);\
6058 } static void x()
6059#define EXPORT_EXTENSION(x) __defineui(___##x)
6060void executeCoreScript(const char* filename, bool build, bool clean);
6061#endif //COMMS_OPENGL
Use this class for build a class for UI or serialization. see class_reg.h for details about the class...
Definition BaseClass.h:91
Definition CoreAPI.h:3737
static vec3 getWorldToScreenSpace(const vec3 &world_pos)
convert the world position to the screen position
static vec3 getScreenToWorldSpace(const vec3 &screen_pos)
convert the screen position to the world position
static void rotateToGradually(const vec3 &destination_dir)
align the camera along the view
static vec3 getPivot()
get the camera pivot position
static bool isOrtho()
return true if the camera is in the ortho mode
static void setPivot(const vec3 &pivot)
set the camera pivot position
static vec3 getForward()
get the forward direction
static vec3 getRight()
get the camera right direction
static void setOrtho(bool ortho)
switch the camera to the ortho or perspective mode
static vec3 getUp()
get the camera up direction
static void setCamera(const vec3 &position, const vec3 &lookAt, float fovY, const vec3 &up=vec3::Zero)
static vec3 getPosition()
get the camera position
Definition CoreAPI.h:3141
void setPointTangents(int idx, const vec3 &t1, const vec3 &t2)
set the point tangents
void add(const Vector3D &p, const Vector3D &normal, float Radius)
add the point to the curve without the direct options the tangents
int pointsCount()
get the base points cout in the curve
void unselectPoints()
unselect all curve points
void removePoints(int index, int count)
remove the points out of the curve base points list
OneCurveObject * curve()
get the low-level ObjeCurveObject pointer
void setClosed()
set the curve to be closed
void setOpen()
set the curve to be open
void addWithTangent(const Vector3D &p, const Vector3D &normal, const Vector3D &inOutTangent, float Radius)
add the point with the opposite tangents
Curve(OneCurveObject *ob)
create Curve based on low-level object OneCurveObject
void setPointNormal(int idx, const vec3 &n)
set the point normal
void addSmooth(const Vector3D &p, const Vector3D &normal, float Radius)
add the smooth B-spline-like point to the curve
bool isOpen()
check if the curve is open
void setPointRadius(int idx, float r)
set the point radius
void addSharp(const Vector3D &p, const Vector3D &normal, float Radius)
add the sharp point to the curve
OneSelPoint * point(int idx)
get the base point pointer
bool & closed()
returns the reference to the closed state of the curve to get or set the value
Curve()
the default constructor, creates the curve without insertion into the scene, it is good for the tempo...
void setPointPosition(int idx, const vec3 &p)
set the point position
Curve(SceneElement &el)
create the curve object based on the SceneElement, it is valid only is scene element is curve
int renderPointsCount()
returns the visual points count. Visual points used to render the curve in the viewport as set of str...
void updatePoints()
update the visual points if need. Use this function if you cahnge the curve. Change the multiple para...
void tubeToMesh(Mesh &mesh, bool hemisphere)
create the solid tube around the curve using the points radius
void addBothTangents(const Vector3D &p, const Vector3D &normal, const Vector3D &inTangent, const Vector3D &outTangent, float Radius)
add the point with two independent tangents.
void fill(Mesh &mesh, float thickness, float relax_count=0, float details_level=1, float extrusion=0)
Create the curved surface around the curve.
void selectPoint(int idx)
select the curve point
std::tuple< vec3, vec3, vec3, vec3, float > getPoint(int idx)
get the point of the curve
OneSelPoint * renderPoint(int idx)
returns the visual point reference
The image references. Look the cImage for the list of allowed operations.
Definition CoreAPI.h:1310
int ToTexture()
Create texture from image.
bool Read(const char *name)
Read the image from the file.
bool Write(const char *name)
Write the image to file.
bool FromArray(PY_BYTE_ARRAY src_data)
Get image from texture.
bool FromTexture(int texture_id)
Get image from texture.
int Paste(PY_BYTE_ARRAY src_data, int pasteLeft=0, int pasteTop=0, int cropLeft=0, int cropTop=0, int cropRight=0, int cropBottom=0, bool flipY=false)
paste image to image
size_t Pointer()
Pointer to the data.
The mesh reference.
Definition CoreAPI.h:418
void subtractFromVolume(Volume &v, const mat4 &transform=mat4::Identity)
boolean subtraction of the mesh from the volume
std::vector< vec2 > getMeshUVs()
get the list of all UV vertices of the mesh
int facesCount()
returns the faces amount
std::vector< vec3 > getMeshVertices()
get the list of all positional vertices of the mesh
void setMaterialTexture(int idx, int texture_layer, const std::string &texture_path)
set the texture layer filename of the material
void shell(float thickness_out, float thickness_in, int divisions=1)
add some thickness to the mesh (intrude a bit)
float getOpenSurfaceVolume(const vec3 &start, const vec3 &dir) const
calculate the volume even if the mesh is not closed, in this case we define plane that limits the int...
void addMeshUVs(const std::vector< vec2 > &uvs)
add the list of all UV vertices for the mesh
void reduceToPolycount(int destination_triangles_count)
reduce the mesh to the given polycount, mesh will be triangulated
void removeObject(int idx)
remove object from the mesh
void distortByPerlinNoise(float noise_degree, float noise_scale, bool anisotropic=false, int seed=0)
distort the mesh by the Perlin noise
void setMeshFaces(const std::vector< int > &faces)
set the complete list of faces for the mesh
std::string getMaterialName(int idx)
get the name of the material
static Mesh cone(const vec3 &center=vec3::Zero, float radius=1, float height=2, float detail_size=1, const vec3 &topAxis=vec3::AxisY)
create the cone mesh
void fromVolume(Volume &v, bool with_subtree=false, bool all_selected=false)
extract the mesh from the volume
void rotateToYZAxis(const vec3 &axisY, const vec3 &axisZ)
rotate the mesh so that Y axis will be aligned with axisY, Z axis will be aligned with axisZ
std::vector< int > getOpenEdges()
get the list of open edges
void addToVolume(Volume &v, const mat4 &transform=mat4::Identity)
boolean add to volume
vec3 getCenterMass() const
calculate the center mass of the mesh
vec3 getFaceNormal(int face)
get the face normal
void weld(float minimal_relative_distance=0.0001f)
weld the mesh, remove all vertices that are closer than minimal_relative_distance*mesh_bound_box_diag...
std::string getMaterialTexture(int idx, int texture_layer)
get the texture name of the material
void clearVerts()
clear all positional vertices of the mesh
void rotateToXYAxis(const vec3 &axisX, const vec3 &axisY)
rotate the mesh so that X axis will be aligned with axisX, Y axis will be aligned with axisY
int createNewVertex(const vec3 &position)
create the positional vertex
void setMaterialName(int idx, const std::string &name)
set material name
int getFaceVertex(int faceIndex, int faceVertexIndex)
get the positional vertex index over the face
void addMeshNormals(const std::vector< vec3 > &normals)
add the list of all normal vertices for the mesh
void clearUvVerts()
clear all uv vertices of the mesh
std::vector< int > getFaceVerts(int face)
get the list of UV vertex indices over the face, pay attention UV vertices are not same as position v...
void clearFaces()
clear all faces of the mesh
void removeMaterial(int idx)
remove the material (and corresponding faces) from the mesh
vec3 getVertex(int idx) const
get the vertex coordinate
static Mesh cylinder(const vec3 &center=vec3::Zero, float radius=1, float height=2, float detail_size=1, int slices=0, int caps=0, int rings=0, float fillet=0)
create the cylinder mesh
static Mesh plane(const vec3 &center=vec3::Zero, float sizeX=2, float sizeY=2, int divisionsX=2, int divisionsY=2, const vec3 &xAxis=vec3::AxisX, const vec3 &yAxis=vec3::AxisY)
create the single-side plane mesh, the faces normals are put toward the vec3.Cross(xAxis,...
int vertsCount() const
returns the amount of verts in the mesh
void addTransformed(const Mesh &m, const mat4 &t)
concatenate the transformed mesh with the current one
void calcNormals()
re-calculate normals over the mesh
void toVolume(Volume &v, const mat4 &transform=mat4::Identity, BoolOpType op=BOOL_MERGE)
merge this mesh to the volume object
void intersectWithVolume(Volume &v, const mat4 &transform=mat4::Identity)
boolean intersection of the mesh with the volume
void fromReducedVolume(Volume &v, float reduction_percent, bool with_subtree=false, bool all_selected=false)
extract the mesh from the volume and reduce it by the given percent
void setVertexNormal(int idx, const vec3 &v)
set the normal of the vertex, pay attention position verts and normal verts are different,...
void fromVolumeWithMaxPolycount(Volume &v, int max_polycount, bool with_subtree=false, bool all_selected=false)
extract the mesh from the volume and reduce to the given polycount
vec2 getVertexUV(int idx) const
get the UV coordinate of the vertex, pay attention position verts and UV verts are different,...
int getFaceVertsCount(int face)
get the amount of vertices over the face
float getVolume() const
get the volume of the mesh
void addMeshVertices(const std::vector< vec3 > &positions)
add the list of all positional vertices for the mesh
int getFaceNormalVertex(int faceIndex, int faceVertexIndex)
get the normal vertex index over the face
std::vector< comms::cPlane > autodetectSymmetryPlanes()
Detect the symmetry planes of the mesh.
void transform(const mat4 &transform)
transform the mesh
void boolean(const Mesh &m, BoolOpType op)
boolean operation
void calcNormalsIgnoreSharpEdges()
re-calculate normals over the mesh, ignore the sharp edges
void clearObject()
clear all objects
void setFaceMaterial(int faceIndex, int materialIndex)
set the material index over the face, see the getMaterialsCount(), getMaterialName()
int addObject(const char *name)
add new object to the mesh
float getFaceSquare(int face)
get the squareof the face
void addMeshFaces(const std::vector< int > &faces)
add the list of faces for the mesh, pay attention, all vertex indices are global over the whole mesh!
void setFaceObject(int faceIndex, int objectIndex)
set the object index for the face, see the getObjectsCount(), getObjectName()
int getFaceUvVertsCount(int face)
get the amount of UV vertices over the face
void rotateToZXAxis(const vec3 &axisZ, const vec3 &axisX)
rotate the mesh so that Z axis will be aligned with axisZ, X axis will be aligned with axisX
void removeUnusedFaces()
remove all faces that contain zero vertices
int getFaceObject(int faceIndex)
get the object index over the face, see the getObjectsCount(), getObjectName()
int getMaterialsCount()
get the materials count in the mesh
void fromRetopo()
take the whole mesh from the retopo room
void setVertexUV(int idx, const vec2 &v)
set the UV coordinate of the vertex, pay attention position verts and UV verts are different,...
void insertInVolume(Volume &v, const mat4 &transform=mat4::Identity)
insert without boolean operation, if the volume is not in surface mode (volumetric) the boolean ADD w...
float getLengthAlongDirection(const vec3 &dir) const
get the mesh size along some axis
bool valid() const
Check if mesh is valid.
void clearMaterials()
clear all materials
int getObjectsCount()
returns the objects count in the mesh
int createNewUvVertex(const vec2 &uv)
create new UV vertex to be used for faces
void booleanOp(Mesh &With, BoolOpType op)
Perform the boolean operation with the given mesh.
void fromPaintRoom()
get the mesh from the paint room
void setFaceNormalVertex(int faceIndex, int faceVertexIndex, int normalVertexIndex)
set the normal vertex index over the face
void setMeshNormals(const std::vector< vec3 > &normals)
set the list of all normal vertices for the mesh
boundbox getBounds() const
get the mesh bound box
int addMaterial(const char *name)
add new material to the mesh
void relax(float degree, bool tangent, float crease_angle=180)
relax the mesh, keep the vertices count
void setFaceVerts(int face, const std::vector< int > &vertices)
set the list of positional vertex indices over the face
std::string getObjectName(int idx)
get the name of the object
void unifyAllObjects(const std::string &name="")
unify all objects in the mesh, i.e. make one object
void removeUnusedVerts()
remove all unused vertices
void setObjectName(int idx, const std::string &name)
set object name
vec3 getVertexNormal(int idx) const
get the normal of the vertex, pay attention position verts and normal verts are different,...
int getFaceUvVertex(int faceIndex, int faceVertexIndex)
get the UV vertex index over the face
bool Read(const char *name)
Load the mesh from the file.
void cutByDistortedPlane(const vec3 &start, const vec3 &NormalDirection, float noise_degree, float noise_scale, int seed=0)
Cut off the mesh by the distorted plane (using the Perlin noise), the result is stored in the current...
void clearNormals()
clear all normal vertices of the mesh
static Mesh hexagonal_plane(const vec3 &center=vec3::Zero, float sizeX=2, float sizeY=2, int divisionsX=2, int divisionsY=2, const vec3 &xAxis=vec3::AxisX, const vec3 &yAxis=vec3::AxisY)
create the single-side triangular plane mesh that consists mostly of quasi equally-sided triangles
static Mesh text(const char *string, const char *font="tahoma", float height=10.0f, const vec3 &center=vec3::Zero, const vec3 &text_direction=vec3::AxisX, const vec3 &text_normal=vec3::AxisY, float thickness=1, int align=1)
Create the text mesh.
int vertsNormalCount() const
returns the amount of normal - verts in the mesh
float getFaceUVSquare(int face)
get the face square in UV space
void setVertex(int idx, const vec3 &v)
set the vertex coordinate
void removeFaces(const std::vector< int > &faces)
remove the set of vertices from the mesh
void setMeshVertices(const std::vector< vec3 > &positions)
set the list of all positional vertices for the mesh
void setFaceUvVertex(int faceIndex, int faceVertexIndex, int uvVertexIndex)
set the UV vertex index over the face
float getSquare() const
get square of the mesh
int addObject(const std::string &name)
add the named object
void triangulate()
triangulate the mesh
void cutByPlane(const vec3 &start, const vec3 &NormalDirection)
Cut off the mesh by the plane, the result is stored in the current mesh, the part of the mesh that is...
void clear()
clear the mesh
std::vector< int > expandOpenEdges(float distance)
extrude open edges of the mesh
static Mesh box(const vec3 &center=vec3::Zero, const vec3 &size=vec3::One, const vec3 &xAxis=vec3::Zero, const vec3 &yAxis=vec3::Zero, const vec3 &zAxis=vec3::Zero, float detail_size=1, float fillet=0.0f, int nx=0, int ny=0, int nz=0)
create the box mesh
int getFaceMaterial(int faceIndex)
get the material index over the face, see the getMaterialsCount(), getMaterialName()
void symmetry(const vec3 &start, const vec3 &NormalDirection, bool resultInQuads)
apply symmetry to the mesh
void removeUnusedObjectsAndMaterials()
remove all unused objects and materials
int vertsUvCount() const
returns the amount of UV - verts in the mesh
std::vector< int > extrudeOpenEdges(float distance, vec3 direction=vec3::Zero)
extrude open edges of the mesh
std::vector< int > getFaceUvVerts(int face)
get the list of UV vertices indices over the face
std::vector< vec3 > getMeshNormals()
get the list of all normal vertices of the mesh
comms::cMeshContainer * geometry()
The low-level mesh reference allows to create, operate over individual faces, vertices,...
void setMeshUVs(const std::vector< vec2 > &uvs)
set the list of all UV vertices for the mesh
static Mesh sphere(const vec3 &center=vec3::Zero, float radius=1.0f, float detail_size=1)
create the sphere mesh
void ensureMaterialsAndObjectsExist()
ensure that at least one material and one object exist in the mesh
void createVDM(int side, const char *path_to_exr, const vec3 &center=vec3::Zero, float radius=1, const vec3 &up=vec3::AxisZ, const vec3 &x=vec3::AxisX, const vec3 &y=vec3::AxisY)
Create the vector displacement map from the mesh and save it as EXR file. The mesh is put on plane at...
int addMaterial(const std::string &name)
add the named material
bool Write(const char *name)
Save the mesh to file.
std::vector< Mesh > splitDisconnectedParts()
split the mesh into disconnected parts
The class that corresponds to the retopo/modeling rooms meshes. This is advanced version of the Mesh ...
Definition CoreAPI.h:4934
void setSelectedEdges(std::vector< int > &edges)
set the selected edges list
void relaxSelected()
relax selected vergtices
std::vector< int > getFacesNearEdge(int vertex1, int vertex2)
get the list of faces that are adjacent to the edge
int getFaceVertsCount(int face)
get the vertices count over the face
void setFaceMaterial(int face, int uv_set)
set the UV set for the face
void unselectAllEdges()
unselect all edges
void toGu(int uv_set, int island_index)
unwrap the island using the GU (Globally Uniform) approach
void invertSelectedFacesTopoplogically()
invert selected faces only within the connective area, if some objects has no selected faces,...
int vertsUvCount()
get the uv vertices count
std::vector< int > getIslandVertexMapping(int uv_set, int island_index)
get the mapping from the vertex index in the mesh that was got by islandToMesh to the vertex index in...
void setEdgeSharpness(int vertex1, int vertex2, bool sharp)
set the sharpness state for the edge
void setEdgeSeam(int vertex1, int vertex2, bool seam)
set or clear the seam state for the edge
int getCurrentObject()
get the index of the current group
Mesh getObjectMesh(int group_index)
get the mesh from some retopo group
void setVertexUV(int uv_vertex, const vec2 &uv)
set the UV for the UV vertex
std::vector< int > getFacesNearVertex(int vertex)
get the list of faces that are adjacent to the vertex
vec3 getFaceNormal(int face)
get the face normal
void bevelOverSelectedVertices(float size)
perform the bevel over the selected vertices. As result, new faces will be selected
void inset(float distance)
perform the inset over the selected faces
int getFaceMaterial(int face)
get the UV set index for the face
void dropUndo()
Drop the whole mesh to the undo queue, it is important if you want allow the user to undo your mesh c...
void pack(int uv_set, bool rotate, bool shuffle)
pack the islands in the current uv-set
void toLscm(int uv_set, int island_index)
unwrap the island using the LSCM approach
void removeUnusedMaterials()
remove all unused UV sets (not referred within the mesh)
int duplicateObject(int group_index, const char *name=nullptr, const mat4 &transform=mat4::Identity, bool select=false)
duplicate the object (retopo group)
void setSelectedVertices(const std::vector< int > &vertices, const std::vector< float > &weights)
set the selected vertices list
void unselectAllVertices()
unselect all vertices
void setSelectedFaces(std::vector< int > &faces)
set the selected faces list
int getFaceObject(int face)
get the group index of the face
void scaleSelectedFacesClusters(float scale, ClusterScale method=Uniform_Scaling)
scale each selection cluster separately, to own center mass
int splitEdge(int vertex1, int vertex2, float position)
split existing edge somewhere between vertices.
void toPlanar(int uv_set, int island_index)
unwrap the island using the Planar approach
void subdivideSelectedFaces(bool apply_catmull_clark=false)
subdivide the selected faces
bool isOpenEdge(int vertex1, int vertex2)
check if the edge is open
std::vector< int > getSelectedFaces()
get the list of selected faces
void intrude()
perform the intrude operation over the selected faces. After calling the intrude() you should call th...
void subdivide(bool apply_catmull_clark=true)
subdivide the whole mesh
~Model()
destroy the mesh reference (the mesh itself will not be destroyed if it is the reference to retopo/mo...
Mesh visibleToMesh()
get the visible faces as the Mesh object
std::vector< int > getFaceVerts(int face)
get the list of UV vertex indices over the face, pay attention UV vertices are not same as position v...
void toStripe(int uv_set, int island_index)
try to uwrap the island as the regular stripe
int createNewFace(int Group, int UVSet)
create empty face, you need to call setFaceVertices to set the vertices, setFaceUVVerts to set the UV...
void selectedToEdges()
convert faces/vertices selection to edges selection
void setFaceObject(int face, int group)
set the group index of the face
Mesh islandToMesh(int uv_set, int island_index)
get the mesh that contains the island, xy of each point is the UV coordinate. The mesh contains only ...
Model & operator=(const Model &source)
the assignment operator. No new Mesh allocated! Use MakeCopy if you need to make a copy of the mesh
void moveSelectedFacesAlongVertexNormals(float displacement)
move selected faces along the vertex normals, each vertex displace on the same distance
void selectPath(int vertex1, int vertex2)
select all edges on the path from vertex1 to vertex2 (add to existing edges selection)
bool getFaceVisibility(int face)
get the face visibility
void bevelOverSelectedEdges(float size, int segments=1, bool OldVariant=false)
perform the bevel over the selected edges.
std::vector< int > getVertsNearVertex(int vertex)
get the list of vertices that are adjacent to the vertex
static Mesh flattenSingleIsland(const Mesh &mesh, int method, bool optimize_rotation=true, bool scale_to_geometry=true)
Flatten the mesh that consists of the single island.
int getObjectsCount()
get the retopo groups count
bool isVertexSelected(int vertex)
check if the vertex is selected
Model(const Model &source)
make a reference to the source mesh. No new Mesh allocated! Use MakeCopy if you need to make a copy o...
void selectedToObject(int group_index)
move the selected faces to the group
std::vector< float > getSelectedVerticesWeights()
get the soft selection weights of the selected vertices, 1 is maximum value
int createNewUvVertex(const vec2 &uv)
create new UV vertex to be used for faces
void setObjectMesh(int group_index, Mesh &mesh, const mat4 &transform=mat4::Identity)
replace the retopo layer with mesh
void updateNormals(bool for_snapping=true)
update the vertex normals
Model(const Mesh &source)
construct model from the Mesh object.
void selectObject(int group_index, bool add_to_selected=true)
select all feces in the group
void contractSelection()
contract the faces/vertices/edges selection to the connected geometry
const char * getObjectName(int group_index)
get the retopo group name
int getFaceUvVertex(int face, int vertex_index)
get the UV vertex index over the face
vec3 getVertexNormal(int vertex)
get vertex normal, calculated as average of adjacent faces normals
void setObjectVisibility(int index, bool visible)
set the group visibility
int addMaterial(const char *name)
add the new UV set/Material
void cleanup()
complete cleanul from non-manifolds or other problems, some faces may be removed
vec3 getVertex(int vertex)
get the vertex position in space
bool isSeam(int vertex1, int vertex2)
check if edge is seam
std::vector< int > getFaceNeighbors(int face)
get the list of faces that are adjacent to the face
void setObjectReferenceColor(int group_index, vec4 color)
set the group reference color
void selectedToFaces()
convert edges/vertices selection to faces selection
bool isEdgeSelected(int vertex1, int vertex2)
check if the edge is selected, order of vertices has no matter
void updateTopology()
update the connectivity information, it should be called sometimes if you feel that the connectivity ...
float getFaceUVSquare(int face)
get the face square in UV space
int getFaceUvVertsCount(int face)
get the amount of UV vertices over the face
void setFaceVisibility(int face, bool visibility)
set the face visibility
void meshToIsland(const Mesh &mesh, int uv_set, int island_index)
use the mesh (that was previously got by islandToMesh) to replace the island in the current uv-set
int createNewVertex(const vec3 &position)
create the positional vertex
std::vector< int > getBorderBetweenIslands(int uv_set1, int island_index1, int uv_set2, int island_index2)
get the border between two islands
void addTransformed(const Mesh &mesh, const mat4 &Transform=mat4::Identity, BoolOpType b=BOOL_MERGE, bool select=false, bool snap_to_existing=false)
insert the mesh to the retopo/modeling room, each object of the mesh treated as the new retopo layer
Model & transform(const mat4 &m)
transform the whole Model with the matrix
std::string generateName(const char *base)
generate unique name for the object, it will start as the string in base base
int getFaceVertex(int face, int vertex_index)
get the vertex index over the face
void expandSelection()
expand the faces/vertices/edges selection to the connected geometry
std::vector< int > getSelectedVertices()
get the list of selected vertices
void collapseEdge(int vertex1, int vertex2)
collapse the edge to the middle of the edge
std::vector< int > getPath(int vertex1, int vertex2)
get all vertices on the path from vertex1 to vertex2
void extrudeSelected()
Extrude the selected edges or selected faces without the actual moving of the extruded elements....
void selectedToVertices()
convert faces/edges selection to vertices selection
vec4 getObjectReferenceColor(int group_index)
get the group reference color
void transformSelected(const mat4 &transform, bool apply_symmetry)
apply the transformation to the selected elements
void toAbf(int uv_set, int island_index)
unwrap the island using the ABF approach
void displayOptions(bool showWireframe=true, bool showColored=true, bool showSeams=true, bool showSharpEdges=true, bool smoothView=false)
Set the display options for the retopo/modeling/uv meshes.
void setFaceUvVerts(int face, const std::vector< int > &vertices)
set the UV vertices for the face
void selectEdge(int vertex1, int vertex2)
select the edge by vertex indices (add to selection)
void moveSelectedFacesAlongFacesNormals(float displacement)
move selected faces along the faces normals, trying to keep faces parallel to the original direction
std::vector< int > getIslandBorder(int uv_set, int island_index)
get unsorted list of edges on the border of the island
Mesh islandToMeshInSpace(int uv_set, int island_index)
get the mesh that contains the island, each point is the coordinate in space (not the uv coordinate!...
Mesh getWholeMesh()
get the whole mesh from the retopo room
void setObjectName(int index, const char *name)
rename the group by index
vec2 getIslandVertexUv(int uv_set, int island_index, int vertex_index)
get the uv coordinate of the positional vertex in the island
void clearObjectMesh(int group_index)
remove all faces from the group
void unwrap(int uv_set)
unwrap the current uv-set
bool connect(int vertex1, int vertex2)
split existing edge somewhere between vertices.
bool isSharpEdge(int vertex1, int vertex2)
check if the edge is sharp
static Model fromModeling()
get the reference to the mesh in the modeling room, currently it is the same mesh as in the retopo ro...
bool getObjectVisibility(int index)
get the group visibility
Model()
construct the lowpoly mesh, it is completely independent on retopo/modeling/uv workspace....
void connectSelectedVerts()
connect selected vertices in smart way
bool isFaceSelected(int face)
check if the face selected
std::vector< int > getFaceUvVerts(int face)
get the list of UV vertices indices over the face
Model MakeCopy() const
make a copy of the source mesh. Pay attention, if you taken it from the retopo/uv context,...
void shell()
perform the shell operation over the selected faces. After calling the shell() you should call the mo...
bool checkConnectivity(int vertex1, int vertex2)
check if connecting the two vertices is possible
void clear()
clear the whole mesh
int vertsCount()
get the positional vertices count
int addObject(const char *name)
add new retopo group
void removeObject(int group_index)
remove the group by index
int islandsCount(int uv_set)
get the islands count over the current uv-set
void setFaceVerts(int face, const std::vector< int > &vertices)
set the list of positional vertex indices over the face
void selectVertex(int vertex, float weight=1.0f)
add the vertex to the selection
std::vector< int > getObjectFaces(int group_index)
get the list of faces in the group
int facesCount()
get the faces count
float getFaceSquare(int face)
get the face square
void setCurrentObject(int index)
set the current group index
static Model fromRetopo()
get the reference to the mesh in the retopo room
Mesh selectedToMesh()
get the selected faces as the Mesh object
void unselectAllFaces()
unselect all faces
void selectFace(int face)
select the face by index
std::vector< int > getSelectedEdges()
returns even amount of vertex indices, pairs os start and end vertices of the selected edges
void setVertex(int vertex, const vec3 &position)
set the vertex position in space
static Model fromUv()
get the reference to the mesh in the uv room, pay attention that topology changes to that mesh may le...
vec2 getVertexUV(int uv_vertex)
get the UV coordinates of the UV vertex
void removeFace(int face)
remove the face by index
Definition CoreAPI.h:2958
static void setExposure(float exposure)
set the exposure value for the rendering (in render room)
static void setDOFDegree(float degree)
set the depth of field (DOF) degree
static vec3 getLightColor(int idx)
get the light color for the additional light
static float getLightIntensity(int idx)
get the light intensity for the additional light
static void removeLight(int idx)
remove the additional directional light
static void setLightIntensity(int idx, float intensity)
set the light intensity for the additional light
static void enableRealtimeRendering(bool enable)
enable or disable the realtime rendering
static void setCustomRenderSize(int width, int height)
set the render output width
static int getRaysPerFrame()
get rays per frame for the rendering
static void setRenderResult(const char *filename)
set the render output filename
static void setAA(bool AA)
set the anti-aliasing (AA) rendering state
static vec3 getLightDirection(int idx)
get the direction for the additional light
static void removeAllLights()
remove all additional directional lights
static void restartRendering()
if the realtime render enabled the command will restart the rendering from scratch
static void setLightScattering(int idx, float scattering)
set the light scattering for the additional light
static void setEnvironmentLight(float envlight)
set the brightness of the environment light (spherical environment)
static void setRaysPerFrame(int count)
set rays per frame for the rendering
static void toRenderRoom()
get to the render room to be able to render
static void setLightColor(int idx, const vec3 &color=vec3::One)
set the light color for the additional light
static void setLightDirection(int idx, const vec3 &dir)
set the direction for the additional light
static float getEnvironmentLight()
get the brightness of the environment light (spherical environment)
static bool isRealtimeRenderingEnabled()
get the realtime rendering state
static float getExposure()
get the exposure value for the rendering (in render room)
static float getDOFDegree()
get the depth of field (DOF) degree
static void renderFrame()
render to the output file
static float getLightScattering(int idx)
get the light scattering for the additional light
static int getLightsCount()
get the amount of additional directional lighte
static int addLight()
add the additional directional light
static bool getAA()
get the anti-aliasing (AA) rendering state
The scene element, like sculpt object or curve.
Definition CoreAPI.h:1638
SceneElement duplicate() const
diplicate the item
void selectOne() const
unselect all similar elements and select this one
SceneElement findInSubtree(const char *name) const
find the element in subtree by name
bool iterateVisibleSubtree(const std::function< bool(SceneElement)> &fn) const
iterate over the visible subtree
SceneElement child(int index) const
returns child element by index
mat4 getTransform() const
get the scene element transform
void removeSubtreeItem(int index) const
remove one child from the subtree
bool ghost() const
returs the state of ghosting (if available)
void removeSubtree() const
remove the whole subtree
bool isParentOf(SceneElement child) const
check if the element is parent of another one
const SceneElement & density(float density_value) const
this command useful if you use voxels, it sets the scale for the volume so that there will be density...
void collectSelected(list< SceneElement > &elemList)
Collect the selected elements in the subtree (including this element if selected)
void setVisibility(bool visible) const
set the visibility of the element
const char * getLinkedPath(int id) const
get the linked file path
int childCount() const
returns the child elements count
bool iterateSubtree(const pybind11::object &fn) const
iterate over the subtree
const char * name() const
get the element name
void unselectAll() const
unselect all similar objects
const SceneElement & rename(const char *name) const
rename the element
void setGhost(bool ghost) const
sets the ghosting state (if available)
void select() const
add the object to selected
void changeParent(SceneElement newParent) const
change the parent element for the current one
void setReferenceColor(const vec4 &color)
set the reference color for the element
void mergeSubtree(bool booleanMerge=false) const
merge all subtree volumes into this
vec4 getReferenceColor()
get the reference color for the element
void addLinkedPath(const char *path) const
set the linked file path
bool & visible() const
returns own visibility state reference. It does not take into account that parent may be invisible.
const SceneElement & transform(const mat4 &Transform) const
Additional transform over the object.
SceneElement duplicateAsInstance() const
create the instance of the object if instancing supported
void copyMergeTo(SceneElement &dest, BoolOpType op)
copy and merge the volume to another one, delete this volume
SceneElement parent() const
get the parent scene graph element
bool iterateSubtree(const std::function< bool(SceneElement)> &fn) const
iterate over the subtree
Volume Volume() const
returns the volume object to operate over voxels or surface
bool selected()
Check if the scene element is selected.
const SceneElement & setTransform(const mat4 &Transform) const
Set the transform matrix.
std::vector< SceneElement > collectSelected()
Collect the selected elements in the subtree (including this element if selected)
void mergeTo(const SceneElement &dest, BoolOpType op)
merge the volume to another one, delete this volume
void remove() const
remove this item and all child objects from the scene
bool iterateVisibleSubtree(const pybind11::object &fn) const
iterate over the visible subtree
void moveTo(SceneElement newParent, int indexInParent) const
move the element to another parent
bool isSculptObject() const
Check if it is the sculpt object.
bool isCurve() const
Check if the element is curve.
const SceneElement & clear() const
Clear the element content.
int linkedObjectCount() const
get the linked file path
const SceneElement & transform_single(const mat4 &Transform) const
Additional transform over the object, not applied to child objects.
SceneElement addChild(const char *name) const
add the child element of the same nature
referes the roots of the scene graph
Definition CoreAPI.h:2521
static void setLayerBlending(int LayerID, int mode)
set the layer blending mode
static void RemoveUVSet(int idx)
Remove the UV-set (texture)
static SceneElement importMesh(const char *filename, const mat4 &transform=mat4::Identity)
import mesh into scene, it is the same as File->Import->Import mesh for vertex painting/reference ....
static void invertLayerMask(int LayerID)
invert the layer mask (if assigned)
static void setActiveLayer(int LayerID)
activate the layer
static const char * getLayerName(int LayerID)
get the layer name
static void mergeVisibleLayers()
merge all visible layers
static bool setSceneUnits(const char *units)
Set the scene units without actual scaling the scene to new units, just name change.
static vec3 getSceneShift()
get the scene shift value, look the Edit->Scale master->X,Y,Z
static void setLayerVisibility(int LayerID, bool Visible)
set the layer visibility
static void setLayerMetalnessOpacity(int LayerID, float Opacity)
set the layer metalness opacity
static int getLayerBlending(int LayerID)
get the layer blending mode
static void setCurrentLayer(int LayerID)
set the current layer
static void RemovePaintObject(int idx)
Remove the paint object.
static void ScaleSceneUnits(float scale)
Keep the scene visial size in scene, but scale the export size.
static float GetSceneScale()
the length of 1 scene unit when you export the scene
static const char * PaintMaterialName(int idx)
Get the reference to the material mane.
static void disableLayerMask(int LayerID)
disable the mask for the layer
static int getLayerMaskLayer(int LayerID)
get the mask identifier assigned to the layer
static void setSceneShift(const vec3 &shift)
set the scene shift value, look the Edit->Scale master->X,Y,Z
static void enableLayerMask(int LayerID)
enable the mask for the layer
static void ScaleSceneVisually(float scale)
Scale the whole scene visually but keep the export size.
static void mergeLayerDown(int LayerID)
merge the layer down
static void removeEmptyLayers()
remove all unused layers
static void setLayerGlossOpacity(int LayerID, float Opacity)
set the layer gloss/roughness opacity
static void extractMaskAsLayer(int LayerID)
If the layer has the mask attached, the mask will be extracted as a new layer and the masking disable...
static bool maskEnabled(int LayerID)
check if the mask is enabled for the layer
static void invalidateLayer(int LayerID)
refresh the layer appearance in scene
static int getCurrentLayer()
get current layer identifier
static void applyLayerBlending(int LayerID)
apply layer blending
static SceneElement current()
returns the current sculpt object
static const char * GetSceneUnits()
get the name of the current scene units
static void scaleTex(int type, float scale)
scale the texture (stencil or material)
static void setTexTiled(int type, bool tiled)
make texture tiled or use single tile
static void flipTexX(int type)
flip the texture (stencil or material) horizontally
static void scaleTexNonUniform(int type, const vec2 &scale)
scale the texture (stencil or material) non-uniformly
static void setMaskForTheLayer(int LayerID, int MaskLayerID)
set the MaskLayerID to be used as mask for the LayerID. The MaskLayerID will disappear among the laye...
static void enableLayerMask(int LayerID, bool enable)
enable or disable the layer mask
static void resetTexTransform(int type)
reset the texture (stencil or material) transform
static void RemovePaintMaterial(int idx)
Remove the paint material.
static bool layerIsEmpty(int layerID)
Check if the layer is empty.
static const char * PaintObjectName(int idx)
Get the reference to the object name.
static int PaintUVSetsCount()
Get the paint UV-sets (textures) count.
static void setLayerName(int LayerID, const char *name)
set the layer name
static void clearScene(bool askUser=false)
clear the whole scene
static void rotateTex(int type, float angle)
rotate the texture (stencil or material)
static int assignLayerMask(int LayerID)
assign the mask to the layer if it is not assigned before
static bool convertSceneUnits(const char *destination_unit_name)
Convert the scene units to the new units, the scene scale will be changed, visual size will be kept.
static void setClippingLayer(int LayerID)
set this layer as clipping layer
static void flipTexY(int type)
flip the texture (stencil or material) vertically
static void removeLayerMask(int LayerID)
remove the layer mask
static std::vector< std::string > getAvailableUnits()
Get the list of all available units.
static void removeLayer(int LayerID)
remove the layer
static int getLayer(const char *name, bool addIfNotExists=true)
get the Layer ID by name, add the layer if not exists
static SceneElement sculptRoot()
get the root of all sculpt objects
static void moveTex(int type, const vec2 &offset)
move the texture (stencil or material)
static int PaintMaterialCount()
Get the count of paint materials.
static int PaintObjectsCount()
Get the count of paint objects in scene.
static vec2 getViewportCenter()
get the viewport center in screen coordinates
static void setTexPivot(int type, const vec2 &pivot)
sep the pivot for the texture (stencil or material)
static SceneElement curvesRoot()
get the root of all curves
static bool isLayerMaskEnabled(int LayerID)
check if the mask is enabled for the layer
static const char * PaintUVSetName(int idx)
Get the reference to the UV set name.
static void disableClippingLayer(int LayerID)
disable the clipping layer
static void stackUndo(int nStack)
Unify several previous undo operations into one.
static void setLayerColorOpacity(int LayerID, float Opacity)
set the layer opacity
static bool layerVisible(int LayerID)
return the layer visibility
static void setLayerDepthOpacity(int LayerID, float Opacity)
set the layer depth opacity
The class intended to place spheres in space and identify if there are spheres around....
Definition CoreAPI.h:3344
int addSphere(const vec3 &p, float radius)
add the sphere into the space
void setUnit(float u)
set the cell size, the cell space should be empty
SphericalCollision(float cellsize)
create the collision space
void clear()
remove all spheres
vec3 collides(const vec3 &p, float radius)
check if sphere intersects other spheres in the space
vec4 sphere(int idx)
get the sphere parameters by index
Definition CoreAPI.h:1943
The class allows to operate over voxels/surface on the relatively low-level.
Definition CoreAPI.h:1953
static void roughness(float value)
assign the roughness for the voxel operations, it will work only if the color already assigned
void subtractMesh(Mesh &mesh, const mat4 &transform=mat4::Identity)
subtract the mesh from volume (boolean)
void removeFacesByWeight(std::function< float(const vec3 &)> weight)
Remove all faces where all the function returns the value < 0 for all the vertices over the face.
VolumeCell * cell(int cx, int cy, int cz, bool create, bool backup)
get the cell by cell coordinates, each cell is 8*8*8
float getInterpolatedValue(const vec3 &pos, bool fromBackup)
returns interolated voxels density
void scanCells(const std::function< void(VolumeCellAttrib *vc)> &fn, bool multithreaded=false)
run through all volume cells
void clearNoUndo()
Clear quickly, without affecting the Undo queue.
boundbox calcLocalSpaceAABB()
Calculate the Axis - Aligned Bound Box of the object in local space.
void relaxGpu(const vec3 &center, float Radius, float degree)
fast voxel-based relax within the sphere with the gradual falloff. It works only in voxel mode.
void relaxSurface(float degree, bool tangent=false, bool keep_sharp_boolean_edges=false)
relax the object in surface mode
static void gloss(float value)
assign the gloss for the voxel operations, it will work only if the color already assigned
SceneElement generateMoldingTest()
generate the figure that fills the gap between the molding shapes
static void setMoldingParams(const vec3 &direction, float tapering_angle=0, float undercuts_density=1.0f, float decimation_limit_millions=10, bool perform_subtraction=true)
set the parameters for the molding
static void enableVoxelsColoring(bool enable=true)
enable or disable the voxel-based coloring. It is applied wherever possible - merging models,...
float getVolume()
get the volume of this object in world coordinates
Volume & makeVoxelFigure(std::function< float(vec3)> densityFunction, const list< vec3 > &growCenters, bool Subtract=false, bool useTempLocation=false, bool overHidden=false, bool useColor=false)
This function is fast (generally realtime) way to fill the volume with voxels. Voxel Brush Engune com...
SceneElement findMoldingTop()
find the top molding shape (that was previously generated)
void mergeMesh(Mesh &mesh, const mat4 &transform=mat4::Identity, BoolOpType op=BOOL_MERGE)
merge the mesh into scene
void mergeMeshWithTexture(Mesh &mesh, const mat4 &transform=mat4::Identity, BoolOpType op=BOOL_MERGE)
merge the mesh with facture, the volume polygons will be hidden, just the texture will be shown (like...
float getSquare()
reg the square of this object in world coordinates
void toVoxels()
turn to voxels, auto-voxelize
void scanTriangles(const std::function< void(const MCVertex &v1, const MCVertex &v2, const MCVertex &v3)> &fn, bool multithreaded=false)
run through all triangles
void removeUndercuts()
remove undercuts for the current volume
VoxTreeBranch * tree()
returns the low-level object (VoxTreeBranch) for all low-level operations
void intersectWithMesh(Mesh &mesh, const mat4 &transform=mat4::Identity)
intersect the volume with the mesh (boolean)
void curveBasedMolding()
perform the curve-based mold
static void color(float r, float g, float b)
assign the color for the voxel operations
void setOpacity(float Opacity)
set the volume opacity
bool isVoxelized() const
Check if in voxel mode.
void assignShader(const char *shaderName)
set the shader for the Volume
void scanCells(const std::function< void(VolumeCellAttrib *vc, const tri_DWORD &T)> &fn, bool multithreaded=false)
run through all volume cells
void closeHoles(int maxSize)
Close the holes.
void scanCells(const std::function< void(VolumeCell *vc, const tri_DWORD &T)> &fn, bool multithreaded=false)
run through all volume cells
void addMesh(Mesh &mesh, const mat4 &transform=mat4::Identity)
add the mesh to volume (boolean)
VolumeCellAttrib * attributes(int cx, int cy, int cz, bool create, bool backup)
get the cell attributes by cell coordinates, each cell is 8*8*8, generally it is kept as VolumeCell::...
void scanTriangles(const std::function< void(const Vector3D &v1, const Vector3D &v2, const Vector3D &v3)> &fn, bool multithreaded=false)
run through all triangles
void generateMoldingCurves()
generate the automatic molding curves
void removeMoldingShapes()
remove all molding intermediate shapes, tests, etc.
static void color(float r, float g, float b, float a)
assign the color for the voxel operations
void clear()
Clear and pass to the Undo queue.
void relaxOpenEdges(int nTimes)
relax the open edges of the mesh, it is applicable only to the surface mode
void toSurface()
turn to surface mode, the triangles will be tangentially relaxed
static void setMoldingBox(float width, float length, float thickness)
set the molding bound box to be user-defined, not automatic
void assignLiveBooleans(int operation)
Apply the live booleans over the sculpt mesh, it is available for voxels only.
boundbox calcWorldSpaceAABB()
Calculate the Axis - Aligned Bound Box of the object in world space.
int getPolycount()
get the volume triangles count
void dirty(int cx, int cy, int cz)
mark the cell as dirty. This is required if you
static bool checkIfMoldingLicenseAvailable()
check if molding allowed
bool isSurface() const
Check if in surface mode.
void subtractWithoutUndecuts()
subtract the current undercutted object from the preliminary generated molding shapes
static void color(DWORD CL)
set the default color to fill voxels if the voxel coloring enabled
void basRelief(const vec3 &start_point=vec3::Zero)
perform the bas-relief for the current volume
SceneElement findMoldingTest()
find the test molding test shape (that was previously generated)
void relaxVoxels(int count)
relax the whole volume, works only for voxels
bool valid() const
checks if object is valid
void collapseBollTree()
collapse the boolean tree, it is available for this volume
void scanCells(const std::function< void(VolumeCell *vc)> &fn, bool multithreaded=false)
run through all volume cells
float getExactDencity(int x, int y, int z, bool fromBackup, VolumeCache &cache_ref)
returns the exact voxel density in local space at the exact integer location
void insertMesh(Mesh &mesh, const mat4 &transform=mat4::Identity)
insert the mesh into the volume, in case of voxels this is identical to addMesh, in case of surface,...
void automaticMolding()
perform the automatic molding
static void color(const char *colorid)
assign the color for the voxel operations
static void metal(float value)
the metalliclty value for the voxel operations, it will work only if the color already assigned
static void setAutomaticMoldingBox()
set the molding bound box to be automatic
SceneElement findMoldingBottom()
find the bottom molding shape (that was previously generated)
VolumeObject * vo()
returns the low-level object (VolumeObject) for all low-level operations
static void setMoldingBorder(float width=0)
set the molding border around the parting line to fade to the plane, if it is zero,...
SceneElement inScene()
Get the Volume placement in the scene.
the rich dialog. You may customize it, show your custom parameters and custom buttons.
Definition CoreAPI.h:3821
dialog & transparentBackground()
the background will not be faded
dialog & no()
add No button
dialog & process(std::function< void()> process)
pass the function/lambda that will be called each frame. But there is better way - override the Proce...
dialog & dontShowAgainCheckbox()
show the checkbox "Don't show again". If user checks if the dialog will net be shown next time and sh...
dialog & modal()
dialog will be modal. Generally, it is modal by default. Execution will be paused at show() till the ...
dialog & params(BaseClass *params)
The important core feature. BaseClass allows to create the custom controls in the dialog....
dialog & width(int w)
change the default width
dialog & noModal()
dialog will be no modal. Execution will continue after you will call the show()
dialog & onPress(std::function< void(int)> press)
pass the function/lambda that will be called when the button will be pressed. The button index (start...
dialog & undoWorks()
allow undo (CTR-Z) act even in modal dialog
dialog & ok()
add Ok button
dialog & cancel()
add Cancel button
dialog & warn()
add Warning icon
dialog & process(pybind11::object callback)
pass the function/lambda that will be called each frame.
int show()
Show the dialog. This is usually the last command in the chain.
dialog & caption(const char *id)
pass the caption of the dialog
dialog & question()
add Question icon
dialog & topRight()
place the dialog at the top-right position of the viewport
dialog & yes()
add Yes button
dialog & buttons(const char *list)
pass the list of buttons for the dialog
dialog & text(const char *id)
pass the header text of the dialog
dialog & params(pybind11::object params)
The important core feature. Pass the object to display object parameters in UI. Look the dialog examp...
static bool & fadeDialogsBackground()
returns the reference to the global property - fade modal dialogs background (true) or not (false)
General I/O access.
Definition CoreAPI.h:4112
static vec2 snappedCursorPos()
returns the snapped cursor position
static void showPythonConsole()
Show the python console, clear it and pop up.
static void pipInstall(const char *requirements)
install one or multiple python packages
static std::vector< std::string > openFilesDialog(const char *extensions)
open multiple files dialog
static void ListFiles(const char *folder, const char *mask, coat::list< coat::str > &result, bool recursive=true)
list files in the folder
static std::string toJson(const pybind11::object &obj, const char *filename="")
Store the object to the file or string as json.
static std::string strFromFile(const char *filename)
read string from file.
static bool openFilesDialog(const char *extensions, list< str > &fileNames)
open multiple files dialog
static std::string getFileName(const char *filepath)
get the file name from the path
static std::string getExtension(const char *filepath)
get the file extension (without .)
static void createRedistributablePackageFromFolder(const char *folder, const char *package_name, const char *excluded_folders_names="", const char *excluded_extensions="")
Create the 3dcpack file from the folder placed in Documents.
static std::string toFullPathInDataFolder(const char *path)
convert the relative path to full path in documents folder. If the path is full and placed in the ins...
static void step(int count=1)
perform rendering cycles
static void restoreObjectFormJsonString(pybind11::object &obj, const char *data)
Restore the object from the json string.
static void progressBarInWindowHeader(float stage, float max_stage, const char *message)
Show the progress bar only in the 3DCoat's window header.
static void exec(const char *command, const char *arguments=nullptr)
execute command. It may be exe file, URL, batch command
static void executeScript(const char *path)
execute python (.py file) or angelscript (c++ like), or CoreAPI (native C++) script
static void post_request(const char *url, const char *data, const char *headers, const std::function< void(const char *)> &report_success=nullptr, const std::function< void(const char *)> &report_error=nullptr)
send the post request to the url
static const char * supportedImagesFormats()
returns the currently supported mesh export formats
static std::vector< std::string > listBlenderInstallFolders()
list the blender install folders
static void fromJsonFile(pybind11::object &obj, const char *filename)
Restore the object from the json file.
static void copyFolder(const char *src, const char *dest)
copy the whole folder from src to dest. If the src or dest is relative, it is relative to the documen...
static std::string getFileNameWithoutExtension(const char *filepath)
remove the file extension from the filename
static const char * currentSceneFilepath()
returns the current scene filename, empty if the scene was not saved/opened
static std::string getFilePath(const char *filepath)
get the file path without the filename
static std::vector< std::string > ListFolders(const char *startFolder)
list folders within the folder, non-recursive, just plain list
static void setWindowTitle(const char *text, float seconds)
Override the 3DCoat's window title for some amount of time.
static rect wholeScreen()
get the whole screen rectangle
static bool openFileDialog(const char *extensions, str &fileName)
show the file dialog
static void get_request(const char *url, const char *headers, const std::function< void(const char *)> &report_success=nullptr, const std::function< void(const char *)> &report_error=nullptr)
send the get request to the url
static std::string convertToWritablePath(const char *path)
If the path is relative or points into some file in the install folder, it will be converted to the p...
static void ListFolders(const char *startFolder, coat::list< coat::str > &result)
list folders within the folder, non-recursive, just plain list
static int getDownloadProgress()
returns the overall download progress
static void removeFolder(const char *folder)
remove the folder. If the folder is relative, it is relative to the documents folder....
static void saveScreenshot(const char *filename, int x=0, int y=0, int width=0, int height=0)
save the screenshot to the file
static rect workArea()
get the work area rectangle
static std::vector< std::string > ListFiles(const char *folder, const char *mask, bool recursive=true)
list files in the folder
static std::string pythonPath()
get the python libraries folder
static vec2 cursorPos()
returns the current cursor position
static void copyFile(const char *src, const char *dest)
copy the file from src to dest. If the src or dest is relative, it is relative to the documents folde...
static void installRequirements(const char *path_to_requirements_txt)
Install all the requirements for the python script execution.
static std::string convertToWritablePathIfFileExists(const char *path)
If the path is relative or points into some file in the install folder, it will be converted to the p...
static bool fileExists(const char *path)
check if file exists
static size_t getFileSize(const char *filename)
get the file size
static void download(const char *url, std::function< void(const char *, const char *)> report_success)
download the file from the url
static bool saveFileDialog(const char *extensions, str &fileName)
show the save file dialog
static void updateCoatPyi(const char *folderOrFile)
update the .pyi file for the given folder or py file
static const char * dataPath()
the 3DCoat data path
static void removeFile(const char *filename)
remove the file. If the filename is relative, it is relative to the documents folder....
static const char * execAndWait(const char *command, const char *arguments=nullptr)
execute and wait till finished, the console output will be returned as string
static const char * documents(const char *path)
convert the relative path to the path in documents, if the path is absolute, just return the original...
static const char * installPath()
the 3DCoat installation path
static std::string toFullPathInInstallFolder(const char *path)
convert the relative path to the full path in the install folder. If the path is full,...
static const char * supportedMeshesFormats()
returns the list of supported images formats
static void strToFile(const char *text, const char *filename)
write the string to file
static void progressBar(float stage, float max_stage, const char *message)
Show the progress bar.
Definition CoreAPI.h:5889
void showMessage()
show the accumulated log in the message box
logger & floatPrecission(int signs=2)
set the precission of floating-point output
logger & flush()
save all acumulated text to the file
void open()
open the accumulated log in the default text editor
logger & directTo(const char *filename)
Direct the log output to the file
logger & timestamp()
add the timestamp to the log as the
logger & endTimer()
stop the timer and output the time into the log as amount of microseconds
logger & newline()
start newline in the text file
logger & startTimer()
start the timer to profile some operation
logger()
create the logger object. You may call directTo later and flush the output there. Otherwise,...
str getFullPath()
Returns the absolute path to the log file.
logger(const char *filename)
create the logger object and direct the output there
logger & format(const char *format,...)
send the formatted message
this class represents different resources accessible in UI - alphas, strips, materials,...
Definition CoreAPI.h:4006
std::string getCurrentItem()
returns the current item name (if possible)
void removeItem(const char *itemName)
remove the item from the current folder
std::vector< std::string > listFolders()
list folders of the resource type referred by this object
std::string currentFolderFullPath()
full path (relative to the 3DCoat's documents) to the current folder files
static std::vector< std::string > listAllResourcesTypes()
list all available resources types
void setCurrentFolder(const char *folder)
set the current folder (short name without the full path)
void moveItemToFolder(const char *itemName, const char *destFolderName)
move the item to another folder
void createFolder(const char *folderName)
create the folder and switch there
void selectItem(const char *itemName)
select/activate the item in the current folder
std::vector< std::string > supportedExtensions()
get the list of supported extensions for the resource type referred by this object
void addItem(const char *itemPath)
add the item to the current folder
std::vector< std::string > listCurrentFolderItems()
get the list of all items in the current folder
std::string currentFolder()
get the current folder short name
std::string rootPath()
the root path (relative to the 3DCoat's documents) to the resource type referred by this object
resource(const char *id)
create the reference to some resource type to access it and operate with it
void removeFolder(const char *folderName)
remove the folder and switch to the root folder if this is the current folder
Definition CoreAPI.h:2419
static std::vector< std::string > listAllSettings()
get the list of all available settings
static float getFloat(const char *ID)
get the float value from the settings
static bool setString(const char *ID, const char *value)
set the string value to the settings
static void pressButton(const char *button_name)
triger some action in settings
static void resetSettings(bool ResetGeneralSettings=true, bool ResetHiddenSet=true, bool ResetHotkeys=true, bool RestNavigation=true, bool ResetPresets=true, bool ResetTheme=true, bool ResetWindows=true)
reset all settings to default values, application will restart
static bool getBool(const char *ID)
get the boolen value from the settings
static std::string getString(const char *ID)
get the string value from the settings
static void saveSettings()
save all changed settings
static int getInt(const char *ID)
get the integer value from the settings
static bool setFloat(const char *ID, float value)
set the float value to the settings
static bool setInt(const char *ID, int value)
set the integer value to the settings
static bool valueExists(const char *ID)
returns true if the value in settings exists
static bool setBool(const char *ID, bool value)
set the boolean value to the settings
Definition CoreAPI.h:1376
static std::vector< comms::cPlane > getCurrentPlanes()
Returns all symmetry planes using the current symmetry state.
static symm & translation(int numX, float stepX, int numY, float stepY, int numZ, float stepZ)
Enable the translation symmetry.
static symm & xyz(bool x, bool y, bool z)
Enable the XYZ-mirror symmetry.
static symm & enable(bool _enable=true)
Enable the symmetry.
static vec3 & start()
get the start point reference
static symm & axialMirror(int n, bool extraMirror=false, bool stepSymmetry=false)
Enable the axial mirror symmetry.
static bool & stepSymmetry()
returns the state of step symmetry
static bool & x()
check x symmetry state
static symm & getCurrentTransforms(list< mat4 > &symmetryTransforms)
Returns all transforms using the current symmetry state.
static bool & z()
check z symmetry state
static symm & setCustomSymetryTransforms(list< mat4 > &symmetryTransforms)
enable the custom symmetry, provide the symmetry transfoms
static bool & y()
check y symmetry state
static int & axialOrder()
returns the axial symmetry order if axial or axial mirror symmetry enabled
static std::vector< mat4 > getCurrentTransforms()
Returns all transforms using the current symmetry state.
static symm & getCurrentPlanes(list< comms::cPlane > &planes)
Returns all symmetry planes using the current symmetry state.
static symm & setCustomSymetryTransforms(pybind11::list &symmetryTransforms)
enable the custom symmetry, provide the symmetry transfoms
static symm & showSymmetryPlane(bool show=true)
Show or hide the symmetry planes.
static float & stepZ()
returns the reference to the z-step if the translational symmetry used
static symm & toGlobalSpace()
set the symmetry to be in global space
static bool & extraMirror()
returns the state of extra mirror, this is valid only tor the axial symmetry
static symm & toLocalSpace()
set the symmetry to be in local space
static int & numY()
returns the reference to the number of the y repeats if the translational symmetry used
static symm & disable()
disable the symmetry
static bool is_axial()
Check if the axial symmetry enabled
static symm & axial(int n, bool extraMirror=false, bool stepSymmetry=false)
Enable the axial symmetry.
static symm & set_start(const vec3 &pos)
set the central point for the symmetry
static int & numX()
returns the reference to the number of the x repeats if the translational symmetry used
static void enableGlobally()
Enable symmetry (preliminary disabled by disableGlobally)
static bool is_xyz()
check if the XYZ symmetry enabled
static symm & toGeneral()
set the symmetry to general case
static symm & set_end(const vec3 &pos)
set the end point for the symmetry axis, calling this function enables the general case of the symmet...
static void disableGlobally()
Totally disable symmetry, don't forget to enable after all operations!
static vec3 & end()
the end point reference
static bool isCustomSymmetry()
Check if the custom symmetry used.
static int & numZ()
returns the reference to the number of the z repeats if the translational symmetry used
static float & stepX()
returns the reference to the x-step if the translational symmetry used
static bool is_translation()
Check if the translation symmetry enabled.
static bool isAxialMirror()
Check if the axial mirror symmetry enabled.
static float & stepY()
returns the reference to the y-step if the translational symmetry used
text primitive
Definition CorePrimAPI.h:1735
operate over the Coat's ui
Definition CoreAPI.h:3397
static const char * roomName(int index)
get the room name by index
static void toolParam(BaseClass *B)
show the class B as the part of the tools params panel
static bool checkIfMenuItemInserted(const char *ID_in_menu)
Check if the command inserted somewhere into the menu.
static std::string inputString(const char *text, int min_length=0)
input text under the mouse position
static void toRoom(const char *name, bool Force=false)
switch to the room
static void insertInMenu(const char *Menu, const char *ID_in_menu, const char *script_path)
Insert the scripted command into the main menu.
static void apply()
pess ENTER, acts as Apply usually
static bool setBoolValue(const char *id, bool value)
Set the value for the checkbox in UI.
static void removeToolParam(BaseClass *B=nullptr)
remove the class from the tools params
static int roomsCount()
returns the rooms count
static void setFileForFileDialog(const char *filename)
Set the file for the next file dialog that will be triggered by user. If you will use coat::ui:cmd(....
static void enablePenChannel(int i, bool enabled)
enable or disable the pen channel
static const char * getOption(const char *id)
get the option from preferences
static bool getBoolField(const char *id)
Get the bool field from the checkbox in UI.
static int inputInt(int initial_value)
input the integer value under the mouse position
static const char * roomID(int index)
get the text identifier of the room
static float inputFloat(float initial_value)
inputh the float value under the mouse position
static bool isInRoom(const char *name)
check if we are in the specified room
static void addExtension(const char *roomID, const char *section, pybind11::object &obj)
Add the extension (new tool) into the room. Look the GeneratorExample.py.
static bool setEditBoxValue(const char *id, float value)
set the edit box value
static const std::string getIdTranslation(const char *id)
Get the translation for the text identifier.
static bool setEditBoxValue(const char *id, int value)
set the edit box value
static bool isEnabledPenChannel(int i)
check if the pen channel is enabled
static bool cmd(const char *id, std::function< void()> process_in_modal_dialog=0)
execute some action in UI as if you pressed on some control
static bool setSliderValue(const char *id, float value)
Set the value for the the slider (if exists in UI)
static void hideDontShowAgainMessage(const char *id)
Hides the "Don't show again dialog" for the current session (not forever)
static void addTranslation(const char *id, const char *text)
Add the translation for the text identifier.
static void showInfoMessage(const char *infoID, int milliseconds)
Show the floating information message for the some time period.
static const char * currentRoom()
get the current room name
static float getSliderValue(const char *id)
get the value of the slider
static bool wait(const char *id, float max_seconds)
wait till the element id will appear in the UI. The element will not be clicked. The max wait time is...
static bool getEditBoxValue(const char *id, str &result)
get the edit box value
static void removeCommandFromMenu(const char *ID_in_menu)
remove the command from the menu
static void insertInToolset(const char *roomID, const char *section, const char *toolID, const char *script_path="")
Insert the script-based tool into the toolset.
static bool setOption(const char *id, const char *value)
set the value to preferences
static bool checkIfExtensionPresent(const char *extension_ID)
Check if extension named as extension_ID is present in the 3DCoat.
static void switchToLanguage(const char *language)
Switch the layout to the language.
static bool cmd(const char *id, pybind11::object fn=pybind11::none())
execute some action in UI as if you pressed on some control
static bool presentInUI(const char *id)
Check if the elemnt present in the UI.
static bool setEditBoxValue(const char *id, const char *value)
set the edit box value
static const std::string getCurrentLanguage()
Get the current language file name (without the XML extension)
static void highlight(const char *id, float milliseconds)
highlight the UI element for a while
static float scale()
returns the scale in comparison to the smallest UI theme
Definition CoreAPI.h:4524
static float getFPS()
get the current FPS
static void set(const char *key, const char *value)
Globally set the value for the key, it is even stored between sessions of the 3DCoat.
static float getFrameTimeMs()
get the frame time in milliseconds
static void testSuccessful()
report that the test was successful. In this case the file "InstallFolder/.installer/test_success....
static void testFailed(const char *message)
report that the test was successful. In this case the file "InstallFolder/.installer/test_failed....
static void clearEnum(const char *enumID)
clear the global strings list.
static int getEnumValueIndex(const char *enumID, const char *key)
get the index of the value in the global strings list. That lists used in dropdown boxes in UI
static bool inRenderProcess()
check if the viewport is in render process in render room
static const char * getEnumValueByIndex(const char *enumID, int index)
get the value from the global strings list by index. That lists used in dropdown boxes in UI
static void quit()
exit the 3DCoat
static vec4 dwordToVec4(unsigned int d)
convert DWORD (unsigned int) to vec4
static unsigned vec4ToDword(const vec4 &v)
convert vec4 to DWORD (unsigned int)
static vec3 randomNormal()
get the normalized random vector
static void addEnumValue(const char *enumID, const char *key, int value=- 1)
add the value to the global strings list.
static float random01()
get the random value 0..1
static const char * get(const char *key)
Get previously stored value by the key.
static float perlin(vec3 p, float seed=0)
generate the perlin noise value
static float random(float min, float max)
get the random value in range
static int getEnumValuesCount(const char *enumID)
get the count of the values in the global strings list. That lists used in dropdown boxes in UI
static void randomize(int seed)
set the random seed for all further random value generation
static void signal(const char *message)
send some message to 3DCoat (usually used for internal purposes)
static int getEnumValue(const char *enumID, const char *key)
get the integer value that corresponds to the string value from the global strings list.
static std::vector< std::string > & last_signals()
get the list of last signals sent to 3DCoat
static vec3 perlin3d(vec3 p, float seed=0)
returns the perlin noise 3d vector
The UV API. The mesh is taken from the current room. If paint or UV rooms is active,...
Definition CoreAPI.h:4691
static void toUvSet(int uv_set, int island_index, int destination_uv_set)
move the island from one uv-set to another one
static std::vector< int > getSeams()
get all seams across the mesh
static Mesh getWholeMesh()
get the whole mesh from the paint/UV/Retopo room - in dependence on current room
static int islandsCount(int uv_set)
get the islands count over the current uv-set
static void toPlanar(int uv_set, int island_index)
unwrap the island using the Planar approach
static void addSeam(DWORDS2 start_vertex_index, int end_vertex_index)
add the seam to the mesh
static void toLscm(int uv_set, int island_index)
unwrap the island using the LSCM approach
static std::vector< int > getIslandVertexMapping(int uv_set, int island_index)
get the mapping from the vertex index in the mesh that was got by islandToMesh to the vertex index in...
static std::vector< int > getIslandBorder(int uv_set, int island_index)
get unsorted list of edges on the border of the island
static Mesh flattenSingleIsland(const Mesh &mesh, int method, bool optimize_rotation=true, bool scale_to_geometry=true)
Flatten the mesh that consists of the single island.
static Mesh selectedToMesh()
get the selected faces as the Mesh object
static void unwrapUnassigned()
re-wrap/extend islands in correspondence to the changed seams and inserted faces. Pay attention,...
static void removeSharpEdge(int start_vertex_index, int end_vertex_index)
remove the sharp edge from the mesh
static Mesh islandToMeshInSpace(int uv_set, int island_index)
get the mesh that contains the island, each point is the coordinate in space (not the uv coordinate!...
static Mesh islandToMesh(int uv_set, int island_index)
get the mesh that contains the island, xy of each point is the UV coordinate. The mesh contains only ...
static void setUnwrapIslandsDistance(float distance)
set the border around the islands when we pack it
static vec2 getIslandVertexUv(int uv_set, int island_index, int vertex_index)
get the uv coordinate of the positional vertex in the island
static void toAbf(int uv_set, int island_index)
unwrap the island using the ABF approach
static void applyUVSet()
apply uv changes to the paint room mesh (if we use uv/paint context)
static int currentUvSet()
get the current uv-set index
static float getUnwrapIslandsDistance()
get the border around the islands when we pack it
static void meshToIsland(const Mesh &mesh, int uv_set, int island_index)
use the mesh (that was previously got by islandToMesh) to replace the island in the current uv-set
static void unwrap(int uv_set)
unwrap the current uv-set
static std::vector< int > getSharpEdges()
get the sharp edges across the mesh
static void addSharpEdge(int start_vertex_index, int end_vertex_index)
add the sharp edge to the mesh
static void removeSeam(int start_vertex_index, int end_vertex_index)
remove the seam from the mesh
static int uvSetsCount()
get the UV-sets count.
static void toGu(int uv_set, int island_index)
unwrap the island using the GU (Globally Uniform) approach
static void toStripe(int uv_set, int island_index)
try to uwrap the island as the regular stripe
static std::vector< int > getBorderBetweenIslands(int uv_set1, int island_index1, int uv_set2, int island_index2)
get the border between two islands
static void pack(int uv_set, bool rotate, bool shuffle)
pack the islands in the current uv-set
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43
bool gltf_support()
gltf export supported
comms::cVec3 vec3
3D - float vector, see the cVec3
Definition CoreAPI.h:50
void menu_separator()
add the separator to the current menu, this command may be called only from the menu making script
BoolOpType
Boolean operations type.
Definition CoreAPI.h:87
@ BOOL_SUBTRACT
boolean subtract
Definition CoreAPI.h:93
@ BOOL_ADD
boolean add
Definition CoreAPI.h:91
@ BOOL_MERGE
just merge, no booleans, it may be used only in surface mode
Definition CoreAPI.h:89
@ BOOL_INTERSECT
boolean intersect
Definition CoreAPI.h:95
bool IsInTool(const char *ToolID)
check if we are in some tool
bool is_new_scene()
is the scene new/empty?
void insert_extensions()
insert extensions into the toolset (may be used only from the toolset.py)
bool UseRecordScript()
check is scripts recording available
bool voxtree_object_picked()
check if the sculpt object is picked in the viewport
int GetCurrentToolSubmode(const char *id)
get the current tool submode (usually for the uv/retopo tools)
void set_space_panel_columns_count(int num)
set the space panel columns count (only for the toolset.py)
void menu_sort()
sort items in the current menu
void menu_item(const char *id)
add the item to the menu, this command may be called only from the menu making script
void menu_info(const char *id)
add the information item to the menu (without any action, just message), this command may be called o...
bool is_surface()
check if the current sculpt object is in surface mode
comms::cVec4 vec4
4D - float vector, see the cVec4
Definition CoreAPI.h:47
void start_main_menu(const char *id)
strat the main menu root items, this command may be called only from the menu making script
bool is_ptex()
check if ptex is used in the current scene
bool ue5_support()
returns if ue5 support enabled
void tools_item(const char *id)
add the item to the tools section (toolset.py)
bool RoomExists(const char *name)
check if the room exists
bool iconic_submenu(const char *id, int size)
start the menu that will be shown on the icon click, like the navigation menu
bool is_mv()
check if mv objects available in scene
void show_space_panel(const char *Subset, int NumColumns)
show the space panel (with limitations if need)
comms::cVec2 vec2
2D - vector, see the cVec2
Definition CoreAPI.h:56
bool voxtree_item_picked()
check if the VoxTree item is picked
comms::cMat4 mat4
4x4 float matrix, see the cMat4
Definition CoreAPI.h:59
void default_tool(const char *tool)
set the default tool for the toolset.py
ClusterScale
the parameters to be used for cluster scaling in Model, scaleSelectedFacesClusters
Definition CoreAPI.h:4918
void tools_section(const char *id)
start the tools section in the toolset.py
bool IsDebug()
is Debug mode (for developers only)
int tex_approach()
returns the texturing approach index (from the Textures menu)
void run_extension(const char *extension_name, bool auto_start=false)
run extension
bool doc_mode()
check if script is in auto-documenting mode (legacy)
bool is_medical()
check if the app is medical
void menu_exit()
finish the current submenu, this command may be called only from the menu making script
bool is_multires()
check if the current sculpt object is on some multiresolution level
void SetAutoSnapDefaults(bool value)
set the default value for auto-snapping, usually for the retopo/modeling rooms (in toolset....
void show_rmb_panel()
show the rmb panel
void menu_hotkey(const char *id, int Shift, int Ctrl, int Alt)
set the hotkey for the menu item, this command may be called only from the menu making script
void page_suffix(const char *suffix)
set the additional suffix for the page in the toolset.py
bool IsRecordScript()
is the script recording enabled?
bool empty_space_picked()
check if no object is picked
comms::cRect rect
rect float, see the cRect
Definition CoreAPI.h:73
void start_rmb_panel()
start the RNB panel. This command may be called only from the RMB response making script (curves....
comms::cVec3i vec3i
3D - int vector, see the cVec3i
Definition CoreAPI.h:53
bool is_steam_app()
is it steam app?
comms::cList< X > list
the array template, see cList
Definition CoreAPI.h:70
void extensions_main_menu()
insert extension menu into the main menu
bool lock_ui_changes()
check if UI changes locked (for specialized applications, like printing)
comms::cMat3 mat3
3x3 float matrix, see the cMat3
Definition CoreAPI.h:62
bool retopo_object_picked()
the retopo object is picked
bool menu_submenu(const char *id)
add the submenu to the current menu, this command may be called only from the menu making script
bool is_proxy()
check if current sculpt object is in proxy mode
bool IsInRoom(const char *name)
check if you are in some room
bool is_ppp()
chack if there are any ppp objects in scene
comms::cStr str
the string that is compatible with the 3DCoat engine, see the cStr
Definition CoreAPI.h:67
void menu_insert_extensions(const char *id)
insert extension into the main menu (may be called only from the menu making script)
void tools_comment(const char *id)
comment in toolset.py for auto-documentation (legacy)
bool menu_property(const char *id)
returns boolean property value
void PureIconic()
enable the radial menu mode for the space panel
bool CheckIfExists(const char *path)
check if the file exists