diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-19 19:40:48 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-19 19:40:48 +0300 |
commit | eaa44afe703eeb785f4590719b39392b66d6a312 (patch) | |
tree | 8dbf73119d330d51e9b1181af1ede4a98e69f90c /source/blender/blenkernel | |
parent | 27fb75fec265fbea31f3976e829b405a87b9970e (diff) |
UI: Drag and Drop Constraints, Layout Updates
This patch implements the list panel system D7490 for constraints.
In this case the panels are still defined in Python.
The layouts are also updated to use subpanels and the a more organized
single column layout. There may be more tweaks necessary for the
layouts.
Reviewed By: Severin, billreynish, Mets
Differential Revision: https://developer.blender.org/D7499
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_constraint.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index 8fe3bd77a26..020b0f8b913 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -136,6 +136,9 @@ typedef struct bConstraintTypeInfo { const bConstraintTypeInfo *BKE_constraint_typeinfo_get(struct bConstraint *con); const bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type); +void BKE_constraint_panel_id(int type, char *r_name); +void BKE_constraint_bone_panel_id(int type, char *r_name); + /* ---------------------------------------------------------------------------- */ /* Constraint function prototypes */ diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 050e8d434ae..f215297c8a2 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -5412,9 +5412,16 @@ static bConstraint *add_new_constraint_internal(const char *name, short type) /* Set up a generic constraint data-block. */ con->type = type; - con->flag |= CONSTRAINT_EXPAND | CONSTRAINT_OVERRIDE_LIBRARY_LOCAL; + con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL; con->enforce = 1.0f; + /* Only open the main panel when constraints are created, not the subpanels. */ + con->ui_expand_flag = (1 << 0); + if (type == CONSTRAINT_TYPE_ACTION || CONSTRAINT_TYPE_SPLINEIK) { + /* Expand the two subpanels in the cases where the main panel barely has any properties. */ + con->ui_expand_flag |= (1 << 1) | (1 << 2); + } + /* Determine a basic name, and info */ if (cti) { /* initialize constraint data */ |