Fix wrong RNA update function declarations
This fixes lots of crashes, especially with painting/brush updates.
This commit is contained in:
parent
54f03914b0
commit
4b376dbe84
|
@ -1799,7 +1799,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
|
|||
* parts of the code that need it still, so we have this exception */
|
||||
if (prop->flag & PROP_CONTEXT_UPDATE) {
|
||||
if (C) {
|
||||
if (prop->flag & PROP_CONTEXT_PROPERTY_UPDATE) {
|
||||
if ((prop->flag & PROP_CONTEXT_PROPERTY_UPDATE) == PROP_CONTEXT_PROPERTY_UPDATE) {
|
||||
((ContextPropUpdateFunc)prop->update)(C, ptr, prop);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -360,16 +360,20 @@ static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
|
|||
/*WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); */
|
||||
}
|
||||
|
||||
static void rna_Brush_main_tex_update(Main *bmain, bContext *C, Scene *scene, PointerRNA *ptr)
|
||||
static void rna_Brush_main_tex_update(bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||
Brush *br = (Brush *)ptr->data;
|
||||
BKE_paint_invalidate_overlay_tex(scene, sl, br->mtex.tex);
|
||||
rna_Brush_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Brush_secondary_tex_update(Main *bmain, bContext *C, Scene *scene, PointerRNA *ptr)
|
||||
static void rna_Brush_secondary_tex_update(bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||
Brush *br = (Brush *)ptr->data;
|
||||
BKE_paint_invalidate_overlay_tex(scene, sl, br->mask_mtex.tex);
|
||||
|
@ -428,8 +432,9 @@ static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
|
|||
WM_main_add_notifier(NC_BRUSH | NA_EDITED, br);
|
||||
}
|
||||
|
||||
static void rna_TextureSlot_brush_angle_update(Main *bmain, bContext *C, Scene *scene, PointerRNA *ptr)
|
||||
static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
MTex *mtex = ptr->data;
|
||||
/* skip invalidation of overlay for stencil mode */
|
||||
if (mtex->mapping != MTEX_MAP_MODE_STENCIL) {
|
||||
|
@ -437,7 +442,7 @@ static void rna_TextureSlot_brush_angle_update(Main *bmain, bContext *C, Scene *
|
|||
BKE_paint_invalidate_overlay_tex(scene, sl, mtex->tex);
|
||||
}
|
||||
|
||||
rna_TextureSlot_update(bmain, C, scene, ptr);
|
||||
rna_TextureSlot_update(C, ptr);
|
||||
}
|
||||
|
||||
static void rna_Brush_set_size(PointerRNA *ptr, int value)
|
||||
|
|
|
@ -236,7 +236,7 @@ int rna_object_shapekey_index_set(struct ID *id, PointerRNA value, int current);
|
|||
/* named internal so as not to conflict with obj.update() rna func */
|
||||
void rna_Object_internal_update_data(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
||||
void rna_Mesh_update_draw(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
||||
void rna_TextureSlot_update(struct Main *bmain, struct bContext *C, struct Scene *scene, struct PointerRNA *ptr);
|
||||
void rna_TextureSlot_update(struct bContext *C, struct PointerRNA *ptr);
|
||||
|
||||
/* basic poll functions for object types */
|
||||
int rna_Armature_object_poll(struct PointerRNA *ptr, struct PointerRNA value);
|
||||
|
|
|
@ -1985,8 +1985,9 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons
|
|||
}
|
||||
}
|
||||
|
||||
static void rna_UnifiedPaintSettings_update(Main *UNUSED(bmain), bContext *C, Scene *scene, PointerRNA *UNUSED(ptr))
|
||||
static void rna_UnifiedPaintSettings_update(bContext *C, PointerRNA *UNUSED(ptr))
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||
Brush *br = BKE_paint_brush(BKE_paint_get_active(scene, sl));
|
||||
WM_main_add_notifier(NC_BRUSH | NA_EDITED, br);
|
||||
|
@ -2011,11 +2012,11 @@ static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, flo
|
|||
ups->unprojected_radius = value;
|
||||
}
|
||||
|
||||
static void rna_UnifiedPaintSettings_radius_update(Main *bmain, bContext *C, Scene *scene, PointerRNA *ptr)
|
||||
static void rna_UnifiedPaintSettings_radius_update(bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
/* changing the unified size should invalidate the overlay but also update the brush */
|
||||
BKE_paint_invalidate_overlay_all();
|
||||
rna_UnifiedPaintSettings_update(bmain, C, scene, ptr);
|
||||
rna_UnifiedPaintSettings_update(C, ptr);
|
||||
}
|
||||
|
||||
static char *rna_UnifiedPaintSettings_path(PointerRNA *UNUSED(ptr))
|
||||
|
|
|
@ -148,8 +148,9 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
|
|||
return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL);
|
||||
}
|
||||
|
||||
static void rna_ParticleEdit_redo(Main *UNUSED(bmain), bContext *C, Scene *scene, PointerRNA *UNUSED(ptr))
|
||||
static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||
Object *ob = OBACT_NEW;
|
||||
PTCacheEdit *edit = PE_get_current(scene, sl, ob);
|
||||
|
@ -166,6 +167,7 @@ static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *scene, PointerRN
|
|||
|
||||
if (ob) DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
|
||||
{
|
||||
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
|
||||
|
@ -330,8 +332,9 @@ static void rna_ImaPaint_viewport_update(Main *UNUSED(bmain), Scene *UNUSED(scen
|
|||
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
|
||||
}
|
||||
|
||||
static void rna_ImaPaint_mode_update(Main *UNUSED(bmain), bContext *C, Scene *scene, PointerRNA *UNUSED(ptr))
|
||||
static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);\
|
||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||
Object *ob = OBACT_NEW;
|
||||
|
||||
|
@ -346,8 +349,9 @@ static void rna_ImaPaint_mode_update(Main *UNUSED(bmain), bContext *C, Scene *sc
|
|||
}
|
||||
}
|
||||
|
||||
static void rna_ImaPaint_stencil_update(Main *UNUSED(bmain), bContext *C, Scene *scene, PointerRNA *UNUSED(ptr))
|
||||
static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr))
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||
Object *ob = OBACT_NEW;
|
||||
|
||||
|
@ -358,8 +362,10 @@ static void rna_ImaPaint_stencil_update(Main *UNUSED(bmain), bContext *C, Scene
|
|||
}
|
||||
}
|
||||
|
||||
static void rna_ImaPaint_canvas_update(Main *bmain, bContext *C, Scene *scene, PointerRNA *UNUSED(ptr))
|
||||
static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr))
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||
Object *ob = OBACT_NEW;
|
||||
bScreen *sc;
|
||||
|
@ -927,7 +933,6 @@ static void rna_def_particle_edit(BlenderRNA *brna)
|
|||
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
|
||||
|
||||
prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_range(prop, 1, 100);
|
||||
RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
|
||||
|
|
|
@ -225,7 +225,7 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value)
|
|||
BKE_texture_type_set(tex, value);
|
||||
}
|
||||
|
||||
void rna_TextureSlot_update(Main *UNUSED(bmain), bContext *C, Scene *scene, PointerRNA *ptr)
|
||||
void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
ID *id = ptr->id.data;
|
||||
|
||||
|
@ -245,6 +245,7 @@ void rna_TextureSlot_update(Main *UNUSED(bmain), bContext *C, Scene *scene, Poin
|
|||
break;
|
||||
case ID_BR:
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
MTex *mtex = ptr->data;
|
||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||
BKE_paint_invalidate_overlay_tex(scene, sl, mtex->tex);
|
||||
|
|
Loading…
Reference in New Issue