[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50790] trunk/blender/source/blender: remove sticky coordinates from blender, this was missing from the UI since 2.49.

Campbell Barton ideasman42 at gmail.com
Fri Sep 21 13:19:17 CEST 2012


Revision: 50790
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50790
Author:   campbellbarton
Date:     2012-09-21 11:19:16 +0000 (Fri, 21 Sep 2012)
Log Message:
-----------
remove sticky coordinates from blender, this was missing from the UI since 2.49.

TODO - drop support from the renderer still.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_blender.h
    trunk/blender/source/blender/blenkernel/intern/mesh.c
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/blenloader/intern/versioning_legacy.c
    trunk/blender/source/blender/editors/mesh/mesh_data.c
    trunk/blender/source/blender/editors/mesh/mesh_intern.h
    trunk/blender/source/blender/editors/mesh/mesh_ops.c
    trunk/blender/source/blender/makesdna/DNA_material_types.h
    trunk/blender/source/blender/makesdna/DNA_mesh_types.h
    trunk/blender/source/blender/makesrna/intern/rna_material.c
    trunk/blender/source/blender/makesrna/intern/rna_mesh.c
    trunk/blender/source/blender/render/intern/source/convertblender.c

Modified: trunk/blender/source/blender/blenkernel/BKE_blender.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_blender.h	2012-09-21 10:40:48 UTC (rev 50789)
+++ trunk/blender/source/blender/blenkernel/BKE_blender.h	2012-09-21 11:19:16 UTC (rev 50790)
@@ -42,7 +42,7 @@
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         263
-#define BLENDER_SUBVERSION      20
+#define BLENDER_SUBVERSION      21
 
 /* 262 was the last editmesh release but its has compatibility code for bmesh data,
  * so set the minversion to 2.61 */

Modified: trunk/blender/source/blender/blenkernel/intern/mesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mesh.c	2012-09-21 10:40:48 UTC (rev 50789)
+++ trunk/blender/source/blender/blenkernel/intern/mesh.c	2012-09-21 11:19:16 UTC (rev 50790)
@@ -367,7 +367,6 @@
 
 	me->mvert = CustomData_get_layer(&me->vdata, CD_MVERT);
 	me->dvert = CustomData_get_layer(&me->vdata, CD_MDEFORMVERT);
-	me->msticky = CustomData_get_layer(&me->vdata, CD_MSTICKY);
 
 	me->medge = CustomData_get_layer(&me->edata, CD_MEDGE);
 

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2012-09-21 10:40:48 UTC (rev 50789)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2012-09-21 11:19:16 UTC (rev 50790)
@@ -3821,7 +3821,6 @@
 	mesh->tface = newdataadr(fd, mesh->tface);
 	mesh->mtface = newdataadr(fd, mesh->mtface);
 	mesh->mcol = newdataadr(fd, mesh->mcol);
-	mesh->msticky = newdataadr(fd, mesh->msticky);
 	mesh->dvert = newdataadr(fd, mesh->dvert);
 	mesh->mloopcol = newdataadr(fd, mesh->mloopcol);
 	mesh->mloopuv = newdataadr(fd, mesh->mloopuv);
@@ -7986,6 +7985,21 @@
 		}
 	}
 
+	/* remove texco */
+	if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 21)) {
+		Material *ma;
+		for (ma = main->mat.first; ma; ma = ma->id.next) {
+			int a;
+			for (a = 0; a < MAX_MTEX; a++) {
+				if (ma->mtex[a]) {
+					if (ma->mtex[a]->texco == TEXCO_STICKY) {
+						ma->mtex[a]->texco = TEXCO_UV;
+					}
+				}
+			}
+		}
+	}
+
 	/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
 	/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
 

Modified: trunk/blender/source/blender/blenloader/intern/versioning_legacy.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/versioning_legacy.c	2012-09-21 10:40:48 UTC (rev 50789)
+++ trunk/blender/source/blender/blenloader/intern/versioning_legacy.c	2012-09-21 11:19:16 UTC (rev 50790)
@@ -387,8 +387,6 @@
 	if (!me->vdata.totlayer) {
 		CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, me->mvert, me->totvert);
 
-		if (me->msticky)
-			CustomData_add_layer(&me->vdata, CD_MSTICKY, CD_ASSIGN, me->msticky, me->totvert);
 		if (me->dvert)
 			CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_ASSIGN, me->dvert, me->totvert);
 	}

Modified: trunk/blender/source/blender/editors/mesh/mesh_data.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/mesh_data.c	2012-09-21 10:40:48 UTC (rev 50789)
+++ trunk/blender/source/blender/editors/mesh/mesh_data.c	2012-09-21 11:19:16 UTC (rev 50790)
@@ -747,118 +747,6 @@
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/*********************** sticky operators ************************/
-
-static Object *mesh_customdata_get_camera_for_sticky(wmOperator *op, Scene *scene, View3D *v3d)
-{
-	/* report an error if we can't find the camera */
-
-	Object *camera = NULL;
-	if (scene->obedit) {
-		BKE_report(op->reports, RPT_ERROR, "Unable to make sticky in Edit Mode");
-	}
-	else {
-		if (v3d)            camera = V3D_CAMERA_LOCAL(v3d);
-		if (camera == NULL) camera = scene->camera;
-
-		if (camera == NULL) {
-			BKE_report(op->reports, RPT_ERROR, "Need camera to make sticky");
-		}
-	}
-
-	return camera;
-}
-
-static int mesh_customdata_add_sticky_selected_exec(bContext *C, wmOperator *op)
-{
-	Scene *scene = CTX_data_scene(C);
-	View3D *v3d = CTX_wm_view3d(C);
-	Object *camera = mesh_customdata_get_camera_for_sticky(op, scene, v3d);
-	LinkNode *objects = NULL;
-	LinkNode *ob_iter;
-
-	if (camera == NULL) {
-		return OPERATOR_CANCELLED;
-	}
-
-	CTX_DATA_BEGIN(C, Object *, ob, selected_editable_objects)
-	{
-		if (ob->type == OB_MESH) {
-			BLI_linklist_prepend(&objects, ob);
-		}
-	}
-	CTX_DATA_END;
-
-	if (objects == NULL) {
-		return OPERATOR_CANCELLED;
-	}
-
-	RE_make_sticky(scene, camera, objects);
-
-	for (ob_iter = objects; ob_iter; ob_iter = ob_iter->next) {
-		Object *ob = ob_iter->link;
-		DAG_id_tag_update(ob->data, 0);
-		WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
-	}
-
-	BLI_linklist_free(objects, NULL);
-
-	return OPERATOR_FINISHED;
-}
-
-void MESH_OT_customdata_create_sticky_selected(wmOperatorType *ot)
-{
-	/* identifiers */
-	ot->name = "Calculate Sticky for Selection";
-	ot->description = "Calculate sticky UV texture layer from the camera on selected objects";
-	ot->idname = "MESH_OT_customdata_create_sticky_selected";
-
-	/* api callbacks */
-	ot->poll = layers_poll;
-	ot->exec = mesh_customdata_add_sticky_selected_exec;
-
-	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
-static int mesh_customdata_add_sticky_exec(bContext *C, wmOperator *op)
-{
-	Object *obedit = ED_object_context(C);
-	Scene *scene = CTX_data_scene(C);
-	View3D *v3d = CTX_wm_view3d(C);
-	Object *camera = mesh_customdata_get_camera_for_sticky(op, scene, v3d);
-	LinkNode objects = {NULL};
-
-	if (camera == NULL) {
-		return OPERATOR_CANCELLED;  /* error is set */
-	}
-
-	objects.link = obedit;
-	objects.next = NULL;
-
-	RE_make_sticky(scene, camera, &objects);
-
-	DAG_id_tag_update(obedit->data, 0);
-	WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
-
-	return OPERATOR_FINISHED;
-}
-
-void MESH_OT_customdata_create_sticky(wmOperatorType *ot)
-{
-	/* identifiers */
-	ot->name = "Calculate Sticky";
-	ot->description = "Calculate sticky UV texture layer from the camera";
-	ot->idname = "MESH_OT_customdata_create_sticky";
-
-	/* api callbacks */
-	ot->poll = layers_poll;
-	ot->exec = mesh_customdata_add_sticky_exec;
-
-	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
 /* *** CustomData clear functions, we need an operator for each *** */
 
 static int mesh_customdata_clear_exec__internal(bContext *C,
@@ -925,78 +813,6 @@
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* Clear Sticky */
-static int mesh_customdata_clear_sticky_poll(bContext *C)
-{
-	Object *ob = ED_object_context(C);
-
-	if (ob && ob->type == OB_MESH) {
-		Mesh *me = ob->data;
-		if (me->id.lib == NULL) {
-			CustomData *data = GET_CD_DATA(me, vdata);
-			if (CustomData_has_layer(data, CD_MSTICKY)) {
-				return TRUE;
-			}
-		}
-	}
-	return FALSE;
-}
-static int mesh_customdata_clear_sticky_exec(bContext *C, wmOperator *UNUSED(op))
-{
-	return mesh_customdata_clear_exec__internal(C, BM_VERT, CD_MSTICKY);
-}
-
-void MESH_OT_customdata_clear_sticky(wmOperatorType *ot)
-{
-	/* identifiers */
-	ot->name = "Clear Sticky Data";
-	ot->idname = "MESH_OT_customdata_clear_sticky";
-	ot->description = "Clear vertex sticky UV texture layer";
-
-	/* api callbacks */
-	ot->exec = mesh_customdata_clear_sticky_exec;
-	ot->poll = mesh_customdata_clear_sticky_poll;
-
-	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
-/* Clear Skin */
-static int mesh_customdata_clear_skin_poll(bContext *C)
-{
-	Object *ob = ED_object_context(C);
-
-	if (ob && ob->type == OB_MESH) {
-		Mesh *me = ob->data;
-		if (me->id.lib == NULL) {
-			CustomData *data = GET_CD_DATA(me, vdata);
-			if (CustomData_has_layer(data, CD_MVERT_SKIN)) {
-				return TRUE;
-			}
-		}
-	}
-	return FALSE;
-}
-static int mesh_customdata_clear_skin_exec(bContext *C, wmOperator *UNUSED(op))
-{
-	return mesh_customdata_clear_exec__internal(C, BM_VERT, CD_MVERT_SKIN);
-}
-
-void MESH_OT_customdata_clear_skin(wmOperatorType *ot)
-{
-	/* identifiers */
-	ot->name = "Clear Skin Data";
-	ot->idname = "MESH_OT_customdata_clear_skin";
-	ot->description = "Clear vertex skin layer";
-
-	/* api callbacks */
-	ot->exec = mesh_customdata_clear_skin_exec;
-	ot->poll = mesh_customdata_clear_skin_poll;
-
-	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
 /************************** Add Geometry Layers *************************/
 
 void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)

Modified: trunk/blender/source/blender/editors/mesh/mesh_intern.h
===================================================================
--- trunk/blender/source/blender/editors/mesh/mesh_intern.h	2012-09-21 10:40:48 UTC (rev 50789)
+++ trunk/blender/source/blender/editors/mesh/mesh_intern.h	2012-09-21 11:19:16 UTC (rev 50790)
@@ -187,12 +187,8 @@
 void MESH_OT_uv_texture_remove(struct wmOperatorType *ot);
 void MESH_OT_vertex_color_add(struct wmOperatorType *ot);
 void MESH_OT_vertex_color_remove(struct wmOperatorType *ot);
-void MESH_OT_customdata_create_sticky_selected(struct wmOperatorType *ot);
-void MESH_OT_customdata_create_sticky(struct wmOperatorType *ot);
-void MESH_OT_customdata_clear_sticky(struct wmOperatorType *ot);
 /* no create_mask yet */
 void MESH_OT_customdata_clear_mask(struct wmOperatorType *ot);
-void MESH_OT_customdata_clear_skin(struct wmOperatorType *ot);
 
 void MESH_OT_drop_named_image(struct wmOperatorType *ot);
 

Modified: trunk/blender/source/blender/editors/mesh/mesh_ops.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/mesh_ops.c	2012-09-21 10:40:48 UTC (rev 50789)
+++ trunk/blender/source/blender/editors/mesh/mesh_ops.c	2012-09-21 11:19:16 UTC (rev 50790)
@@ -134,7 +134,6 @@
 	WM_operatortype_append(MESH_OT_vertices_smooth);
 	WM_operatortype_append(MESH_OT_noise);
 	WM_operatortype_append(MESH_OT_flip_normals);
-	//WM_operatortype_append(MESH_OT_knife_cut);
 	WM_operatortype_append(MESH_OT_rip);
 	WM_operatortype_append(MESH_OT_blend_from_shape);
 	WM_operatortype_append(MESH_OT_shape_propagate_to_all);
@@ -143,11 +142,7 @@
 	WM_operatortype_append(MESH_OT_uv_texture_remove);
 	WM_operatortype_append(MESH_OT_vertex_color_add);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list