RNA:
* Property update functions no longer get context, instead they get only Main and Scene. The RNA api was intended to be as context-less as possible, since it doesn't really matter who is changing the property, everything that uses the property should be updated. * There's still one exception case that use it now, screen operations still depend on context too much. It also revealed a few places using context where they shouldn't. * Ideally Scene shouldn't be passed, but much of Blender still depends on it, should be dropped when we try to support multiple scene editing. Change was planned for a while, but need this now to be able to call update without a context pointer.
This commit is contained in:
@@ -98,7 +98,7 @@ void ED_screen_delete_scene(struct bContext *C, struct Scene *scene);
|
||||
void ED_screen_set_subwinactive(struct wmWindow *win, struct wmEvent *event);
|
||||
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
|
||||
void ED_screen_animation_timer(struct bContext *C, int redraws, int sync, int enable);
|
||||
void ED_screen_animation_timer_update(struct bContext *C, int redraws);
|
||||
void ED_screen_animation_timer_update(struct bScreen *screen, int redraws);
|
||||
int ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
|
||||
void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa);
|
||||
void ED_screen_full_restore(struct bContext *C, ScrArea *sa);
|
||||
|
||||
@@ -1632,10 +1632,8 @@ static ARegion *time_top_left_3dwindow(bScreen *screen)
|
||||
return aret;
|
||||
}
|
||||
|
||||
void ED_screen_animation_timer_update(bContext *C, int redraws)
|
||||
void ED_screen_animation_timer_update(bScreen *screen, int redraws)
|
||||
{
|
||||
bScreen *screen= CTX_wm_screen(C);
|
||||
|
||||
if(screen && screen->animtimer) {
|
||||
wmTimer *wt= screen->animtimer;
|
||||
ScreenAnimData *sad= wt->customdata;
|
||||
|
||||
@@ -2418,7 +2418,7 @@ static int screen_animation_play(bContext *C, wmOperator *op, wmEvent *event)
|
||||
ED_screen_animation_timer(C, stime->redraws, sync, mode);
|
||||
|
||||
/* update region if TIME_REGION was set, to leftmost 3d window */
|
||||
ED_screen_animation_timer_update(C, stime->redraws);
|
||||
ED_screen_animation_timer_update(screen, stime->redraws);
|
||||
}
|
||||
else {
|
||||
int redraws = TIME_REGION|TIME_ALL_3D_WIN;
|
||||
|
||||
@@ -38,6 +38,7 @@ struct bContext;
|
||||
struct ID;
|
||||
struct Main;
|
||||
struct ReportList;
|
||||
struct Scene;
|
||||
|
||||
/* Types */
|
||||
|
||||
@@ -649,6 +650,7 @@ int RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop);
|
||||
int RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop);
|
||||
|
||||
void RNA_property_update(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop);
|
||||
void RNA_property_update_main(struct Main *bmain, struct Scene *scene, PointerRNA *ptr, PropertyRNA *prop);
|
||||
|
||||
/* Property Data */
|
||||
|
||||
|
||||
@@ -166,6 +166,9 @@ typedef enum PropertyFlag {
|
||||
/* flag contains multiple enums */
|
||||
PROP_ENUM_FLAG = 1<<21,
|
||||
|
||||
/* need context for update function */
|
||||
PROP_CONTEXT_UPDATE = 1<<22,
|
||||
|
||||
/* internal flags */
|
||||
PROP_BUILTIN = 1<<7,
|
||||
PROP_EXPORT = 1<<8,
|
||||
|
||||
@@ -1763,7 +1763,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
|
||||
rna_print_c_string(f, prop->description); fprintf(f, ",\n\t");
|
||||
fprintf(f, "%d,\n", prop->icon);
|
||||
fprintf(f, "\t%s, %s|%s, %s, %d, {%d, %d, %d}, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), rna_function_string(prop->getlength), prop->arraydimension, prop->arraylength[0], prop->arraylength[1], prop->arraylength[2], prop->totarraylength);
|
||||
fprintf(f, "\t%s, %d, %s, %s,\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable), rna_function_string(prop->itemeditable));
|
||||
fprintf(f, "\t%s%s, %d, %s, %s,\n", (prop->flag & PROP_CONTEXT_UPDATE)? "(UpdateFunc)": "", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable), rna_function_string(prop->itemeditable));
|
||||
|
||||
if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
|
||||
else fprintf(f, "\t0, 0");
|
||||
@@ -2050,11 +2050,13 @@ static void rna_generate(BlenderRNA *brna, FILE *f, char *filename, char *api_fi
|
||||
fprintf(f, "#include <stddef.h>\n\n");
|
||||
|
||||
fprintf(f, "#include \"DNA_ID.h\"\n");
|
||||
fprintf(f, "#include \"DNA_scene_types.h\"\n");
|
||||
|
||||
fprintf(f, "#include \"BLI_blenlib.h\"\n\n");
|
||||
|
||||
fprintf(f, "#include \"BKE_context.h\"\n");
|
||||
fprintf(f, "#include \"BKE_library.h\"\n");
|
||||
fprintf(f, "#include \"BKE_main.h\"\n");
|
||||
fprintf(f, "#include \"BKE_report.h\"\n");
|
||||
fprintf(f, "#include \"BKE_utildefines.h\"\n\n");
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_windowmanager_types.h"
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
@@ -37,6 +38,7 @@
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_idprop.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_utildefines.h"
|
||||
|
||||
@@ -1103,23 +1105,41 @@ int RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
|
||||
static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
|
||||
{
|
||||
int is_rna = (prop->magic == RNA_MAGIC);
|
||||
prop= rna_ensure_property(prop);
|
||||
|
||||
if(is_rna) {
|
||||
if(prop->update)
|
||||
prop->update(C, ptr);
|
||||
if(prop->update) {
|
||||
/* ideally no context would be needed for update, but there's some
|
||||
parts of the code that need it still, so we have this exception */
|
||||
if(prop->flag & PROP_CONTEXT_UPDATE) {
|
||||
if(C) ((ContextUpdateFunc)prop->update)(C, ptr);
|
||||
}
|
||||
else
|
||||
prop->update(bmain, scene, ptr);
|
||||
}
|
||||
if(prop->noteflag)
|
||||
WM_event_add_notifier(C, prop->noteflag, ptr->id.data);
|
||||
WM_main_add_notifier(prop->noteflag, ptr->id.data);
|
||||
}
|
||||
else {
|
||||
/* WARNING! This is so property drivers update the display!
|
||||
* not especially nice */
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
|
||||
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
||||
WM_main_add_notifier(NC_WINDOW, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
|
||||
{
|
||||
rna_property_update(C, CTX_data_main(C), CTX_data_scene(C), ptr, prop);
|
||||
}
|
||||
|
||||
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
|
||||
{
|
||||
rna_property_update(NULL, bmain, scene, ptr, prop);
|
||||
}
|
||||
|
||||
/* Property Data */
|
||||
|
||||
@@ -47,13 +47,13 @@
|
||||
|
||||
#include "ED_armature.h"
|
||||
|
||||
static void rna_Armature_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Armature_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
|
||||
//WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
|
||||
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
|
||||
//WM_main_add_notifier(NC_OBJECT|ND_POSE, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,11 +103,11 @@ void rna_Armature_edit_bone_remove(bArmature *arm, EditBone *ebone)
|
||||
ED_armature_edit_bone_remove(arm, ebone);
|
||||
}
|
||||
|
||||
static void rna_Armature_redraw_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Armature_redraw_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
|
||||
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
|
||||
}
|
||||
|
||||
static char *rna_Bone_path(PointerRNA *ptr)
|
||||
@@ -304,7 +304,7 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Armature_editbone_transform_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bArmature *arm= (bArmature*)ptr->id.data;
|
||||
EditBone *ebone= (EditBone*)ptr->data;
|
||||
@@ -339,7 +339,7 @@ static void rna_Armature_editbone_transform_update(bContext *C, PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
rna_Armature_update_data(C, ptr);
|
||||
rna_Armature_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Armature_bones_next(CollectionPropertyIterator *iter)
|
||||
|
||||
@@ -72,7 +72,7 @@ EnumPropertyItem boidruleset_type_items[] ={
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_particle.h"
|
||||
|
||||
static void rna_Boids_reset(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Boids_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
if(ptr->type==&RNA_ParticleSystem) {
|
||||
ParticleSystem *psys = (ParticleSystem*)ptr->data;
|
||||
@@ -84,12 +84,10 @@ static void rna_Boids_reset(bContext *C, PointerRNA *ptr)
|
||||
else
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
}
|
||||
static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
if(ptr->type==&RNA_ParticleSystem) {
|
||||
ParticleSystem *psys = (ParticleSystem*)ptr->data;
|
||||
|
||||
@@ -102,7 +100,7 @@ static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr)
|
||||
|
||||
DAG_scene_sort(scene);
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
}
|
||||
|
||||
static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr)
|
||||
|
||||
@@ -76,10 +76,10 @@ static void rna_Brush_active_texture_set(PointerRNA *ptr, PointerRNA value)
|
||||
set_current_brush_texture(br, value.data);
|
||||
}
|
||||
|
||||
static void rna_Brush_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Brush_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Brush *br= (Brush*)ptr->data;
|
||||
WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, br);
|
||||
WM_main_add_notifier(NC_BRUSH|NA_EDITED, br);
|
||||
}
|
||||
|
||||
static float rna_BrushTextureSlot_angle_get(PointerRNA *ptr)
|
||||
|
||||
@@ -37,13 +37,13 @@
|
||||
|
||||
#ifdef RNA_RUNTIME
|
||||
|
||||
static void rna_Camera_angle_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Camera_angle_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Camera *cam= (Camera*)ptr->id.data;
|
||||
cam->lens = 16.0f / tan(M_PI*cam->angle/360.0f);
|
||||
}
|
||||
|
||||
static void rna_Camera_lens_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Camera_lens_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Camera *cam= (Camera*)ptr->id.data;
|
||||
cam->angle= 360.0f * atan(16.0f/cam->lens) / M_PI;
|
||||
|
||||
@@ -45,15 +45,15 @@
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_depsgraph.h"
|
||||
|
||||
static void rna_cloth_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_cloth_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
|
||||
}
|
||||
|
||||
static void rna_cloth_reset(bContext *C, PointerRNA *ptr)
|
||||
static void rna_cloth_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
|
||||
@@ -61,7 +61,7 @@ static void rna_cloth_reset(bContext *C, PointerRNA *ptr)
|
||||
settings->reset = 1;
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -198,24 +198,24 @@ static char *rna_Constraint_path(PointerRNA *ptr)
|
||||
return BLI_sprintfN("constraints[\"%s\"]", con->name);
|
||||
}
|
||||
|
||||
static void rna_Constraint_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Constraint_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ED_object_constraint_update(ptr->id.data);
|
||||
}
|
||||
|
||||
static void rna_Constraint_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Constraint_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ED_object_constraint_dependency_update(CTX_data_scene(C), ptr->id.data);
|
||||
ED_object_constraint_dependency_update(scene, ptr->id.data);
|
||||
}
|
||||
|
||||
static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= ptr->id.data;
|
||||
|
||||
if(ob->pose)
|
||||
ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
|
||||
|
||||
rna_Constraint_update(C, ptr);
|
||||
rna_Constraint_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value)
|
||||
|
||||
@@ -215,21 +215,21 @@ static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA
|
||||
rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
|
||||
}
|
||||
|
||||
static void rna_Curve_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
|
||||
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
|
||||
}
|
||||
|
||||
static void rna_Curve_update_deps(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
DAG_scene_sort(CTX_data_scene(C));
|
||||
rna_Curve_update_data(C, ptr);
|
||||
DAG_scene_sort(scene);
|
||||
rna_Curve_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Curve_resolution_u_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Curve *cu= (Curve*)ptr->id.data;
|
||||
Nurb *nu=NULL;
|
||||
@@ -242,10 +242,10 @@ static void rna_Curve_resolution_u_update_data(bContext *C, PointerRNA *ptr)
|
||||
nu= nu->next;
|
||||
}
|
||||
|
||||
rna_Curve_update_data(C, ptr);
|
||||
rna_Curve_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Curve_resolution_v_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Curve *cu= (Curve*)ptr->id.data;
|
||||
Nurb *nu=NULL;
|
||||
@@ -258,7 +258,7 @@ static void rna_Curve_resolution_v_update_data(bContext *C, PointerRNA *ptr)
|
||||
nu= nu->next;
|
||||
}
|
||||
|
||||
rna_Curve_update_data(C, ptr);
|
||||
rna_Curve_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
/* name functions that ignore the first two ID characters */
|
||||
@@ -293,34 +293,34 @@ void rna_Curve_body_set(PointerRNA *ptr, const char *value)
|
||||
BLI_strncpy(cu->str, value, len+1);
|
||||
}
|
||||
|
||||
static void rna_Nurb_update_handle_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Nurb_update_handle_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Nurb *nu= (Nurb*)ptr->data;
|
||||
|
||||
if(nu->type == CU_BEZIER)
|
||||
calchandlesNurb(nu);
|
||||
|
||||
rna_Curve_update_data(C, ptr);
|
||||
rna_Curve_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Nurb_update_knot_u(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Nurb *nu= (Nurb*)ptr->data;
|
||||
|
||||
clamp_nurb_order_u(nu);
|
||||
makeknots(nu, 1);
|
||||
|
||||
rna_Curve_update_data(C, ptr);
|
||||
rna_Curve_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Nurb_update_knot_v(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Nurb *nu= (Nurb*)ptr->data;
|
||||
|
||||
clamp_nurb_order_v(nu);
|
||||
makeknots(nu, 2);
|
||||
|
||||
rna_Curve_update_data(C, ptr);
|
||||
rna_Curve_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -91,7 +91,7 @@ static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr)
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_animsys.h"
|
||||
|
||||
static void rna_ChannelDriver_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
ChannelDriver *driver= ptr->data;
|
||||
@@ -99,20 +99,20 @@ static void rna_ChannelDriver_update_data(bContext *C, PointerRNA *ptr)
|
||||
driver->flag &= ~DRIVER_FLAG_INVALID;
|
||||
|
||||
// TODO: this really needs an update guard...
|
||||
DAG_scene_sort(CTX_data_scene(C));
|
||||
DAG_scene_sort(scene);
|
||||
DAG_id_flush_update(id, OB_RECALC_OB|OB_RECALC_DATA);
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, CTX_data_scene(C));
|
||||
WM_main_add_notifier(NC_SCENE|ND_FRAME, scene);
|
||||
}
|
||||
|
||||
static void rna_ChannelDriver_update_expr(bContext *C, PointerRNA *ptr)
|
||||
static void rna_ChannelDriver_update_expr(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ChannelDriver *driver= ptr->data;
|
||||
driver->flag |= DRIVER_FLAG_RECOMPILE;
|
||||
rna_ChannelDriver_update_data(C, ptr);
|
||||
rna_ChannelDriver_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_DriverTarget_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_DriverTarget_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
PointerRNA driverptr;
|
||||
ChannelDriver *driver;
|
||||
@@ -125,7 +125,7 @@ static void rna_DriverTarget_update_data(bContext *C, PointerRNA *ptr)
|
||||
|
||||
if(driver && BLI_findindex(&driver->targets, ptr->data) != -1) {
|
||||
RNA_pointer_create(ptr->id.data, &RNA_Driver, driver, &driverptr);
|
||||
rna_ChannelDriver_update_data(C, &driverptr);
|
||||
rna_ChannelDriver_update_data(bmain, scene, &driverptr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -267,7 +267,7 @@ static void rna_FModifier_active_set(PointerRNA *ptr, int value)
|
||||
fm->flag |= FMODIFIER_FLAG_ACTIVE;
|
||||
}
|
||||
|
||||
static void rna_FModifier_active_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_FModifier_active_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
FModifier *fm, *fmo= (FModifier*)ptr->data;
|
||||
|
||||
|
||||
@@ -72,17 +72,16 @@ static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_fluid_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_fluid_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
|
||||
}
|
||||
|
||||
static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr)
|
||||
static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain= CTX_data_main(C);
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
FluidsimModifierData *fluidmd;
|
||||
ParticleSystemModifierData *psmd;
|
||||
@@ -132,7 +131,7 @@ static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
rna_fluid_update(C, ptr);
|
||||
rna_fluid_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value)
|
||||
|
||||
@@ -56,7 +56,7 @@ static void rna_Group_objects_link(Group *group, bContext *C, ReportList *report
|
||||
return;
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, &object->id);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, &object->id);
|
||||
}
|
||||
|
||||
static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object)
|
||||
@@ -66,7 +66,7 @@ static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *repo
|
||||
return;
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, &object->id);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, &object->id);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -49,7 +49,7 @@ static EnumPropertyItem image_source_items[]= {
|
||||
|
||||
#include "IMB_imbuf_types.h"
|
||||
|
||||
static void rna_Image_animated_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Image_animated_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Image *ima= (Image*)ptr->data;
|
||||
int nr;
|
||||
@@ -74,13 +74,13 @@ static int rna_Image_dirty_get(PointerRNA *ptr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rna_Image_source_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Image_source_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Image *ima= ptr->id.data;
|
||||
BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
|
||||
}
|
||||
|
||||
static void rna_Image_fields_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Image_fields_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Image *ima= ptr->id.data;
|
||||
ImBuf *ibuf;
|
||||
@@ -101,22 +101,21 @@ static void rna_Image_fields_update(bContext *C, PointerRNA *ptr)
|
||||
BKE_image_release_ibuf(ima, lock);
|
||||
}
|
||||
|
||||
static void rna_Image_reload_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Image_reload_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Image *ima= ptr->id.data;
|
||||
BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
|
||||
printf("reload %p\n", ima);
|
||||
}
|
||||
|
||||
static void rna_Image_generated_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Image_generated_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Image *ima= ptr->id.data;
|
||||
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
|
||||
}
|
||||
|
||||
static void rna_ImageUser_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_ImageUser_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
ImageUser *iuser= ptr->data;
|
||||
|
||||
BKE_image_user_calc_imanr(iuser, scene->r.cfra, 0);
|
||||
|
||||
@@ -194,10 +194,10 @@ void rna_object_vgroup_name_set(struct PointerRNA *ptr, const char *value, char
|
||||
void rna_object_uvlayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen);
|
||||
void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen);
|
||||
|
||||
void rna_Object_update(struct bContext *C, struct PointerRNA *ptr);
|
||||
void rna_Object_update_data(struct bContext *C, struct PointerRNA *ptr);
|
||||
void rna_Mesh_update_draw(struct bContext *C, struct PointerRNA *ptr);
|
||||
void rna_TextureSlot_update(struct bContext *C, struct PointerRNA *ptr);
|
||||
void rna_Object_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
||||
void rna_Object_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 Scene *scene, struct PointerRNA *ptr);
|
||||
|
||||
char *rna_TextureSlot_path(struct PointerRNA *ptr);
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ struct CollectionPropertyIterator;
|
||||
struct bContext;
|
||||
struct IDProperty;
|
||||
struct GHash;
|
||||
struct Main;
|
||||
struct Scene;
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
#define RNA_MAX_ARRAY_LENGTH 64
|
||||
@@ -53,7 +55,8 @@ struct GHash;
|
||||
|
||||
/* Function Callbacks */
|
||||
|
||||
typedef void (*UpdateFunc)(struct bContext *C, struct PointerRNA *ptr);
|
||||
typedef void (*UpdateFunc)(struct Main *main, struct Scene *scene, struct PointerRNA *ptr);
|
||||
typedef void (*ContextUpdateFunc)(struct bContext *C, struct PointerRNA *ptr);
|
||||
typedef int (*EditableFunc)(struct PointerRNA *ptr);
|
||||
typedef int (*ItemEditableFunc)(struct PointerRNA *ptr, int index);
|
||||
typedef struct IDProperty* (*IDPropertiesFunc)(struct PointerRNA *ptr, int create);
|
||||
|
||||
@@ -286,16 +286,15 @@ static char *rna_ShapeKey_path(PointerRNA *ptr)
|
||||
return BLI_sprintfN("keys[\"%s\"]", ((KeyBlock*)ptr->data)->name);
|
||||
}
|
||||
|
||||
static void rna_Key_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Key_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain= CTX_data_main(C);
|
||||
Key *key= ptr->id.data;
|
||||
Object *ob;
|
||||
|
||||
for(ob=bmain->object.first; ob; ob= ob->id.next) {
|
||||
if(ob_get_key(ob) == key) {
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,28 +100,28 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Lamp_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Lamp_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Lamp *la= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&la->id, 0);
|
||||
WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, la);
|
||||
WM_main_add_notifier(NC_LAMP|ND_LIGHTING, la);
|
||||
}
|
||||
|
||||
static void rna_Lamp_draw_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Lamp_draw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Lamp *la= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&la->id, 0);
|
||||
WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING_DRAW, la);
|
||||
WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la);
|
||||
}
|
||||
|
||||
static void rna_Lamp_sky_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Lamp_sky_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Lamp *la= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&la->id, 0);
|
||||
WM_event_add_notifier(C, NC_LAMP|ND_SKY, la);
|
||||
WM_main_add_notifier(NC_LAMP|ND_SKY, la);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -87,17 +87,16 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN
|
||||
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void rna_Lattice_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Lattice_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
|
||||
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
|
||||
}
|
||||
|
||||
static void rna_Lattice_update_size(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain= CTX_data_main(C);
|
||||
Lattice *lt= ptr->id.data;
|
||||
Object *ob;
|
||||
int newu, newv, neww;
|
||||
@@ -124,7 +123,7 @@ static void rna_Lattice_update_size(bContext *C, PointerRNA *ptr)
|
||||
resizelattice(lt->editlatt, newu, newv, neww, NULL);
|
||||
}
|
||||
|
||||
rna_Lattice_update_data(C, ptr);
|
||||
rna_Lattice_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Lattice_outside_set(PointerRNA *ptr, int value)
|
||||
|
||||
@@ -50,41 +50,41 @@
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
static Mesh *rna_Main_add_mesh(Main *main, char *name)
|
||||
static Mesh *rna_Main_add_mesh(Main *bmain, char *name)
|
||||
{
|
||||
Mesh *me= add_mesh(name);
|
||||
me->id.us--;
|
||||
return me;
|
||||
}
|
||||
|
||||
static void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me)
|
||||
static void rna_Main_remove_mesh(Main *bmain, ReportList *reports, Mesh *me)
|
||||
{
|
||||
if(me->id.us == 0)
|
||||
free_libblock(&main->mesh, me);
|
||||
free_libblock(&bmain->mesh, me);
|
||||
else
|
||||
BKE_report(reports, RPT_ERROR, "Mesh must have zero users to be removed.");
|
||||
|
||||
/* XXX python now has invalid pointer? */
|
||||
}
|
||||
|
||||
static void rna_Main_remove_armature(Main *main, ReportList *reports, bArmature *arm)
|
||||
static void rna_Main_remove_armature(Main *bmain, ReportList *reports, bArmature *arm)
|
||||
{
|
||||
if(arm->id.us == 0)
|
||||
free_libblock(&main->armature, arm);
|
||||
free_libblock(&bmain->armature, arm);
|
||||
else
|
||||
BKE_report(reports, RPT_ERROR, "Armature must have zero users to be removed.");
|
||||
|
||||
/* XXX python now has invalid pointer? */
|
||||
}
|
||||
|
||||
static bArmature *rna_Main_add_armature(Main *main, char *name)
|
||||
static bArmature *rna_Main_add_armature(Main *bmain, char *name)
|
||||
{
|
||||
bArmature *arm= add_armature(name);
|
||||
arm->id.us--;
|
||||
return arm;
|
||||
}
|
||||
|
||||
static Lamp *rna_Main_add_lamp(Main *main, char *name)
|
||||
static Lamp *rna_Main_add_lamp(Main *bmain, char *name)
|
||||
{
|
||||
Lamp *la= add_lamp(name);
|
||||
la->id.us--;
|
||||
@@ -92,7 +92,7 @@ static Lamp *rna_Main_add_lamp(Main *main, char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
static void rna_Main_remove_lamp(Main *main, ReportList *reports, Lamp *la)
|
||||
static void rna_Main_remove_lamp(Main *bmain, ReportList *reports, Lamp *la)
|
||||
{
|
||||
if(la->id.us == 0)
|
||||
free_libblock(&main->lamp, la);
|
||||
@@ -101,7 +101,7 @@ static void rna_Main_remove_lamp(Main *main, ReportList *reports, Lamp *la)
|
||||
}
|
||||
*/
|
||||
|
||||
static Object* rna_Main_add_object(Main *main, int type, char *name)
|
||||
static Object* rna_Main_add_object(Main *bmain, int type, char *name)
|
||||
{
|
||||
Object *ob= add_only_object(type, name);
|
||||
ob->id.us--;
|
||||
@@ -120,29 +120,29 @@ static Object* rna_Main_add_object(Main *main, int type, char *name)
|
||||
# don't do this since ob is already freed!
|
||||
bpy.data.remove_object(ob)
|
||||
*/
|
||||
static void rna_Main_remove_object(Main *main, ReportList *reports, Object *ob)
|
||||
static void rna_Main_remove_object(Main *bmain, ReportList *reports, Object *ob)
|
||||
{
|
||||
if(ob->id.us == 0)
|
||||
free_libblock(&main->object, ob);
|
||||
free_libblock(&bmain->object, ob);
|
||||
else
|
||||
BKE_report(reports, RPT_ERROR, "Object must have zero users to be removed.");
|
||||
}
|
||||
|
||||
static Material *rna_Main_add_material(Main *main, char *name)
|
||||
static Material *rna_Main_add_material(Main *bmain, char *name)
|
||||
{
|
||||
return add_material(name);
|
||||
}
|
||||
|
||||
/* TODO: remove material? */
|
||||
|
||||
struct Tex *rna_Main_add_texture(Main *main, char *name)
|
||||
struct Tex *rna_Main_add_texture(Main *bmain, char *name)
|
||||
{
|
||||
return add_texture(name);
|
||||
}
|
||||
|
||||
/* TODO: remove texture? */
|
||||
|
||||
struct Image *rna_Main_add_image(Main *main, char *filename)
|
||||
struct Image *rna_Main_add_image(Main *bmain, char *filename)
|
||||
{
|
||||
return BKE_add_image_file(filename, 0);
|
||||
}
|
||||
|
||||
@@ -64,20 +64,20 @@ static EnumPropertyItem prop_texture_coordinates_items[] = {
|
||||
|
||||
#include "ED_node.h"
|
||||
|
||||
static void rna_Material_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Material_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Material *ma= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&ma->id, 0);
|
||||
WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, ma);
|
||||
WM_main_add_notifier(NC_MATERIAL|ND_SHADING, ma);
|
||||
}
|
||||
|
||||
static void rna_Material_draw_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Material_draw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Material *ma= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&ma->id, 0);
|
||||
WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING_DRAW, ma);
|
||||
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma);
|
||||
}
|
||||
|
||||
static PointerRNA rna_Material_mirror_get(PointerRNA *ptr)
|
||||
|
||||
@@ -50,26 +50,26 @@
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
static void rna_Mesh_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Mesh_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
|
||||
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
|
||||
}
|
||||
|
||||
static void rna_Mesh_update_select(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Mesh_update_select(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, id);
|
||||
WM_main_add_notifier(NC_GEOM|ND_SELECT, id);
|
||||
}
|
||||
|
||||
void rna_Mesh_update_draw(bContext *C, PointerRNA *ptr)
|
||||
void rna_Mesh_update_draw(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
|
||||
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
|
||||
}
|
||||
|
||||
static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)
|
||||
|
||||
@@ -50,10 +50,8 @@ static int rna_Meta_texspace_editable(PointerRNA *ptr)
|
||||
return (mb->texflag & AUTOSPACE)? 0: PROP_EDITABLE;
|
||||
}
|
||||
|
||||
static void rna_MetaBall_update_data(bContext *C, PointerRNA *ptr)
|
||||
static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain= CTX_data_main(C);
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
MetaBall *mb= ptr->id.data;
|
||||
Object *ob;
|
||||
|
||||
@@ -62,11 +60,9 @@ static void rna_MetaBall_update_data(bContext *C, PointerRNA *ptr)
|
||||
copy_mball_properties(scene, ob);
|
||||
|
||||
DAG_id_flush_update(&mb->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
|
||||
WM_main_add_notifier(NC_GEOM|ND_DATA, mb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#else
|
||||
|
||||
static void rna_def_metaelement(BlenderRNA *brna)
|
||||
|
||||
@@ -192,19 +192,19 @@ static char *rna_Modifier_path(PointerRNA *ptr)
|
||||
return BLI_sprintfN("modifiers[\"%s\"]", ((ModifierData*)ptr->data)->name);
|
||||
}
|
||||
|
||||
static void rna_Modifier_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Modifier_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ptr->id.data);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ptr->id.data);
|
||||
}
|
||||
|
||||
static void rna_Modifier_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
rna_Modifier_update(C, ptr);
|
||||
DAG_scene_sort(CTX_data_scene(C));
|
||||
rna_Modifier_update(bmain, scene, ptr);
|
||||
DAG_scene_sort(scene);
|
||||
}
|
||||
|
||||
static void rna_Smoke_set_type(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SmokeModifierData *smd= (SmokeModifierData *)ptr->data;
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
@@ -229,7 +229,7 @@ static void rna_Smoke_set_type(bContext *C, PointerRNA *ptr)
|
||||
}
|
||||
|
||||
// update dependancy since a domain - other type switch could have happened
|
||||
rna_Modifier_dependency_update(C, ptr);
|
||||
rna_Modifier_dependency_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value)
|
||||
|
||||
@@ -149,9 +149,8 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value)
|
||||
chroma->t2 = value;
|
||||
}
|
||||
|
||||
static void node_update(bContext *C, bNodeTree *ntree, bNode *node)
|
||||
static void node_update(Main *bmain, Scene *scene, bNodeTree *ntree, bNode *node)
|
||||
{
|
||||
Main *bmain= CTX_data_main(C);
|
||||
Material *ma;
|
||||
Tex *tex;
|
||||
Scene *sce;
|
||||
@@ -170,15 +169,15 @@ static void node_update(bContext *C, bNodeTree *ntree, bNode *node)
|
||||
ED_node_changed_update(&sce->id, node);
|
||||
}
|
||||
|
||||
static void rna_Node_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
|
||||
bNode *node= (bNode*)ptr->data;
|
||||
|
||||
node_update(C, ntree, node);
|
||||
node_update(bmain, scene, ntree, node);
|
||||
}
|
||||
|
||||
static void rna_Node_update_name(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Node_update_name(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
|
||||
bNode *node= (bNode*)ptr->data;
|
||||
@@ -193,12 +192,12 @@ static void rna_Node_update_name(bContext *C, PointerRNA *ptr)
|
||||
/* fix all the animation data which may link to this */
|
||||
BKE_all_animdata_fix_paths_rename("nodes", oldname, node->name);
|
||||
|
||||
node_update(C, ntree, node);
|
||||
node_update(bmain, scene, ntree, node);
|
||||
}
|
||||
|
||||
/* this should be done at display time! if no custom names are set */
|
||||
#if 0
|
||||
static void rna_Node_update_username(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Node_update_username(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bNode *node= (bNode*)ptr->data;
|
||||
const char *name;
|
||||
@@ -241,18 +240,18 @@ static void rna_Node_update_username(bContext *C, PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
rna_Node_update(C, ptr);
|
||||
rna_Node_update(bmain, scene, ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void rna_NodeSocket_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_NodeSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
|
||||
bNodeSocket *sock= (bNodeSocket*)ptr->data;
|
||||
bNode *node;
|
||||
|
||||
if (nodeFindNode(ntree, sock, &node, NULL))
|
||||
node_update(C, ntree, node);
|
||||
node_update(bmain, scene, ntree, node);
|
||||
}
|
||||
|
||||
static void rna_NodeSocket_defvalue_range(PointerRNA *ptr, float *min, float *max)
|
||||
@@ -263,16 +262,16 @@ static void rna_NodeSocket_defvalue_range(PointerRNA *ptr, float *min, float *ma
|
||||
*max = sock->ns.max;
|
||||
}
|
||||
|
||||
static void rna_Node_mapping_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Node_mapping_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bNode *node= (bNode*)ptr->data;
|
||||
|
||||
init_mapping((TexMapping *)node->storage);
|
||||
|
||||
rna_Node_update(C, ptr);
|
||||
rna_Node_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Node_image_layer_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bNode *node= (bNode*)ptr->data;
|
||||
Image *ima = (Image *)node->id;
|
||||
@@ -281,7 +280,7 @@ static void rna_Node_image_layer_update(bContext *C, PointerRNA *ptr)
|
||||
BKE_image_multilayer_index(ima->rr, iuser);
|
||||
BKE_image_signal(ima, iuser, IMA_SIGNAL_SRC_CHANGE);
|
||||
|
||||
rna_Node_update(C, ptr);
|
||||
rna_Node_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
|
||||
|
||||
@@ -114,56 +114,56 @@ EnumPropertyItem object_type_items[] = {
|
||||
|
||||
#include "BLI_editVert.h" /* for EditMesh->mat_nr */
|
||||
|
||||
#include "ED_mesh.h"
|
||||
#include "ED_object.h"
|
||||
#include "ED_particle.h"
|
||||
|
||||
void rna_Object_update(bContext *C, PointerRNA *ptr)
|
||||
void rna_Object_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
|
||||
}
|
||||
|
||||
void rna_Object_matrix_update(bContext *C, PointerRNA *ptr)
|
||||
void rna_Object_matrix_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ED_object_apply_obmat(ptr->id.data);
|
||||
rna_Object_update(C, ptr);
|
||||
rna_Object_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
void rna_Object_update_data(bContext *C, PointerRNA *ptr)
|
||||
void rna_Object_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ptr->id.data);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data);
|
||||
}
|
||||
|
||||
void rna_Object_active_shape_update(bContext *C, PointerRNA *ptr)
|
||||
void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= ptr->id.data;
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
int editmode= (scene->obedit == ob && ob->type == OB_MESH);
|
||||
|
||||
if(editmode) {
|
||||
/* exit/enter editmode to get new shape */
|
||||
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO);
|
||||
ED_object_enter_editmode(C, EM_WAITCURSOR);
|
||||
load_editMesh(scene, ob);
|
||||
make_editMesh(scene, ob);
|
||||
}
|
||||
|
||||
rna_Object_update_data(C, ptr);
|
||||
rna_Object_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Object_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
|
||||
DAG_scene_sort(CTX_data_scene(C));
|
||||
DAG_scene_sort(scene);
|
||||
}
|
||||
|
||||
/* when changing the selection flag the scene needs updating */
|
||||
static void rna_Object_select_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Object_select_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT;
|
||||
ED_base_object_select(object_in_scene(ob, CTX_data_scene(C)), mode);
|
||||
ED_base_object_select(object_in_scene(ob, scene), mode);
|
||||
}
|
||||
|
||||
static void rna_Base_select_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Base_select_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Base *base= (Base*)ptr->data;
|
||||
short mode = base->flag & BA_SELECT ? BA_SELECT : BA_DESELECT;
|
||||
@@ -182,10 +182,9 @@ static void rna_Object_layer_update__internal(Scene *scene, Base *base, Object *
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Object_layer_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Base *base;
|
||||
|
||||
base= object_in_scene(ob, scene);
|
||||
@@ -196,11 +195,10 @@ static void rna_Object_layer_update(bContext *C, PointerRNA *ptr)
|
||||
rna_Object_layer_update__internal(scene, base, ob);
|
||||
}
|
||||
|
||||
static void rna_Base_layer_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Base *base= (Base*)ptr->id.data;
|
||||
Object *ob= (Object*)base->object;
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
|
||||
ob->lay= base->lay;
|
||||
|
||||
@@ -527,9 +525,8 @@ static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int val
|
||||
psys_set_current_num(ob, value);
|
||||
}
|
||||
|
||||
static void rna_Object_particle_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Object_particle_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
|
||||
PE_current_changed(scene, ob);
|
||||
@@ -973,7 +970,7 @@ static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value)
|
||||
|
||||
static bConstraint *rna_Object_constraint_new(Object *object, bContext *C, int type)
|
||||
{
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
|
||||
return add_ob_constraint(object, NULL, type);
|
||||
}
|
||||
|
||||
@@ -982,7 +979,7 @@ static int rna_Object_constraint_remove(Object *object, bContext *C, int index)
|
||||
int ok = remove_constraint_index(&object->constraints, index);
|
||||
if(ok) {
|
||||
ED_object_constraint_set_active(object, NULL);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, object);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object);
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
||||
@@ -97,9 +97,9 @@ EnumPropertyItem empty_vortex_shape_items[] = {
|
||||
|
||||
#include "ED_object.h"
|
||||
|
||||
static void rna_Cache_change(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Cache_change(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
Object *ob = (Object*)ptr->id.data;
|
||||
PointCache *cache = (PointCache*)ptr->data;
|
||||
PTCacheID *pid = NULL;
|
||||
ListBase pidlist;
|
||||
@@ -124,9 +124,9 @@ static void rna_Cache_change(bContext *C, PointerRNA *ptr)
|
||||
BLI_freelistN(&pidlist);
|
||||
}
|
||||
|
||||
static void rna_Cache_toggle_disk_cache(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Cache_toggle_disk_cache(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
Object *ob = (Object*)ptr->id.data;
|
||||
PointCache *cache = (PointCache*)ptr->data;
|
||||
PTCacheID *pid = NULL;
|
||||
ListBase pidlist;
|
||||
@@ -147,9 +147,9 @@ static void rna_Cache_toggle_disk_cache(bContext *C, PointerRNA *ptr)
|
||||
BLI_freelistN(&pidlist);
|
||||
}
|
||||
|
||||
static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Cache_idname_change(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
Object *ob = (Object*)ptr->id.data;
|
||||
PointCache *cache = (PointCache*)ptr->data;
|
||||
PTCacheID *pid = NULL, *pid2= NULL;
|
||||
ListBase pidlist;
|
||||
@@ -440,7 +440,7 @@ static int particle_id_check(PointerRNA *ptr)
|
||||
return (GS(id->name) == ID_PA);
|
||||
}
|
||||
|
||||
static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_FieldSettings_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
if(particle_id_check(ptr)) {
|
||||
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
|
||||
@@ -456,7 +456,7 @@ static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr)
|
||||
}
|
||||
|
||||
DAG_id_flush_update(&part->id, OB_RECALC|PSYS_RECALC_RESET);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -468,14 +468,12 @@ static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr)
|
||||
}
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_OB);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_FieldSettings_shape_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
|
||||
if(!particle_id_check(ptr)) {
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
PartDeflect *pd= ob->pd;
|
||||
@@ -492,14 +490,12 @@ static void rna_FieldSettings_shape_update(bContext *C, PointerRNA *ptr)
|
||||
ED_object_modifier_remove(NULL, scene, ob, md);
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_FieldSettings_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
|
||||
if(particle_id_check(ptr)) {
|
||||
DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC|PSYS_RECALC_RESET);
|
||||
}
|
||||
@@ -513,7 +509,7 @@ static void rna_FieldSettings_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
do_curvebuts(B_CU3D); // all curves too
|
||||
}*/
|
||||
|
||||
rna_FieldSettings_shape_update(C, ptr);
|
||||
rna_FieldSettings_shape_update(bmain, scene, ptr);
|
||||
|
||||
DAG_scene_sort(scene);
|
||||
|
||||
@@ -522,7 +518,7 @@ static void rna_FieldSettings_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
else
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_OB);
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,22 +546,20 @@ static char *rna_FieldSettings_path(PointerRNA *ptr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void rna_EffectorWeight_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_EffectorWeight_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
|
||||
}
|
||||
|
||||
static void rna_EffectorWeight_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_EffectorWeight_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
|
||||
DAG_scene_sort(scene);
|
||||
|
||||
DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
|
||||
}
|
||||
|
||||
static char *rna_EffectorWeight_path(PointerRNA *ptr)
|
||||
@@ -612,9 +606,8 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void rna_CollisionSettings_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
ModifierData *md= modifiers_findByType(ob, eModifierType_Collision);
|
||||
|
||||
@@ -624,23 +617,23 @@ static void rna_CollisionSettings_dependency_update(bContext *C, PointerRNA *ptr
|
||||
else if(!ob->pd->deflect && md)
|
||||
ED_object_modifier_remove(NULL, scene, ob, md);
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
|
||||
}
|
||||
|
||||
static void rna_CollisionSettings_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_CollisionSettings_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
|
||||
}
|
||||
|
||||
static void rna_softbody_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_softbody_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ EnumPropertyItem part_hair_ren_as_items[] = {
|
||||
#include "BLI_listbase.h"
|
||||
|
||||
/* property update functions */
|
||||
static void particle_recalc(bContext *C, PointerRNA *ptr, short flag)
|
||||
static void particle_recalc(Main *bmain, Scene *scene, PointerRNA *ptr, short flag)
|
||||
{
|
||||
if(ptr->type==&RNA_ParticleSystem) {
|
||||
ParticleSystem *psys = (ParticleSystem*)ptr->data;
|
||||
@@ -121,43 +121,41 @@ static void particle_recalc(bContext *C, PointerRNA *ptr, short flag)
|
||||
else
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|flag);
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
}
|
||||
static void rna_Particle_redo(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
particle_recalc(C, ptr, PSYS_RECALC_REDO);
|
||||
particle_recalc(bmain, scene, ptr, PSYS_RECALC_REDO);
|
||||
}
|
||||
|
||||
static void rna_Particle_redo_dependency(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_redo_dependency(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
DAG_scene_sort(CTX_data_scene(C));
|
||||
rna_Particle_redo(C, ptr);
|
||||
DAG_scene_sort(scene);
|
||||
rna_Particle_redo(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Particle_reset(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
particle_recalc(C, ptr, PSYS_RECALC_RESET);
|
||||
particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET);
|
||||
}
|
||||
|
||||
static void rna_Particle_change_type(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_change_type(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
particle_recalc(C, ptr, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
|
||||
particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
|
||||
}
|
||||
|
||||
static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_change_physics(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
particle_recalc(C, ptr, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
|
||||
particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
|
||||
}
|
||||
|
||||
static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_redo_child(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
particle_recalc(C, ptr, PSYS_RECALC_CHILD);
|
||||
particle_recalc(bmain, scene, ptr, PSYS_RECALC_CHILD);
|
||||
}
|
||||
|
||||
static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
if(ptr->type==&RNA_ParticleTarget) {
|
||||
ParticleTarget *pt = (ParticleTarget*)ptr->data;
|
||||
Object *ob = (Object*)ptr->id.data;
|
||||
@@ -187,10 +185,10 @@ static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr)
|
||||
DAG_scene_sort(scene);
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
}
|
||||
|
||||
static void rna_Particle_target_redo(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_target_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
if(ptr->type==&RNA_ParticleTarget) {
|
||||
Object *ob = (Object*)ptr->id.data;
|
||||
@@ -199,13 +197,12 @@ static void rna_Particle_target_redo(bContext *C, PointerRNA *ptr)
|
||||
psys->recalc = PSYS_RECALC_REDO;
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Particle_hair_dynamics(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
/* Scene *scene = CTX_data_scene(C); */
|
||||
ParticleSystem *psys = (ParticleSystem*)ptr->data;
|
||||
|
||||
if(psys && !psys->clmd) {
|
||||
@@ -213,10 +210,10 @@ static void rna_Particle_hair_dynamics(bContext *C, PointerRNA *ptr)
|
||||
psys->clmd->sim_parms->goalspring = 0.0f;
|
||||
psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL|CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS;
|
||||
psys->clmd->coll_parms->flags &= ~CLOTH_COLLSETTINGS_FLAG_SELF;
|
||||
rna_Particle_redo(C, ptr);
|
||||
rna_Particle_redo(bmain, scene, ptr);
|
||||
}
|
||||
else
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
|
||||
}
|
||||
static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
|
||||
{
|
||||
@@ -241,7 +238,7 @@ static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
|
||||
psys_check_boid_data(psys);
|
||||
}
|
||||
}
|
||||
static void rna_Particle_abspathtime_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Particle_abspathtime_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ParticleSettings *settings = (ParticleSettings*)ptr->data;
|
||||
float delta = settings->end + settings->lifetime - settings->sta;
|
||||
@@ -253,7 +250,7 @@ static void rna_Particle_abspathtime_update(bContext *C, PointerRNA *ptr)
|
||||
settings->path_start = (settings->path_start - settings->sta)/delta;
|
||||
settings->path_end = (settings->path_end - settings->sta)/delta;
|
||||
}
|
||||
rna_Particle_redo(C, ptr);
|
||||
rna_Particle_redo(bmain, scene, ptr);
|
||||
}
|
||||
static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
|
||||
{
|
||||
|
||||
@@ -58,14 +58,14 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
static void rna_Pose_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Pose_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
// XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
|
||||
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
static void rna_Pose_IK_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Pose_IK_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
// XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
|
||||
Object *ob= ptr->id.data;
|
||||
@@ -142,11 +142,10 @@ static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Pose_ik_solver_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Pose_ik_solver_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= ptr->id.data;
|
||||
bPose *pose = ptr->data;
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
pose->flag |= POSE_RECALC; // checks & sorts pose channels
|
||||
DAG_scene_sort(scene);
|
||||
@@ -242,7 +241,7 @@ static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Itasc_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Itasc_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob = ptr->id.data;
|
||||
bItasc *itasc = ptr->data;
|
||||
@@ -267,13 +266,13 @@ static void rna_Itasc_update(bContext *C, PointerRNA *ptr)
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
static void rna_Itasc_update_rebuild(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob= ptr->id.data;
|
||||
bPose *pose = ob->pose;
|
||||
|
||||
pose->flag |= POSE_RECALC; // checks & sorts pose channels
|
||||
rna_Itasc_update(C, ptr);
|
||||
rna_Itasc_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
|
||||
@@ -431,7 +430,7 @@ static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr, PointerRNA va
|
||||
|
||||
static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, bContext *C, int type)
|
||||
{
|
||||
//WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
|
||||
//WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
|
||||
// TODO, pass object also
|
||||
// TODO, new pose bones don't have updated draw flags
|
||||
return add_pose_constraint(NULL, pchan, NULL, type);
|
||||
@@ -441,7 +440,7 @@ static int rna_PoseChannel_constraints_remove(bPoseChannel *pchan, bContext *C,
|
||||
{
|
||||
// TODO
|
||||
//ED_object_constraint_set_active(object, NULL);
|
||||
//WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, object);
|
||||
//WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object);
|
||||
return remove_constraint_index(&pchan->constraints, index);
|
||||
}
|
||||
|
||||
|
||||
@@ -190,9 +190,8 @@ static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
|
||||
scene->lay= ED_view3d_scene_layer_set(scene->lay, values);
|
||||
}
|
||||
|
||||
static void rna_Scene_layer_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Scene_layer_update(Main *bmain, Scene *unused, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain= CTX_data_main(C);
|
||||
Scene *scene= (Scene*)ptr->data;
|
||||
|
||||
ED_view3d_scene_layers_update(bmain, scene);
|
||||
@@ -269,7 +268,7 @@ static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
|
||||
data->r.pefra= value;
|
||||
}
|
||||
|
||||
static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Scene_frame_update(Main *bmain, Scene *unused, PointerRNA *ptr)
|
||||
{
|
||||
//Scene *scene= ptr->id.data;
|
||||
//ED_update_for_newframe(C);
|
||||
@@ -538,7 +537,7 @@ static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
|
||||
rl->lay= ED_view3d_scene_layer_set(rl->lay, values);
|
||||
}
|
||||
|
||||
static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= (Scene*)ptr->id.data;
|
||||
|
||||
@@ -555,7 +554,7 @@ static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
|
||||
ED_node_composit_default(scene);
|
||||
}
|
||||
|
||||
static void rna_Physics_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Physics_update(Main *bmain, Scene *unused, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= (Scene*)ptr->id.data;
|
||||
Base *base;
|
||||
|
||||
@@ -54,7 +54,7 @@ static void rna_Scene_set_frame(Scene *scene, bContext *C, int frame)
|
||||
CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
|
||||
scene_update_for_newframe(scene, (1<<20) - 1);
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
|
||||
WM_main_add_notifier(NC_SCENE|ND_FRAME, scene);
|
||||
}
|
||||
|
||||
static KeyingSet *rna_Scene_add_keying_set(Scene *sce, ReportList *reports,
|
||||
|
||||
@@ -61,13 +61,13 @@ static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
|
||||
sc->newscene= value.data;
|
||||
}
|
||||
|
||||
static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Screen_scene_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bScreen *sc= (bScreen*)ptr->data;
|
||||
|
||||
/* exception: can't set screens inside of area/region handers */
|
||||
if(sc->newscene) {
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene);
|
||||
WM_main_add_notifier(NC_SCENE|ND_SCENEBROWSE, sc->newscene);
|
||||
sc->newscene= NULL;
|
||||
}
|
||||
}
|
||||
@@ -94,10 +94,8 @@ static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
ScrArea *sa= (ScrArea*)ptr->data;
|
||||
|
||||
if(sa) {
|
||||
ED_area_newspace(C, sa, sa->butspacetype); /* XXX - this uses the window */
|
||||
ED_area_tag_redraw(sa);
|
||||
}
|
||||
ED_area_newspace(C, sa, sa->butspacetype); /* XXX - this uses the window */
|
||||
ED_area_tag_redraw(sa);
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -135,9 +133,9 @@ static void rna_def_area(BlenderRNA *brna)
|
||||
RNA_def_property_enum_items(prop, space_type_items);
|
||||
RNA_def_property_enum_funcs(prop, NULL, "rna_Area_type_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Type", "Space type.");
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_update(prop, 0, "rna_Area_type_update");
|
||||
|
||||
|
||||
RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
|
||||
}
|
||||
|
||||
|
||||
@@ -100,9 +100,10 @@ static void rna_Paint_active_brush_set(PointerRNA *ptr, PointerRNA value)
|
||||
paint_brush_set(ptr->data, value.data);
|
||||
}
|
||||
|
||||
static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr)
|
||||
static void rna_ParticleEdit_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
PTCacheEdit *edit = PE_get_current(CTX_data_scene(C), CTX_data_active_object(C));
|
||||
Object *ob= (scene->basact)? scene->basact->object: NULL;
|
||||
PTCacheEdit *edit = PE_get_current(scene, ob);
|
||||
|
||||
if(!edit)
|
||||
return;
|
||||
@@ -110,9 +111,9 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr)
|
||||
psys_free_path_cache(edit->psys, edit);
|
||||
}
|
||||
|
||||
static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_ParticleEdit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
Object *ob= (scene->basact)? scene->basact->object: NULL;
|
||||
|
||||
if(ob) DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
}
|
||||
@@ -120,7 +121,8 @@ static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr)
|
||||
static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C));
|
||||
Object *ob= (scene->basact)? scene->basact->object: NULL;
|
||||
PTCacheEdit *edit = PE_get_current(scene, ob);
|
||||
|
||||
if(edit && edit->psys)
|
||||
return particle_edit_hair_brush_items;
|
||||
|
||||
@@ -264,9 +264,8 @@ static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
|
||||
BLI_strncpy(elem->name, name, sizeof(elem->name));
|
||||
}
|
||||
|
||||
static void rna_Sequence_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Sequence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= (Scene*)ptr->id.data;
|
||||
Editing *ed= seq_give_editing(scene, FALSE);
|
||||
|
||||
free_imbuf_seq(scene, &ed->seqbase, FALSE);
|
||||
@@ -275,13 +274,12 @@ static void rna_Sequence_update(bContext *C, PointerRNA *ptr)
|
||||
seq_update_sound(ptr->data);
|
||||
}
|
||||
|
||||
static void rna_Sequence_mute_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= (Scene*)ptr->id.data;
|
||||
Editing *ed= seq_give_editing(scene, FALSE);
|
||||
|
||||
seq_update_muting(ed);
|
||||
rna_Sequence_update(C, ptr);
|
||||
rna_Sequence_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -49,33 +49,33 @@
|
||||
|
||||
#include "ED_object.h"
|
||||
|
||||
static void rna_Smoke_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Smoke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
static void rna_Smoke_dependency_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
rna_Smoke_update(C, ptr);
|
||||
DAG_scene_sort(CTX_data_scene(C));
|
||||
rna_Smoke_update(bmain, scene, ptr);
|
||||
DAG_scene_sort(scene);
|
||||
}
|
||||
|
||||
static void rna_Smoke_reset(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
|
||||
|
||||
smokeModifier_reset(settings->smd);
|
||||
|
||||
rna_Smoke_update(C, ptr);
|
||||
rna_Smoke_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_Smoke_reset_dependancy(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
|
||||
|
||||
smokeModifier_reset(settings->smd);
|
||||
|
||||
rna_Smoke_dependency_update(C, ptr);
|
||||
rna_Smoke_dependency_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
#include "BKE_sound.h"
|
||||
#include "BKE_context.h"
|
||||
|
||||
static void rna_Sound_filename_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Sound_filename_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
sound_load(CTX_data_main(C), (bSound*)ptr->data);
|
||||
sound_load(bmain, (bSound*)ptr->data);
|
||||
}
|
||||
|
||||
static int rna_Sound_caching_get(PointerRNA *ptr)
|
||||
|
||||
@@ -83,7 +83,7 @@ static EnumPropertyItem transform_orientation_items[] = {
|
||||
{V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
static EnumPropertyItem autosnap_items[] = {
|
||||
EnumPropertyItem autosnap_items[] = {
|
||||
{SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""},
|
||||
{SACTSNAP_STEP, "STEP", 0, "Time Step", "Snap to 1.0 frame/second intervals."},
|
||||
{SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames/seconds (nla-action time)."},
|
||||
@@ -249,12 +249,9 @@ static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
|
||||
return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
|
||||
}
|
||||
|
||||
static void rna_SpaceImageEditor_paint_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
|
||||
if(scene)
|
||||
paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
|
||||
paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
|
||||
}
|
||||
|
||||
static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
|
||||
@@ -322,7 +319,7 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P
|
||||
return item;
|
||||
}
|
||||
|
||||
static void rna_SpaceImageEditor_curves_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_SpaceImageEditor_curves_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SpaceImage *sima= (SpaceImage*)ptr->data;
|
||||
ImBuf *ibuf;
|
||||
@@ -332,7 +329,7 @@ static void rna_SpaceImageEditor_curves_update(bContext *C, PointerRNA *ptr)
|
||||
curvemapping_do_ibuf(sima->cumap, ibuf);
|
||||
ED_space_image_release_buffer(sima, lock);
|
||||
|
||||
WM_event_add_notifier(C, NC_IMAGE, sima->image);
|
||||
WM_main_add_notifier(NC_IMAGE, sima->image);
|
||||
}
|
||||
|
||||
|
||||
@@ -432,10 +429,12 @@ static void rna_View3D_display_background_image_set(PointerRNA *ptr, int value)
|
||||
|
||||
/* Space Time */
|
||||
|
||||
static void rna_SpaceTime_redraw_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_SpaceTime_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SpaceTime *st= (SpaceTime*)ptr->data;
|
||||
ED_screen_animation_timer_update(C, st->redraws);
|
||||
bScreen *screen= (bScreen*)ptr->id.data;
|
||||
|
||||
ED_screen_animation_timer_update(screen, st->redraws);
|
||||
}
|
||||
|
||||
/* Space Dopesheet */
|
||||
@@ -446,10 +445,10 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu
|
||||
saction->action= value.data;
|
||||
}
|
||||
|
||||
static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SpaceAction *saction= (SpaceAction*)(ptr->data);
|
||||
Object *obact= CTX_data_active_object(C);
|
||||
Object *obact= (scene->basact)? scene->basact->object: NULL;
|
||||
|
||||
/* we must set this action to be the one used by active object (if not pinned) */
|
||||
if(obact && saction->pin == 0) {
|
||||
@@ -464,7 +463,7 @@ static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_SpaceDopeSheetEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SpaceAction *saction= (SpaceAction*)(ptr->data);
|
||||
|
||||
|
||||
@@ -106,21 +106,21 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Texture_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Tex *tex= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&tex->id, 0);
|
||||
WM_event_add_notifier(C, NC_TEXTURE, tex);
|
||||
WM_main_add_notifier(NC_TEXTURE, tex);
|
||||
}
|
||||
|
||||
/* Used for Texture Properties, used (also) for/in Nodes */
|
||||
static void rna_Texture_nodes_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Tex *tex= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&tex->id, 0);
|
||||
WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, tex);
|
||||
WM_main_add_notifier(NC_TEXTURE|ND_NODES, tex);
|
||||
}
|
||||
|
||||
static void rna_Texture_type_set(PointerRNA *ptr, int value)
|
||||
@@ -140,7 +140,7 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value)
|
||||
tex->type = value;
|
||||
}
|
||||
|
||||
void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
|
||||
void rna_TextureSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ID *id= ptr->id.data;
|
||||
|
||||
@@ -148,16 +148,16 @@ void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
|
||||
|
||||
switch(GS(id->name)) {
|
||||
case ID_MA:
|
||||
WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, id);
|
||||
WM_main_add_notifier(NC_MATERIAL|ND_SHADING, id);
|
||||
break;
|
||||
case ID_WO:
|
||||
WM_event_add_notifier(C, NC_WORLD, id);
|
||||
WM_main_add_notifier(NC_WORLD, id);
|
||||
break;
|
||||
case ID_LA:
|
||||
WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, id);
|
||||
WM_main_add_notifier(NC_LAMP|ND_LIGHTING, id);
|
||||
break;
|
||||
case ID_BR:
|
||||
WM_event_add_notifier(C, NC_BRUSH, id);
|
||||
WM_main_add_notifier(NC_BRUSH, id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ static void rna_Panel_unregister(const bContext *C, StructRNA *type)
|
||||
|
||||
/* update while blender is running */
|
||||
if(C)
|
||||
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
|
||||
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
|
||||
}
|
||||
|
||||
static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
|
||||
@@ -196,7 +196,7 @@ static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, voi
|
||||
|
||||
/* update while blender is running */
|
||||
if(C)
|
||||
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
|
||||
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
|
||||
|
||||
return pt->ext.srna;
|
||||
}
|
||||
@@ -242,7 +242,7 @@ static void rna_Header_unregister(const bContext *C, StructRNA *type)
|
||||
|
||||
/* update while blender is running */
|
||||
if(C)
|
||||
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
|
||||
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
|
||||
}
|
||||
|
||||
static StructRNA *rna_Header_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
|
||||
@@ -289,7 +289,7 @@ static StructRNA *rna_Header_register(const bContext *C, ReportList *reports, vo
|
||||
|
||||
/* update while blender is running */
|
||||
if(C)
|
||||
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
|
||||
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
|
||||
|
||||
return ht->ext.srna;
|
||||
}
|
||||
@@ -356,7 +356,7 @@ static void rna_Menu_unregister(const bContext *C, StructRNA *type)
|
||||
|
||||
/* update while blender is running */
|
||||
if(C)
|
||||
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
|
||||
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
|
||||
}
|
||||
|
||||
static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
|
||||
@@ -396,7 +396,7 @@ static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void
|
||||
|
||||
/* update while blender is running */
|
||||
if(C)
|
||||
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
|
||||
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
|
||||
|
||||
return mt->ext.srna;
|
||||
}
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
#include "DNA_object_types.h"
|
||||
// #include "GPU_draw.h"
|
||||
|
||||
static void rna_userdef_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_userdef_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
||||
WM_main_add_notifier(NC_WINDOW, NULL);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -132,14 +132,13 @@ static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
|
||||
return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
|
||||
}
|
||||
|
||||
static void rna_UserDef_audio_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_UserDef_audio_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
sound_init(C);
|
||||
sound_init();
|
||||
}
|
||||
|
||||
static void rna_UserDef_weight_color_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain= CTX_data_main(C);
|
||||
Object *ob;
|
||||
|
||||
vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
|
||||
@@ -149,22 +148,25 @@ static void rna_UserDef_weight_color_update(bContext *C, PointerRNA *ptr)
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
rna_userdef_update(C, ptr);
|
||||
rna_userdef_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
// XXX - todo, this is not accessible from here and it only works when the userprefs are in the same window.
|
||||
// extern int GPU_default_lights(void);
|
||||
static void rna_UserDef_viewport_lights_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
// GPU_default_lights();
|
||||
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
|
||||
rna_userdef_update(C, ptr);
|
||||
WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL);
|
||||
rna_userdef_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
static void rna_userdef_autosave_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
WM_autosave_init(C);
|
||||
rna_userdef_update(C, ptr);
|
||||
wmWindowManager *wm= bmain->wm.first;
|
||||
|
||||
if(wm)
|
||||
WM_autosave_init(wm);
|
||||
rna_userdef_update(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -348,13 +348,13 @@ static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value)
|
||||
win->newscreen= value.data;
|
||||
}
|
||||
|
||||
static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_Window_screen_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
wmWindow *win= (wmWindow*)ptr->data;
|
||||
|
||||
/* exception: can't set screens inside of area/region handers */
|
||||
if(win->newscreen) {
|
||||
WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, win->newscreen);
|
||||
WM_main_add_notifier(NC_SCREEN|ND_SCREENBROWSE, win->newscreen);
|
||||
win->newscreen= NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,20 +82,20 @@ static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value)
|
||||
set_current_world_texture(wo, value.data);
|
||||
}
|
||||
|
||||
static void rna_World_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_World_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
World *wo= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&wo->id, 0);
|
||||
WM_event_add_notifier(C, NC_WORLD, wo);
|
||||
WM_main_add_notifier(NC_WORLD, wo);
|
||||
}
|
||||
|
||||
static void rna_World_draw_update(bContext *C, PointerRNA *ptr)
|
||||
static void rna_World_draw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
World *wo= ptr->id.data;
|
||||
|
||||
DAG_id_flush_update(&wo->id, 0);
|
||||
WM_event_add_notifier(C, NC_WORLD|ND_WORLD_DRAW, wo);
|
||||
WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -74,7 +74,7 @@ int WM_write_homefile (struct bContext *C, struct wmOperator *op);
|
||||
void WM_read_file (struct bContext *C, char *name, struct ReportList *reports);
|
||||
void WM_write_file (struct bContext *C, char *target, int fileflags, struct ReportList *reports);
|
||||
void WM_read_autosavefile(struct bContext *C);
|
||||
void WM_autosave_init (struct bContext *C);
|
||||
void WM_autosave_init (struct wmWindowManager *wm);
|
||||
|
||||
/* mouse cursors */
|
||||
void WM_cursor_set (struct wmWindow *win, int curs);
|
||||
|
||||
@@ -213,7 +213,7 @@ void WM_check(bContext *C)
|
||||
/* case: fileread */
|
||||
if((wm->initialized & WM_INIT_WINDOW) == 0) {
|
||||
WM_keymap_init(C);
|
||||
WM_autosave_init(C);
|
||||
WM_autosave_init(wm);
|
||||
}
|
||||
|
||||
/* case: no open windows at all, for old file reads */
|
||||
|
||||
@@ -569,9 +569,8 @@ void wm_autosave_location(char *filename)
|
||||
BLI_make_file_string("/", filename, U.tempdir, pidstr);
|
||||
}
|
||||
|
||||
void WM_autosave_init(bContext *C)
|
||||
void WM_autosave_init(wmWindowManager *wm)
|
||||
{
|
||||
wmWindowManager *wm= CTX_wm_manager(C);
|
||||
wm_autosave_timer_ended(wm);
|
||||
|
||||
if(U.flag & USER_AUTOSAVE)
|
||||
|
||||
Reference in New Issue
Block a user