[Bf-blender-cvs] [6516452] bake-cycles: Cycles-Bake: Renaming 'Custom-Cage' to 'Cage'

Dalai Felinto noreply at git.blender.org
Wed Apr 23 02:47:51 CEST 2014


Commit: 651645265959728e9996cef72224f9eaade1ecf6
Author: Dalai Felinto
Date:   Tue Mar 25 23:41:35 2014 -0300
https://developer.blender.org/rB651645265959728e9996cef72224f9eaade1ecf6

Cycles-Bake: Renaming 'Custom-Cage' to 'Cage'

As suggested by Andy Davies (metallandy):

The Custom cage title is not correct. Custom cages are when the user has
modified the topology of the cage by moving verts/topology and meshes
under this slot do not need to have modified verts/topology in order to
work. They could use a regular mesh or have one imported from another
application so just calling it Cage mesh or Cage object would be
perfect. Calling it cage mesh goes against convention for all other 3d
applications so it's just going to cause confusion.

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

M	intern/cycles/blender/addon/properties.py
M	intern/cycles/blender/addon/ui.py
M	source/blender/editors/object/object_bake_api.c

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

diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 18603e5..5b1d753 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -319,9 +319,9 @@ class CyclesBakeSettings(bpy.types.PropertyGroup):
             max=props_base['cage_extrusion'].hard_max,
             )
 
-    custom_cage = StringProperty(
-            name=props_base['custom_cage'].name,
-            description=props_base['custom_cage'].description,
+    cage = StringProperty(
+            name=props_base['cage'].name,
+            description=props_base['cage'].description,
             )
 
     normal_space = EnumProperty(
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 3625375..d13e469 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1301,7 +1301,7 @@ class CyclesRender_PT_bake(CyclesButtonsPanel, Panel):
                 "margin",
                 "use_selected_to_active",
                 "cage_extrusion",
-                "custom_cage",
+                "cage",
                 "normal_space",
                 "normal_r",
                 "normal_g",
@@ -1341,7 +1341,7 @@ class CyclesRender_PT_bake(CyclesButtonsPanel, Panel):
         sub = col.column()
         sub.active = cbk.use_selected_to_active
         sub.prop(cbk, "cage_extrusion")
-        sub.prop_search(cbk, "custom_cage", scene, "objects")
+        sub.prop_search(cbk, "cage", scene, "objects")
 
         if cbk.type == 'NORMAL':
             col.separator()
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 9c9924a..debfe0d 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -241,7 +241,7 @@ static int bake_exec(bContext *C, wmOperator *op)
 	char custom_cage[MAX_NAME];
 	char filepath[FILE_MAX];
 
-	RNA_string_get(op->ptr, "custom_cage", custom_cage);
+	RNA_string_get(op->ptr, "cage", custom_cage);
 	RNA_string_get(op->ptr, "filepath", filepath);
 
 	if (use_selected_to_active) {
@@ -264,8 +264,9 @@ static int bake_exec(bContext *C, wmOperator *op)
 	if (custom_cage[0] != '\0') {
 		ob_custom_cage = (Object *)BLI_findstring(&bmain->object, custom_cage, offsetof(ID, name) + 2);
 
+		/* TODO check if cage object has the same topology (num of triangles and a valid UV) */
 		if (ob_custom_cage == NULL || ob_custom_cage->type != OB_MESH) {
-			BKE_report(op->reports, RPT_ERROR, "No valid custom cage object");
+			BKE_report(op->reports, RPT_ERROR, "No valid cage object");
 			return OPERATOR_CANCELLED;
 		}
 		else {
@@ -583,7 +584,7 @@ void OBJECT_OT_bake(wmOperatorType *ot)
 	ot->prop = RNA_def_int(ot->srna, "margin", 16, 0, INT_MAX, "Margin", "Extends the baked result as a post process filter", 0, 64);
 	ot->prop = RNA_def_boolean(ot->srna, "use_selected_to_active", false, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
 	ot->prop = RNA_def_float(ot->srna, "cage_extrusion", 0.0, 0.0, 1.0, "Cage Extrusion", "Distance to use for the inward ray cast when using selected to active", 0.0, 1.0);
-	ot->prop = RNA_def_string(ot->srna, "custom_cage", NULL, MAX_NAME, "Custom Cage", "Object to use as custom cage");
+	ot->prop = RNA_def_string(ot->srna, "cage", NULL, MAX_NAME, "Cage", "Object to use as cage");
 	ot->prop = RNA_def_enum(ot->srna, "normal_space", normal_space_items, R_BAKE_SPACE_WORLD, "Normal Space", "Choose normal space for baking");
 	ot->prop = RNA_def_enum(ot->srna, "normal_r", normal_swizzle_items, OB_NEGX, "R", "Axis to bake in red channel");
 	ot->prop = RNA_def_enum(ot->srna, "normal_g", normal_swizzle_items, OB_NEGY, "G", "Axis to bake in green channel");




More information about the Bf-blender-cvs mailing list