Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-06-19 19:40:48 +0300
committerHans Goudey <h.goudey@me.com>2020-06-19 19:40:48 +0300
commiteaa44afe703eeb785f4590719b39392b66d6a312 (patch)
tree8dbf73119d330d51e9b1181af1ede4a98e69f90c /source/blender/blenkernel/intern/constraint.c
parent27fb75fec265fbea31f3976e829b405a87b9970e (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/intern/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c9
1 files changed, 8 insertions, 1 deletions
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 */