I added operator game_property_move_up and game_property_move_down.
same result that in : https://developer.blender.org/T32292 but no rewrite of the properties list just remove and insert in C code.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- ge_properties_order
Event Timeline
In general this looks fine to me, just added some inline comments for minor things.
Furthermore, I'm not sure if you have seen it, but I recently worked on modifier drag & drop which is generic enough to be used here as well (although it's not ready for that yet).
Maybe it's worth waiting with this and use drag & drop right away?| source/blender/editors/object/object_edit.c | ||
|---|---|---|
| 1782 | prevprop can be accessed using prop->prev. Also following our codestyle, index-1 should be index - 1, just as a general note ;) | |
| 1786–1787 | BLI_listbase_swaplinks(...) makes this a one-liner | |
| 1824 | Same here of course, prop->next | |
| 1828–1829 | And here: BLI_listbase_swaplinks(...) | |
I wouldn't say dnd should be the only way to order the stuff, in some cases it might be just faster to single-click on a button than dragging stuff around. So IMO the patch is still valid.
The only thing i'm not totally agree with is having dedicated operators for moving property up and down, it makes more sense to have a single operator with a direction option, so you'll have OBJECT_OT_game_property_move and UP/DOWN will be an enum option of this operator.
Would use defines for move directions (PROPERTIES_MOVE_UP & co), makes code cleaner and easier to read. Otherwise looks good to me.
