[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23681] trunk/blender: - rna path lookup crashed if the string was null ( reported by Cessen with an empty driver)

Campbell Barton ideasman42 at gmail.com
Wed Oct 7 11:23:29 CEST 2009


Revision: 23681
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23681
Author:   campbellbarton
Date:     2009-10-07 11:23:29 +0200 (Wed, 07 Oct 2009)

Log Message:
-----------
- rna path lookup crashed if the string was null (reported by Cessen with an empty driver)
- added TexMesh access ([#19505] Missing option : TexMesh)
- Ctrl+Tab works again, not-so-nice workaround, disallow switching to paint modes from editmode, but would be nicer to manage this with keymaps.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/buttons_data_mesh.py
    trunk/blender/source/blender/editors/mesh/editmesh_mods.c
    trunk/blender/source/blender/editors/object/object_edit.c
    trunk/blender/source/blender/makesrna/intern/rna_access.c
    trunk/blender/source/blender/makesrna/intern/rna_mesh.c
    trunk/blender/source/blender/makesrna/intern/rna_scene.c

Modified: trunk/blender/release/scripts/ui/buttons_data_mesh.py
===================================================================
--- trunk/blender/release/scripts/ui/buttons_data_mesh.py	2009-10-07 07:18:50 UTC (rev 23680)
+++ trunk/blender/release/scripts/ui/buttons_data_mesh.py	2009-10-07 09:23:29 UTC (rev 23681)
@@ -48,6 +48,19 @@
 		col.itemR(mesh, "vertex_normal_flip")
 		col.itemR(mesh, "double_sided")
 
+class DATA_PT_settings(DataButtonsPanel):
+	__label__ = "Settings"
+
+	def draw(self, context):
+		layout = self.layout
+		
+		mesh = context.mesh
+		
+		split = layout.split()
+		
+		col = split.column()
+		col.itemR(mesh, "texture_mesh")
+
 class DATA_PT_vertex_groups(DataButtonsPanel):
 	__label__ = "Vertex Groups"
 	
@@ -197,6 +210,7 @@
 
 bpy.types.register(DATA_PT_context_mesh)
 bpy.types.register(DATA_PT_normals)
+bpy.types.register(DATA_PT_settings)
 bpy.types.register(DATA_PT_vertex_groups)
 bpy.types.register(DATA_PT_shape_keys)
 bpy.types.register(DATA_PT_uv_texture)

Modified: trunk/blender/source/blender/editors/mesh/editmesh_mods.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_mods.c	2009-10-07 07:18:50 UTC (rev 23680)
+++ trunk/blender/source/blender/editors/mesh/editmesh_mods.c	2009-10-07 09:23:29 UTC (rev 23681)
@@ -78,6 +78,8 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
+#include "UI_resources.h"
+
 #include "RNA_access.h"
 #include "RNA_define.h"
 
@@ -3614,9 +3616,9 @@
 }
 
 static EnumPropertyItem prop_mesh_edit_types[] = {
-	{1, "VERT", 0, "Vertices", ""},
-	{2, "EDGE", 0, "Edges", ""},
-	{3, "FACE", 0, "Faces", ""},
+	{1, "VERT", ICON_VERTEXSEL, "Vertices", ""},
+	{2, "EDGE", ICON_EDGESEL, "Edges", ""},
+	{3, "FACE", ICON_FACESEL, "Faces", ""},
 	{0, NULL, 0, NULL, NULL}
 };
 

Modified: trunk/blender/source/blender/editors/object/object_edit.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_edit.c	2009-10-07 07:18:50 UTC (rev 23680)
+++ trunk/blender/source/blender/editors/object/object_edit.c	2009-10-07 09:23:29 UTC (rev 23681)
@@ -1995,6 +1995,12 @@
 	if(!ob || !object_mode_set_compat(C, op, ob))
 		return OPERATOR_PASS_THROUGH;
 
+	/* Irritating workaround! disallow paint modes from editmode since a number of shortcuts conflict
+	 * XXX - would be much better to handle this on a keymap level */
+	if(ob->mode == OB_MODE_EDIT && ELEM6(mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT, OB_MODE_PARTICLE_EDIT, OB_MODE_POSE)) {
+		return OPERATOR_PASS_THROUGH;
+	}
+
 	/* Exit current mode if it's not the mode we're setting */
 	if(ob->mode != OB_MODE_OBJECT && ob->mode != mode)
 		WM_operator_name_call(C, object_mode_op_string(ob->mode), WM_OP_EXEC_REGION_WIN, NULL);

Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_access.c	2009-10-07 07:18:50 UTC (rev 23680)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2009-10-07 09:23:29 UTC (rev 23681)
@@ -2226,6 +2226,9 @@
 	prop= NULL;
 	curptr= *ptr;
 
+	if(path)
+		return 0;
+
 	while(*path) {
 		/* look up property name in current struct */
 		token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0);

Modified: trunk/blender/source/blender/makesrna/intern/rna_mesh.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_mesh.c	2009-10-07 07:18:50 UTC (rev 23680)
+++ trunk/blender/source/blender/makesrna/intern/rna_mesh.c	2009-10-07 09:23:29 UTC (rev 23681)
@@ -1413,8 +1413,13 @@
 	RNA_def_property_struct_type(prop, "MeshSticky");
 	RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates.");
 
+	/* TODO, should this be allowed to be its self? */
+	prop= RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE);
+	RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
+	RNA_def_property_flag(prop, PROP_EDITABLE);
+	RNA_def_property_ui_text(prop, "Texture Mesh", "Use another mesh for texture indicies (vertex indicies must be aligned).");
+
 	/* UV textures */
-
 	prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
 	RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", 0, 0, 0, "rna_Mesh_uv_textures_length", 0, 0, 0, 0);

Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c	2009-10-07 07:18:50 UTC (rev 23680)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c	2009-10-07 09:23:29 UTC (rev 23681)
@@ -279,6 +279,7 @@
 	}
 }
 
+#ifdef WITH_OPENJPEG
 static void rna_SceneRenderData_jpeg2k_preset_set(PointerRNA *ptr, int value)
 {
 	RenderData *rd= (RenderData*)ptr->data;
@@ -292,6 +293,7 @@
 	rd->jp2_depth= value;
 	rna_SceneRenderData_jpeg2k_preset_update(rd);
 }
+#endif
 
 static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr)
 {





More information about the Bf-blender-cvs mailing list