Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object_force.c
| Show First 20 Lines • Show All 642 Lines • ▼ Show 20 Lines | static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| else { | else { | ||||
| Object *ob = (Object *)ptr->owner_id; | Object *ob = (Object *)ptr->owner_id; | ||||
| if (ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) { | if (ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) { | ||||
| id_us_min(&ob->pd->tex->id); | id_us_min(&ob->pd->tex->id); | ||||
| ob->pd->tex = NULL; | ob->pd->tex = NULL; | ||||
| } | } | ||||
| /* Solution [1]: Need to rebuild mesh and bhvtree for SurfaceModifier to work correctly. */ | |||||
| if (ELEM(ob->type, OB_SURF, OB_FONT, OB_CURVE) && | |||||
| (ELEM(ob->pd->shape, PFIELD_SHAPE_SURFACE, PFIELD_SHAPE_POINTS) || | |||||
| ob->pd->forcefield == PFIELD_GUIDE)) { | |||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | |||||
| } | |||||
| DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); | DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); | ||||
| WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); | WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); | ||||
| } | } | ||||
| } | } | ||||
| static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| { | { | ||||
| if (!particle_id_check(ptr)) { | if (!particle_id_check(ptr)) { | ||||
| ▲ Show 20 Lines • Show All 1,480 Lines • Show Last 20 Lines | |||||