diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-28 05:06:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-28 05:06:56 +0400 |
commit | fe881aa7ad0ba77052d0c637a5a4056f8ef427f8 (patch) | |
tree | 41bac228ce3afc29ac1aa6f601fc289cd80e155a | |
parent | 396ebf0c91b1527e6ea1ab923a314a164007b8e9 (diff) |
- lamp UI was missing y samples for rectangle area lamps
- returned ID types from RNA funcs didnt get their ID's assigned which crashed in some cases (still not working for members of ID types).
- ob.create_remder_mesh() wasnt assigning any materials.
-rw-r--r-- | release/ui/buttons_data_lamp.py | 15 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 21 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 8 |
3 files changed, 37 insertions, 7 deletions
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index a3505dd6970..9c5b3dd1573 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -85,7 +85,7 @@ class DATA_PT_lamp(DataButtonsPanel): sub.itemR(lamp, "shape", text="") if (lamp.shape == 'SQUARE'): sub.itemR(lamp, "size") - if (lamp.shape == 'RECTANGLE'): + elif (lamp.shape == 'RECTANGLE'): sub.itemR(lamp, "size", text="Size X") sub.itemR(lamp, "size_y", text="Size Y") @@ -198,15 +198,20 @@ class DATA_PT_shadow(DataButtonsPanel): if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC': col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") - if lamp.type == 'AREA': + elif lamp.type == 'AREA': split = layout.split() col = split.column(align=True) - col.itemR(lamp, "shadow_ray_samples_x", text="Samples") + if lamp.shape == 'SQUARE': + col.itemR(lamp, "shadow_ray_samples_x", text="Samples") + elif lamp.shape == 'RECTANGLE': + col.itemR(lamp, "shadow_ray_samples_x", text="Samples X") + col.itemR(lamp, "shadow_ray_samples_y", text="Samples Y") + if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC': col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") - if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED': + elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED': col = split.column() col.itemR(lamp, "umbra") col.itemR(lamp, "dither") @@ -236,7 +241,7 @@ class DATA_PT_shadow(DataButtonsPanel): sub.itemR(lamp, "shadow_buffer_size", text="Size") sub.itemR(lamp, "shadow_buffer_samples", text="Samples") - if (lamp.shadow_buffer_type == 'IRREGULAR'): + elif lamp.shadow_buffer_type == 'IRREGULAR': layout.itemR(lamp, "shadow_buffer_bias", text="Bias") row = layout.row() diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 053ab115b3b..3541bc2b1b0 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -34,6 +34,8 @@ #ifdef RNA_RUNTIME +#include "MEM_guardedalloc.h" + #include "BKE_customdata.h" #include "BKE_DerivedMesh.h" @@ -61,6 +63,25 @@ Mesh *rna_Object_create_render_mesh(Object *ob, Scene *scene) DM_to_mesh(dm, me); dm->release(dm); + + { /* update the material */ + short i, *totcol =give_totcolp(ob); + + /* free the current material list */ + if(me->mat) + MEM_freeN((void *)me->mat); + + me->mat= (Material **)MEM_callocN(sizeof(void *)*(*totcol), "matarray"); + + for(i=0; i<*totcol; i++) { + Material *mat= give_current_material(ob, i+1); + if(mat) { + me->mat[i]= mat; + mat->id.us++; + } + } + } + return me; } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index c76cb252f2c..91e443dbc93 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1867,8 +1867,12 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) newptr= *(PointerRNA*)data; } else { - /* XXX this is missing the ID part! */ - RNA_pointer_create(NULL, type, *(void**)data, &newptr); + if(RNA_struct_is_ID(type)) { + RNA_id_pointer_create(*(void**)data, &newptr); + } else { + /* XXX this is missing the ID part! */ + RNA_pointer_create(NULL, type, *(void**)data, &newptr); + } } if (newptr.data) { |