Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object_force.c
| Show All 20 Lines | |||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include "DNA_cloth_types.h" | #include "DNA_cloth_types.h" | ||||
| #include "DNA_fluid_types.h" | #include "DNA_fluid_types.h" | ||||
| #include "DNA_object_force_types.h" | #include "DNA_object_force_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_particle_types.h" | #include "DNA_particle_types.h" | ||||
| #include "DNA_pointcache_types.h" | #include "DNA_pointcache_types.h" | ||||
| #include "DNA_rigidbody_types.h" | |||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "rna_internal.h" | #include "rna_internal.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| ▲ Show 20 Lines • Show All 735 Lines • ▼ Show 20 Lines | if (particle_id_check(ptr)) { | ||||
| /* particle effector weights */ | /* particle effector weights */ | ||||
| ParticleSettings *part = (ParticleSettings *)ptr->owner_id; | ParticleSettings *part = (ParticleSettings *)ptr->owner_id; | ||||
| if (part->effector_weights == ew) { | if (part->effector_weights == ew) { | ||||
| return BLI_strdup("effector_weights"); | return BLI_strdup("effector_weights"); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| Object *ob = (Object *)ptr->owner_id; | ID *id = ptr->owner_id; | ||||
| if (id && GS(id->name) == ID_SCE) { | |||||
| Scene *scene = (Scene *)id; | |||||
| RigidBodyWorld *rbw = scene->rigidbody_world; | |||||
sybren: These two can be `const`. | |||||
| if (rbw->effector_weights == ew) { | |||||
| return BLI_strdup("rigidbody_world.effector_weights"); | |||||
| } | |||||
| } | |||||
| Object *ob = (Object *)id; | |||||
| ModifierData *md; | ModifierData *md; | ||||
| /* check softbody modifier */ | /* check softbody modifier */ | ||||
| md = (ModifierData *)BKE_modifiers_findby_type(ob, eModifierType_Softbody); | md = (ModifierData *)BKE_modifiers_findby_type(ob, eModifierType_Softbody); | ||||
| if (md) { | if (md) { | ||||
| /* no pointer from modifier data to actual softbody storage, would be good to add */ | /* no pointer from modifier data to actual softbody storage, would be good to add */ | ||||
| if (ob->soft->effector_weights == ew) { | if (ob->soft->effector_weights == ew) { | ||||
| char name_esc[sizeof(md->name) * 2]; | char name_esc[sizeof(md->name) * 2]; | ||||
| ▲ Show 20 Lines • Show All 1,332 Lines • Show Last 20 Lines | |||||
These two can be const.