[Bf-blender-cvs] [194a33f] master: CacheFile: only enable scale property slider if we are editing the cache through a constraint.

Kévin Dietrich noreply at git.blender.org
Fri Oct 28 18:09:25 CEST 2016


Commit: 194a33ff001bb240d15268caf6ec0a4738b30225
Author: Kévin Dietrich
Date:   Fri Oct 28 17:56:09 2016 +0200
Branches: master
https://developer.blender.org/rB194a33ff001bb240d15268caf6ec0a4738b30225

CacheFile: only enable scale property slider if we are editing the cache
through a constraint.

It doesn't make sense and is a bit confusing to have this property
enabled in the modifier context.

===================================================================

M	source/blender/editors/interface/interface_templates.c

===================================================================

diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 36f6506..bdad667 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -3886,6 +3886,8 @@ void uiTemplateCacheFile(uiLayout *layout, bContext *C, PointerRNA *ptr, const c
 		return;
 	}
 
+	SpaceButs *sbuts = CTX_wm_space_buts(C);
+
 	uiLayout *row = uiLayoutRow(layout, false);
 	uiBlock *block = uiLayoutGetBlock(row);
 	uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
@@ -3911,6 +3913,7 @@ void uiTemplateCacheFile(uiLayout *layout, bContext *C, PointerRNA *ptr, const c
 	uiItemL(row, IFACE_("Manual Transform:"), ICON_NONE);
 
 	row = uiLayoutRow(layout, false);
+	uiLayoutSetEnabled(row, (sbuts->mainb == BCONTEXT_CONSTRAINT));
 	uiItemR(row, &fileptr, "scale", 0, "Scale", ICON_NONE);
 
 	/* TODO: unused for now, so no need to expose. */




More information about the Bf-blender-cvs mailing list