diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-26 08:23:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-26 08:23:18 +0400 |
commit | 452f7c38687527d3283395fb6d716cb63a2d8f60 (patch) | |
tree | 80c52c8918946ca6205ae3bf4be630878666bb52 /source/blender/makesrna/intern/rna_mesh.c | |
parent | 48f0444760ea33c67d607b4f1e1dadd66e1eea76 (diff) |
setting the active texture layer from python would get the UV layer out of sync. (entering editmode would show the wrong UV layer)
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 7eef6630924..ad5b72079a9 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -483,13 +483,20 @@ static int rna_CustomDataLayer_clone_get(PointerRNA *ptr, CustomData *data, int static void rna_CustomDataLayer_active_set(PointerRNA *ptr, CustomData *data, int value, int type, int render) { - int n = ((CustomDataLayer*)ptr->data) - data->layers; + int n = (((CustomDataLayer*)ptr->data) - data->layers) - CustomData_get_layer_index(data, type); if (value == 0) return; - if (render) CustomData_set_layer_render_index(data, type, n); - else CustomData_set_layer_active_index(data, type, n); + if (render) CustomData_set_layer_render(data, type, n); + else CustomData_set_layer_active(data, type, n); + + /* sync loop layer */ + if (type == CD_MTEXPOLY) { + CustomData *ldata = rna_mesh_ldata(ptr); + if (render) CustomData_set_layer_render(ldata, CD_MLOOPUV, n); + else CustomData_set_layer_active(ldata, CD_MLOOPUV, n); + } } static void rna_CustomDataLayer_clone_set(PointerRNA *ptr, CustomData *data, int value, int type, int render) @@ -2178,12 +2185,6 @@ static void rna_def_mesh_loops(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "Mesh"); RNA_def_struct_ui_text(srna, "Mesh Loops", "Collection of mesh loops"); -#if 0 /* BMESH_TODO */ - prop = RNA_def_property(srna, "active", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "act_face"); - RNA_def_property_ui_text(prop, "Active Polygon", "The active polygon for this mesh"); -#endif - func = RNA_def_function(srna, "add", "ED_mesh_loops_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of loops to add", 0, INT_MAX); |