This gives better type safety, ease of use (at least in C++ code), and
better readability. The downside is that C code becomes uglier, since
it doesn't have lambdas.
Details
- Reviewers
- None
Diff Detail
- Repository
- rB Blender
- Branch
- cleanup-node-cc-use-map (branched from master)
- Build Status
Buildable 18635 Build 18635: arc lint + arc unit
Event Timeline
| source/blender/blenkernel/intern/node.cc | ||
|---|---|---|
| 1403 | Here you make the assumption that there will always be at least one element in the iterator. While it might be true, for this specific case, this isn't something you should assume. | |
| 1406 | Should take the map as reference. | |
| 1491 | You don't know yet if you can safely dereference the iterator that you just incremented. | |
Thanks, that did it. Checked it by enabling and disabling a node based addon.
- Take the map as reference in constructors
- Check if the end has been reached before dereferencing
| source/blender/blenkernel/intern/node.cc | ||
|---|---|---|
| 1418 | The fact that you have to compare to iterator->end in all of these functions indicates that the approach does not seem quite right. I think it should be possible to only have this check in one of the functions, while still being correct. Maybe you need to use a different set of functions. | |
Refactor to avoid iterators, use foreach callbacks instead
This makes C code (rna_nodetree.c) more ugly but it seems like a good direction.
I also removed some unused RNA functions to avoid having to reimplement them.
Currently there is a crash, but I'm finding it difficult to debug.
I think it has to do with the way I'm using FunctionRef.
Fix incorrec types in C code. Blender seems to work correctly now, but enabling
and disabling sverchok a few times still causes some issues.