Developer Discussion: New Grease Pencil Data Structure Proposal

I think sharing some code with the existing operators, modifiers and tools will simplify things. If you have to deal with two DNA/RNA structures for every modifier, two keymaps because the operators are different, two mappings from operators to the user manual, … that’s messy. And then at the end do versioning for all that, whereas you can avoid doing any modifier/keymap versioning if the data structures and names all stay the same.

if(new_data) ... else ... in the operator exec/invoke function, or modifier generate/deform function is not that bad? You would have to move the existing files to C++, but I think that’s much more straightforward.

1 Like

That would work, yes! I wasn’t thinking to duplicate all the actual operators. Just replace the internal logic. Having an if/else to switch between the ID’s sounds good.

Agree that the best idea is to create a new ID. Also, the goal of this first project phase is get the same functionality with the new data structure. If we try to add more things in this phase, it would more work and more difficult to debug if all was working as expected.

Now, we need to think in detail what will be our strategy to keep both systems running but avoiding a full code duplication.

1 Like