[Bf-blender-cvs] [01949c7] cycles-ptex-49: Select new layer after importing a Ptex layer

Nicholas Bishop noreply at git.blender.org
Mon Feb 9 10:01:07 CET 2015


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 {




More information about the Bf-blender-cvs mailing list