Blender
V3.3
|
Rigid Body object editing operators. More...
#include <stdlib.h>
#include <string.h>
#include "DNA_collection_types.h"
#include "DNA_object_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_rigidbody.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_object.h"
#include "ED_physics.h"
#include "ED_screen.h"
#include "physics_intern.h"
Go to the source code of this file.
Classes | |
struct | rbMaterialDensityItem |
Typedefs | |
typedef struct rbMaterialDensityItem | rbMaterialDensityItem |
Variables | |
static rbMaterialDensityItem | RB_MATERIAL_DENSITY_TABLE [] |
static const int | NUM_RB_MATERIAL_PRESETS |
Rigid Body object editing operators.
Definition in file rigidbody_object.c.
typedef struct rbMaterialDensityItem rbMaterialDensityItem |
Definition at line 58 of file rigidbody_object.c.
References C, CTX_data_scene(), ED_object_active_context(), ED_operator_object_active_editable(), operator_rigidbody_editable_poll(), Object::rigidbody_object, and scene.
Referenced by RIGIDBODY_OT_mass_calculate(), RIGIDBODY_OT_object_remove(), RIGIDBODY_OT_objects_remove(), and RIGIDBODY_OT_shape_change().
Definition at line 73 of file rigidbody_object.c.
References C, CTX_data_scene(), ED_object_active_context(), ED_operator_object_active_editable(), OB_MESH, operator_rigidbody_editable_poll(), scene, and Object::type.
Referenced by RIGIDBODY_OT_object_add(), and RIGIDBODY_OT_objects_add().
bool ED_rigidbody_object_add | ( | Main * | bmain, |
Scene * | scene, | ||
Object * | ob, | ||
int | type, | ||
ReportList * | reports | ||
) |
Definition at line 90 of file rigidbody_object.c.
References BKE_rigidbody_add_object(), scene, and type.
Referenced by rigidbody_object_add_exec(), and rigidbody_objects_add_exec().
Definition at line 95 of file rigidbody_object.c.
References BKE_rigidbody_remove_object(), DEG_id_tag_update(), DEG_relations_tag_update(), Object::id, ID_RECALC_TRANSFORM, and scene.
Referenced by object_convert_exec(), rigidbody_object_remove_exec(), and rigidbody_objects_remove_exec().
|
static |
Definition at line 517 of file rigidbody_object.c.
References material, PROP_EDITABLE, wmOperator::ptr, RNA_def_property_clear_flag(), RNA_def_property_flag(), RNA_enum_get(), RNA_property_identifier(), and STREQ.
Referenced by RIGIDBODY_OT_mass_calculate().
Definition at line 47 of file rigidbody_object.c.
References RigidBodyWorld::group, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, NULL, Scene::rigidbody_world, and scene.
Referenced by ED_operator_rigidbody_active_poll(), and ED_operator_rigidbody_add_poll().
|
static |
Definition at line 423 of file rigidbody_object.c.
References EnumPropertyItem::identifier, IFACE_, rbMaterialDensityItem::name, EnumPropertyItem::name, NULL, NUM_RB_MATERIAL_PRESETS, RB_MATERIAL_DENSITY_TABLE, RNA_enum_item_add(), RNA_enum_item_end(), and EnumPropertyItem::value.
Referenced by RIGIDBODY_OT_mass_calculate().
|
static |
Definition at line 108 of file rigidbody_object.c.
References C, CTX_data_main(), CTX_data_scene(), ED_object_active_context(), ED_rigidbody_object_add(), NC_OBJECT, ND_POINTCACHE, ND_TRANSFORM, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), scene, type, and WM_event_add_notifier().
Referenced by RIGIDBODY_OT_object_add().
|
static |
Definition at line 155 of file rigidbody_object.c.
References BKE_report(), C, CTX_data_main(), CTX_data_scene(), ED_object_active_context(), ED_rigidbody_object_remove(), ELEM, NC_OBJECT, ND_POINTCACHE, ND_TRANSFORM, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, Object::rigidbody_object, RPT_ERROR, scene, and WM_event_add_notifier().
Referenced by RIGIDBODY_OT_object_remove().
|
static |
Definition at line 201 of file rigidbody_object.c.
References C, CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), CTX_data_scene(), ED_rigidbody_object_add(), NC_OBJECT, ND_POINTCACHE, ND_TRANSFORM, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), scene, type, and WM_event_add_notifier().
Referenced by RIGIDBODY_OT_objects_add().
|
static |
Definition at line 459 of file rigidbody_object.c.
References BKE_rigidbody_calc_volume(), C, CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_ensure_evaluated_depsgraph(), DEG_get_evaluated_object(), DEG_id_tag_update(), rbMaterialDensityItem::density, usdtokens::density(), depsgraph, ID_RECALC_TRANSFORM, material, NC_OBJECT, ND_POINTCACHE, NULL, NUM_RB_MATERIAL_PRESETS, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, ptr, RB_MATERIAL_DENSITY_TABLE, RNA_enum_get(), RNA_float_get(), RNA_float_set(), RNA_pointer_create(), and WM_event_add_notifier().
Referenced by RIGIDBODY_OT_mass_calculate().
|
static |
Definition at line 250 of file rigidbody_object.c.
References C, CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), CTX_data_scene(), ED_rigidbody_object_remove(), NC_OBJECT, ND_POINTCACHE, ND_TRANSFORM, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, scene, and WM_event_add_notifier().
Referenced by RIGIDBODY_OT_objects_remove().
|
static |
Definition at line 296 of file rigidbody_object.c.
References C, CTX_DATA_BEGIN, CTX_DATA_END, DEG_id_tag_update(), ID_RECALC_TRANSFORM, NC_OBJECT, NC_SPACE, ND_POINTCACHE, ND_SPACE_VIEW3D, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, ptr, RNA_enum_get(), RNA_enum_set(), RNA_pointer_create(), and WM_event_add_notifier().
Referenced by RIGIDBODY_OT_shape_change().
void RIGIDBODY_OT_mass_calculate | ( | wmOperatorType * | ot | ) |
Definition at line 537 of file rigidbody_object.c.
References wmOperatorType::description, DummyRNA_DEFAULT_items, ED_operator_rigidbody_active_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, mass_calculate_poll_property(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::poll_property, wmOperatorType::prop, PROP_ENUM_NO_TRANSLATE, rigidbody_materials_itemf(), rigidbody_objects_calc_mass_exec(), RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_float(), RNA_def_property_flag(), wmOperatorType::srna, and WM_menu_invoke().
Referenced by operatortypes_particle().
void RIGIDBODY_OT_object_add | ( | wmOperatorType * | ot | ) |
Definition at line 130 of file rigidbody_object.c.
References wmOperatorType::description, ED_operator_rigidbody_add_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RBO_TYPE_ACTIVE, rigidbody_object_add_exec(), RNA_def_enum(), rna_enum_rigidbody_object_type_items, and wmOperatorType::srna.
Referenced by operatortypes_particle().
void RIGIDBODY_OT_object_remove | ( | wmOperatorType * | ot | ) |
Definition at line 181 of file rigidbody_object.c.
References wmOperatorType::description, ED_operator_rigidbody_active_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and rigidbody_object_remove_exec().
Referenced by operatortypes_particle().
void RIGIDBODY_OT_objects_add | ( | wmOperatorType * | ot | ) |
Definition at line 225 of file rigidbody_object.c.
References wmOperatorType::description, ED_operator_rigidbody_add_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RBO_TYPE_ACTIVE, rigidbody_objects_add_exec(), RNA_def_enum(), rna_enum_rigidbody_object_type_items, and wmOperatorType::srna.
Referenced by operatortypes_particle().
void RIGIDBODY_OT_objects_remove | ( | wmOperatorType * | ot | ) |
Definition at line 276 of file rigidbody_object.c.
References wmOperatorType::description, ED_operator_rigidbody_active_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and rigidbody_objects_remove_exec().
Referenced by operatortypes_particle().
void RIGIDBODY_OT_shape_change | ( | wmOperatorType * | ot | ) |
Definition at line 328 of file rigidbody_object.c.
References wmOperatorType::description, ED_operator_rigidbody_active_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RB_SHAPE_TRIMESH, rigidbody_objects_shape_change_exec(), RNA_def_enum(), rna_enum_rigidbody_object_shape_items, wmOperatorType::srna, and WM_menu_invoke().
Referenced by operatortypes_particle().
|
static |
Definition at line 416 of file rigidbody_object.c.
Referenced by rigidbody_materials_itemf(), and rigidbody_objects_calc_mass_exec().
|
static |
Definition at line 366 of file rigidbody_object.c.
Referenced by rigidbody_materials_itemf(), and rigidbody_objects_calc_mass_exec().