[Bf-committers] Attempt on duplicating modifier

Edgard Damiani edamiani at gmail.com
Wed Oct 26 22:34:48 CEST 2016


Hi everyone,

It's in my plans using Blender as a prototyping platform for my master's
thesis, so I decided to start my tests by duplicating an existing modifier
and changing its code. I've chosen the Skin Modifier, since it's the
closest I could find to what I have in mind, and took these steps to
duplicate it:

- Duplicated the MOD_skin.c file and renamed it to MOD_skin2.c;
- Inside MOD_skin2.c, I renamed modifierType_Skin to modifierType_Skin2,
and changed its first parameter accordingly ("Skin2");
- Added "eModifierType_Skin2 = 53" to the end of ModifierType in
DNA_modifier_types.h (53 being the first vacant number);
- Declared modifierType_Skin2 inside MOD_modifiertypes.h;
- Added INIT_TYPE(Skin2) inside MOD_util.c;

With these steps, the code compiles without issues, but when I run Blender,
the recently-created modifier doesn't appear in the Modifiers list. Then, I
realized that I should somehow add it to the UI through Python, but the
only file I've found that had a connection with the modifiers was
properties_data_modifier.py, which lists the user interface code for each
modifier. I tried to create a SKIN2 function inside this file by
duplicating the SKIN function, but the whole Python interface breaks down
when I do it.

Is there anything else I should do in order to correctly show this Skin2
modifier inside Blender's Modifiers list?


Thanks and best regards,
Edgard


More information about the Bf-committers mailing list