Skip to content

Commit

Permalink
No slvs data when constraint is a contructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
amrsoll committed Aug 24, 2022
1 parent a0d2a32 commit 5b618b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions class_defines.py
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,7 @@ def _name_setter(self, new_name):
name: StringProperty(name="Name", get=_name_getter, set=_name_setter)
failed: BoolProperty(name="Failed")
visible: BoolProperty(name="Visible", default=True, update=functions.update_cb)
construction: BoolProperty(name="Construction")
signature = ()
props = ()

Expand Down Expand Up @@ -2314,6 +2315,7 @@ def draw_props(self, layout: UILayout):
# General props
layout.separator()
layout.prop(self, "visible")
layout.prop(self, "construction")

# Specific props
layout.separator()
Expand All @@ -2339,6 +2341,12 @@ def placements(self):
return []


def py_data(self, solvesys: Solver, **kwargs):
if self.construction:
return []
return self.create_slvs_data(solvesys, **kwargs)


# NOTE: When tweaking, it's necessary to constrain a point that is only temporary available
# and has no SlvsPoint representation
def make_coincident(solvesys, point_handle, e2, wp, group, entity_type=None):
Expand Down
9 changes: 5 additions & 4 deletions solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ def _get_msg_entities():
# Store a index-constraint mapping
from collections.abc import Iterable

indices = c.create_slvs_data(self.solvesys, group=group)
self._store_constraint_indices(
c, indices if isinstance(indices, Iterable) else (indices,)
)
indices = c.py_data(self.solvesys, group=group)
if indices:
self._store_constraint_indices(
c, indices if isinstance(indices, Iterable) else (indices,)
)

def _get_msg_constraints():
msg = "Initialize constraints:"
Expand Down

0 comments on commit 5b618b3

Please sign in to comment.