Skip to content

Commit

Permalink
Mesh modifier changes now stick.
Browse files Browse the repository at this point in the history
  • Loading branch information
croudyj committed Jul 28, 2023
1 parent 031c255 commit ba891ef
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 102 deletions.
2 changes: 1 addition & 1 deletion src/bindings/bnd_extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,7 @@ void initExtensionsBindings(pybind11::module& m)
.def("__len__", &BND_File3dmShutLiningCurveTable::Count)
.def("__getitem__", &BND_File3dmShutLiningCurveTable::FindIndex)
.def("__iter__", [](py::object s) { return PyBNDIterator<BND_File3dmShutLiningCurveTable&, BND_File3dmShutLiningCurve*>(s.cast<BND_File3dmShutLiningCurveTable&>(), s); })
.def("Add", &BND_File3dmShutLiningCurveTable::Add)
.def("Add", &BND_File3dmShutLiningCurveTable::Add, py::arg("id"))
.def("FindIndex", &BND_File3dmShutLiningCurveTable::FindIndex, py::arg("index"))
.def("FindId", &BND_File3dmShutLiningCurveTable::FindId, py::arg("id"))
;
Expand Down
40 changes: 29 additions & 11 deletions src/bindings/bnd_mesh_modifiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ BND_File3dmDisplacement::BND_File3dmDisplacement(ON_3dmObjectAttributes* attr)
{
if (nullptr != m_attr)
{
m_mm = m_ds = m_attr->MeshModifiers().Displacement();
m_mm = m_attr->MeshModifiers().Displacement();
}
}

void BND_File3dmDisplacement::CreateNew(void)
{
if (nullptr != m_attr)
{
m_mm = m_ds = m_attr->MeshModifiers().Displacement(true);
m_mm = m_attr->MeshModifiers().Displacement(true);
}
}

Expand All @@ -25,15 +25,15 @@ BND_File3dmEdgeSoftening::BND_File3dmEdgeSoftening(ON_3dmObjectAttributes* attr)
{
if (nullptr != m_attr)
{
m_mm = m_es = m_attr->MeshModifiers().EdgeSoftening();
m_mm = m_attr->MeshModifiers().EdgeSoftening();
}
}

void BND_File3dmEdgeSoftening::CreateNew(void)
{
if (nullptr != m_attr)
{
m_mm = m_es = m_attr->MeshModifiers().EdgeSoftening(true);
m_mm = m_attr->MeshModifiers().EdgeSoftening(true);
}
}

Expand All @@ -43,15 +43,15 @@ BND_File3dmThickening::BND_File3dmThickening(ON_3dmObjectAttributes* attr)
{
if (nullptr != m_attr)
{
m_mm = m_th = m_attr->MeshModifiers().Thickening();
m_mm = m_attr->MeshModifiers().Thickening();
}
}

void BND_File3dmThickening::CreateNew(void)
{
if (nullptr != m_attr)
{
m_mm = m_th = m_attr->MeshModifiers().Thickening(true);
m_mm = m_attr->MeshModifiers().Thickening(true);
}
}

Expand All @@ -61,15 +61,22 @@ BND_File3dmCurvePiping::BND_File3dmCurvePiping(ON_3dmObjectAttributes* attr)
{
if (nullptr != m_attr)
{
m_mm = m_cp = m_attr->MeshModifiers().CurvePiping();
m_mm = m_attr->MeshModifiers().CurvePiping();
}
}

BND_File3dmCurvePiping::BND_File3dmCurvePiping(const BND_File3dmCurvePiping& cp)
:
BND_File3dmMeshModifier(cp.m_attr)
{
m_mm = cp.m_mm;
}

void BND_File3dmCurvePiping::CreateNew(void)
{
if (nullptr != m_attr)
{
m_mm = m_cp = m_attr->MeshModifiers().CurvePiping(true);
m_mm = m_attr->MeshModifiers().CurvePiping(true);
}
}

Expand All @@ -79,15 +86,15 @@ BND_File3dmShutLining::BND_File3dmShutLining(ON_3dmObjectAttributes* attr)
{
if (nullptr != m_attr)
{
m_mm = m_sl = m_attr->MeshModifiers().ShutLining();
m_mm = m_attr->MeshModifiers().ShutLining();
}
}

void BND_File3dmShutLining::CreateNew(void)
{
if (nullptr != m_attr)
{
m_mm = m_sl = m_attr->MeshModifiers().ShutLining(true);
m_mm = m_attr->MeshModifiers().ShutLining(true);
}
}

Expand Down Expand Up @@ -158,6 +165,7 @@ BND_File3dmShutLiningCurve* BND_File3dmShutLiningCurveTable::FindId(BND_UUID id)

BND_File3dmMeshModifiers::BND_File3dmMeshModifiers(ON_3dmObjectAttributes* attr)
:
m_attr(attr),
m_displacement(attr),
m_edge_softening(attr),
m_thickening(attr),
Expand All @@ -166,6 +174,17 @@ BND_File3dmMeshModifiers::BND_File3dmMeshModifiers(ON_3dmObjectAttributes* attr)
{
}

BND_File3dmMeshModifiers::BND_File3dmMeshModifiers(const BND_File3dmMeshModifiers& mm)
:
m_attr(mm.m_attr),
m_displacement(mm.m_attr),
m_edge_softening(mm.m_attr),
m_thickening(mm.m_attr),
m_curve_piping(mm.m_attr),
m_shutlining(mm.m_attr)
{
}

//////////////////////////////////////////////////////////////////////////////

#if defined(ON_PYTHON_COMPILE)
Expand Down Expand Up @@ -242,7 +261,6 @@ void initMeshModifierBindings(pybind11::module& m)
.def_property("Faceted", &BND_File3dmShutLining::Faceted, &BND_File3dmShutLining::SetFaceted)
.def_property("AutoUpdate", &BND_File3dmShutLining::AutoUpdate, &BND_File3dmShutLining::SetAutoUpdate)
.def_property("ForceUpdate", &BND_File3dmShutLining::ForceUpdate, &BND_File3dmShutLining::SetForceUpdate)
.def_property("ForceUpdate", &BND_File3dmShutLining::ForceUpdate, &BND_File3dmShutLining::SetForceUpdate)
.def_property_readonly("Curves", &BND_File3dmShutLining::Curves)
.def("DeleteAllCurves", &BND_File3dmShutLining::DeleteAllCurves)
;
Expand Down
Loading

0 comments on commit ba891ef

Please sign in to comment.