Commit: 01949c7d59c2589fc81b81dffb5e25ee4e977ca2
Author: Nicholas Bishop
Date:   Mon Feb 9 02:28:32 2015 +0100
Branches: cycles-ptex-49
https://developer.blender.org/rB01949c7d59c2589fc81b81dffb5e25ee4e977ca2

Select new layer after importing a Ptex layer

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

M       source/blender/editors/mesh/mesh_data.c

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

diff --git a/source/blender/editors/mesh/mesh_data.c 
b/source/blender/editors/mesh/mesh_data.c
index 1eb12b9..3ed4ef9 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -931,11 +931,13 @@ static int mesh_ptex_import_exec(bContext *C, wmOperator 
*op)
 {
        Object *ob = ED_object_context(C);
        Mesh *me = ob->data;
+       const int layernum = CustomData_number_of_layers(&me->ldata, 
CD_LOOP_PTEX);
        char path[FILE_MAX];
 
        RNA_string_get(op->ptr, "filepath", path);
 
        if (BKE_ptex_import(me, path)) {
+               CustomData_set_layer_active(&me->ldata, CD_LOOP_PTEX, layernum);
                return OPERATOR_FINISHED;
        }
        else {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to