Revision: 36214
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36214
Author:   campbellbarton
Date:     2011-04-18 15:20:19 +0000 (Mon, 18 Apr 2011)
Log Message:
-----------
fix [#27015] RNA Bug: Unpacking sounds with a long ID name fails: sound ID 
length wrong?!
also fix for OBJECT_OT_proxy_make and RENDER_OT_render using incorrect lengths 
for ID names.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_relations.c
    trunk/blender/source/blender/editors/render/render_internal.c
    trunk/blender/source/blender/editors/sound/sound_ops.c
    trunk/blender/source/blender/editors/space_image/image_ops.c

Modified: trunk/blender/source/blender/editors/object/object_relations.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_relations.c      
2011-04-18 14:24:36 UTC (rev 36213)
+++ trunk/blender/source/blender/editors/object/object_relations.c      
2011-04-18 15:20:19 UTC (rev 36214)
@@ -402,7 +402,7 @@
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
-       RNA_def_string(ot->srna, "object", "", 19, "Proxy Object", "Name of 
lib-linked/grouped object to make a proxy for.");
+       RNA_def_string(ot->srna, "object", "", sizeof(((ID *)NULL)->name)-2, 
"Proxy Object", "Name of lib-linked/grouped object to make a proxy for.");
        prop= RNA_def_enum(ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Type", 
"Group object"); /* XXX, relies on hard coded ID at the moment */
        RNA_def_enum_funcs(prop, proxy_group_object_itemf);
        ot->prop= prop;

Modified: trunk/blender/source/blender/editors/render/render_internal.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_internal.c       
2011-04-18 14:24:36 UTC (rev 36213)
+++ trunk/blender/source/blender/editors/render/render_internal.c       
2011-04-18 15:20:19 UTC (rev 36214)
@@ -823,7 +823,7 @@
        RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files 
from the animation range of this scene");
        RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save 
rendered the image to the output path (used only when animation is disabled)");
        RNA_def_string(ot->srna, "layer", "", RE_MAXNAME, "Render Layer", 
"Single render layer to re-render");
-       RNA_def_string(ot->srna, "scene", "", 19, "Scene", "Re-render single 
layer in this scene");
+       RNA_def_string(ot->srna, "scene", "", sizeof(((ID *)NULL)->name)-2, 
"Scene", "Re-render single layer in this scene");
 }
 
 /* ****************************** opengl render *************************** */

Modified: trunk/blender/source/blender/editors/sound/sound_ops.c
===================================================================
--- trunk/blender/source/blender/editors/sound/sound_ops.c      2011-04-18 
14:24:36 UTC (rev 36213)
+++ trunk/blender/source/blender/editors/sound/sound_ops.c      2011-04-18 
15:20:19 UTC (rev 36214)
@@ -276,7 +276,7 @@
 
        /* properties */
        RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, 
"Method", "How to unpack.");
-       RNA_def_string(ot->srna, "id", "", 21, "Sound Name", "Sound datablock 
name to unpack."); /* XXX, weark!, will fail with library, name collisions */
+       RNA_def_string(ot->srna, "id", "", sizeof(((ID *)NULL)->name)-2, "Sound 
Name", "Sound datablock name to unpack."); /* XXX, weark!, will fail with 
library, name collisions */
 }
 
 /* ******************************************************* */

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c        
2011-04-18 14:24:36 UTC (rev 36213)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c        
2011-04-18 15:20:19 UTC (rev 36214)
@@ -1352,7 +1352,7 @@
        ot->flag= OPTYPE_UNDO;
 
        /* properties */
-       RNA_def_string(ot->srna, "name", "untitled", 21, "Name", "Image 
datablock name.");
+       RNA_def_string(ot->srna, "name", "untitled", sizeof(((ID 
*)NULL)->name)-2, "Name", "Image datablock name.");
        RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image 
width.", 1, 16384);
        RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image 
height.", 1, 16384);
        prop= RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, 
"Color", "Default fill color.", 0.0f, 1.0f);
@@ -1604,7 +1604,7 @@
        
        /* properties */
        RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, 
"Method", "How to unpack.");
-       RNA_def_string(ot->srna, "id", "", 21, "Image Name", "Image datablock 
name to unpack."); /* XXX, weark!, will fail with library, name collisions */
+       RNA_def_string(ot->srna, "id", "", sizeof(((ID *)NULL)->name)-2, "Image 
Name", "Image datablock name to unpack."); /* XXX, weark!, will fail with 
library, name collisions */
 }
 
 /******************** sample image operator ********************/

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

Reply via email to