Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mball.c
| Context not available. | |||||
| #include "DNA_meta_types.h" | #include "DNA_meta_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DEG_depsgraph.h" | |||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| Context not available. | |||||
| return mb_copy; | return mb_copy; | ||||
| } | } | ||||
| void BKE_mball_copy_properties(MetaBall *to, const MetaBall *from) | |||||
| { | |||||
| to->wiresize = from->wiresize; | |||||
| to->rendersize = from->rendersize; | |||||
| to->thresh = from->thresh; | |||||
| to->flag = from->flag; | |||||
| } | |||||
| void BKE_mball_make_local(Main *bmain, MetaBall *mb, const bool lib_local) | void BKE_mball_make_local(Main *bmain, MetaBall *mb, const bool lib_local) | ||||
| { | { | ||||
| BKE_id_make_local_generic(bmain, &mb->id, true, lib_local); | BKE_id_make_local_generic(bmain, &mb->id, true, lib_local); | ||||
| Context not available. | |||||
| * are copied to all metaballs in same "group" (metaballs with same base name: MBall, | * are copied to all metaballs in same "group" (metaballs with same base name: MBall, | ||||
| * MBall.001, MBall.002, etc). The most important is to copy properties to the base metaball, | * MBall.001, MBall.002, etc). The most important is to copy properties to the base metaball, | ||||
| * because this metaball influence polygonisation of metaballs. */ | * because this metaball influence polygonisation of metaballs. */ | ||||
| void BKE_mball_properties_copy(Scene *scene, Object *active_object) | void BKE_mball_propagate_properties(Scene *scene, Object *active_object) | ||||
| { | { | ||||
| Scene *sce_iter = scene; | Scene *sce_iter = scene; | ||||
| Base *base; | Base *base; | ||||
| Context not available. | |||||
| MetaBall *mb = ob->data; | MetaBall *mb = ob->data; | ||||
| /* Copy properties from selected/edited metaball */ | /* Copy properties from selected/edited metaball */ | ||||
| mb->wiresize = active_mball->wiresize; | BKE_mball_copy_properties(mb, active_mball); | ||||
| mb->rendersize = active_mball->rendersize; | /* Trigger refresh if changed object is the basis object */ | ||||
| mb->thresh = active_mball->thresh; | if (BKE_mball_is_basis(ob)) { | ||||
| mb->flag = active_mball->flag; | DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | ||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||