Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/freestyle/modules/parameter_editor.py
| Context not available. | |||||
| class MaterialBoundaryUP0D(UnaryPredicate0D): | class MaterialBoundaryUP0D(UnaryPredicate0D): | ||||
| def __call__(self, it): | def __call__(self, it): | ||||
| if it.is_begin: | # can't use only it.is_end here, see commit rBeb8964fb7f19 | ||||
| if it.is_begin or it.is_last or it.is_end: | |||||
| return False | return False | ||||
| it_prev = Interface0DIterator(it) | it.decrement() | ||||
| it_prev.decrement() | prev, v, succ = it.object, next(it), next(it) | ||||
kjym3: This revision is not correct. Checking of .is_last must be done after the first call of `next… | |||||
Not Done Inline Actionswell, say it points to element 6, then it.is_begin is false so if it.is_last is true now, it would have been true at the top (and vice versa). So I believe my solution is correct (tests suggest this too). flokkievids: well, say it points to element 6, then
it.is_begin is false
it.decrement() -> it now points to… | |||||
Not Done Inline ActionsYes, you're right. Thanks for the clarification! kjym3: Yes, you're right. Thanks for the clarification! | |||||
Not Done Inline ActionsThis line of code has to be: prev, v, succ = next(it), next(it), next(it) kjym3: This line of code has to be:
```
prev, v, succ = next(it), next(it), next(it)
```
| |||||
| v = it.object | fe = v.get_fedge(prev) | ||||
| it.increment() | |||||
| if it.is_end: | |||||
| return False | |||||
| fe = v.get_fedge(it_prev.object) | |||||
| idx1 = fe.material_index if fe.is_smooth else fe.material_index_left | idx1 = fe.material_index if fe.is_smooth else fe.material_index_left | ||||
| fe = v.get_fedge(it.object) | fe = v.get_fedge(succ) | ||||
| idx2 = fe.material_index if fe.is_smooth else fe.material_index_left | idx2 = fe.material_index if fe.is_smooth else fe.material_index_left | ||||
| return idx1 != idx2 | return idx1 != idx2 | ||||
| Context not available. | |||||
This revision is not correct. Checking of .is_last must be done after the first call of next().
if it.is_begin: return False it.decrement() prev, v = it.object, next(it) if it.is_last: return False succ = next(it)