- 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.
This commit is contained in:
2009-07-28 01:06:56 +00:00
parent 396ebf0c91
commit fe881aa7ad
3 changed files with 37 additions and 7 deletions

View File

@@ -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)
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()

View File

@@ -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;
}

View File

@@ -1867,9 +1867,13 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
newptr= *(PointerRNA*)data;
}
else {
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) {
ret = pyrna_struct_CreatePyObject(&newptr);