Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_rigidbody.c
| Show First 20 Lines • Show All 724 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| #else | #else | ||||
| static void rna_def_rigidbody_world(BlenderRNA *brna) | static void rna_def_rigidbody_world(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | |||||
| srna = RNA_def_struct(brna, "RigidBodyWorld", NULL); | srna = RNA_def_struct(brna, "RigidBodyWorld", NULL); | ||||
| RNA_def_struct_sdna(srna, "RigidBodyWorld"); | RNA_def_struct_sdna(srna, "RigidBodyWorld"); | ||||
| RNA_def_struct_ui_text(srna, "Rigid Body World", "Self-contained rigid body simulation environment and settings"); | RNA_def_struct_ui_text(srna, "Rigid Body World", "Self-contained rigid body simulation environment and settings"); | ||||
| RNA_def_struct_path_func(srna, "rna_RigidBodyWorld_path"); | RNA_def_struct_path_func(srna, "rna_RigidBodyWorld_path"); | ||||
| /* groups */ | /* groups */ | ||||
| prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); | ||||
| ▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | static void rna_def_rigidbody_world(BlenderRNA *brna) | ||||
| RNA_def_property_struct_type(prop, "EffectorWeights"); | RNA_def_property_struct_type(prop, "EffectorWeights"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Effector Weights", ""); | RNA_def_property_ui_text(prop, "Effector Weights", ""); | ||||
| /* Sweep test */ | /* Sweep test */ | ||||
| func = RNA_def_function(srna, "convex_sweep_test", "rna_RigidBodyWorld_convex_sweep_test"); | func = RNA_def_function(srna, "convex_sweep_test", "rna_RigidBodyWorld_convex_sweep_test"); | ||||
| RNA_def_function_ui_description(func, "Sweep test convex rigidbody against the current rigidbody world"); | RNA_def_function_ui_description(func, "Sweep test convex rigidbody against the current rigidbody world"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "object", "Object", "", "Rigidbody object with a convex collision shape"); | |||||
| prop = RNA_def_pointer(func, "object", "Object", "", "Rigidbody object with a convex collision shape"); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_property_clear_flag(prop, PROP_THICK_WRAP); | |||||
| /* ray start and end */ | /* ray start and end */ | ||||
| prop = RNA_def_float_vector(func, "start", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); | parm = RNA_def_float_vector(func, "start", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_float_vector(func, "end", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); | parm = RNA_def_float_vector(func, "end", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_float_vector(func, "object_location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", | |||||
| prop = RNA_def_float_vector(func, "object_location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", | |||||
| "The hit location of this sweep test", -1e4, 1e4); | "The hit location of this sweep test", -1e4, 1e4); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, prop); | RNA_def_function_output(func, parm); | ||||
| parm = RNA_def_float_vector(func, "hitpoint", 3, NULL, -FLT_MAX, FLT_MAX, "Hitpoint", | |||||
| prop = RNA_def_float_vector(func, "hitpoint", 3, NULL, -FLT_MAX, FLT_MAX, "Hitpoint", | |||||
| "The hit location of this sweep test", -1e4, 1e4); | "The hit location of this sweep test", -1e4, 1e4); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, prop); | RNA_def_function_output(func, parm); | ||||
| parm = RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", | |||||
| prop = RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", | |||||
| "The face normal at the sweep test hit location", -1e4, 1e4); | "The face normal at the sweep test hit location", -1e4, 1e4); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, prop); | RNA_def_function_output(func, parm); | ||||
| parm = RNA_def_int(func, "has_hit", 0, 0, 0, "", "If the function has found collision point, value is 1, otherwise 0", 0, 0); | |||||
| prop = RNA_def_int(func, "has_hit", 0, 0, 0, "", "If the function has found collision point, value is 1, otherwise 0", 0, 0); | RNA_def_function_output(func, parm); | ||||
| RNA_def_function_output(func, prop); | |||||
| } | } | ||||
| static void rna_def_rigidbody_object(BlenderRNA *brna) | static void rna_def_rigidbody_object(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 541 Lines • Show Last 20 Lines | |||||