Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_meta.c
| Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
| static void rna_MetaBall_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_MetaBall_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| ID *id = ptr->owner_id; | ID *id = ptr->owner_id; | ||||
| DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); | ||||
| WM_main_add_notifier(NC_GEOM | ND_DATA, id); | WM_main_add_notifier(NC_GEOM | ND_DATA, id); | ||||
| } | } | ||||
| static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_MetaBall_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| MetaBall *mb = (MetaBall *)ptr->owner_id; | MetaBall *mb = (MetaBall *)ptr->owner_id; | ||||
| Object *ob; | Object *ob; | ||||
| /* cheating way for importers to avoid slow updates */ | /* NOTE: The check on the number of users allows to avoid many repetitive (slow) updates in some | ||||
| * cases, like e.g. importers. Calling `BKE_mball_properties_copy` on an obdata with no users | |||||
| * would be meaningless anyway, as by definition it would not be used by any object, so not part | |||||
| * of any meta-ball group. */ | |||||
| if (mb->id.us > 0) { | if (mb->id.us > 0) { | ||||
| for (ob = bmain->objects.first; ob; ob = ob->id.next) { | BKE_mball_properties_copy(bmain, mb); | ||||
| if (ob->data == mb) { | |||||
| BKE_mball_properties_copy(scene, ob); | |||||
| } | |||||
| } | |||||
| DEG_id_tag_update(&mb->id, 0); | DEG_id_tag_update(&mb->id, 0); | ||||
| WM_main_add_notifier(NC_GEOM | ND_DATA, mb); | WM_main_add_notifier(NC_GEOM | ND_DATA, mb); | ||||
| } | } | ||||
| } | } | ||||
| static void rna_MetaBall_update_rotation(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_MetaBall_update_rotation(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 318 Lines • Show Last 20 Lines | |||||