diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-04-16 15:07:42 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-04-17 18:51:28 +0300 |
commit | 159806140fd33e6ddab951c0f6f180cfbf927d38 (patch) | |
tree | da076be3baa4d987fb5935e220a3d901c926e0e7 /source/blender/makesrna | |
parent | 28b996a9d2090efdd74115a653629ef9d7d871f7 (diff) |
Removing Blender Game Engine from Blender 2.8
Folders removed entirely:
* //extern/recastnavigation
* //intern/decklink
* //intern/moto
* //source/blender/editors/space_logic
* //source/blenderplayer
* //source/gameengine
This includes DNA data and any reference to the BGE code in Blender itself.
We are bumping the subversion.
Pending tasks:
* Tile/clamp code in image editor draw code.
* Viewport drawing code (so much of this will go away because of BI removal
that we can wait until then to remove this.
Diffstat (limited to 'source/blender/makesrna')
22 files changed, 2 insertions, 5758 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 562855c01cc..d991e28a648 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -277,14 +277,6 @@ extern StructRNA RNA_GPencilStroke; extern StructRNA RNA_GPencilStrokePoint; extern StructRNA RNA_GPencilSculptSettings; extern StructRNA RNA_GPencilSculptBrush; -extern StructRNA RNA_GameBooleanProperty; -extern StructRNA RNA_GameFloatProperty; -extern StructRNA RNA_GameIntProperty; -extern StructRNA RNA_GameObjectSettings; -extern StructRNA RNA_GameProperty; -extern StructRNA RNA_GameSoftBodySettings; -extern StructRNA RNA_GameStringProperty; -extern StructRNA RNA_GameTimerProperty; extern StructRNA RNA_GaussianBlurSequence; extern StructRNA RNA_GlowSequence; extern StructRNA RNA_GreasePencil; @@ -521,7 +513,6 @@ extern StructRNA RNA_RigidBodyObject; extern StructRNA RNA_RigidBodyJointConstraint; extern StructRNA RNA_SPHFluidSettings; extern StructRNA RNA_Scene; -extern StructRNA RNA_SceneGameData; extern StructRNA RNA_SceneRenderLayer; extern StructRNA RNA_SceneSequence; extern StructRNA RNA_SceneObjects; @@ -591,7 +582,6 @@ extern StructRNA RNA_SpaceFileBrowser; extern StructRNA RNA_SpaceGraphEditor; extern StructRNA RNA_SpaceImageEditor; extern StructRNA RNA_SpaceInfo; -extern StructRNA RNA_SpaceLogicEditor; extern StructRNA RNA_SpaceNLA; extern StructRNA RNA_SpaceNodeEditor; extern StructRNA RNA_SpaceOutliner; diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 345c47ae1bf..0c0a22cc467 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -165,8 +165,6 @@ extern const EnumPropertyItem rna_enum_property_type_items[]; extern const EnumPropertyItem rna_enum_property_subtype_items[]; extern const EnumPropertyItem rna_enum_property_unit_items[]; -extern const EnumPropertyItem rna_enum_gameproperty_type_items[]; - extern const EnumPropertyItem rna_enum_viewport_shade_items[]; extern const EnumPropertyItem rna_enum_navigation_mode_items[]; diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 74c36c456b0..5e815e16a82 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -32,7 +32,6 @@ endif() set(DEFSRC rna_ID.c rna_action.c - rna_actuator.c rna_animation.c rna_animviz.c rna_armature.c @@ -44,7 +43,6 @@ set(DEFSRC rna_color.c rna_constraint.c rna_context.c - rna_controller.c rna_curve.c rna_depsgraph.c rna_dynamicpaint.c @@ -74,14 +72,12 @@ set(DEFSRC rna_particle.c rna_pose.c rna_lightprobe.c - rna_property.c rna_render.c rna_rigidbody.c rna_rna.c rna_scene.c rna_screen.c rna_sculpt_paint.c - rna_sensor.c rna_sequencer.c rna_smoke.c rna_sound.c @@ -103,11 +99,9 @@ set(DEFSRC set(APISRC rna_action_api.c - rna_actuator_api.c rna_animation_api.c rna_armature_api.c rna_camera_api.c - rna_controller_api.c rna_curve_api.c rna_fcurve_api.c rna_image_api.c @@ -120,7 +114,6 @@ set(APISRC rna_object_api.c rna_pose_api.c rna_scene_api.c - rna_sensor_api.c rna_sequencer_api.c rna_sound_api.c rna_space_api.c @@ -193,10 +186,6 @@ if(WITH_PYTHON) ) endif() -if(WITH_GAMEENGINE) - add_definitions(-DWITH_GAMEENGINE) -endif() - if(WITH_CLAY_ENGINE) add_definitions(-DWITH_CLAY_ENGINE) endif() diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 9745ca39872..40028eec4c8 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3350,7 +3350,6 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_action.c", "rna_action_api.c", RNA_def_action}, {"rna_animation.c", "rna_animation_api.c", RNA_def_animation}, {"rna_animviz.c", NULL, RNA_def_animviz}, - {"rna_actuator.c", "rna_actuator_api.c", RNA_def_actuator}, {"rna_armature.c", "rna_armature_api.c", RNA_def_armature}, {"rna_boid.c", NULL, RNA_def_boid}, {"rna_brush.c", NULL, RNA_def_brush}, @@ -3360,7 +3359,6 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_color.c", NULL, RNA_def_color}, {"rna_constraint.c", NULL, RNA_def_constraint}, {"rna_context.c", NULL, RNA_def_context}, - {"rna_controller.c", "rna_controller_api.c", RNA_def_controller}, {"rna_curve.c", "rna_curve_api.c", RNA_def_curve}, {"rna_dynamicpaint.c", NULL, RNA_def_dynamic_paint}, {"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve}, @@ -3388,13 +3386,11 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_particle.c", NULL, RNA_def_particle}, {"rna_pose.c", "rna_pose_api.c", RNA_def_pose}, {"rna_lightprobe.c", NULL, RNA_def_lightprobe}, - {"rna_property.c", NULL, RNA_def_gameproperty}, {"rna_render.c", NULL, RNA_def_render}, {"rna_rigidbody.c", NULL, RNA_def_rigidbody}, {"rna_scene.c", "rna_scene_api.c", RNA_def_scene}, {"rna_screen.c", NULL, RNA_def_screen}, {"rna_sculpt_paint.c", NULL, RNA_def_sculpt_paint}, - {"rna_sensor.c", "rna_sensor_api.c", RNA_def_sensor}, {"rna_sequencer.c", "rna_sequencer_api.c", RNA_def_sequencer}, {"rna_smoke.c", NULL, RNA_def_smoke}, {"rna_space.c", "rna_space_api.c", RNA_def_space}, diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c deleted file mode 100644 index 26ec813a14f..00000000000 --- a/source/blender/makesrna/intern/rna_actuator.c +++ /dev/null @@ -1,2220 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributor(s): Blender Foundation (2008). - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/makesrna/intern/rna_actuator.c - * \ingroup RNA - */ - - -#include <stdlib.h> - -#include "DNA_constraint_types.h" -#include "DNA_object_types.h" -#include "DNA_actuator_types.h" -#include "DNA_scene_types.h" /* for MAXFRAME */ - -#include "BLI_math.h" -#include "BLI_string_utils.h" -#include "BLI_utildefines.h" - -#include "BLT_translation.h" - -#include "RNA_define.h" -#include "RNA_access.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - -#include "WM_types.h" - -/* Always keep in alphabetical order */ -static const EnumPropertyItem actuator_type_items[] = { - {ACT_ACTION, "ACTION", 0, "Action", ""}, - {ACT_ARMATURE, "ARMATURE", 0, "Armature", ""}, - {ACT_CAMERA, "CAMERA", 0, "Camera", ""}, - {ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""}, - {ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""}, - {ACT_2DFILTER, "FILTER_2D", 0, "Filter 2D", ""}, - {ACT_GAME, "GAME", 0, "Game", ""}, - {ACT_MESSAGE, "MESSAGE", 0, "Message", ""}, - {ACT_OBJECT, "MOTION", 0, "Motion", ""}, - {ACT_MOUSE, "MOUSE", 0, "Mouse", ""}, - {ACT_PARENT, "PARENT", 0, "Parent", ""}, - {ACT_PROPERTY, "PROPERTY", 0, "Property", ""}, - {ACT_RANDOM, "RANDOM", 0, "Random", ""}, - {ACT_SCENE, "SCENE", 0, "Scene", ""}, - {ACT_SOUND, "SOUND", 0, "Sound", ""}, - {ACT_STATE, "STATE", 0, "State", ""}, - {ACT_STEERING, "STEERING", 0, "Steering", ""}, - {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""}, - {0, NULL, 0, NULL, NULL} -}; - -#ifdef RNA_RUNTIME - -#include "BKE_sca.h" - -static StructRNA *rna_Actuator_refine(struct PointerRNA *ptr) -{ - bActuator *actuator = (bActuator *)ptr->data; - - switch (actuator->type) { - case ACT_ACTION: - return &RNA_ActionActuator; - case ACT_OBJECT: - return &RNA_ObjectActuator; - case ACT_CAMERA: - return &RNA_CameraActuator; - case ACT_SOUND: - return &RNA_SoundActuator; - case ACT_PROPERTY: - return &RNA_PropertyActuator; - case ACT_CONSTRAINT: - return &RNA_ConstraintActuator; - case ACT_EDIT_OBJECT: - return &RNA_EditObjectActuator; - case ACT_SCENE: - return &RNA_SceneActuator; - case ACT_RANDOM: - return &RNA_RandomActuator; - case ACT_MESSAGE: - return &RNA_MessageActuator; - case ACT_GAME: - return &RNA_GameActuator; - case ACT_VISIBILITY: - return &RNA_VisibilityActuator; - case ACT_2DFILTER: - return &RNA_Filter2DActuator; - case ACT_PARENT: - return &RNA_ParentActuator; - case ACT_STATE: - return &RNA_StateActuator; - case ACT_ARMATURE: - return &RNA_ArmatureActuator; - case ACT_STEERING: - return &RNA_SteeringActuator; - case ACT_MOUSE: - return &RNA_MouseActuator; - default: - return &RNA_Actuator; - } -} - -static void rna_Actuator_name_set(PointerRNA *ptr, const char *value) -{ - Object *ob = ptr->id.data; - bActuator *act = ptr->data; - BLI_strncpy_utf8(act->name, value, sizeof(act->name)); - BLI_uniquename(&ob->actuators, act, DATA_("Actuator"), '.', offsetof(bActuator, name), sizeof(act->name)); -} - -static void rna_Actuator_type_set(struct PointerRNA *ptr, int value) -{ - bActuator *act = (bActuator *)ptr->data; - - if (value != act->type) { - act->type = value; - init_actuator(act); - } -} - -static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - - if (value != ca->type) { - ca->type = value; - switch (ca->type) { - case ACT_CONST_TYPE_ORI: - /* negative axis not supported in the orientation mode */ - if (ELEM(ca->mode, ACT_CONST_DIRNX, ACT_CONST_DIRNY, ACT_CONST_DIRNZ)) - ca->mode = ACT_CONST_NONE; - break; - - case ACT_CONST_TYPE_LOC: - case ACT_CONST_TYPE_DIST: - case ACT_CONST_TYPE_FH: - default: - break; - } - } -} - -static float rna_ConstraintActuator_limitmin_get(struct PointerRNA *ptr) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->flag & ACT_CONST_LOCX) fp = ca->minloc; - else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc + 1; - else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc + 2; - else if (ca->flag & ACT_CONST_ROTX) fp = ca->minrot; - else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot + 1; - else fp = ca->minrot + 2; - - return *fp; -} - -static void rna_ConstraintActuator_limitmin_set(struct PointerRNA *ptr, float value) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->flag & ACT_CONST_LOCX) fp = ca->minloc; - else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc + 1; - else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc + 2; - else if (ca->flag & ACT_CONST_ROTX) fp = ca->minrot; - else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot + 1; - else fp = ca->minrot + 2; - - *fp = value; -} - -static float rna_ConstraintActuator_limitmax_get(struct PointerRNA *ptr) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->flag & ACT_CONST_LOCX) fp = ca->maxloc; - else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc + 1; - else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc + 2; - else if (ca->flag & ACT_CONST_ROTX) fp = ca->maxrot; - else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot + 1; - else fp = ca->maxrot + 2; - - return *fp; -} - -static void rna_ConstraintActuator_limitmax_set(struct PointerRNA *ptr, float value) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->flag & ACT_CONST_LOCX) fp = ca->maxloc; - else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc + 1; - else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc + 2; - else if (ca->flag & ACT_CONST_ROTX) fp = ca->maxrot; - else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot + 1; - else fp = ca->maxrot + 2; - - *fp = value; -} - -static float rna_ConstraintActuator_distance_get(struct PointerRNA *ptr) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc; - else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1; - else fp = ca->minloc + 2; - - return *fp; -} - -static void rna_ConstraintActuator_distance_set(struct PointerRNA *ptr, float value) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc; - else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1; - else fp = ca->minloc + 2; - - *fp = value; -} - -static float rna_ConstraintActuator_range_get(struct PointerRNA *ptr) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc; - else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1; - else fp = ca->maxloc + 2; - - return *fp; -} - -static void rna_ConstraintActuator_range_set(struct PointerRNA *ptr, float value) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc; - else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1; - else fp = ca->maxloc + 2; - - *fp = value; -} - -static float rna_ConstraintActuator_fhheight_get(struct PointerRNA *ptr) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc; - else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1; - else fp = ca->minloc + 2; - - return *fp; -} - -static void rna_ConstraintActuator_fhheight_set(struct PointerRNA *ptr, float value) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc; - else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1; - else fp = ca->minloc + 2; - - *fp = value; -} - -static float rna_ConstraintActuator_spring_get(struct PointerRNA *ptr) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc; - else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1; - else fp = ca->maxloc + 2; - - return *fp; -} - -static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float value) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - float *fp; - - if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc; - else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1; - else fp = ca->maxloc + 2; - - *fp = value; -} -/* ConstraintActuator uses the same property for Material and Property. - * Therefore we need to clear the property when "use_material_detect" mode changes */ -static void rna_Actuator_constraint_detect_material_set(struct PointerRNA *ptr, int value) -{ - bActuator *act = (bActuator *)ptr->data; - bConstraintActuator *ca = act->data; - - short old_value = (ca->flag & ACT_CONST_MATERIAL) ? 1 : 0; - - if (old_value != value) { - ca->flag ^= ACT_CONST_MATERIAL; - ca->matprop[0] = '\0'; - } -} - -static void rna_ActionActuator_add_set(struct PointerRNA *ptr, int value) -{ - bActuator *act = (bActuator *)ptr->data; - bActionActuator *aa = act->data; - - if (value == 1) { - aa->flag &= ~ACT_IPOFORCE; - aa->flag |= ACT_IPOADD; - } - else { - aa->flag &= ~ACT_IPOADD; - } -} - -static void rna_ActionActuator_force_set(struct PointerRNA *ptr, int value) -{ - bActuator *act = (bActuator *)ptr->data; - bActionActuator *aa = act->data; - - if (value == 1) { - aa->flag &= ~ACT_IPOADD; - aa->flag |= ACT_IPOFORCE; - } - else { - aa->flag &= ~ACT_IPOFORCE; - } -} - -static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value) -{ - bActuator *act = (bActuator *)ptr->data; - bObjectActuator *oa = act->data; - if (value != oa->type) { - oa->type = value; - switch (oa->type) { - case ACT_OBJECT_NORMAL: - memset(oa, 0, sizeof(bObjectActuator)); - oa->flag = ACT_FORCE_LOCAL | ACT_TORQUE_LOCAL | ACT_DLOC_LOCAL | ACT_DROT_LOCAL; - oa->type = ACT_OBJECT_NORMAL; - break; - - case ACT_OBJECT_SERVO: - memset(oa, 0, sizeof(bObjectActuator)); - oa->flag = ACT_LIN_VEL_LOCAL; - oa->type = ACT_OBJECT_SERVO; - oa->forcerot[0] = 30.0f; - oa->forcerot[1] = 0.5f; - oa->forcerot[2] = 0.0f; - break; - - case ACT_OBJECT_CHARACTER: - memset(oa, 0, sizeof(bObjectActuator)); - oa->flag = ACT_DLOC_LOCAL | ACT_DROT_LOCAL; - oa->type = ACT_OBJECT_CHARACTER; - break; - } - } -} - -static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, float value) -{ - bActuator *act = (bActuator *)ptr->data; - bObjectActuator *oa = act->data; - - oa->forcerot[1] = value; - oa->forcerot[0] = 60.0f * oa->forcerot[1]; -} - -static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values) -{ - bActuator *act = (bActuator *)ptr->data; - bStateActuator *sa = act->data; - - int i, tot = 0; - - /* ensure we always have some state selected */ - for (i = 0; i < OB_MAX_STATES; i++) - if (values[i]) - tot++; - - if (tot == 0) - return; - - for (i = 0; i < OB_MAX_STATES; i++) { - if (values[i]) sa->mask |= (1 << i); - else sa->mask &= ~(1 << i); - } -} - -/* Always keep in alphabetical order */ -const EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) -{ - EnumPropertyItem *item = NULL; - Object *ob = NULL; - int totitem = 0; - - if (ptr->type == &RNA_Actuator || RNA_struct_is_a(ptr->type, &RNA_Actuator)) { - ob = (Object *)ptr->id.data; - } - else { - /* can't use ob from ptr->id.data because that enum is also used by operators */ - ob = CTX_data_active_object(C); - } - - if (ob != NULL) { - if (ob->type == OB_ARMATURE) { - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE); - } - } - - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_EDIT_OBJECT); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_2DFILTER); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_GAME); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_MESSAGE); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_MOUSE); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_OBJECT); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PARENT); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PROPERTY); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_RANDOM); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SCENE); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STEERING); - - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SOUND); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STATE); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY); - - RNA_enum_item_end(&item, &totitem); - *r_free = true; - - return item; -} - -static void rna_Actuator_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) -{ - bActuator *act = (bActuator *)ptr->data; - bArmatureActuator *aa = act->data; - Object *ob = (Object *)ptr->id.data; - - char *posechannel = aa->posechannel; - char *constraint = aa->constraint; - - /* check that bone exist in the active object */ - if (ob->type == OB_ARMATURE && ob->pose) { - bPoseChannel *pchan; - bPose *pose = ob->pose; - for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { - if (STREQ(pchan->name, posechannel)) { - /* found it, now look for constraint channel */ - bConstraint *con; - for (con = pchan->constraints.first; con; con = con->next) { - if (STREQ(con->name, constraint)) { - /* found it, all ok */ - return; - } - } - /* didn't find constraint, make empty */ - constraint[0] = 0; - return; - } - } - } - /* didn't find any */ - posechannel[0] = 0; - constraint[0] = 0; -} - -static void rna_SteeringActuator_navmesh_set(PointerRNA *ptr, PointerRNA value) -{ - bActuator *act = (bActuator *)ptr->data; - bSteeringActuator *sa = (bSteeringActuator *) act->data; - - Object *obj = value.data; - if (obj && obj->body_type == OB_BODY_TYPE_NAVMESH) - sa->navmesh = obj; - else - sa->navmesh = NULL; -} - -/* note: the following set functions exists only to avoid id refcounting */ -static void rna_Actuator_editobject_mesh_set(PointerRNA *ptr, PointerRNA value) -{ - bActuator *act = (bActuator *)ptr->data; - bEditObjectActuator *eoa = (bEditObjectActuator *) act->data; - - eoa->me = value.data; -} - -#else - -static void rna_def_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "Actuator", NULL); - RNA_def_struct_ui_text(srna, "Actuator", "Actuator to apply actions in the game engine"); - RNA_def_struct_sdna(srna, "bActuator"); - RNA_def_struct_refine_func(srna, "rna_Actuator_refine"); - - prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Name", ""); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Actuator_name_set"); - RNA_def_struct_name_property(srna, prop); - - prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_enum_items(prop, actuator_type_items); - RNA_def_property_enum_funcs(prop, NULL, "rna_Actuator_type_set", "rna_Actuator_type_itemf"); - RNA_def_property_ui_text(prop, "Type", ""); - - prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PIN); - RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller"); - RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SHOW); - RNA_def_property_ui_text(prop, "Expanded", "Set actuator expanded in the user interface"); - RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); - - prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_DEACTIVATE); - RNA_def_property_ui_text(prop, "Active", "Set the active state of the actuator"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - RNA_api_actuator(srna); -} - -static void rna_def_action_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_ACTION_PLAY, "PLAY", 0, "Play", ""}, - {ACT_ACTION_PINGPONG, "PINGPONG", 0, "Ping Pong", ""}, - {ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""}, - {ACT_ACTION_LOOP_STOP, "LOOPSTOP", 0, "Loop Stop", ""}, - {ACT_ACTION_LOOP_END, "LOOPEND", 0, "Loop End", ""}, - {ACT_ACTION_FROM_PROP, "PROPERTY", 0, "Property", ""}, -#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR - {ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""}, -#endif - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_blend_items[] = { - {ACT_ACTION_BLEND, "BLEND", 0, "Blend", ""}, - {ACT_ACTION_ADD, "ADD", 0, "Add", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "ActionActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Action Actuator", "Actuator to control the object movement"); - RNA_def_struct_sdna_from(srna, "bActionActuator", "data"); - - prop = RNA_def_property(srna, "play_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Action Type", "Action playback type"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "act"); - RNA_def_property_struct_type(prop, "Action"); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); - RNA_def_property_ui_text(prop, "Action", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "end_reset", 1); - RNA_def_property_ui_text(prop, "Continue", - "Restore last frame when switching on/off, otherwise play from the start each time"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sta"); - RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2); - RNA_def_property_ui_text(prop, "Start Frame", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "end"); - RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2); - RNA_def_property_ui_text(prop, "End Frame", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "blendin"); - RNA_def_property_range(prop, 0, 32767); - RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "priority", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "Priority", - "Execution priority - lower numbers will override actions with higher numbers " - "(with 2 or more actions at once, the overriding channels must be lower in the stack)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, 32766); /* This should match BL_ActionManager::MAX_ACTION_LAYERS - 1 */ - RNA_def_property_ui_text(prop, "Layer", "The animation layer to play the action on"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "layer_weight", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Layer Weight", - "How much of the previous layer to blend into this one"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "frameProp"); - RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* booleans */ - prop = RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOADD); - RNA_def_property_boolean_funcs(prop, NULL, "rna_ActionActuator_add_set"); - RNA_def_property_ui_text(prop, "Add", - "Action is added to the current loc/rot/scale in global or local coordinate according to " - "Local flag"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_force", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOFORCE); - RNA_def_property_boolean_funcs(prop, NULL, "rna_ActionActuator_force_set"); - RNA_def_property_ui_text(prop, "Force", - "Apply Action as a global or local force depending on the local option " - "(dynamic objects only)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOLOCAL); - RNA_def_property_ui_text(prop, "L", "Let the Action act in local coordinates, used in Force and Add mode"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOCHILD); - RNA_def_property_ui_text(prop, "Child", "Update Action on all children Objects as well"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "blend_mode"); - RNA_def_property_enum_items(prop, prop_blend_items); - RNA_def_property_ui_text(prop, "Blend Mode", "How this layer is blended with previous layers"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - -#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR - prop = RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "stridelength"); - RNA_def_property_range(prop, 0.0, 2500.0); - RNA_def_property_ui_text(prop, "Cycle", "Distance covered by a single cycle of the action"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -#endif -} - -static void rna_def_object_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""}, - {ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""}, - {ACT_OBJECT_CHARACTER, "OBJECT_CHARACTER", 0, "Character Motion", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "ObjectActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Motion Actuator", "Actuator to control the object movement"); - RNA_def_struct_sdna_from(srna, "bObjectActuator", "data"); - - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_enum_funcs(prop, NULL, "rna_ObjectActuator_type_set", NULL); - RNA_def_property_ui_text(prop, "Motion Type", "Specify the motion system"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_sdna(prop, NULL, "reference"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Reference Object", - "Reference object for velocity calculation, leave empty for world reference"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "damping", PROP_INT, PROP_NONE); - RNA_def_property_ui_range(prop, 0, 1000, 1, 1); - RNA_def_property_ui_text(prop, "Damping Frames", "Number of frames to reach the target velocity"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "proportional_coefficient", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "forcerot[0]"); - RNA_def_property_ui_range(prop, 0.0, 200.0, 10, 2); - RNA_def_property_ui_text(prop, "Proportional Coefficient", "Typical value is 60x integral coefficient"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "integral_coefficient", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "forcerot[1]"); - RNA_def_property_ui_range(prop, 0.0, 3.0, 10, 2); - RNA_def_property_float_funcs(prop, NULL, "rna_ObjectActuator_integralcoefficient_set", NULL); - RNA_def_property_ui_text(prop, "Integral Coefficient", - "Low value (0.01) for slow response, high value (0.5) for fast response"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "derivate_coefficient", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "forcerot[2]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2); - RNA_def_property_ui_text(prop, "Derivate Coefficient", "Not required, high values can cause instability"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Servo Limit */ - prop = RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "dloc[0]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Max", "Upper limit for X force"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "drot[0]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Min", "Lower limit for X force"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "dloc[1]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Max", "Upper limit for Y force"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "drot[1]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Min", "Lower limit for Y force"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "dloc[2]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Max", "Upper limit for Z force"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "drot[2]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Min", "Lower limit for Z force"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* floats 3 Arrays*/ - prop = RNA_def_property(srna, "offset_location", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "dloc"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Loc", "Location"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "offset_rotation", PROP_FLOAT, PROP_EULER); - RNA_def_property_float_sdna(prop, NULL, "drot"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Rot", "Rotation"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "force", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "forceloc"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Force", "Force"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "torque", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "forcerot"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Torque", "Torque"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "linearvelocity"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Linear Velocity", - "Linear velocity (in Servo mode it sets the target relative linear velocity, it will be " - "achieved by automatic application of force - Null velocity is a valid target)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "angularvelocity"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* booleans */ - prop = RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DLOC_LOCAL); - RNA_def_property_ui_text(prop, "L", "Location is defined in local coordinates"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_local_rotation", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DROT_LOCAL); - RNA_def_property_ui_text(prop, "L", "Rotation is defined in local coordinates"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_local_force", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_FORCE_LOCAL); - RNA_def_property_ui_text(prop, "L", "Force is defined in local coordinates"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_local_torque", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TORQUE_LOCAL); - RNA_def_property_ui_text(prop, "L", "Torque is defined in local coordinates"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_LIN_VEL_LOCAL); - RNA_def_property_ui_text(prop, "L", "Velocity is defined in local coordinates"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ANG_VEL_LOCAL); - RNA_def_property_ui_text(prop, "L", "Angular velocity is defined in local coordinates"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_add_linear_velocity", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ADD_LIN_VEL); - RNA_def_property_ui_text(prop, "Add", "Toggles between ADD and SET linV"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_add_character_location", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ADD_CHAR_LOC); - RNA_def_property_ui_text(prop, "Add", "Toggle between ADD and SET character location"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_servo_limit_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_X); - RNA_def_property_ui_text(prop, "X", "Set limit to force along the X axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_servo_limit_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Y); - RNA_def_property_ui_text(prop, "Y", "Set limit to force along the Y axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_servo_limit_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Z); - RNA_def_property_ui_text(prop, "Z", "Set limit to force along the Z axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_character_jump", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CHAR_JUMP); - RNA_def_property_ui_text(prop, "Jump", "Make the character jump using the settings in the physics properties"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_camera_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_axis_items[] = { - {OB_POSX, "POS_X", 0, "+X", "Camera tries to get behind the X axis"}, - {OB_POSY, "POS_Y", 0, "+Y", "Camera tries to get behind the Y axis"}, - {OB_NEGX, "NEG_X", 0, "-X", "Camera tries to get behind the -X axis"}, - {OB_NEGY, "NEG_Y", 0, "-Y", "Camera tries to get behind the -Y axis"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "CameraActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Camera Actuator", ""); - RNA_def_struct_sdna_from(srna, "bCameraActuator", "data"); - - prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_sdna(prop, NULL, "ob"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Camera Object", "Look at this Object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* floats */ - prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); - RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2); - RNA_def_property_ui_text(prop, "Height", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE); - RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2); - RNA_def_property_ui_text(prop, "Min", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE); - RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2); - RNA_def_property_ui_text(prop, "Max", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "damping"); - RNA_def_property_range(prop, 0, 10.0); - RNA_def_property_ui_range(prop, 0, 5.0, 1, 2); - RNA_def_property_ui_text(prop, "Damping", "Strength of the constraint that drives the camera behind the target"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* +x/+y/-x/-y */ - prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "axis"); - RNA_def_property_enum_items(prop, prop_axis_items); - RNA_def_property_ui_text(prop, "Axis", "Axis the Camera will try to get behind"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_sound_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_SND_PLAY_STOP_SOUND, "PLAYSTOP", 0, "Play Stop", ""}, - {ACT_SND_PLAY_END_SOUND, "PLAYEND", 0, "Play End", ""}, - {ACT_SND_LOOP_STOP_SOUND, "LOOPSTOP", 0, "Loop Stop", ""}, - {ACT_SND_LOOP_END_SOUND, "LOOPEND", 0, "Loop End", ""}, - {ACT_SND_LOOP_BIDIRECTIONAL_SOUND, "LOOPBIDIRECTIONAL", 0, "Loop Bidirectional", ""}, - {ACT_SND_LOOP_BIDIRECTIONAL_STOP_SOUND, "LOOPBIDIRECTIONALSTOP", 0, "Loop Bidirectional Stop", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "SoundActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Sound Actuator", "Actuator to handle sound"); - RNA_def_struct_sdna_from(srna, "bSoundActuator", "data"); - - prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Sound"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_struct_ui_text(srna, "Sound", "Sound file"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Play Mode", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); - RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); - RNA_def_property_range(prop, 0.0, 2.0); - RNA_def_property_ui_text(prop, "Volume", "Initial volume of the sound"); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); - RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2); - RNA_def_property_ui_text(prop, "Pitch", "Pitch of the sound"); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* floats - 3D Parameters */ - prop = RNA_def_property(srna, "gain_3d_min", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sound3D.min_gain"); - RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); - RNA_def_property_ui_text(prop, "Minimum Gain", "The minimum gain of the sound, no matter how far it is away"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "gain_3d_max", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sound3D.max_gain"); - RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); - RNA_def_property_ui_text(prop, "Maximum Gain", "The maximum gain of the sound, no matter how near it is"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "distance_3d_reference", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sound3D.reference_distance"); - RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2); - RNA_def_property_ui_text(prop, "Reference Distance", "The distance where the sound has a gain of 1.0"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "distance_3d_max", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sound3D.max_distance"); - RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2); - RNA_def_property_ui_text(prop, "Maximum Distance", "The maximum distance at which you can hear the sound"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "rolloff_factor_3d", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sound3D.rolloff_factor"); - RNA_def_property_ui_range(prop, 0.0, 5.0, 1, 2); - RNA_def_property_ui_text(prop, "Rolloff", "The influence factor on volume depending on distance"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "cone_outer_gain_3d", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_gain"); - RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); - RNA_def_property_ui_text(prop, "Cone Outer Gain", - "The gain outside the outer cone (the gain in the outer cone will be interpolated " - "between this value and the normal gain in the inner cone)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "cone_outer_angle_3d", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_angle"); - RNA_def_property_ui_range(prop, 0.0, DEG2RADF(360.0f), 1, 2); - RNA_def_property_ui_text(prop, "Cone Outer Angle", "The angle of the outer cone"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "cone_inner_angle_3d", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_inner_angle"); - RNA_def_property_ui_range(prop, 0.0, DEG2RADF(360.0f), 1, 2); - RNA_def_property_ui_text(prop, "Cone Inner Angle", "The angle of the inner cone"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* booleans */ - prop = RNA_def_property(srna, "use_sound_3d", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SND_3D_SOUND); - RNA_def_property_ui_text(prop, "3D Sound", "Enable/Disable 3D Sound"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_property_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_PROP_ASSIGN, "ASSIGN", 0, "Assign", ""}, - {ACT_PROP_ADD, "ADD", 0, "Add", ""}, - {ACT_PROP_COPY, "COPY", 0, "Copy", ""}, - {ACT_PROP_TOGGLE, "TOGGLE", 0, "Toggle", "For bool/int/float/timer properties only"}, - {ACT_PROP_LEVEL, "LEVEL", 0, "Level", "For bool/int/float/timer properties only"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "PropertyActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Property Actuator", "Actuator to handle properties"); - RNA_def_struct_sdna_from(srna, "bPropertyActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "The name of the property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Value", "The name of the property or the value to use (use \"\" around strings)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Copy Mode */ - prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_sdna(prop, NULL, "ob"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Object", "Copy from this Object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /*XXX add even magic'er property lookup (need to look for the property list of the target object) */ - prop = RNA_def_property(srna, "object_property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "value"); - RNA_def_property_ui_text(prop, "Property Name", "Copy this property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_constraint_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_CONST_TYPE_LOC, "LOC", 0, "Location Constraint", ""}, - {ACT_CONST_TYPE_DIST, "DIST", 0, "Distance Constraint", ""}, - {ACT_CONST_TYPE_ORI, "ORI", 0, "Orientation Constraint", ""}, - {ACT_CONST_TYPE_FH, "FH", 0, "Force Field Constraint", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_limit_items[] = { - {ACT_CONST_NONE, "NONE", 0, "None", ""}, - {ACT_CONST_LOCX, "LOCX", 0, "Loc X", ""}, - {ACT_CONST_LOCY, "LOCY", 0, "Loc Y", ""}, - {ACT_CONST_LOCZ, "LOCZ", 0, "Loc Z", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_direction_items[] = { - {ACT_CONST_NONE, "NONE", 0, "None", ""}, - {ACT_CONST_DIRPX, "DIRPX", 0, "X axis", ""}, - {ACT_CONST_DIRPY, "DIRPY", 0, "Y axis", ""}, - {ACT_CONST_DIRPZ, "DIRPZ", 0, "Z axis", ""}, - {ACT_CONST_DIRNX, "DIRNX", 0, "-X axis", ""}, - {ACT_CONST_DIRNY, "DIRNY", 0, "-Y axis", ""}, - {ACT_CONST_DIRNZ, "DIRNZ", 0, "-Z axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_direction_pos_items[] = { - {ACT_CONST_NONE, "NONE", 0, "None", ""}, - {ACT_CONST_DIRPX, "DIRPX", 0, "X axis", ""}, - {ACT_CONST_DIRPY, "DIRPY", 0, "Y axis", ""}, - {ACT_CONST_DIRPZ, "DIRPZ", 0, "Z axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "ConstraintActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Constraint Actuator", "Actuator to handle Constraints"); - RNA_def_struct_sdna_from(srna, "bConstraintActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_enum_funcs(prop, NULL, "rna_ConstraintActuator_type_set", NULL); - RNA_def_property_ui_text(prop, "Constraints Mode", "The type of the constraint"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "limit", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "flag"); - RNA_def_property_enum_items(prop, prop_limit_items); - RNA_def_property_ui_text(prop, "Limit", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "mode"); - RNA_def_property_enum_items(prop, prop_direction_items); - RNA_def_property_ui_text(prop, "Direction", "Direction of the ray"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "direction_axis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "mode"); - RNA_def_property_enum_items(prop, prop_direction_items); - RNA_def_property_ui_text(prop, "Direction", "Select the axis to be aligned along the reference direction"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_CONST_TYPE_LOC */ - prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmin_get", - "rna_ConstraintActuator_limitmin_set", NULL); - RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2); - RNA_def_property_ui_text(prop, "Min", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmax_get", - "rna_ConstraintActuator_limitmax_set", NULL); - RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2); - RNA_def_property_ui_text(prop, "Max", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "damping", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "damp"); - RNA_def_property_ui_range(prop, 0, 100, 1, 1); - RNA_def_property_ui_text(prop, "Damping", "Damping factor: time constant (in frame) of low pass filter"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_CONST_TYPE_DIST */ - prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_range_get", "rna_ConstraintActuator_range_set", NULL); - RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2); - RNA_def_property_ui_text(prop, "Range", "Maximum length of ray"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_distance_get", - "rna_ConstraintActuator_distance_set", NULL); - RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2); - RNA_def_property_ui_text(prop, "Distance", "Keep this distance to target"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /*XXX to use a pointer or add a material lookup */ - prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "matprop"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Material", "Ray detects only Objects with this material"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /*XXX add magic property lookup */ - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "matprop"); - RNA_def_property_ui_text(prop, "Property", "Ray detects only Objects with this property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "time", PROP_INT, PROP_NONE); - RNA_def_property_ui_range(prop, 0, 1000, 1, 2); - RNA_def_property_ui_text(prop, "Time", "Maximum activation time in frame, 0 for unlimited"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "damping_rotation", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "rotdamp"); - RNA_def_property_ui_range(prop, 0, 100, 1, 1); - RNA_def_property_ui_text(prop, "RotDamp", "Use a different damping for orientation"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_CONST_TYPE_ORI */ - prop = RNA_def_property(srna, "direction_axis_pos", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "mode"); - RNA_def_property_enum_items(prop, prop_direction_pos_items); - RNA_def_property_ui_text(prop, "Direction", "Select the axis to be aligned along the reference direction"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "rotation_max", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "maxrot"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -2000.0, 2000.0, 10, 2); - RNA_def_property_ui_text(prop, "Reference Direction", "Reference Direction"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "minloc[0]"); - RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f)); - RNA_def_property_ui_text(prop, "Min Angle", - "Minimum angle to maintain with target direction " - "(no correction is done if angle with target direction is between min and max)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "maxloc[0]"); - RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f)); - RNA_def_property_ui_text(prop, "Max Angle", - "Maximum angle allowed with target direction " - "(no correction is done if angle with target direction is between min and max)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_CONST_TYPE_FH */ - prop = RNA_def_property(srna, "fh_height", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_fhheight_get", - "rna_ConstraintActuator_fhheight_set", NULL); - RNA_def_property_ui_range(prop, 0.01, 2000.0, 10, 2); - RNA_def_property_ui_text(prop, "Distance", "Height of the force field area"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_spring_get", "rna_ConstraintActuator_spring_set", NULL); - RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2); - RNA_def_property_ui_text(prop, "Force", "Spring force within the force field area"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "maxrot[0]"); - RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2); - RNA_def_property_ui_text(prop, "Damping", "Damping factor of the force field spring"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* booleans */ - prop = RNA_def_property(srna, "use_force_distance", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DISTANCE); - RNA_def_property_ui_text(prop, "Force Distance", "Force distance of object to point of impact of ray"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_LOCAL); - RNA_def_property_ui_text(prop, "L", "Set ray along object's axis or global axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL); - RNA_def_property_ui_text(prop, "N", - "Set object axis along (local axis) or parallel (global axis) to the normal at " - "hit position"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_PERMANENT); - RNA_def_property_ui_text(prop, "PER", "Persistent actuator: stays active even if ray does not reach target"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /*XXX to use an enum instead of a flag if possible */ - prop = RNA_def_property(srna, "use_material_detect", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_MATERIAL); - RNA_def_property_ui_text(prop, "M/P", "Detect material instead of property"); - RNA_def_property_boolean_funcs(prop, NULL, "rna_Actuator_constraint_detect_material_set"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_fh_paralel_axis", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DOROTFH); - RNA_def_property_ui_text(prop, "Rot Fh", "Keep object axis parallel to normal"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL); - RNA_def_property_ui_text(prop, "N", "Add a horizontal spring force on slopes"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_edit_object_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_dyn_items[] = { - {ACT_EDOB_RESTORE_DYN, "RESTOREDYN", 0, "Restore Dynamics", ""}, - {ACT_EDOB_SUSPEND_DYN, "SUSPENDDYN", 0, "Suspend Dynamics", ""}, - {ACT_EDOB_ENABLE_RB, "ENABLERIGIDBODY", 0, "Enable Rigid Body", ""}, - {ACT_EDOB_DISABLE_RB, "DISABLERIGIDBODY", 0, "Disable Rigid Body", ""}, - {ACT_EDOB_SET_MASS, "SETMASS", 0, "Set Mass", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""}, - {ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""}, - {ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""}, - {ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""}, - {ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_track_axis_items[] = { - {ACT_TRACK_TRAXIS_X, "TRACKAXISX", 0, "X axis", ""}, - {ACT_TRACK_TRAXIS_Y, "TRACKAXISY", 0, "Y axis", ""}, - {ACT_TRACK_TRAXIS_Z, "TRACKAXISZ", 0, "Z axis", ""}, - {ACT_TRACK_TRAXIS_NEGX, "TRACKAXISNEGX", 0, "-X axis", ""}, - {ACT_TRACK_TRAXIS_NEGY, "TRACKAXISNEGY", 0, "-Y axis", ""}, - {ACT_TRACK_TRAXIS_NEGZ, "TRACKAXISNEGZ", 0, "-Z axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_up_axis_items[] = { - {ACT_TRACK_UP_X, "UPAXISX", 0, "X axis", ""}, - {ACT_TRACK_UP_Y, "UPAXISY", 0, "Y axis", ""}, - {ACT_TRACK_UP_Z, "UPAXISZ", 0, "Z axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "EditObjectActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Edit Object Actuator", "Actuator used to edit objects"); - RNA_def_struct_sdna_from(srna, "bEditObjectActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Edit Object", "The mode of the actuator"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "dynamic_operation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "dyn_operation"); - RNA_def_property_enum_items(prop, prop_dyn_items); - RNA_def_property_ui_text(prop, "Dynamic Operation", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "upflag"); - RNA_def_property_enum_items(prop, prop_up_axis_items); - RNA_def_property_ui_text(prop, "Up Axis", "The axis that points upward"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "trackflag"); - RNA_def_property_enum_items(prop, prop_track_axis_items); - RNA_def_property_ui_text(prop, "Track Axis", "The axis that points to the target object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_sdna(prop, NULL, "ob"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Object", "Add this Object and all its children (can't be on a visible layer)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "track_object", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_sdna(prop, NULL, "ob"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Object", "Track to this Object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "mesh", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Mesh"); - RNA_def_property_pointer_sdna(prop, NULL, "me"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Mesh", - "Replace the existing, when left blank 'Phys' will remake the existing physics mesh"); - /* note: custom set function is ONLY to avoid rna setting a user for this. */ - RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_editobject_mesh_set", NULL, NULL); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "time", PROP_INT, PROP_NONE); - RNA_def_property_ui_range(prop, 0, 2000, 1, 1); - RNA_def_property_ui_text(prop, "Time", "Duration the new Object lives or the track takes"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); - RNA_def_property_ui_range(prop, 0, 10000, 1, 2); - RNA_def_property_ui_text(prop, "Mass", "The mass of the object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* floats 3 Arrays*/ - prop = RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "linVelocity"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2); - RNA_def_property_ui_text(prop, "Linear Velocity", "Velocity upon creation"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "angVelocity"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity upon creation"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* booleans */ - prop = RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_LINV); - RNA_def_property_ui_text(prop, "L", "Apply the transformation locally"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_ANGV); - RNA_def_property_ui_text(prop, "L", "Apply the rotation locally"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_replace_display_mesh", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_NOGFX); - RNA_def_property_ui_text(prop, "Gfx", "Replace the display mesh"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_replace_physics_mesh", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_PHYS); - RNA_def_property_ui_text(prop, "Phys", - "Replace the physics mesh (triangle bounds only - compound shapes not supported)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_3d_tracking", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TRACK_3D); - RNA_def_property_ui_text(prop, "3D", "Enable 3D tracking"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_scene_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_SCENE_RESTART, "RESTART", 0, "Restart", ""}, - {ACT_SCENE_SET, "SET", 0, "Set Scene", ""}, - {ACT_SCENE_CAMERA, "CAMERA", 0, "Set Camera", ""}, - {ACT_SCENE_ADD_FRONT, "ADDFRONT", 0, "Add Overlay Scene", ""}, - {ACT_SCENE_ADD_BACK, "ADDBACK", 0, "Add Background Scene", ""}, - {ACT_SCENE_REMOVE, "REMOVE", 0, "Remove Scene", ""}, - {ACT_SCENE_SUSPEND, "SUSPEND", 0, "Suspend Scene", ""}, - {ACT_SCENE_RESUME, "RESUME", 0, "Resume Scene", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "SceneActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Scene Actuator", ""); - RNA_def_struct_sdna_from(srna, "bSceneActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Camera Object", "Set this Camera (leave empty to refer to self object)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Scene"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Scene", "Scene to be added/removed/paused/resumed"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_random_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_distribution_items[] = { - {ACT_RANDOM_BOOL_CONST, "BOOL_CONSTANT", 0, "Bool Constant", ""}, - {ACT_RANDOM_BOOL_UNIFORM, "BOOL_UNIFORM", 0, "Bool Uniform", ""}, - {ACT_RANDOM_BOOL_BERNOUILLI, "BOOL_BERNOUILLI", 0, "Bool Bernoulli", ""}, - {ACT_RANDOM_INT_CONST, "INT_CONSTANT", 0, "Int Constant", ""}, - {ACT_RANDOM_INT_UNIFORM, "INT_UNIFORM", 0, "Int Uniform", ""}, - {ACT_RANDOM_INT_POISSON, "INT_POISSON", 0, "Int Poisson", ""}, - {ACT_RANDOM_FLOAT_CONST, "FLOAT_CONSTANT", 0, "Float Constant", ""}, - {ACT_RANDOM_FLOAT_UNIFORM, "FLOAT_UNIFORM", 0, "Float Uniform", ""}, - {ACT_RANDOM_FLOAT_NORMAL, "FLOAT_NORMAL", 0, "Float Normal", ""}, - {ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL, "FLOAT_NEGATIVE_EXPONENTIAL", 0, "Float Neg. Exp.", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "RandomActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Random Actuator", ""); - RNA_def_struct_sdna_from(srna, "bRandomActuator", "data"); - - prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); - RNA_def_property_ui_range(prop, 0, 1000, 1, 1); - RNA_def_property_range(prop, 0, MAXFRAME); - RNA_def_property_ui_text(prop, "Seed", - "Initial seed of the random generator, use Python for more freedom " - "(choose 0 for not random)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "propname"); - RNA_def_property_ui_text(prop, "Property", "Assign the random value to this property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, prop_distribution_items); - RNA_def_property_ui_text(prop, "Distribution", "Choose the type of distribution"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* arguments for the distribution */ - /* int_arg_1, int_arg_2, float_arg_1, float_arg_2 */ - - /* ACT_RANDOM_BOOL_CONST */ - prop = RNA_def_property(srna, "use_always_true", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "int_arg_1", 1); - RNA_def_property_ui_text(prop, "Always True", "Always false or always true"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_RANDOM_BOOL_UNIFORM */ - /* label => "Choose between true and false, 50% chance each" */ - - /* ACT_RANDOM_BOOL_BERNOUILLI */ - prop = RNA_def_property(srna, "chance", PROP_FLOAT, PROP_PERCENTAGE); - RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Chance", "Pick a number between 0 and 1, success if it's below this value"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_RANDOM_INT_CONST */ - prop = RNA_def_property(srna, "int_value", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "int_arg_1"); - RNA_def_property_ui_range(prop, -1000, 1000, 1, 1); - RNA_def_property_ui_text(prop, "Value", "Always return this number"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_RANDOM_INT_UNIFORM */ - prop = RNA_def_property(srna, "int_min", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "int_arg_1"); - RNA_def_property_range(prop, -1000, 1000); - RNA_def_property_ui_text(prop, "Min", "Choose a number from a range: lower boundary of the range"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "int_max", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "int_arg_2"); - RNA_def_property_range(prop, -1000, 1000); - RNA_def_property_ui_text(prop, "Max", "Choose a number from a range: upper boundary of the range"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_RANDOM_INT_POISSON */ - prop = RNA_def_property(srna, "int_mean", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); - RNA_def_property_range(prop, 0.01, 100.0); - RNA_def_property_ui_text(prop, "Mean", "Expected mean value of the distribution"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_RANDOM_FLOAT_CONST */ - prop = RNA_def_property(srna, "float_value", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Value", "Always return this number"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_RANDOM_FLOAT_UNIFORM */ - prop = RNA_def_property(srna, "float_min", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); - RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "Min", "Choose a number from a range: lower boundary of the range"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "float_max", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "float_arg_2"); - RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "Max", "Choose a number from a range: upper boundary of the range"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_RANDOM_FLOAT_NORMAL */ - prop = RNA_def_property(srna, "float_mean", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); - RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "Mean", "A normal distribution: mean of the distribution"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "standard_derivation", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "float_arg_2"); - RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "SD", "A normal distribution: standard deviation of the distribution"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL */ - prop = RNA_def_property(srna, "half_life_time", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); - RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "Half-Life Time", "Negative exponential dropoff"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_message_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_body_type_items[] = { - {ACT_MESG_MESG, "TEXT", 0, "Text", ""}, - {ACT_MESG_PROP, "PROPERTY", 0, "Property", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "MessageActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Message Actuator", ""); - RNA_def_struct_sdna_from(srna, "bMessageActuator", "data"); - - prop = RNA_def_property(srna, "to_property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "toPropName"); - RNA_def_property_ui_text(prop, "To", - "Optional, send message to objects with this name only, or empty to broadcast"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Subject", "Optional, message subject (this is what can be filtered on)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "body_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "bodyType"); - RNA_def_property_enum_items(prop, prop_body_type_items); - RNA_def_property_ui_text(prop, "Body", "Toggle message type: either Text or a PropertyName"); - - /* ACT_MESG_MESG */ - prop = RNA_def_property(srna, "body_message", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "body"); - RNA_def_property_ui_text(prop, "Body", "Optional, message body Text"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_MESG_PROP */ - prop = RNA_def_property(srna, "body_property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "body"); - RNA_def_property_ui_text(prop, "Prop Name", "The message body will be set by the Property Value"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_game_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { -/* {ACT_GAME_LOAD, "LOAD", 0, "Load Game", ""}, */ -/* {ACT_GAME_START, "START", 0, "Start Loaded Game", ""}, */ -/* keeping the load/start hacky for compatibility with 2.49 */ -/* ideally we could use ACT_GAME_START again and do a do_version() */ - - {ACT_GAME_LOAD, "START", 0, "Start Game From File", ""}, - {ACT_GAME_RESTART, "RESTART", 0, "Restart Game", ""}, - {ACT_GAME_QUIT, "QUIT", 0, "Quit Game", ""}, - {ACT_GAME_SAVECFG, "SAVECFG", 0, "Save bge.logic.globalDict", ""}, - {ACT_GAME_LOADCFG, "LOADCFG", 0, "Load bge.logic.globalDict", ""}, - {ACT_GAME_SCREENSHOT, "SCREENSHOT", 0, "Screenshot", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "GameActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Game Actuator", ""); - RNA_def_struct_sdna_from(srna, "bGameActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Game", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* ACT_GAME_LOAD */ - prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH); - RNA_def_property_ui_text(prop, "File", - "The file to use, depending on the mode (e.g. the blend file to load or a destination " - "for saving a screenshot) - use the \"//\" prefix for a relative path"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - /*XXX to do: an operator that calls file_browse with relative_path on and blender filtering active */ -} - -static void rna_def_visibility_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "VisibilityActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Visibility Actuator", "Actuator to set visibility and occlusion of the object"); - RNA_def_struct_sdna_from(srna, "bVisibilityActuator", "data"); - - prop = RNA_def_property(srna, "use_visible", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE); - RNA_def_property_ui_text(prop, "Visible", - "Set the objects visible (initialized from the object render restriction toggle in " - "physics button)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_occlusion", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_OCCLUSION); - RNA_def_property_ui_text(prop, "Occlusion", - "Set the object to occlude objects behind it (initialized from the object type in " - "physics button)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_RECURSIVE); - RNA_def_property_ui_text(prop, "Children", - "Set all the children of this object to the same visibility/occlusion recursively"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_twodfilter_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_2DFILTER_ENABLED, "ENABLE", 0, "Enable Filter", ""}, - {ACT_2DFILTER_DISABLED, "DISABLE", 0, "Disable Filter", ""}, - {ACT_2DFILTER_NOFILTER, "REMOVE", 0, "Remove Filter", ""}, - {ACT_2DFILTER_MOTIONBLUR, "MOTIONBLUR", 0, "Motion Blur", ""}, - {ACT_2DFILTER_BLUR, "BLUR", 0, "Blur", ""}, - {ACT_2DFILTER_SHARPEN, "SHARPEN", 0, "Sharpen", ""}, - {ACT_2DFILTER_DILATION, "DILATION", 0, "Dilation", ""}, - {ACT_2DFILTER_EROSION, "EROSION", 0, "Erosion", ""}, - {ACT_2DFILTER_LAPLACIAN, "LAPLACIAN", 0, "Laplacian", ""}, - {ACT_2DFILTER_SOBEL, "SOBEL", 0, "Sobel", ""}, - {ACT_2DFILTER_PREWITT, "PREWITT", 0, "Prewitt", ""}, - {ACT_2DFILTER_GRAYSCALE, "GRAYSCALE", 0, "Gray Scale", ""}, - {ACT_2DFILTER_SEPIA, "SEPIA", 0, "Sepia", ""}, - {ACT_2DFILTER_INVERT, "INVERT", 0, "Invert", ""}, - {ACT_2DFILTER_CUSTOMFILTER, "CUSTOMFILTER", 0, "Custom Filter", ""}, -/* {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""}, */ - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "Filter2DActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Filter 2D Actuator", "Actuator to apply screen graphic effects"); - RNA_def_struct_sdna_from(srna, "bTwoDFilterActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Filter 2D Type", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "glsl_shader", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "text"); - RNA_def_property_struct_type(prop, "Text"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Script", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "filter_pass", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "int_arg"); - RNA_def_property_ui_text(prop, "Pass Number", "Set filter order"); - RNA_def_property_range(prop, 0, 99); /*MAX_RENDER_PASS-1 */ - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "motion_blur_factor", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "float_arg"); - RNA_def_property_ui_text(prop, "Value", "Motion blur factor"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* booleans */ - prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1); - RNA_def_property_ui_text(prop, "Enable", "Enable/Disable Motion Blur"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_parent_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_PARENT_SET, "SETPARENT", 0, "Set Parent", ""}, - {ACT_PARENT_REMOVE, "REMOVEPARENT", 0, "Remove Parent", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "ParentActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Parent Actuator", ""); - RNA_def_struct_sdna_from(srna, "bParentActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Scene", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_sdna(prop, NULL, "ob"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Parent Object", "Set this object as parent"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* booleans */ - prop = RNA_def_property(srna, "use_compound", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_PARENT_COMPOUND); - RNA_def_property_ui_text(prop, "Compound", - "Add this object shape to the parent shape " - "(only if the parent shape is already compound)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_PARENT_GHOST); - RNA_def_property_ui_text(prop, "Ghost", "Make this object ghost while parented"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_state_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_STATE_SET, "SET", 0, "Set State", ""}, - {ACT_STATE_ADD, "ADD", 0, "Add State", ""}, - {ACT_STATE_REMOVE, "REMOVE", 0, "Remove State", ""}, - {ACT_STATE_CHANGE, "CHANGE", 0, "Change State", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "StateActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "State Actuator", "Actuator to handle states"); - RNA_def_struct_sdna_from(srna, "bStateActuator", "data"); - - prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Operation", "Select the bit operation on object state mask"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER); - RNA_def_property_boolean_sdna(prop, NULL, "mask", 1); - RNA_def_property_array(prop, OB_MAX_STATES); - RNA_def_property_ui_text(prop, "State", ""); - RNA_def_property_boolean_funcs(prop, NULL, "rna_StateActuator_state_set"); -} - -static void rna_def_armature_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_ARM_RUN, "RUN", 0, "Run Armature", ""}, - {ACT_ARM_ENABLE, "ENABLE", 0, "Enable", ""}, - {ACT_ARM_DISABLE, "DISABLE", 0, "Disable", ""}, - {ACT_ARM_SETTARGET, "SETTARGET", 0, "Set Target", ""}, - {ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set Weight", ""}, - {ACT_ARM_SETINFLUENCE, "SETINFLUENCE", 0, "Set Influence", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "ArmatureActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Armature Actuator", ""); - RNA_def_struct_sdna_from(srna, "bArmatureActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Constraint Type", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "posechannel"); - RNA_def_property_ui_text(prop, "Bone", "Bone on which the constraint is defined"); - RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update"); - - prop = RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "constraint"); - RNA_def_property_ui_text(prop, "Constraint", "Name of the constraint to control"); - RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update"); - - prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Target", "Set this object as the target of the constraint"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "secondary_target", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "subtarget"); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Secondary Target", - "Set this object as the secondary target of the constraint " - "(only IK polar target at the moment)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "weight"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Weight", "Weight of this constraint"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "influence"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Influence", "Influence of this constraint"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_steering_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_STEERING_SEEK, "SEEK", 0, "Seek", ""}, - {ACT_STEERING_FLEE, "FLEE", 0, "Flee", ""}, - {ACT_STEERING_PATHFOLLOWING, "PATHFOLLOWING", 0, "Path following", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem facingaxis_items[] = { - {1, "X", 0, "X", ""}, - {2, "Y", 0, "Y", ""}, - {3, "Z", 0, "Z", ""}, - {4, "NEG_X", 0, "-X", ""}, - {5, "NEG_Y", 0, "-Y", ""}, - {6, "NEG_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "SteeringActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Steering Actuator", ""); - RNA_def_struct_sdna_from(srna, "bSteeringActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Behavior", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "velocity"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_ui_text(prop, "Velocity", "Velocity magnitude"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "acceleration"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_ui_text(prop, "Acceleration", "Max acceleration"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "turn_speed", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "turnspeed"); - RNA_def_property_range(prop, 0.0, 720.0); - RNA_def_property_ui_text(prop, "Turn Speed", "Max turn speed"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "dist"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_ui_text(prop, "Dist", "Relax distance"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_sdna(prop, NULL, "target"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Target Object", "Target object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "self_terminated", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_SELFTERMINATED); - RNA_def_property_ui_text(prop, "Self Terminated", "Terminate when target is reached"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_visualization", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_ENABLEVISUALIZATION); - RNA_def_property_ui_text(prop, "Visualize", "Enable debug visualization for 'Path following'"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "update_period", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "updateTime"); - RNA_def_property_ui_range(prop, -1, 100000, 1, 1); - RNA_def_property_ui_text(prop, "Update period", "Path update period"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "navmesh", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_sdna(prop, NULL, "navmesh"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Navigation Mesh Object", "Navigation mesh"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_SteeringActuator_navmesh_set", NULL, NULL); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "facing", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_AUTOMATICFACING); - RNA_def_property_ui_text(prop, "Facing", "Enable automatic facing"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "facing_axis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "facingaxis"); - RNA_def_property_enum_items(prop, facingaxis_items); - RNA_def_property_ui_text(prop, "Axis", "Axis for automatic facing"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "normal_up", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_NORMALUP); - RNA_def_property_ui_text(prop, "N", "Use normal of the navmesh to set \"UP\" vector"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "lock_z_velocity", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_LOCKZVEL); - RNA_def_property_ui_text(prop, "Lock Z velocity", "Disable simulation of linear motion along Z axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_mouse_actuator(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_type_items[] = { - {ACT_MOUSE_VISIBILITY, "VISIBILITY", 0, "Visibility", ""}, - {ACT_MOUSE_LOOK, "LOOK", 0, "Look", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_object_axis_items[] = { - {ACT_MOUSE_OBJECT_AXIS_X, "OBJECT_AXIS_X", 0, "X Axis", ""}, - {ACT_MOUSE_OBJECT_AXIS_Y, "OBJECT_AXIS_Y", 0, "Y Axis", ""}, - {ACT_MOUSE_OBJECT_AXIS_Z, "OBJECT_AXIS_Z", 0, "Z Axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "MouseActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Mouse Actuator", ""); - RNA_def_struct_sdna_from(srna, "bMouseActuator", "data"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Visibility */ - prop = RNA_def_property(srna, "visible", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_MOUSE_VISIBLE); - RNA_def_property_ui_text(prop, "Visible", "Make mouse cursor visible"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Mouse Look */ - prop = RNA_def_property(srna, "use_axis_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_MOUSE_USE_AXIS_X); - RNA_def_property_ui_text(prop, "Use X Axis", "Calculate mouse movement on the X axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_axis_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_MOUSE_USE_AXIS_Y); - RNA_def_property_ui_text(prop, "Use Y Axis", "Calculate mouse movement on the Y axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "reset_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_MOUSE_RESET_X); - RNA_def_property_ui_text(prop, "Reset", - "Reset the cursor's X position to the center of the screen space after calculating"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "reset_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_MOUSE_RESET_Y); - RNA_def_property_ui_text(prop, "Reset", - "Reset the cursor's Y position to the center of the screen space after calculating"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "local_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_MOUSE_LOCAL_X); - RNA_def_property_ui_text(prop, "Local", "Apply rotation locally"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "local_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_MOUSE_LOCAL_Y); - RNA_def_property_ui_text(prop, "Local", "Apply rotation locally"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "threshold_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "threshold[0]"); - RNA_def_property_ui_range(prop, 0, 0.5, 1, 3); - RNA_def_property_ui_text(prop, "Threshold", "Amount of X motion before mouse movement will register"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "threshold_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "threshold[1]"); - RNA_def_property_ui_range(prop, 0, 0.5, 1, 3); - RNA_def_property_ui_text(prop, "Threshold", "Amount of Y motion before mouse movement will register"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "object_axis_x", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "object_axis[0]"); - RNA_def_property_enum_items(prop, prop_object_axis_items); - RNA_def_property_ui_text(prop, "Object Axis", "Local object axis mouse movement in the X direction will apply to"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "object_axis_y", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "object_axis[1]"); - RNA_def_property_enum_items(prop, prop_object_axis_items); - RNA_def_property_ui_text(prop, "Object Axis", "Local object axis mouse movement in the Y direction will apply to"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "sensitivity_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sensitivity[0]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 0.2, 3); - RNA_def_property_ui_text(prop, "Sensitivity", "Sensitivity of the X axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "sensitivity_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sensitivity[1]"); - RNA_def_property_ui_range(prop, -100.0, 100.0, 0.2, 3); - RNA_def_property_ui_text(prop, "Sensitivity", "Sensitivity of the Y axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "limit_x[0]"); - RNA_def_property_ui_range(prop, DEG2RADF(-3600.0f), 0.0, 9, 3); - RNA_def_property_ui_text(prop, "Min", "Maximum negative rotation allowed by X mouse movement (0 for infinite)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "limit_x[1]"); - RNA_def_property_ui_range(prop, 0.0, DEG2RADF(3600.0f), 9, 3); - RNA_def_property_ui_text(prop, "Max", "Maximum positive rotation allowed by X mouse movement (0 for infinite)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "limit_y[0]"); - RNA_def_property_ui_range(prop, DEG2RADF(-3600.0f), 0.0, 9, 3); - RNA_def_property_ui_text(prop, "Min", "Maximum negative rotation allowed by Y mouse movement (0 for infinite)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "limit_y[1]"); - RNA_def_property_ui_range(prop, 0.0, DEG2RADF(3600.0f), 9, 3); - RNA_def_property_ui_text(prop, "Max", "Maximum positive rotation allowed by Y mouse movement (0 for infinite)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -void RNA_def_actuator(BlenderRNA *brna) -{ - rna_def_actuator(brna); - - rna_def_action_actuator(brna); - rna_def_object_actuator(brna); - rna_def_camera_actuator(brna); - rna_def_sound_actuator(brna); - rna_def_property_actuator(brna); - rna_def_constraint_actuator(brna); - rna_def_edit_object_actuator(brna); - rna_def_scene_actuator(brna); - rna_def_random_actuator(brna); - rna_def_message_actuator(brna); - rna_def_game_actuator(brna); - rna_def_visibility_actuator(brna); - rna_def_twodfilter_actuator(brna); - rna_def_parent_actuator(brna); - rna_def_state_actuator(brna); - rna_def_armature_actuator(brna); - rna_def_steering_actuator(brna); - rna_def_mouse_actuator(brna); -} - -#endif diff --git a/source/blender/makesrna/intern/rna_actuator_api.c b/source/blender/makesrna/intern/rna_actuator_api.c deleted file mode 100644 index 23fdd8a1d5b..00000000000 --- a/source/blender/makesrna/intern/rna_actuator_api.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2010 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/makesrna/intern/rna_actuator_api.c - * \ingroup RNA - */ - - -#include <stdlib.h> -#include <stdio.h> - -#include "WM_types.h" -#include "RNA_define.h" - -#include "rna_internal.h" /* own include */ - -#ifdef RNA_RUNTIME - -#include "BKE_sca.h" -#include "DNA_controller_types.h" -#include "DNA_actuator_types.h" - -static void rna_Actuator_link(bActuator *act, bController *cont) -{ - link_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks, sizeof(bActuator *)); -} - -static void rna_Actuator_unlink(bActuator *act, bController *cont) -{ - unlink_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks); -} - -#else - -void RNA_api_actuator(StructRNA *srna) -{ - FunctionRNA *func; - PropertyRNA *parm; - - func = RNA_def_function(srna, "link", "rna_Actuator_link"); - RNA_def_function_ui_description(func, "Link the actuator to a controller"); - parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to"); - RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - RNA_def_property_update(parm, NC_LOGIC, NULL); - - func = RNA_def_function(srna, "unlink", "rna_Actuator_unlink"); - RNA_def_function_ui_description(func, "Unlink the actuator from a controller"); - parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from"); - RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - RNA_def_property_update(parm, NC_LOGIC, NULL); -} - -#endif - diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 05074bc9f16..3afa682e75f 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -989,11 +989,6 @@ static void rna_def_armature(BlenderRNA *brna) {ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"}, {0, NULL, 0, NULL, NULL} }; - static const EnumPropertyItem prop_vdeformer[] = { - {ARM_VDEF_BLENDER, "BLENDER", 0, "Blender", "Use Blender's armature vertex deformation"}, - {ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Use vertex deformation code optimized for the BGE"}, - {0, NULL, 0, NULL, NULL} - }; static const EnumPropertyItem prop_ghost_type_items[] = { {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame"}, @@ -1050,13 +1045,6 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - prop = RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "gevertdeformer"); - RNA_def_property_enum_items(prop, prop_vdeformer); - RNA_def_property_ui_text(prop, "Vertex Deformer", "Vertex Deformer Method (Game Engine only)"); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - /* XXX deprecated ....... old animviz for armatures only */ prop = RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ghosttype"); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 8eb6bc1261e..97114e02e48 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -100,8 +100,8 @@ const EnumPropertyItem rna_enum_constraint_type_items[] = { "Use to animate an object/bone following a path"}, {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", "Change pivot point for transforms (buggy)"}, - {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", - "Use to define a Rigid Body Constraint (for Game Engine use only)"}, + /* {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", + "Use to define a Rigid Body Constraint (for Game Engine use only)"}, */ /* {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", "Custom constraint(s) written in Python (Not yet implemented)"}, */ {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", @@ -190,8 +190,6 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr) return &RNA_StretchToConstraint; case CONSTRAINT_TYPE_MINMAX: return &RNA_FloorConstraint; - case CONSTRAINT_TYPE_RIGIDBODYJOINT: - return &RNA_RigidBodyJointConstraint; case CONSTRAINT_TYPE_CLAMPTO: return &RNA_ClampToConstraint; case CONSTRAINT_TYPE_TRANSFORM: @@ -1419,178 +1417,6 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } -static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem pivot_items[] = { - {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", "Allow rotations around all axes"}, - {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", "Work in one plane, allow rotations around one axis only"}, - {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", - "Allow rotations around all axes with limits for the cone and twist axes"}, - {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", - "No constraints by default, limits can be set individually"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "RigidBodyJointConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Rigid Body Joint Constraint", "For use with the Game Engine"); - RNA_def_struct_sdna_from(srna, "bRigidBodyJointConstraint", "data"); - - prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tar"); - RNA_def_property_ui_text(prop, "Target", "Target Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE); - RNA_def_property_ui_text(prop, "Child Object", "Child object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "pivot_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, pivot_items); - RNA_def_property_ui_text(prop, "Pivot Type", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "pivX"); - RNA_def_property_range(prop, -1000.0, 1000.f); - RNA_def_property_ui_text(prop, "Pivot X", "Offset pivot on X"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "pivY"); - RNA_def_property_range(prop, -1000.0, 1000.f); - RNA_def_property_ui_text(prop, "Pivot Y", "Offset pivot on Y"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "pivot_z", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "pivZ"); - RNA_def_property_range(prop, -1000.0, 1000.f); - RNA_def_property_ui_text(prop, "Pivot Z", "Offset pivot on Z"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "axX"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Axis X", "Rotate pivot on X axis"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "axY"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Axis Y", "Rotate pivot on Y axis"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "axZ"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Axis Z", "Rotate pivot on Z axis"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "use_linked_collision", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION); - RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "show_pivot", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT); - RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - - /* Limits */ - /* Limit Min/Max */ - prop = RNA_def_property(srna, "limit_min_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "minLimit[0]"); - RNA_def_property_ui_text(prop, "Minimum Limit X", ""); - - prop = RNA_def_property(srna, "limit_min_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "minLimit[1]"); - RNA_def_property_ui_text(prop, "Minimum Limit Y", ""); - - prop = RNA_def_property(srna, "limit_min_z", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "minLimit[2]"); - RNA_def_property_ui_text(prop, "Minimum Limit Z", ""); - - prop = RNA_def_property(srna, "limit_max_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "maxLimit[0]"); - RNA_def_property_ui_text(prop, "Maximum Limit X", ""); - - prop = RNA_def_property(srna, "limit_max_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "maxLimit[1]"); - RNA_def_property_ui_text(prop, "Maximum Limit Y", ""); - - prop = RNA_def_property(srna, "limit_max_z", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "maxLimit[2]"); - RNA_def_property_ui_text(prop, "Maximum Limit Z", ""); - - /* Limit Min/Max for angle */ - prop = RNA_def_property(srna, "limit_angle_min_x", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "minLimit[3]"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Minimum Angular Limit X", ""); - - prop = RNA_def_property(srna, "limit_angle_min_y", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "minLimit[4]"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Minimum Angular Limit Y", ""); - - prop = RNA_def_property(srna, "limit_angle_min_z", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "minLimit[5]"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Minimum Angular Limit Z", ""); - - prop = RNA_def_property(srna, "limit_angle_max_x", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "maxLimit[3]"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Maximum Angular Limit X", ""); - - prop = RNA_def_property(srna, "limit_angle_max_y", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "maxLimit[4]"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Maximum Angular Limit Y", ""); - - prop = RNA_def_property(srna, "limit_angle_max_z", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "maxLimit[5]"); - RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); - RNA_def_property_ui_text(prop, "Maximum Angular Limit Z", ""); - - /* Limit Booleans */ - prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); - RNA_def_property_ui_text(prop, "Limit X", "Use minimum/maximum X limit"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", 2); - RNA_def_property_ui_text(prop, "Limit Y", "Use minimum/maximum y limit"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", 4); - RNA_def_property_ui_text(prop, "Limit Z", "Use minimum/maximum z limit"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "use_angular_limit_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", 8); - RNA_def_property_ui_text(prop, "Angular X Limit", "Use minimum/maximum X angular limit"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "use_angular_limit_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", 16); - RNA_def_property_ui_text(prop, "Angular Y Limit", "Use minimum/maximum Y angular limit"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - prop = RNA_def_property(srna, "use_angular_limit_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", 32); - RNA_def_property_ui_text(prop, "Angular Z Limit", "Use minimum/maximum Z angular limit"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); -} - static void rna_def_constraint_clamp_to(BlenderRNA *brna) { StructRNA *srna; @@ -2718,7 +2544,6 @@ void RNA_def_constraint(BlenderRNA *brna) rna_def_constraint_minmax(brna); rna_def_constraint_track_to(brna); rna_def_constraint_kinematic(brna); - rna_def_constraint_rigid_body_joint(brna); rna_def_constraint_clamp_to(brna); rna_def_constraint_distance_limit(brna); rna_def_constraint_size_limit(brna); diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c deleted file mode 100644 index bdb3daedebb..00000000000 --- a/source/blender/makesrna/intern/rna_controller.c +++ /dev/null @@ -1,327 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributor(s): Blender Foundation (2008). - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/makesrna/intern/rna_controller.c - * \ingroup RNA - */ - -#include <stdlib.h> - -#include "DNA_object_types.h" -#include "DNA_controller_types.h" - -#include "BLI_string_utils.h" -#include "BLI_utildefines.h" - -#include "BLT_translation.h" - -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - -#include "WM_types.h" - -const EnumPropertyItem rna_enum_controller_type_items[] = { - {CONT_LOGIC_AND, "LOGIC_AND", 0, "And", "Logic And"}, - {CONT_LOGIC_OR, "LOGIC_OR", 0, "Or", "Logic Or"}, - {CONT_LOGIC_NAND, "LOGIC_NAND", 0, "Nand", "Logic Nand"}, - {CONT_LOGIC_NOR, "LOGIC_NOR", 0, "Nor", "Logic Nor"}, - {CONT_LOGIC_XOR, "LOGIC_XOR", 0, "Xor", "Logic Xor"}, - {CONT_LOGIC_XNOR, "LOGIC_XNOR", 0, "Xnor", "Logic Xnor"}, - {CONT_EXPRESSION, "EXPRESSION", 0, "Expression", ""}, - {CONT_PYTHON, "PYTHON", 0, "Python", ""}, - {0, NULL, 0, NULL, NULL} -}; - -#ifdef RNA_RUNTIME - -#include "BKE_sca.h" -#include "DNA_actuator_types.h" - -static StructRNA *rna_Controller_refine(struct PointerRNA *ptr) -{ - bController *controller = (bController *)ptr->data; - - switch (controller->type) { - case CONT_LOGIC_AND: - return &RNA_AndController; - case CONT_LOGIC_OR: - return &RNA_OrController; - case CONT_LOGIC_NAND: - return &RNA_NandController; - case CONT_LOGIC_NOR: - return &RNA_NorController; - case CONT_LOGIC_XOR: - return &RNA_XorController; - case CONT_LOGIC_XNOR: - return &RNA_XnorController; - case CONT_EXPRESSION: - return &RNA_ExpressionController; - case CONT_PYTHON: - return &RNA_PythonController; - default: - return &RNA_Controller; - } -} - -static void rna_Constroller_name_set(PointerRNA *ptr, const char *value) -{ - Object *ob = ptr->id.data; - bController *cont = ptr->data; - BLI_strncpy_utf8(cont->name, value, sizeof(cont->name)); - BLI_uniquename(&ob->controllers, cont, DATA_("Controller"), '.', offsetof(bController, name), sizeof(cont->name)); -} - -static void rna_Controller_type_set(struct PointerRNA *ptr, int value) -{ - bController *cont = (bController *)ptr->data; - - if (value != cont->type) { - cont->type = value; - init_controller(cont); - } -} - -static void rna_Controller_mode_set(struct PointerRNA *ptr, int value) -{ - bController *cont = (bController *)ptr->data; - bPythonCont *pycon = (bPythonCont *)cont->data; - - /* if mode changed and previous mode were Script */ - if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) { - /* clear script to avoid it to get linked with the controller */ - pycon->text = NULL; - } - pycon->mode = value; -} - -static int rna_Controller_state_number_get(struct PointerRNA *ptr) -{ - bController *cont = (bController *)ptr->data; - int bit; - - for (bit = 0; bit < 32; bit++) { - if (cont->state_mask & (1u << bit)) - return bit + 1; - } - return 0; -} - -static void rna_Controller_state_number_set(struct PointerRNA *ptr, const int value) -{ - bController *cont = (bController *)ptr->data; - if (value < 1 || value > OB_MAX_STATES) - return; - - cont->state_mask = (1 << (value - 1)); -} - -static void rna_Controller_actuators_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) -{ - bController *cont = (bController *)ptr->data; - rna_iterator_array_begin(iter, cont->links, sizeof(bActuator *), (int)cont->totlinks, 0, NULL); -} - -static int rna_Controller_actuators_length(PointerRNA *ptr) -{ - bController *cont = (bController *)ptr->data; - return (int) cont->totlinks; -} - -#if 0 /* editable is set to false, comment for now. */ -static void rna_Controller_state_get(PointerRNA *ptr, int *values) -{ - bController *cont = (bController *)ptr->data; - int i; - - memset(values, 0, sizeof(int) * OB_MAX_STATES); - for (i = 0; i < OB_MAX_STATES; i++) - values[i] = (cont->state_mask & (1 << i)); -} - -static void rna_Controller_state_set(PointerRNA *ptr, const int *values) -{ - bController *cont = (bController *)ptr->data; - int i, tot = 0; - - /* ensure we always have some state selected */ - for (i = 0; i < OB_MAX_STATES; i++) - if (values[i]) - tot++; - - if (tot == 0) - return; - - /* only works for one state at once */ - if (tot > 1) - return; - - for (i = 0; i < OB_MAX_STATES; i++) { - if (values[i]) cont->state_mask |= (1 << i); - else cont->state_mask &= ~(1 << i); - } -} -#endif - -#else - -void RNA_def_controller(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem python_controller_modes[] = { - {CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""}, - {CONT_PY_MODULE, "MODULE", 0, "Module", ""}, - {0, NULL, 0, NULL, NULL} - }; - - /* Controller */ - srna = RNA_def_struct(brna, "Controller", NULL); - RNA_def_struct_sdna(srna, "bController"); - RNA_def_struct_refine_func(srna, "rna_Controller_refine"); - RNA_def_struct_ui_text(srna, "Controller", - "Game engine logic brick to process events, connecting sensors to actuators"); - - RNA_api_controller(srna); - - prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Name", ""); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constroller_name_set"); - RNA_def_struct_name_property(srna, prop); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_type_set", NULL); - RNA_def_property_enum_items(prop, rna_enum_controller_type_items); - RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_SHOW); - RNA_def_property_ui_text(prop, "Expanded", "Set controller expanded in the user interface"); - RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONT_DEACTIVATE); - RNA_def_property_ui_text(prop, "Active", "Set the active state of the controller"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_priority", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PRIO); - RNA_def_property_ui_text(prop, "Priority", - "Mark controller for execution before all non-marked controllers " - "(good for startup scripts)"); - RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "links", NULL); - RNA_def_property_struct_type(prop, "Actuator"); - RNA_def_property_ui_text(prop, "Actuators", "The list containing the actuators connected to the controller"); - RNA_def_property_collection_funcs(prop, "rna_Controller_actuators_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_dereference_get", - "rna_Controller_actuators_length", NULL, NULL, NULL); - - /* State */ - - /* array of OB_MAX_STATES */ - /*prop = RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER); */ - /*RNA_def_property_array(prop, OB_MAX_STATES); */ - /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ - /*RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); */ - /*RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set"); */ - /*RNA_def_property_update(prop, NC_LOGIC, NULL); */ - - /* number of the state */ - prop = RNA_def_property(srna, "states", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_sdna(prop, NULL, "state_mask"); - RNA_def_property_range(prop, 1, OB_MAX_STATES); - RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); - RNA_def_property_int_funcs(prop, "rna_Controller_state_number_get", "rna_Controller_state_number_set", NULL); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Expression Controller */ - srna = RNA_def_struct(brna, "ExpressionController", "Controller"); - RNA_def_struct_sdna_from(srna, "bExpressionCont", "data"); - RNA_def_struct_ui_text(srna, "Expression Controller", - "Controller passing on events based on the evaluation of an expression"); - - prop = RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "str"); - RNA_def_property_ui_text(prop, "Expression", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Python Controller */ - srna = RNA_def_struct(brna, "PythonController", "Controller"); - RNA_def_struct_sdna_from(srna, "bPythonCont", "data"); - RNA_def_struct_ui_text(srna, "Python Controller", "Controller executing a python script"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, python_controller_modes); - RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL); - RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Text"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Text", "Text data-block with the python script"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Module", - "Module name and function to run, e.g. \"someModule.main\" " - "(internal texts and external python files can be used)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PY_DEBUG); - RNA_def_property_ui_text(prop, "D", - "Continuously reload the module from disk for editing external modules " - "without restarting"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Other Controllers */ - srna = RNA_def_struct(brna, "AndController", "Controller"); - RNA_def_struct_ui_text(srna, "And Controller", "Controller passing on events based on a logical AND operation"); - - srna = RNA_def_struct(brna, "OrController", "Controller"); - RNA_def_struct_ui_text(srna, "Or Controller", "Controller passing on events based on a logical OR operation"); - - srna = RNA_def_struct(brna, "NorController", "Controller"); - RNA_def_struct_ui_text(srna, "Nor Controller", "Controller passing on events based on a logical NOR operation"); - - srna = RNA_def_struct(brna, "NandController", "Controller"); - RNA_def_struct_ui_text(srna, "Nand Controller", "Controller passing on events based on a logical NAND operation"); - - srna = RNA_def_struct(brna, "XorController", "Controller"); - RNA_def_struct_ui_text(srna, "Xor Controller", "Controller passing on events based on a logical XOR operation"); - - srna = RNA_def_struct(brna, "XnorController", "Controller"); - RNA_def_struct_ui_text(srna, "Xnor Controller", "Controller passing on events based on a logical XNOR operation"); -} - -#endif diff --git a/source/blender/makesrna/intern/rna_controller_api.c b/source/blender/makesrna/intern/rna_controller_api.c deleted file mode 100644 index 639d6a330a5..00000000000 --- a/source/blender/makesrna/intern/rna_controller_api.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2010 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/makesrna/intern/rna_controller_api.c - * \ingroup RNA - */ - - -#include <stdlib.h> -#include <stdio.h> - -#include "WM_types.h" -#include "RNA_define.h" - -#include "rna_internal.h" /* own include */ - -#ifdef RNA_RUNTIME - -#include "BKE_sca.h" -#include "DNA_sensor_types.h" -#include "DNA_controller_types.h" -#include "DNA_actuator_types.h" - -static void rna_Controller_link(bController *cont, bSensor *sens, bActuator *act) -{ - if (sens) - link_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks, sizeof(bController *)); - if (act) - link_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks, sizeof(bActuator *)); -} - -static void rna_Controller_unlink(bController *cont, bSensor *sens, bActuator *act) -{ - if (sens) - unlink_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks); - if (act) - unlink_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks); -} - -#else - -void RNA_api_controller(StructRNA *srna) -{ - FunctionRNA *func; - PropertyRNA *parm; - - func = RNA_def_function(srna, "link", "rna_Controller_link"); - RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator"); - parm = RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to"); - RNA_def_property_update(parm, NC_LOGIC, NULL); - parm = RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to"); - RNA_def_property_update(parm, NC_LOGIC, NULL); - - func = RNA_def_function(srna, "unlink", "rna_Controller_unlink"); - RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator"); - parm = RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from"); - RNA_def_property_update(parm, NC_LOGIC, NULL); - parm = RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from"); - RNA_def_property_update(parm, NC_LOGIC, NULL); -} - -#endif - diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index c1f82bab300..11ad39a2dd1 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -151,7 +151,6 @@ void RNA_def_depsgraph(struct BlenderRNA *brna); void RNA_def_dynamic_paint(struct BlenderRNA *brna); void RNA_def_fluidsim(struct BlenderRNA *brna); void RNA_def_fcurve(struct BlenderRNA *brna); -void RNA_def_gameproperty(struct BlenderRNA *brna); void RNA_def_gpencil(struct BlenderRNA *brna); void RNA_def_group(struct BlenderRNA *brna); void RNA_def_image(struct BlenderRNA *brna); diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index 36e6afe26d6..e6fa7bb26dd 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -1000,18 +1000,6 @@ static int rna_ViewRenderSettings_use_spherical_stereo_get(PointerRNA *ptr) return BKE_viewrender_use_spherical_stereo(view_render); } -static int rna_ViewRenderSettings_use_game_engine_get(PointerRNA *ptr) -{ - ViewRender *view_render = (ViewRender *)ptr->data; - RenderEngineType *type; - - for (type = R_engines.first; type; type = type->next) - if (STREQ(type->idname, view_render->engine_id)) - return (type->flag & RE_GAME) != 0; - - return 0; -} - #else static void rna_def_scene_collections(BlenderRNA *brna, PropertyRNA *cprop) @@ -2233,11 +2221,6 @@ static void rna_def_scene_view_render(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_ViewRenderSettings_use_spherical_stereo_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Use Spherical Stereo", "Active render engine supports spherical stereo rendering"); - - prop = RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_ViewRenderSettings_use_game_engine_get", NULL); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine"); } void RNA_def_view_layer(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 8bc818d2658..d800022ec82 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -153,11 +153,6 @@ static PointerRNA rna_Material_strand_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_MaterialStrand, ptr->id.data); } -static PointerRNA rna_Material_physics_get(PointerRNA *ptr) -{ - return rna_pointer_inherit_refine(ptr, &RNA_MaterialPhysics, ptr->id.data); -} - static void rna_Material_type_set(PointerRNA *ptr, int value) { Material *ma = (Material *)ptr->data; @@ -843,67 +838,6 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Material_update"); } -static void rna_def_material_gamesettings(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_alpha_blend_items[] = { - {GEMAT_SOLID, "OPAQUE", 0, "Opaque", "Render color of textured face as color"}, - {GEMAT_ADD, "ADD", 0, "Add", "Render face transparent and add color of face"}, - {GEMAT_CLIP, "CLIP", 0, "Alpha Clip", "Use the image alpha values clipped with no blending (binary alpha)"}, - {GEMAT_ALPHA, "ALPHA", 0, "Alpha Blend", - "Render polygon transparent, depending on alpha channel of the texture"}, - {GEMAT_ALPHA_SORT, "ALPHA_SORT", 0, "Alpha Sort", - "Sort faces for correct alpha drawing (slow, use Alpha Clip instead when possible)"}, - {GEMAT_ALPHA_TO_COVERAGE, "ALPHA_ANTIALIASING", 0, "Alpha Anti-Aliasing", - "Use textures alpha as anti-aliasing mask, requires multi-sample OpenGL display"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_face_orientation_items[] = { - {GEMAT_NORMAL, "NORMAL", 0, "Normal", "No transformation"}, - {GEMAT_HALO, "HALO", 0, "Halo", "Screen aligned billboard"}, - {GEMAT_BILLBOARD, "BILLBOARD", 0, "Billboard", "Billboard with Z-axis constraint"}, - {GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "MaterialGameSettings", NULL); - RNA_def_struct_sdna(srna, "GameSettings"); - RNA_def_struct_nested(brna, srna, "Material"); - RNA_def_struct_ui_text(srna, "Material Game Settings", "Game Engine settings for a Material data-block"); - - prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_BACKCULL); /* use bitflags */ - RNA_def_property_ui_text(prop, "Backface Culling", "Hide Back of the face in Game Engine "); - RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - - prop = RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_TEXT); /* use bitflags */ - RNA_def_property_ui_text(prop, "Text", "Use material as text in Game Engine "); - RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - - prop = RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_INVISIBLE); /* use bitflags */ - RNA_def_property_ui_text(prop, "Invisible", "Make face invisible"); - RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - - prop = RNA_def_property(srna, "alpha_blend", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "alpha_blend"); - RNA_def_property_enum_items(prop, prop_alpha_blend_items); - RNA_def_property_ui_text(prop, "Blend Mode", "Blend Mode for Transparent Faces"); - RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - - prop = RNA_def_property(srna, "face_orientation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, prop_face_orientation_items); - RNA_def_property_ui_text(prop, "Face Orientations", "Especial face orientation options"); - - prop = RNA_def_property(srna, "physics", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GEMAT_NOPHYSICS); /* use bitflags */ - RNA_def_property_ui_text(prop, "Physics", "Use physics properties of materials "); -} - static void rna_def_material_colors(StructRNA *srna) { PropertyRNA *prop; @@ -1741,50 +1675,6 @@ static void rna_def_material_strand(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Material_update"); } -static void rna_def_material_physics(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "MaterialPhysics", NULL); - RNA_def_struct_sdna(srna, "Material"); - RNA_def_struct_nested(brna, srna, "Material"); - RNA_def_struct_ui_text(srna, "Material Physics", "Physics settings for a Material data-block"); - - prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "friction"); - RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "Friction", "Coulomb friction coefficient, when inside the physics distance area"); - - prop = RNA_def_property(srna, "elasticity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "reflect"); - RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Elasticity", "Elasticity of collisions"); - - /* FH/Force Field Settings */ - prop = RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "dynamode", MA_FH_NOR); - RNA_def_property_ui_text(prop, "Align to Normal", - "Align dynamic game objects along the surface normal, " - "when inside the physics distance area"); - - prop = RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "fh"); - RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2); - RNA_def_property_ui_text(prop, "Force", "Upward spring force, when inside the physics distance area"); - - prop = RNA_def_property(srna, "fh_distance", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "fhdist"); - RNA_def_property_range(prop, 0, 20); - RNA_def_property_ui_text(prop, "Distance", "Distance of the physics area"); - - prop = RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "xyfrict"); - RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Damping", "Damping of the spring force, when inside the physics distance area"); -} - void RNA_def_material(BlenderRNA *brna) { StructRNA *srna; @@ -2149,19 +2039,6 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_struct_type(prop, "MaterialStrand"); RNA_def_property_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Strand", "Strand settings for the material"); - - prop = RNA_def_property(srna, "physics", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "MaterialPhysics"); - RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL, NULL); - RNA_def_property_ui_text(prop, "Physics", "Game physics settings"); - - /* game settings */ - prop = RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "game"); - RNA_def_property_struct_type(prop, "MaterialGameSettings"); - RNA_def_property_ui_text(prop, "Game Settings", "Game material settings"); /* nodetree */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); @@ -2210,8 +2087,6 @@ void RNA_def_material(BlenderRNA *brna) rna_def_material_sss(brna); rna_def_material_mtex(brna); rna_def_material_strand(brna); - rna_def_material_physics(brna); - rna_def_material_gamesettings(brna); RNA_api_material(srna); } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 1932390d0fd..9a3066207f9 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -29,13 +29,11 @@ #include "DNA_action_types.h" #include "DNA_customdata_types.h" -#include "DNA_controller_types.h" #include "DNA_group_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_object_force_types.h" #include "DNA_object_types.h" -#include "DNA_property_types.h" #include "DNA_scene_types.h" #include "DNA_meta_types.h" #include "DNA_workspace_types.h" @@ -121,18 +119,6 @@ static EnumPropertyItem dupli_items_nogroup[] = { #undef DUPLI_ITEMS_SHARED #undef DUPLI_ITEM_GROUP -static const EnumPropertyItem collision_bounds_items[] = { - {OB_BOUND_BOX, "BOX", ICON_MESH_CUBE, "Box", ""}, - {OB_BOUND_SPHERE, "SPHERE", ICON_MESH_UVSPHERE, "Sphere", ""}, - {OB_BOUND_CYLINDER, "CYLINDER", ICON_MESH_CYLINDER, "Cylinder", ""}, - {OB_BOUND_CONE, "CONE", ICON_MESH_CONE, "Cone", ""}, - {OB_BOUND_CONVEX_HULL, "CONVEX_HULL", ICON_MESH_ICOSPHERE, "Convex Hull", ""}, - {OB_BOUND_TRIANGLE_MESH, "TRIANGLE_MESH", ICON_MESH_MONKEY, "Triangle Mesh", ""}, - {OB_BOUND_CAPSULE, "CAPSULE", ICON_MESH_CAPSULE, "Capsule", ""}, - /*{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, */ - {0, NULL, 0, NULL, NULL} -}; - const EnumPropertyItem rna_enum_metaelem_type_items[] = { {MB_BALL, "BALL", ICON_META_BALL, "Ball", ""}, {MB_TUBE, "CAPSULE", ICON_META_CAPSULE, "Capsule", ""}, @@ -192,7 +178,6 @@ const EnumPropertyItem rna_enum_object_axis_items[] = { #include "DNA_node_types.h" #include "BKE_armature.h" -#include "BKE_bullet.h" #include "BKE_constraint.h" #include "BKE_context.h" #include "BKE_curve.h" @@ -469,32 +454,6 @@ static void rna_Object_empty_draw_type_set(PointerRNA *ptr, int value) BKE_object_empty_draw_type_set(ob, value); } -static const EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), PointerRNA *ptr, - PropertyRNA *UNUSED(prop), bool *r_free) -{ - Object *ob = (Object *)ptr->data; - EnumPropertyItem *item = NULL; - int totitem = 0; - - if (ob->body_type != OB_BODY_TYPE_CHARACTER) { - RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_TRIANGLE_MESH); - } - RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONVEX_HULL); - - if (ob->body_type != OB_BODY_TYPE_SOFT) { - RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONE); - RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CYLINDER); - RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_SPHERE); - RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_BOX); - RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CAPSULE); - } - - RNA_enum_item_end(&item, &totitem); - *r_free = true; - - return item; -} - static void rna_Object_parent_bone_set(PointerRNA *ptr, const char *value) { Object *ob = (Object *)ptr->data; @@ -1047,122 +1006,6 @@ static char *rna_MaterialSlot_path(PointerRNA *ptr) * * logic from check_body_type() * */ -static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr) -{ - Object *ob = (Object *)ptr->id.data; - - /* determine the body_type setting based on flags */ - if (!(ob->gameflag & OB_COLLISION)) { - if (ob->gameflag & OB_OCCLUDER) { - ob->body_type = OB_BODY_TYPE_OCCLUDER; - } - else if (ob->gameflag & OB_NAVMESH) { - ob->body_type = OB_BODY_TYPE_NAVMESH; - } - else { - ob->body_type = OB_BODY_TYPE_NO_COLLISION; - } - } - else if (ob->gameflag & OB_CHARACTER) { - ob->body_type = OB_BODY_TYPE_CHARACTER; - } - else if (ob->gameflag & OB_SENSOR) { - ob->body_type = OB_BODY_TYPE_SENSOR; - } - else if (!(ob->gameflag & OB_DYNAMIC)) { - ob->body_type = OB_BODY_TYPE_STATIC; - } - else if (!(ob->gameflag & (OB_RIGID_BODY | OB_SOFT_BODY))) { - ob->body_type = OB_BODY_TYPE_DYNAMIC; - } - else if (ob->gameflag & OB_RIGID_BODY) { - ob->body_type = OB_BODY_TYPE_RIGID; - } - else { - ob->body_type = OB_BODY_TYPE_SOFT; - /* create the structure here because we display soft body buttons in the main panel */ - if (!ob->bsoft) - ob->bsoft = bsbNew(); - } - - return ob->body_type; -} - -static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value) -{ - Object *ob = (Object *)ptr->id.data; - const int gameflag_prev = ob->gameflag; - ob->body_type = value; - - switch (ob->body_type) { - case OB_BODY_TYPE_SENSOR: - ob->gameflag |= OB_SENSOR | OB_COLLISION; - ob->gameflag &= ~(OB_OCCLUDER | OB_CHARACTER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR | - OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH); - break; - case OB_BODY_TYPE_OCCLUDER: - ob->gameflag |= OB_OCCLUDER; - ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_CHARACTER | OB_DYNAMIC | OB_NAVMESH); - break; - case OB_BODY_TYPE_NAVMESH: - ob->gameflag |= OB_NAVMESH; - ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_CHARACTER | OB_DYNAMIC | OB_OCCLUDER); - - if (ob->type == OB_MESH) { - /* could be moved into mesh UI but for now ensure mesh data layer */ - BKE_mesh_ensure_navmesh(ob->data); - } - - break; - case OB_BODY_TYPE_NO_COLLISION: - ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_CHARACTER | OB_OCCLUDER | OB_DYNAMIC | OB_NAVMESH); - break; - case OB_BODY_TYPE_CHARACTER: - ob->gameflag |= OB_COLLISION | OB_CHARACTER; - ob->gameflag &= ~(OB_SENSOR | OB_OCCLUDER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR | - OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH); - /* When we switch to character physics and the collision bounds is set to triangle mesh - * we have to change collision bounds because triangle mesh is not supported by Characters */ - if ((ob->gameflag & OB_BOUNDS) && ob->collision_boundtype == OB_BOUND_TRIANGLE_MESH) { - ob->boundtype = ob->collision_boundtype = OB_BOUND_BOX; - } - break; - case OB_BODY_TYPE_STATIC: - ob->gameflag |= OB_COLLISION; - ob->gameflag &= ~(OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_OCCLUDER | OB_CHARACTER | OB_SENSOR | OB_NAVMESH); - break; - case OB_BODY_TYPE_DYNAMIC: - ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_ACTOR; - ob->gameflag &= ~(OB_RIGID_BODY | OB_SOFT_BODY | OB_OCCLUDER | OB_CHARACTER | OB_SENSOR | OB_NAVMESH); - break; - case OB_BODY_TYPE_RIGID: - ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_RIGID_BODY | OB_ACTOR; - ob->gameflag &= ~(OB_SOFT_BODY | OB_OCCLUDER | OB_CHARACTER | OB_SENSOR | OB_NAVMESH); - break; - default: - case OB_BODY_TYPE_SOFT: - ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_SOFT_BODY | OB_ACTOR; - ob->gameflag &= ~(OB_RIGID_BODY | OB_OCCLUDER | OB_CHARACTER | OB_SENSOR | OB_NAVMESH); - - /* assume triangle mesh, if no bounds chosen for soft body */ - if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype < OB_BOUND_TRIANGLE_MESH)) { - ob->boundtype = OB_BOUND_TRIANGLE_MESH; - } - /* create a BulletSoftBody structure if not already existing */ - if (!ob->bsoft) - ob->bsoft = bsbNew(); - break; - } - - if ((gameflag_prev & OB_NAVMESH) != (ob->gameflag & OB_NAVMESH)) { - if (ob->type == OB_MESH) { - /* this is needed to refresh the derived meshes draw func */ - DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA); - } - } - - WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->id.data); -} static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr) { @@ -1171,117 +1014,6 @@ static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, psys); } -static PointerRNA rna_Object_game_settings_get(PointerRNA *ptr) -{ - return rna_pointer_inherit_refine(ptr, &RNA_GameObjectSettings, ptr->id.data); -} - -static void rna_GameObjectSettings_state_get(PointerRNA *ptr, int *values) -{ - Object *ob = (Object *)ptr->data; - int i; - int all_states = (ob->scaflag & OB_ALLSTATE) ? 1 : 0; - - memset(values, 0, sizeof(int) * OB_MAX_STATES); - for (i = 0; i < OB_MAX_STATES; i++) { - values[i] = (ob->state & (1 << i)) ? 1 : 0 | all_states; - } -} - -static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values) -{ - Object *ob = (Object *)ptr->data; - int i, tot = 0; - - /* ensure we always have some state selected */ - for (i = 0; i < OB_MAX_STATES; i++) - if (values[i]) - tot++; - - if (tot == 0) - return; - - for (i = 0; i < OB_MAX_STATES; i++) { - if (values[i]) ob->state |= (1 << i); - else ob->state &= ~(1 << i); - } -} - -static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values) -{ - Object *ob = (Object *)ptr->data; - bController *cont; - - memset(values, 0, sizeof(int) * OB_MAX_STATES); - for (cont = ob->controllers.first; cont; cont = cont->next) { - int i; - - for (i = 0; i < OB_MAX_STATES; i++) { - if (cont->state_mask & (1 << i)) - values[i] = 1; - } - } -} - -static void rna_GameObjectSettings_col_group_get(PointerRNA *ptr, int *values) -{ - Object *ob = (Object *)ptr->data; - int i; - - for (i = 0; i < OB_MAX_COL_MASKS; i++) { - values[i] = (ob->col_group & (1 << i)) != 0; - } -} - -static void rna_GameObjectSettings_col_group_set(PointerRNA *ptr, const int *values) -{ - Object *ob = (Object *)ptr->data; - int i, tot = 0; - - /* ensure we always have some group selected */ - for (i = 0; i < OB_MAX_COL_MASKS; i++) - if (values[i]) - tot++; - - if (tot == 0) - return; - - for (i = 0; i < OB_MAX_COL_MASKS; i++) { - if (values[i]) ob->col_group |= (1 << i); - else ob->col_group &= ~(1 << i); - } -} - -static void rna_GameObjectSettings_col_mask_get(PointerRNA *ptr, int *values) -{ - Object *ob = (Object *)ptr->data; - int i; - - for (i = 0; i < OB_MAX_COL_MASKS; i++) { - values[i] = (ob->col_mask & (1 << i)) != 0; - } -} - -static void rna_GameObjectSettings_col_mask_set(PointerRNA *ptr, const int *values) -{ - Object *ob = (Object *)ptr->data; - int i, tot = 0; - - /* ensure we always have some mask selected */ - for (i = 0; i < OB_MAX_COL_MASKS; i++) - if (values[i]) - tot++; - - if (tot == 0) - return; - - for (i = 0; i < OB_MAX_COL_MASKS; i++) { - if (values[i]) ob->col_mask |= (1 << i); - else ob->col_mask &= ~(1 << i); - } -} - - static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { @@ -1617,16 +1349,6 @@ int rna_Object_use_dynamic_topology_sculpting_get(PointerRNA *ptr) return (ss && ss->bm); } -static void rna_Object_lod_distance_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) -{ - Object *ob = (Object *)ptr->id.data; - -#ifdef WITH_GAMEENGINE - BKE_object_lod_sort(ob); -#else - (void)ob; -#endif -} #else static void rna_def_vertex_group(BlenderRNA *brna) @@ -1777,313 +1499,6 @@ static void rna_def_material_slot(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_MaterialSlot_path"); } -static void rna_def_object_game_settings(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem body_type_items[] = { - {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", 0, "No Collision", "Disable collision for this object"}, - {OB_BODY_TYPE_STATIC, "STATIC", 0, "Static", "Stationary object"}, - {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", "Linear physics"}, - {OB_BODY_TYPE_RIGID, "RIGID_BODY", 0, "Rigid Body", "Linear and angular physics"}, - {OB_BODY_TYPE_SOFT, "SOFT_BODY", 0, "Soft Body", "Soft body"}, - {OB_BODY_TYPE_OCCLUDER, "OCCLUDER", 0, "Occluder", "Occluder for optimizing scene rendering"}, - {OB_BODY_TYPE_SENSOR, "SENSOR", 0, "Sensor", - "Collision Sensor, detects static and dynamic objects but not the other " - "collision sensor objects"}, - {OB_BODY_TYPE_NAVMESH, "NAVMESH", 0, "Navigation Mesh", "Navigation mesh"}, - {OB_BODY_TYPE_CHARACTER, "CHARACTER", 0, "Character", - "Simple kinematic physics appropriate for game characters"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "GameObjectSettings", NULL); - RNA_def_struct_sdna(srna, "Object"); - RNA_def_struct_nested(brna, srna, "Object"); - RNA_def_struct_ui_text(srna, "Game Object Settings", "Game engine related settings for the object"); - RNA_def_struct_ui_icon(srna, ICON_GAME); - - /* logic */ - - prop = RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE); - RNA_def_property_struct_type(prop, "Sensor"); - RNA_def_property_ui_text(prop, "Sensors", "Game engine sensor to detect events"); - - prop = RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE); - RNA_def_property_struct_type(prop, "Controller"); - RNA_def_property_ui_text(prop, "Controllers", - "Game engine controllers to process events, connecting sensors to actuators"); - - prop = RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE); - RNA_def_property_struct_type(prop, "Actuator"); - RNA_def_property_ui_text(prop, "Actuators", "Game engine actuators to act on events"); - - prop = RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "prop", NULL); - RNA_def_property_struct_type(prop, "GameProperty"); /* rna_property.c */ - RNA_def_property_ui_text(prop, "Properties", "Game engine properties"); - - prop = RNA_def_property(srna, "show_sensors", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSENS); - RNA_def_property_ui_text(prop, "Show Sensors", "Shows sensors for this object in the user interface"); - - prop = RNA_def_property(srna, "show_controllers", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWCONT); - RNA_def_property_ui_text(prop, "Show Controllers", "Shows controllers for this object in the user interface"); - - prop = RNA_def_property(srna, "show_actuators", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWACT); - RNA_def_property_ui_text(prop, "Show Actuators", "Shows actuators for this object in the user interface"); - - /* physics */ - - prop = RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "body_type"); - RNA_def_property_enum_items(prop, body_type_items); - RNA_def_property_enum_default(prop, OB_BODY_TYPE_STATIC); - RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", - "rna_GameObjectSettings_physics_type_set", NULL); - RNA_def_property_ui_text(prop, "Physics Type", "Select the type of physical representation"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_record_animation", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_RECORD_ANIMATION); - RNA_def_property_ui_text(prop, "Record Animation", "Record animation objects without physics"); - - prop = RNA_def_property(srna, "use_actor", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ACTOR); - RNA_def_property_ui_text(prop, "Actor", "Object is detected by the Near and Radar sensor"); - - prop = RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_GHOST); - RNA_def_property_ui_text(prop, "Ghost", "Object does not react to collisions, like a ghost"); - - prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.01, 10000.0); - RNA_def_property_float_default(prop, 1.0f); - RNA_def_property_ui_text(prop, "Mass", "Mass of the object"); - - prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); - RNA_def_property_float_sdna(prop, NULL, "inertia"); - RNA_def_property_range(prop, 0.01f, FLT_MAX); - RNA_def_property_ui_range(prop, 0.01f, 10.0f, 1, 3); - RNA_def_property_float_default(prop, 1.0f); - RNA_def_property_ui_text(prop, "Radius", "Radius of bounding sphere and material physics"); - RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - - prop = RNA_def_property(srna, "use_sleep", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_COLLISION_RESPONSE); - RNA_def_property_ui_text(prop, "No Sleeping", "Disable auto (de)activation in physics simulation"); - - prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "damping"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_float_default(prop, 0.04f); - RNA_def_property_ui_text(prop, "Damping", "General movement damping"); - - prop = RNA_def_property(srna, "rotation_damping", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "rdamping"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_float_default(prop, 0.1f); - RNA_def_property_ui_text(prop, "Rotation Damping", "General rotation damping"); - - prop = RNA_def_property(srna, "velocity_min", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "min_vel"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_ui_text(prop, "Velocity Min", "Clamp velocity to this minimum speed (except when totally still), " - "in distance per second"); - - prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "max_vel"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_ui_text(prop, "Velocity Max", "Clamp velocity to this maximum speed, " - "in distance per second"); - - prop = RNA_def_property(srna, "angular_velocity_min", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "min_angvel"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_ui_text(prop, "Angular Velocity Min", - "Clamp angular velocity to this minimum speed (except when totally still), " - "in angle per second"); - - prop = RNA_def_property(srna, "angular_velocity_max", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "max_angvel"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_ui_text(prop, "Angular Velocity Max", "Clamp angular velocity to this maximum speed, " - "in angle per second"); - - /* Character physics */ - prop = RNA_def_property(srna, "step_height", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "step_height"); - RNA_def_property_range(prop, 0.01, 1.0); - RNA_def_property_float_default(prop, 0.15f); - RNA_def_property_ui_text(prop, "Step Height", "Maximum height of steps the character can run over"); - - prop = RNA_def_property(srna, "jump_speed", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "jump_speed"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_float_default(prop, 10.0f); - RNA_def_property_ui_text(prop, "Jump Force", "Upward velocity applied to the character when jumping"); - - prop = RNA_def_property(srna, "fall_speed", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "fall_speed"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_float_default(prop, 55.0f); - RNA_def_property_ui_text(prop, "Fall Speed Max", "Maximum speed at which the character will fall"); - - prop = RNA_def_property(srna, "jump_max", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "max_jumps"); - RNA_def_property_range(prop, 1, CHAR_MAX); - RNA_def_property_ui_range(prop, 1, 10, 1, 1); - RNA_def_property_int_default(prop, 1); - RNA_def_property_ui_text(prop, "Max Jumps", - "The maximum number of jumps the character can make before it hits the ground"); - - /* Collision Masks */ - prop = RNA_def_property(srna, "collision_group", PROP_BOOLEAN, PROP_LAYER_MEMBER); - RNA_def_property_boolean_sdna(prop, NULL, "col_group", 1); - RNA_def_property_array(prop, OB_MAX_COL_MASKS); - RNA_def_property_ui_text(prop, "Collision Group", "The collision group of the object"); - RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_col_group_get", "rna_GameObjectSettings_col_group_set"); - - prop = RNA_def_property(srna, "collision_mask", PROP_BOOLEAN, PROP_LAYER_MEMBER); - RNA_def_property_boolean_sdna(prop, NULL, "col_mask", 1); - RNA_def_property_array(prop, OB_MAX_COL_MASKS); - RNA_def_property_ui_text(prop, "Collision Mask", "The groups this object can collide with"); - RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_col_mask_get", "rna_GameObjectSettings_col_mask_set"); - - /* lock position */ - prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_AXIS); - RNA_def_property_ui_text(prop, "Lock X Axis", "Disable simulation of linear motion along the X axis"); - - prop = RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_AXIS); - RNA_def_property_ui_text(prop, "Lock Y Axis", "Disable simulation of linear motion along the Y axis"); - - prop = RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_AXIS); - RNA_def_property_ui_text(prop, "Lock Z Axis", "Disable simulation of linear motion along the Z axis"); - - - /* lock rotation */ - prop = RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_ROT_AXIS); - RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis"); - - prop = RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_ROT_AXIS); - RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis"); - - prop = RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_ROT_AXIS); - RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis"); - - /* is this used anywhere ? */ - prop = RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflag2", OB_NEVER_DO_ACTIVITY_CULLING); - RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis"); - - - prop = RNA_def_property(srna, "use_material_physics_fh", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH); - RNA_def_property_ui_text(prop, "Use Material Force Field", "React to force field physics settings in materials"); - - prop = RNA_def_property(srna, "use_rotate_from_normal", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH); - RNA_def_property_ui_text(prop, "Rotate From Normal", - "Use face normal to rotate object, so that it points away from the surface"); - - prop = RNA_def_property(srna, "form_factor", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "formfactor"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_float_default(prop, 0.4f); - RNA_def_property_ui_text(prop, "Form Factor", "Form factor scales the inertia tensor"); - - prop = RNA_def_property(srna, "use_anisotropic_friction", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ANISOTROPIC_FRICTION); - RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable anisotropic friction"); - - prop = RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Friction Coefficients", - "Relative friction coefficients in the in the X, Y and Z directions, " - "when anisotropic friction is enabled"); - - prop = RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS); - RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default"); - RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - - prop = RNA_def_property(srna, "collision_bounds_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "collision_boundtype"); - RNA_def_property_enum_items(prop, collision_bounds_items); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf"); - RNA_def_property_ui_text(prop, "Collision Shape", "Select the collision shape that better fits the object"); - RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - - prop = RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD); - RNA_def_property_ui_text(prop, "Collision Compound", "Add children to form a compound collision object"); - - prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); - RNA_def_property_float_sdna(prop, NULL, "margin"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_float_default(prop, 0.04f); - RNA_def_property_ui_text(prop, "Collision Margin", - "Extra margin around object for collision detection, small amount required " - "for stability"); - - prop = RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "bsoft"); - RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for Bullet soft body simulation"); - - prop = RNA_def_property(srna, "use_obstacle_create", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_HASOBSTACLE); - RNA_def_property_ui_text(prop, "Create obstacle", "Create representation for obstacle simulation"); - - prop = RNA_def_property(srna, "obstacle_radius", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); - RNA_def_property_float_sdna(prop, NULL, "obstacleRad"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_float_default(prop, 1.0f); - RNA_def_property_ui_text(prop, "Obstacle Radius", "Radius of object representation in obstacle simulation"); - - /* state */ - - prop = RNA_def_property(srna, "states_visible", PROP_BOOLEAN, PROP_LAYER_MEMBER); - RNA_def_property_boolean_sdna(prop, NULL, "state", 1); - RNA_def_property_array(prop, OB_MAX_STATES); - RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed"); - RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_state_get", "rna_GameObjectSettings_state_set"); - - prop = RNA_def_property(srna, "used_states", PROP_BOOLEAN, PROP_LAYER_MEMBER); - RNA_def_property_array(prop, OB_MAX_STATES); - RNA_def_property_ui_text(prop, "Used State", "States which are being used by controllers"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_used_state_get", NULL); - - prop = RNA_def_property(srna, "states_initial", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "init_state", 1); - RNA_def_property_array(prop, OB_MAX_STATES); - RNA_def_property_ui_text(prop, "Initial State", "Initial state when the game starts"); - - prop = RNA_def_property(srna, "show_debug_state", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_DEBUGSTATE); - RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine"); - RNA_def_property_ui_icon(prop, ICON_INFO, 0); - - prop = RNA_def_property(srna, "use_all_states", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_ALLSTATE); - RNA_def_property_ui_text(prop, "All", "Set all state bits"); - - prop = RNA_def_property(srna, "show_state_panel", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSTATE); - RNA_def_property_ui_text(prop, "States", "Show state panel"); - RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); -} - static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; @@ -2312,54 +1727,6 @@ static void rna_def_object_face_maps(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Delete all vertex groups from object"); } -static void rna_def_object_lodlevel(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "LodLevel", NULL); - RNA_def_struct_sdna(srna, "LodLevel"); - - prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "distance"); - RNA_def_property_range(prop, 0.0, FLT_MAX); - RNA_def_property_ui_text(prop, "Distance", "Distance to begin using this level of detail"); - RNA_def_property_update(prop, NC_OBJECT | ND_LOD, "rna_Object_lod_distance_update"); - - prop = RNA_def_property(srna, "object_hysteresis_percentage", PROP_INT, PROP_PERCENTAGE); - RNA_def_property_int_sdna(prop, NULL, "obhysteresis"); - RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_range(prop, 0, 100, 10, 1); - RNA_def_property_ui_text(prop, "Hysteresis %", - "Minimum distance change required to transition to the previous level of detail"); - RNA_def_property_update(prop, NC_OBJECT | ND_LOD, NULL); - - prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "source"); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Object", "Object to use for this level of detail"); - RNA_def_property_update(prop, NC_OBJECT | ND_LOD, NULL); - - prop = RNA_def_property(srna, "use_mesh", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", OB_LOD_USE_MESH); - RNA_def_property_ui_text(prop, "Use Mesh", "Use the mesh from this object at this level of detail"); - RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0); - RNA_def_property_update(prop, NC_OBJECT | ND_LOD, NULL); - - prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", OB_LOD_USE_MAT); - RNA_def_property_ui_text(prop, "Use Material", "Use the material from this object at this level of detail"); - RNA_def_property_ui_icon(prop, ICON_MATERIAL, 0); - RNA_def_property_update(prop, NC_OBJECT | ND_LOD, NULL); - - prop = RNA_def_property(srna, "use_object_hysteresis", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", OB_LOD_USE_HYST); - RNA_def_property_ui_text(prop, "Hysteresis Override", "Override LoD Hysteresis scene setting for this LoD level"); - RNA_def_property_update(prop, NC_OBJECT | ND_LOD, NULL); -} - - static void rna_def_object(BlenderRNA *brna) { StructRNA *srna; @@ -2710,13 +2077,6 @@ static void rna_def_object(BlenderRNA *brna) /* RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "constraints__add", "constraints__remove"); */ rna_def_object_constraints(brna, prop); - /* game engine */ - prop = RNA_def_property(srna, "game", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "GameObjectSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL, NULL); - RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object"); - /* vertex groups */ prop = RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL); @@ -3040,13 +2400,6 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Dynamic Topology Sculpting", NULL); - /* Levels of Detail */ - prop = RNA_def_property(srna, "lod_levels", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "lodlevels", NULL); - RNA_def_property_struct_type(prop, "LodLevel"); - RNA_def_property_ui_text(prop, "Level of Detail Levels", "A collection of detail levels to automatically switch between"); - RNA_def_property_update(prop, NC_OBJECT | ND_LOD, NULL); - /* Base Settings */ prop = RNA_def_property(srna, "is_from_duplicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "base_flag", BASE_FROMDUPLI); @@ -3124,13 +2477,11 @@ void RNA_def_object(BlenderRNA *brna) rna_def_object(brna); RNA_define_animate_sdna(false); - rna_def_object_game_settings(brna); rna_def_vertex_group(brna); rna_def_face_map(brna); rna_def_material_slot(brna); rna_def_dupli_object(brna); RNA_define_animate_sdna(true); - rna_def_object_lodlevel(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 7d062d41e4f..3a61accfad3 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1459,78 +1459,6 @@ static void rna_def_field(BlenderRNA *brna) /* falloff_power, use_max_distance, maximum_distance */ } -static void rna_def_game_softbody(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "GameSoftBodySettings", NULL); - RNA_def_struct_sdna(srna, "BulletSoftBody"); - RNA_def_struct_ui_text(srna, "Game Soft Body Settings", - "Soft body simulation settings for an object in the game engine"); - - /* Floats */ - - prop = RNA_def_property(srna, "linear_stiffness", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "linStiff"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Linear Stiffness", "Linear stiffness of the soft body links"); - - prop = RNA_def_property(srna, "dynamic_friction", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "kDF"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Friction", "Dynamic Friction"); - - prop = RNA_def_property(srna, "shape_threshold", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "kMT"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Threshold", "Shape matching threshold"); - - prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "margin"); - RNA_def_property_range(prop, 0.01f, 1.0f); - RNA_def_property_ui_text(prop, "Margin", - "Collision margin for soft body. Small value makes the algorithm unstable"); - - prop = RNA_def_property(srna, "weld_threshold", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "welding"); - RNA_def_property_range(prop, 0.0f, 0.01f); - RNA_def_property_ui_text(prop, "Welding", - "Welding threshold: distance between nearby vertices to be considered equal " - "=> set to 0.0 to disable welding test and speed up scene loading " - "(ok if the mesh has no duplicates)"); - - /* Integers */ - - prop = RNA_def_property(srna, "location_iterations", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "piterations"); - RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Position Iterations", "Position solver iterations"); - - prop = RNA_def_property(srna, "cluster_iterations", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "numclusteriterations"); - RNA_def_property_range(prop, 1, 128); - RNA_def_property_ui_text(prop, "Cluster Iterations", "Number of cluster iterations"); - - /* Booleans */ - - prop = RNA_def_property(srna, "use_shape_match", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_SHAPE_MATCHING); - RNA_def_property_ui_text(prop, "Shape Match", "Enable soft body shape matching goal"); - - prop = RNA_def_property(srna, "use_bending_constraints", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_BENDING_CONSTRAINTS); - RNA_def_property_ui_text(prop, "Bending Const", "Enable bending constraints"); - - prop = RNA_def_property(srna, "use_cluster_rigid_to_softbody", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_RS); - RNA_def_property_ui_text(prop, "Rigid to Soft Body", "Enable cluster collision between soft and rigid body"); - - prop = RNA_def_property(srna, "use_cluster_soft_to_softbody", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_SS); - RNA_def_property_ui_text(prop, "Soft to Soft Body", "Enable cluster collision between soft and soft body"); -} - static void rna_def_softbody(BlenderRNA *brna) { StructRNA *srna; @@ -1851,7 +1779,6 @@ void RNA_def_object_force(BlenderRNA *brna) rna_def_collision(brna); rna_def_effector_weight(brna); rna_def_field(brna); - rna_def_game_softbody(brna); rna_def_softbody(brna); } diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c deleted file mode 100644 index 7ee792b5d1f..00000000000 --- a/source/blender/makesrna/intern/rna_property.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributor(s): Blender Foundation (2008). - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/makesrna/intern/rna_property.c - * \ingroup RNA - */ - - -#include <stdlib.h> - -#include "DNA_property_types.h" -#include "DNA_object_types.h" - -#include "BLI_path_util.h" -#include "BLI_string_utils.h" - -#include "BLT_translation.h" - -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - - -#include "WM_types.h" - -const EnumPropertyItem rna_enum_gameproperty_type_items[] = { - {GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"}, - {GPROP_INT, "INT", 0, "Integer", "Integer Property"}, - {GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"}, - {GPROP_STRING, "STRING", 0, "String", "String Property"}, - {GPROP_TIME, "TIMER", 0, "Timer", "Timer Property"}, - {0, NULL, 0, NULL, NULL} -}; - - -#ifdef RNA_RUNTIME - -#include "BKE_property.h" - -static StructRNA *rna_GameProperty_refine(struct PointerRNA *ptr) -{ - bProperty *property = (bProperty *)ptr->data; - - switch (property->type) { - case GPROP_BOOL: - return &RNA_GameBooleanProperty; - case GPROP_INT: - return &RNA_GameIntProperty; - case GPROP_FLOAT: - return &RNA_GameFloatProperty; - case GPROP_STRING: - return &RNA_GameStringProperty; - case GPROP_TIME: - return &RNA_GameTimerProperty; - default: - return &RNA_GameProperty; - } -} - -/* for both float and timer */ -static float rna_GameFloatProperty_value_get(PointerRNA *ptr) -{ - bProperty *prop = (bProperty *)(ptr->data); - return *(float *)(&prop->data); -} - -static void rna_GameFloatProperty_value_set(PointerRNA *ptr, float value) -{ - bProperty *prop = (bProperty *)(ptr->data); - CLAMP(value, -10000.0f, 10000.0f); - *(float *)(&prop->data) = value; -} - -static void rna_GameProperty_type_set(PointerRNA *ptr, int value) -{ - bProperty *prop = (bProperty *)(ptr->data); - - if (prop->type != value) { - prop->type = value; - BKE_bproperty_init(prop); - } -} - -static void rna_GameProperty_name_set(PointerRNA *ptr, const char *value) -{ - Object *ob = ptr->id.data; - bProperty *prop = ptr->data; - BLI_strncpy_utf8(prop->name, value, sizeof(prop->name)); - - BLI_uniquename(&ob->prop, prop, DATA_("Property"), '.', offsetof(bProperty, name), sizeof(prop->name)); -} - - -#else - -void RNA_def_gameproperty(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - /* Base Struct for GameProperty */ - srna = RNA_def_struct(brna, "GameProperty", NULL); - RNA_def_struct_ui_text(srna, "Game Property", "Game engine user defined object property"); - RNA_def_struct_sdna(srna, "bProperty"); - RNA_def_struct_refine_func(srna, "rna_GameProperty_refine"); - - prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Name", "Available as GameObject attributes in the game engine's python API"); - RNA_def_struct_name_property(srna, prop); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GameProperty_name_set"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_enum_gameproperty_type_items); - RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_enum_funcs(prop, NULL, "rna_GameProperty_type_set", NULL); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG); - RNA_def_property_ui_text(prop, "Debug", "Print debug information for this property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* GameBooleanProperty */ - srna = RNA_def_struct(brna, "GameBooleanProperty", "GameProperty"); - RNA_def_struct_ui_text(srna, "Game Boolean Property", "Game engine user defined Boolean property"); - RNA_def_struct_sdna(srna, "bProperty"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "data", 1); - RNA_def_property_ui_text(prop, "Value", "Property value"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* GameIntProperty */ - srna = RNA_def_struct(brna, "GameIntProperty", "GameProperty"); - RNA_def_struct_ui_text(srna, "Game Integer Property", "Game engine user defined integer number property"); - RNA_def_struct_sdna(srna, "bProperty"); - - prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "data"); - RNA_def_property_ui_text(prop, "Value", "Property value"); - RNA_def_property_range(prop, -10000, 10000); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* GameFloatProperty */ - srna = RNA_def_struct(brna, "GameFloatProperty", "GameProperty"); - RNA_def_struct_ui_text(srna, "Game Float Property", "Game engine user defined floating point number property"); - RNA_def_struct_sdna(srna, "bProperty"); - - prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); - /* RNA_def_property_float_sdna(prop, NULL, "data"); */ - RNA_def_property_ui_text(prop, "Value", "Property value"); - RNA_def_property_range(prop, -10000, 10000); - RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* GameTimerProperty */ - srna = RNA_def_struct(brna, "GameTimerProperty", "GameProperty"); - RNA_def_struct_ui_text(srna, "Game Timer Property", "Game engine user defined timer property"); - RNA_def_struct_sdna(srna, "bProperty"); - - prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); - /* RNA_def_property_float_sdna(prop, NULL, "data"); */ - RNA_def_property_ui_text(prop, "Value", "Property value"); - RNA_def_property_range(prop, -10000, 10000); - RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* GameStringProperty */ - srna = RNA_def_struct(brna, "GameStringProperty", "GameProperty"); - RNA_def_struct_ui_text(srna, "Game String Property", "Game engine user defined text string property"); - RNA_def_struct_sdna(srna, "bProperty"); - - prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "poin"); - RNA_def_property_string_maxlength(prop, MAX_PROPSTRING); - RNA_def_property_ui_text(prop, "Value", "Property value"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -#endif - diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1032acbae67..2e842687831 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1627,27 +1627,6 @@ static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value) } } -static int rna_GameSettings_auto_start_get(PointerRNA *UNUSED(ptr)) -{ - return (G.fileflags & G_FILE_AUTOPLAY) != 0; -} - -static void rna_GameSettings_auto_start_set(PointerRNA *UNUSED(ptr), int value) -{ - if (value) - G.fileflags |= G_FILE_AUTOPLAY; - else - G.fileflags &= ~G_FILE_AUTOPLAY; -} - -static void rna_GameSettings_exit_key_set(PointerRNA *ptr, int value) -{ - GameData *gm = (GameData *)ptr->data; - - if (ISKEYBOARD(value)) - gm->exitkey = value; -} - static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[], int frame) { TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker"); @@ -3941,124 +3920,6 @@ void rna_def_freestyle_settings(BlenderRNA *brna) rna_def_freestyle_linesets(brna, prop); } -static void rna_def_scene_game_recast_data(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem rna_enum_partitioning_items[] = { - {RC_PARTITION_WATERSHED, "WATERSHED", 0, "Watershed", "Classic Recast partitioning method generating the nicest tessellation"}, - {RC_PARTITION_MONOTONE, "MONOTONE", 0, "Monotone", "Fastest navmesh generation method, may create long thin polygons"}, - {RC_PARTITION_LAYERS, "LAYERS", 0, "Layers", "Reasonably fast method that produces better triangles than monotone partitioning"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "SceneGameRecastData", NULL); - RNA_def_struct_sdna(srna, "RecastData"); - RNA_def_struct_nested(brna, srna, "Scene"); - RNA_def_struct_ui_text(srna, "Recast Data", "Recast data for a Game data-block"); - - prop = RNA_def_property(srna, "cell_size", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "cellsize"); - RNA_def_property_ui_range(prop, 0.1, 1, 1, 2); - RNA_def_property_float_default(prop, 0.3f); - RNA_def_property_ui_text(prop, "Cell Size", "Rasterized cell size"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "cell_height", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "cellheight"); - RNA_def_property_ui_range(prop, 0.1, 1, 1, 2); - RNA_def_property_float_default(prop, 0.2f); - RNA_def_property_ui_text(prop, "Cell Height", "Rasterized cell height"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "agent_height", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "agentheight"); - RNA_def_property_ui_range(prop, 0.1, 5, 1, 2); - RNA_def_property_float_default(prop, 2.0f); - RNA_def_property_ui_text(prop, "Agent Height", "Minimum height where the agent can still walk"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "agent_radius", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "agentradius"); - RNA_def_property_ui_range(prop, 0.1, 5, 1, 2); - RNA_def_property_float_default(prop, 0.6f); - RNA_def_property_ui_text(prop, "Agent Radius", "Radius of the agent"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "climb_max", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "agentmaxclimb"); - RNA_def_property_ui_range(prop, 0.1, 5, 1, 2); - RNA_def_property_float_default(prop, 0.9f); - RNA_def_property_ui_text(prop, "Max Climb", "Maximum height between grid cells the agent can climb"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "slope_max", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_float_sdna(prop, NULL, "agentmaxslope"); - RNA_def_property_range(prop, 0, M_PI_2); - RNA_def_property_float_default(prop, M_PI_4); - RNA_def_property_ui_text(prop, "Max Slope", "Maximum walkable slope angle"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - - prop = RNA_def_property(srna, "region_min_size", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "regionminsize"); - RNA_def_property_ui_range(prop, 0, 150, 1, 2); - RNA_def_property_float_default(prop, 8.0f); - RNA_def_property_ui_text(prop, "Min Region Size", "Minimum regions size (smaller regions will be deleted)"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "region_merge_size", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "regionmergesize"); - RNA_def_property_ui_range(prop, 0, 150, 1, 2); - RNA_def_property_float_default(prop, 20.0f); - RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size (smaller regions will be merged)"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "partitioning", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "partitioning"); - RNA_def_property_enum_items(prop, rna_enum_partitioning_items); - RNA_def_property_enum_default(prop, RC_PARTITION_WATERSHED); - RNA_def_property_ui_text(prop, "Partitioning", "Choose partitioning method"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "edge_max_len", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "edgemaxlen"); - RNA_def_property_ui_range(prop, 0, 50, 1, 2); - RNA_def_property_float_default(prop, 12.0f); - RNA_def_property_ui_text(prop, "Max Edge Length", "Maximum contour edge length"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "edge_max_error", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "edgemaxerror"); - RNA_def_property_ui_range(prop, 0.1, 3.0, 1, 2); - RNA_def_property_float_default(prop, 1.3f); - RNA_def_property_ui_text(prop, "Max Edge Error", "Maximum distance error from contour to cells"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "verts_per_poly", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "vertsperpoly"); - RNA_def_property_ui_range(prop, 3, 12, 1, -1); - RNA_def_property_int_default(prop, 6); - RNA_def_property_ui_text(prop, "Verts Per Poly", "Max number of vertices per polygon"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "sample_dist", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "detailsampledist"); - RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2); - RNA_def_property_float_default(prop, 6.0f); - RNA_def_property_ui_text(prop, "Sample Distance", "Detail mesh sample spacing"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "sample_max_error", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "detailsamplemaxerror"); - RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2); - RNA_def_property_float_default(prop, 1.0f); - RNA_def_property_ui_text(prop, "Max Sample Error", "Detail mesh simplification max sample error"); - RNA_def_property_update(prop, NC_SCENE, NULL); -} - - static void rna_def_bake_data(BlenderRNA *brna) { StructRNA *srna; @@ -4222,493 +4083,6 @@ static void rna_def_bake_data(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); } -static void rna_def_scene_game_data(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem aasamples_items[] = { - {0, "SAMPLES_0", 0, "Off", ""}, - {2, "SAMPLES_2", 0, "2x", ""}, - {4, "SAMPLES_4", 0, "4x", ""}, - {8, "SAMPLES_8", 0, "8x", ""}, - {16, "SAMPLES_16", 0, "16x", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem framing_types_items[] = { - {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", - "Show the entire viewport in the display window, using bar horizontally or vertically"}, - {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", - "Show the entire viewport in the display window, viewing more horizontally " - "or vertically"}, - {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem dome_modes_items[] = { - {DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""}, - {DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""}, - {DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""}, - {DOME_ENVMAP, "ENVMAP", 0, "Cube Map", ""}, - {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem stereo_modes_items[] = { - {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""}, - {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""}, - {STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""}, - {STEREO_ANAGLYPH, "ANAGLYPH", 0, "Anaglyph", ""}, - {STEREO_SIDEBYSIDE, "SIDEBYSIDE", 0, "Side-by-side", ""}, - {STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""}, - {STEREO_3DTVTOPBOTTOM, "3DTVTOPBOTTOM", 0, "3DTV Top-Bottom", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem stereo_items[] = { - {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"}, - {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"}, - {STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem physics_engine_items[] = { - {WOPHY_NONE, "NONE", 0, "None", "Don't use a physics engine"}, - {WOPHY_BULLET, "BULLET", 0, "Bullet", "Use the Bullet physics engine"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem material_items[] = { - {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"}, - {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem obstacle_simulation_items[] = { - {OBSTSIMULATION_NONE, "NONE", 0, "None", ""}, - {OBSTSIMULATION_TOI_rays, "RVO_RAYS", 0, "RVO (rays)", ""}, - {OBSTSIMULATION_TOI_cells, "RVO_CELLS", 0, "RVO (cells)", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem vsync_items[] = { - {VSYNC_OFF, "OFF", 0, "Off", "Disable vsync"}, - {VSYNC_ON, "ON", 0, "On", "Enable vsync"}, - {VSYNC_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", "Enable adaptive vsync (if supported)"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem storage_items[] = { - {RAS_STORE_AUTO, "AUTO", 0, "Auto Select", "Choose the best supported mode"}, - {RAS_STORE_VA, "VERTEX_ARRAY", 0, "Vertex Arrays", "Usually the best choice (good performance with display lists)"}, - {RAS_STORE_VBO, "VERTEX_BUFFER_OBJECT", 0, "Vertex Buffer Objects", - "Typically slower than vertex arrays with display lists, requires at least OpenGL 1.4"}, - {0, NULL, 0, NULL, NULL}}; - - srna = RNA_def_struct(brna, "SceneGameData", NULL); - RNA_def_struct_sdna(srna, "GameData"); - RNA_def_struct_nested(brna, srna, "Scene"); - RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene data-block"); - - prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL); - RNA_def_property_int_sdna(prop, NULL, "xplay"); - RNA_def_property_range(prop, 4, 10000); - RNA_def_property_int_default(prop, 640); - RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL); - RNA_def_property_int_sdna(prop, NULL, "yplay"); - RNA_def_property_range(prop, 4, 10000); - RNA_def_property_int_default(prop, 480); - RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "vsync", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "vsync"); - RNA_def_property_enum_items(prop, vsync_items); - RNA_def_property_ui_text(prop, "Vsync", "Change vsync settings"); - - prop = RNA_def_property(srna, "samples", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "aasamples"); - RNA_def_property_enum_items(prop, aasamples_items); - RNA_def_property_ui_text(prop, "AA Samples", "The number of AA Samples to use for MSAA"); - - prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_sdna(prop, NULL, "depth"); - RNA_def_property_range(prop, 8, 32); - RNA_def_property_int_default(prop, 32); - RNA_def_property_ui_text(prop, "Bits", "Display bit depth of full screen display"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "exit_key", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "exitkey"); - RNA_def_property_enum_items(prop, rna_enum_event_type_items); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UI_EVENTS); - RNA_def_property_enum_default(prop, ESCKEY); - RNA_def_property_enum_funcs(prop, NULL, "rna_GameSettings_exit_key_set", NULL); - RNA_def_property_ui_text(prop, "Exit Key", "The key that exits the Game Engine"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "raster_storage", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "raster_storage"); - RNA_def_property_enum_items(prop, storage_items); - RNA_def_property_ui_text(prop, "Storage", "Set the storage mode used by the rasterizer"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - /* Do we need it here ? (since we already have it in World */ - prop = RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "freqplay"); - RNA_def_property_range(prop, 4, 2000); - RNA_def_property_int_default(prop, 60); - RNA_def_property_ui_text(prop, "Freq", "Display clock frequency of fullscreen display"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_FULLSCREEN); - RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "use_desktop", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_DESKTOP_RESOLUTION); - RNA_def_property_ui_text(prop, "Desktop", "Use the current desktop resolution in fullscreen mode"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - /* Framing */ - prop = RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "framing.type"); - RNA_def_property_enum_items(prop, framing_types_items); - RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR); - RNA_def_property_float_sdna(prop, NULL, "framing.col"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Framing Color", "Set color of the bars"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - /* Stereo */ - prop = RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "stereoflag"); - RNA_def_property_enum_items(prop, stereo_items); - RNA_def_property_ui_text(prop, "Stereo Options", ""); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "stereomode"); - RNA_def_property_enum_items(prop, stereo_modes_items); - RNA_def_property_enum_default(prop, STEREO_ANAGLYPH); - RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "eyeseparation"); - RNA_def_property_range(prop, 0.01, 5.0); - RNA_def_property_float_default(prop, 0.1f); - RNA_def_property_ui_text(prop, "Eye Separation", - "Set the distance between the eyes - the camera focal distance/30 should be fine"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - /* Dome */ - prop = RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "dome.mode"); - RNA_def_property_enum_items(prop, dome_modes_items); - RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "dome_tessellation", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "dome.res"); - RNA_def_property_ui_range(prop, 1, 8, 1, 1); - RNA_def_property_int_default(prop, 4); - RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "dome.resbuf"); - RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 2); - RNA_def_property_float_default(prop, 1.0f); - RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "dome.angle"); - RNA_def_property_ui_range(prop, 90, 250, 1, 1); - RNA_def_property_int_default(prop, 180); - RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "dome.tilt"); - RNA_def_property_ui_range(prop, -180, 180, 1, 1); - RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext"); - RNA_def_property_struct_type(prop, "Text"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - /* physics */ - prop = RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "physicsEngine"); - RNA_def_property_enum_items(prop, physics_engine_items); - RNA_def_property_enum_default(prop, WOPHY_BULLET); - RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION); - RNA_def_property_float_sdna(prop, NULL, "gravity"); - RNA_def_property_ui_range(prop, 0.0, 25.0, 1, 2); - RNA_def_property_range(prop, 0.0, 10000.0); - RNA_def_property_float_default(prop, 9.8f); - RNA_def_property_ui_text(prop, "Physics Gravity", - "Gravitational constant used for physics simulation in the game engine"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_PIXEL); - RNA_def_property_int_sdna(prop, NULL, "occlusionRes"); - RNA_def_property_range(prop, 128.0, 1024.0); - RNA_def_property_int_default(prop, 128); - RNA_def_property_ui_text(prop, "Occlusion Resolution", - "Size of the occlusion buffer, use higher value for better precision (slower)"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ticrate"); - RNA_def_property_ui_range(prop, 1, 60, 1, 1); - RNA_def_property_range(prop, 1, 10000); - RNA_def_property_int_default(prop, 60); - RNA_def_property_ui_text(prop, "Frames Per Second", - "Nominal number of game frames per second " - "(physics fixed timestep = 1/fps, independently of actual frame rate)"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "maxlogicstep"); - RNA_def_property_range(prop, 1, 10000); - RNA_def_property_ui_range(prop, 1, 50, 1, 1); - RNA_def_property_int_default(prop, 5); - RNA_def_property_ui_text(prop, "Max Logic Steps", - "Maximum number of logic frame per game frame if graphics slows down the game, " - "higher value allows better synchronization with physics"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "maxphystep"); - RNA_def_property_range(prop, 1, 10000); - RNA_def_property_ui_range(prop, 1, 50, 1, 1); - RNA_def_property_int_default(prop, 5); - RNA_def_property_ui_text(prop, "Max Physics Steps", - "Maximum number of physics step per game frame if graphics slows down the game, " - "higher value allows physics to keep up with realtime"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "physubstep"); - RNA_def_property_range(prop, 1, 50); - RNA_def_property_ui_range(prop, 1, 5, 1, 1); - RNA_def_property_int_default(prop, 1); - RNA_def_property_ui_text(prop, "Physics Sub Steps", - "Number of simulation substep per physic timestep, " - "higher value give better physics precision"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "deactivation_linear_threshold", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "lineardeactthreshold"); - RNA_def_property_ui_range(prop, 0.001, 10000.0, 2, 3); - RNA_def_property_range(prop, 0.001, 10000.0); - RNA_def_property_float_default(prop, 0.8f); - RNA_def_property_ui_text(prop, "Deactivation Linear Threshold", - "Linear velocity that an object must be below before the deactivation timer can start"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "deactivation_angular_threshold", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "angulardeactthreshold"); - RNA_def_property_ui_range(prop, 0.001, 10000.0, 2, 3); - RNA_def_property_range(prop, 0.001, 10000.0); - RNA_def_property_float_default(prop, 1.0f); - RNA_def_property_ui_text(prop, "Deactivation Angular Threshold", - "Angular velocity that an object must be below before the deactivation timer can start"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "deactivation_time", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "deactivationtime"); - RNA_def_property_ui_range(prop, 0.0, 60.0, 1, 1); - RNA_def_property_range(prop, 0.0, 60.0); - RNA_def_property_ui_text(prop, "Deactivation Time", - "Amount of time (in seconds) after which objects with a velocity less than the given " - "threshold will deactivate (0.0 means no deactivation)"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - /* mode */ - /* not used *//* deprecated !!!!!!!!!!!!! */ - prop = RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_DBVT_CULLING); - RNA_def_property_ui_text(prop, "DBVT Culling", - "Use optimized Bullet DBVT tree for view frustum and occlusion culling (more efficient, " - "but it can waste unnecessary CPU if the scene doesn't have occluder objects)"); - - /* not used *//* deprecated !!!!!!!!!!!!! */ - prop = RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_ACTIVITY_CULLING); - RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled"); - - /* not used *//* deprecated !!!!!!!!!!!!! */ - prop = RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius"); - RNA_def_property_range(prop, 0.0, 1000.0); - RNA_def_property_ui_text(prop, "Box Radius", - "Radius of the activity bubble, in Manhattan length " - "(objects outside the box are activity-culled)"); - - /* booleans */ - prop = RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS); - RNA_def_property_ui_text(prop, "Show Debug Properties", - "Show properties marked for debugging while the game runs"); - - prop = RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE); - RNA_def_property_ui_text(prop, "Show Framerate and Profile", - "Show framerate and profiling information while the game runs"); - - prop = RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS); - RNA_def_property_ui_text(prop, "Show Physics Visualization", - "Show a visualization of physics bounds and interactions"); - - prop = RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_MOUSE); - RNA_def_property_ui_text(prop, "Show Mouse", "Start player with a visible mouse cursor"); - - prop = RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES); - RNA_def_property_ui_text(prop, "Use Frame Rate", - "Respect the frame rate from the Physics panel in the world properties " - "rather than rendering as many frames as possible"); - - prop = RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS); - RNA_def_property_ui_text(prop, "Deprecation Warnings", - "Print warnings when using deprecated features in the python API"); - - prop = RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD); - RNA_def_property_ui_text(prop, "Record Animation", "Record animation to F-Curves"); - - prop = RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set"); - RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time"); - - prop = RNA_def_property(srna, "use_restrict_animation_updates", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES); - RNA_def_property_ui_text(prop, "Restrict Animation Updates", - "Restrict the number of animation updates to the animation FPS (this is " - "better for performance, but can cause issues with smooth playback)"); - - /* materials */ - prop = RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "matmode"); - RNA_def_property_enum_items(prop, material_items); - RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, NULL); - - prop = RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS); - RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update"); - - prop = RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS); - RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update"); - - prop = RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS); - RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update"); - - prop = RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS); - RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update"); - - prop = RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES); - RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update"); - - prop = RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT); - RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update"); - - prop = RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX); - RNA_def_property_ui_text(prop, "GLSL Extra Textures", - "Use extra textures like normal or specular maps for GLSL rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update"); - - prop = RNA_def_property(srna, "use_glsl_environment_lighting", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_ENV_LIGHTING); - RNA_def_property_ui_text(prop, "GLSL Environment Lighting", "Use environment lighting for GLSL rendering"); - RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update"); - - prop = RNA_def_property(srna, "use_material_caching", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_NO_MATERIAL_CACHING); - RNA_def_property_ui_text(prop, "Use Material Caching", - "Cache materials in the converter (this is faster, but can cause problems with older " - "Singletexture and Multitexture games)"); - - /* obstacle simulation */ - prop = RNA_def_property(srna, "obstacle_simulation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "obstacleSimulation"); - RNA_def_property_enum_items(prop, obstacle_simulation_items); - RNA_def_property_ui_text(prop, "Obstacle simulation", "Simulation used for obstacle avoidance in the game engine"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "level_height", PROP_FLOAT, PROP_ACCELERATION); - RNA_def_property_float_sdna(prop, NULL, "levelHeight"); - RNA_def_property_range(prop, 0.0f, 200.0f); - RNA_def_property_float_default(prop, 2.0f); - RNA_def_property_ui_text(prop, "Level height", - "Max difference in heights of obstacles to enable their interaction"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "show_obstacle_simulation", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_OBSTACLE_SIMULATION); - RNA_def_property_ui_text(prop, "Visualization", "Enable debug visualization for obstacle simulation"); - - /* Recast Settings */ - prop = RNA_def_property(srna, "recast_data", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "recastData"); - RNA_def_property_struct_type(prop, "SceneGameRecastData"); - RNA_def_property_ui_text(prop, "Recast Data", ""); - - /* Nestled Data */ - rna_def_scene_game_recast_data(brna); - - /* LoD */ - prop = RNA_def_property(srna, "use_scene_hysteresis", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "lodflag", SCE_LOD_USE_HYST); - RNA_def_property_ui_text(prop, "Hysteresis", "Use LoD Hysteresis setting for the scene"); - RNA_def_property_update(prop, NC_SCENE, NULL); - - prop = RNA_def_property(srna, "scene_hysteresis_percentage", PROP_INT, PROP_PERCENTAGE); - RNA_def_property_int_sdna(prop, NULL, "scehysteresis"); - RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_range(prop, 0, 100, 10, 1); - RNA_def_property_int_default(prop, 10); - RNA_def_property_ui_text(prop, "Hysteresis %", - "Minimum distance change required to transition to the previous level of detail"); - RNA_def_property_update(prop, NC_SCENE, NULL); -} - static void rna_def_gpu_dof_fx(BlenderRNA *brna) { StructRNA *srna; @@ -6950,13 +6324,6 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE, NULL); RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL); - /* Game Settings */ - prop = RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "gm"); - RNA_def_property_struct_type(prop, "SceneGameData"); - RNA_def_property_ui_text(prop, "Game Data", ""); - /* Statistics */ func = RNA_def_function(srna, "statistics", "ED_info_stats_string"); parm = RNA_def_pointer(func, "view_layer", "ViewLayer", "", "Active layer"); @@ -7020,7 +6387,6 @@ void RNA_def_scene(BlenderRNA *brna) rna_def_statvis(brna); rna_def_unit_settings(brna); rna_def_scene_image_format_data(brna); - rna_def_scene_game_data(brna); rna_def_selected_uv_element(brna); rna_def_display_safe_areas(brna); RNA_define_animate_sdna(true); diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c deleted file mode 100644 index 735df471721..00000000000 --- a/source/blender/makesrna/intern/rna_sensor.c +++ /dev/null @@ -1,939 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributor(s): Blender Foundation (2008). - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/makesrna/intern/rna_sensor.c - * \ingroup RNA - */ - -#include <stdlib.h> - -#include "DNA_constraint_types.h" -#include "DNA_object_types.h" -#include "DNA_sensor_types.h" - -#include "BLI_utildefines.h" -#include "BLI_math.h" -#include "BLI_string_utils.h" - -#include "BLT_translation.h" - -#include "RNA_define.h" -#include "RNA_enum_types.h" -#include "RNA_access.h" - -#include "rna_internal.h" - -#include "WM_types.h" - -/* Always keep in alphabetical order */ -static const EnumPropertyItem sensor_type_items[] = { - {SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""}, - {SENS_ALWAYS, "ALWAYS", 0, "Always", ""}, - {SENS_ARMATURE, "ARMATURE", 0, "Armature", ""}, - {SENS_COLLISION, "COLLISION", 0, "Collision", ""}, - {SENS_DELAY, "DELAY", 0, "Delay", ""}, - {SENS_JOYSTICK, "JOYSTICK", 0, "Joystick", ""}, - {SENS_KEYBOARD, "KEYBOARD", 0, "Keyboard", ""}, - {SENS_MESSAGE, "MESSAGE", 0, "Message", ""}, - {SENS_MOUSE, "MOUSE", 0, "Mouse", ""}, - {SENS_NEAR, "NEAR", 0, "Near", ""}, - {SENS_PROPERTY, "PROPERTY", 0, "Property", ""}, - {SENS_RADAR, "RADAR", 0, "Radar", ""}, - {SENS_RANDOM, "RANDOM", 0, "Random", ""}, - {SENS_RAY, "RAY", 0, "Ray", ""}, - {0, NULL, 0, NULL, NULL} -}; - -#ifdef RNA_RUNTIME - -#include "BKE_sca.h" -#include "DNA_controller_types.h" - -static StructRNA *rna_Sensor_refine(struct PointerRNA *ptr) -{ - bSensor *sensor = (bSensor *)ptr->data; - - switch (sensor->type) { - case SENS_ALWAYS: - return &RNA_AlwaysSensor; - case SENS_NEAR: - return &RNA_NearSensor; - case SENS_KEYBOARD: - return &RNA_KeyboardSensor; - case SENS_PROPERTY: - return &RNA_PropertySensor; - case SENS_ARMATURE: - return &RNA_ArmatureSensor; - case SENS_MOUSE: - return &RNA_MouseSensor; - case SENS_COLLISION: - return &RNA_CollisionSensor; - case SENS_RADAR: - return &RNA_RadarSensor; - case SENS_RANDOM: - return &RNA_RandomSensor; - case SENS_RAY: - return &RNA_RaySensor; - case SENS_MESSAGE: - return &RNA_MessageSensor; - case SENS_JOYSTICK: - return &RNA_JoystickSensor; - case SENS_ACTUATOR: - return &RNA_ActuatorSensor; - case SENS_DELAY: - return &RNA_DelaySensor; - default: - return &RNA_Sensor; - } -} - -static void rna_Sensor_name_set(PointerRNA *ptr, const char *value) -{ - Object *ob = ptr->id.data; - bSensor *sens = ptr->data; - BLI_strncpy_utf8(sens->name, value, sizeof(sens->name)); - BLI_uniquename(&ob->sensors, sens, DATA_("Sensor"), '.', offsetof(bSensor, name), sizeof(sens->name)); -} - -static void rna_Sensor_type_set(struct PointerRNA *ptr, int value) -{ - bSensor *sens = (bSensor *)ptr->data; - if (value != sens->type) { - sens->type = value; - init_sensor(sens); - } -} - -/* Always keep in alphabetical order */ - -static void rna_Sensor_controllers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) -{ - bSensor *sens = (bSensor *)ptr->data; - rna_iterator_array_begin(iter, sens->links, sizeof(bController *), (int)sens->totlinks, 0, NULL); -} - -static int rna_Sensor_controllers_length(PointerRNA *ptr) -{ - bSensor *sens = (bSensor *)ptr->data; - return (int) sens->totlinks; -} - -const EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) -{ - EnumPropertyItem *item = NULL; - Object *ob = NULL; - int totitem = 0; - - if (ptr->type == &RNA_Sensor || RNA_struct_is_a(ptr->type, &RNA_Sensor)) { - ob = (Object *)ptr->id.data; - } - else { - /* can't use ob from ptr->id.data because that enum is also used by operators */ - ob = CTX_data_active_object(C); - } - - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ACTUATOR); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ALWAYS); - - if (ob != NULL) { - if (ob->type == OB_ARMATURE) { - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ARMATURE); - } - } - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_COLLISION); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_DELAY); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_JOYSTICK); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_KEYBOARD); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_MESSAGE); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_MOUSE); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_NEAR); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_PROPERTY); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_RADAR); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_RANDOM); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_RAY); - RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_TOUCH); - - RNA_enum_item_end(&item, &totitem); - *r_free = true; - - return item; -} - -static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value) -{ - bSensor *sens = (bSensor *)ptr->data; - bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; - - if (ISKEYBOARD(value)) - ks->key = value; - else - ks->key = 0; -} - -static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value) -{ - bSensor *sens = (bSensor *)ptr->data; - bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; - - if (ISKEYBOARD(value)) - ks->qual = value; - else - ks->qual = 0; -} - -static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value) -{ - bSensor *sens = (bSensor *)ptr->data; - bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; - - if (ISKEYBOARD(value)) - ks->qual2 = value; - else - ks->qual2 = 0; -} - -static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value) -{ - bSensor *sens = (bSensor *)ptr->data; - - sens->tap = value; - if (sens->tap == 1) - sens->level = 0; -} - -static void rna_Sensor_level_set(struct PointerRNA *ptr, int value) -{ - bSensor *sens = (bSensor *)ptr->data; - - sens->level = value; - if (sens->level == 1) - sens->tap = 0; -} - -static void rna_Sensor_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) -{ - bSensor *sens = (bSensor *)ptr->data; - bArmatureSensor *as = sens->data; - Object *ob = (Object *)ptr->id.data; - - char *posechannel = as->posechannel; - char *constraint = as->constraint; - - /* check that bone exist in the active object */ - if (ob->type == OB_ARMATURE && ob->pose) { - bPoseChannel *pchan; - bPose *pose = ob->pose; - for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { - if (STREQ(pchan->name, posechannel)) { - /* found it, now look for constraint channel */ - bConstraint *con; - for (con = pchan->constraints.first; con; con = con->next) { - if (STREQ(con->name, constraint)) { - /* found it, all ok */ - return; - } - } - /* didn't find constraint, make empty */ - constraint[0] = 0; - return; - } - } - } - /* didn't find any */ - posechannel[0] = 0; - constraint[0] = 0; -} -#else - -static void rna_def_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "Sensor", NULL); - RNA_def_struct_ui_text(srna, "Sensor", "Game engine logic brick to detect events"); - RNA_def_struct_sdna(srna, "bSensor"); - RNA_def_struct_refine_func(srna, "rna_Sensor_refine"); - - prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Name", "Sensor name"); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Sensor_name_set"); - RNA_def_struct_name_property(srna, prop); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_enum_items(prop, sensor_type_items); - RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_type_set", "rna_Sensor_type_itemf"); - RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_PIN); - RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller"); - RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SENS_DEACTIVATE); - RNA_def_property_ui_text(prop, "Active", "Set active state of the sensor"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_SHOW); - RNA_def_property_ui_text(prop, "Expanded", "Set sensor expanded in the user interface"); - RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Invert Output", "Invert the level(output) of this sensor"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_level", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "level", 1); - RNA_def_property_ui_text(prop, "Level", - "Level detector, trigger controllers of new states " - "(only applicable upon logic state transition)"); - RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_level_set"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_pulse_true_level", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_PULSE_REPEAT); - RNA_def_property_ui_text(prop, "Pulse True Level", "Activate TRUE level triggering (pulse mode)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_pulse_false_level", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_NEG_PULSE_MODE); - RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "tick_skip", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "freq"); - RNA_def_property_ui_text(prop, "Skip", - "Number of logic ticks skipped between 2 active pulses " - "(0 = pulse every logic tick, 1 = skip 1 logic tick between pulses, etc.)"); - RNA_def_property_range(prop, 0, 10000); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_tap", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "tap", 1); - RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_tap_set"); - RNA_def_property_ui_text(prop, "Tap", - "Trigger controllers only for an instant, even while the sensor remains true"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "links", NULL); - RNA_def_property_struct_type(prop, "Controller"); - RNA_def_property_ui_text(prop, "Controllers", "The list containing the controllers connected to the sensor"); - RNA_def_property_collection_funcs(prop, "rna_Sensor_controllers_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_dereference_get", - "rna_Sensor_controllers_length", NULL, NULL, NULL); - - - RNA_api_sensor(srna); -} - -static void rna_def_always_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - srna = RNA_def_struct(brna, "AlwaysSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Always Sensor", "Sensor to generate continuous pulses"); -} - -static void rna_def_near_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "NearSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Near Sensor", "Sensor to detect nearby objects"); - RNA_def_struct_sdna_from(srna, "bNearSensor", "data"); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "dist"); - RNA_def_property_ui_text(prop, "Distance", "Trigger distance"); - RNA_def_property_range(prop, 0.0f, 10000.0f); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "reset_distance", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "resetdist"); - RNA_def_property_ui_text(prop, "Reset Distance", "The distance where the sensor forgets the actor"); - RNA_def_property_range(prop, 0.0f, 10000.0f); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_mouse_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem mouse_event_items[] = { - {BL_SENS_MOUSE_LEFT_BUTTON, "LEFTCLICK", 0, "Left Button", ""}, - {BL_SENS_MOUSE_MIDDLE_BUTTON, "MIDDLECLICK", 0, "Middle Button", ""}, - {BL_SENS_MOUSE_RIGHT_BUTTON, "RIGHTCLICK", 0, "Right Button", ""}, - {BL_SENS_MOUSE_WHEEL_UP, "WHEELUP", 0, "Wheel Up", ""}, - {BL_SENS_MOUSE_WHEEL_DOWN, "WHEELDOWN", 0, "Wheel Down", ""}, - {BL_SENS_MOUSE_MOVEMENT, "MOVEMENT", 0, "Movement", ""}, - {BL_SENS_MOUSE_MOUSEOVER, "MOUSEOVER", 0, "Mouse Over", ""}, - {BL_SENS_MOUSE_MOUSEOVER_ANY, "MOUSEOVERANY", 0, "Mouse Over Any", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_mouse_type_items[] = { - {SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a property for ray intersections"}, - {SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a material for ray intersections"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "MouseSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Mouse Sensor", "Sensor to detect mouse events"); - RNA_def_struct_sdna_from(srna, "bMouseSensor", "data"); - - prop = RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, mouse_event_items); - RNA_def_property_ui_text(prop, "Mouse Event", "Type of event this mouse sensor should trigger on"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_MOUSE_FOCUS_PULSE); - RNA_def_property_ui_text(prop, "Pulse", "Moving the mouse over a different object generates a pulse"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_material", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); - RNA_def_property_enum_items(prop, prop_mouse_type_items); - RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "propname"); - RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "matname"); - RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_RAY_XRAY); - RNA_def_property_ui_text(prop, "X-Ray", "Toggle X-Ray option (see through objects that don't have the property)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_keyboard_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "KeyboardSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Keyboard Sensor", "Sensor to detect keyboard events"); - RNA_def_struct_sdna_from(srna, "bKeyboardSensor", "data"); - - prop = RNA_def_property(srna, "key", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "key"); - RNA_def_property_enum_items(prop, rna_enum_event_type_items); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UI_EVENTS); - RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_key_set", NULL); - RNA_def_property_ui_text(prop, "Key", ""); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_WINDOWMANAGER); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "modifier_key_1", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "qual"); - RNA_def_property_enum_items(prop, rna_enum_event_type_items); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UI_EVENTS); - RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier_set", NULL); - RNA_def_property_ui_text(prop, "Modifier Key", "Modifier key code"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "modifier_key_2", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "qual2"); - RNA_def_property_enum_items(prop, rna_enum_event_type_items); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UI_EVENTS); - RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier2_set", NULL); - RNA_def_property_ui_text(prop, "Second Modifier Key", "Modifier key code"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "target", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "targetName"); - RNA_def_property_ui_text(prop, "Target", "Property that receives the keystrokes in case a string is logged"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "log", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "toggleName"); - RNA_def_property_ui_text(prop, "Log Toggle", "Property that indicates whether to log keystrokes as a string"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_all_keys", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "type", 1); - RNA_def_property_ui_text(prop, "All Keys", "Trigger this sensor on any keystroke"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_property_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - static const EnumPropertyItem prop_type_items[] = { - {SENS_PROP_EQUAL, "PROPEQUAL", 0, "Equal", ""}, - {SENS_PROP_NEQUAL, "PROPNEQUAL", 0, "Not Equal", ""}, - {SENS_PROP_INTERVAL, "PROPINTERVAL", 0, "Interval", ""}, - {SENS_PROP_CHANGED, "PROPCHANGED", 0, "Changed", ""}, - /* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", 0, "Expression", ""}, NOT_USED_IN_UI */ - {SENS_PROP_LESSTHAN, "PROPLESSTHAN", 0, "Less Than", ""}, - {SENS_PROP_GREATERTHAN, "PROPGREATERTHAN", 0, "Greater Than", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "PropertySensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Property Sensor", "Sensor to detect values and changes in values of properties"); - RNA_def_struct_sdna_from(srna, "bPropertySensor", "data"); - - prop = RNA_def_property(srna, "evaluation_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Evaluation Type", "Type of property evaluation"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "value"); - RNA_def_property_ui_text(prop, "Value", "Check for this value in types in Equal, Not Equal, Less Than and Greater Than types"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "value_min", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "value"); - RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value in Interval type"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "value_max", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "maxvalue"); - RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value in Interval type"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_armature_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - static const EnumPropertyItem prop_type_items[] = { - {SENS_ARM_STATE_CHANGED, "STATECHG", 0, "State Changed", ""}, - {SENS_ARM_LIN_ERROR_BELOW, "LINERRORBELOW", 0, "Lin error below", ""}, - {SENS_ARM_LIN_ERROR_ABOVE, "LINERRORABOVE", 0, "Lin error above", ""}, - {SENS_ARM_ROT_ERROR_BELOW, "ROTERRORBELOW", 0, "Rot error below", ""}, - {SENS_ARM_ROT_ERROR_ABOVE, "ROTERRORABOVE", 0, "Rot error above", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "ArmatureSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Armature Sensor", "Sensor to detect values and changes in values of IK solver"); - RNA_def_struct_sdna_from(srna, "bArmatureSensor", "data"); - - prop = RNA_def_property(srna, "test_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Test", "Type of value and test"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "posechannel"); - RNA_def_property_ui_text(prop, "Bone Name", "Identify the bone to check value from"); - RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update"); - - prop = RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "constraint"); - RNA_def_property_ui_text(prop, "Constraint Name", "Identify the bone constraint to check value from"); - RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update"); - - prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "value"); - RNA_def_property_ui_text(prop, "Compare Value", "Value to be used in comparison"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_actuator_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "ActuatorSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Actuator Sensor", "Sensor to detect state modifications of actuators"); - RNA_def_struct_sdna_from(srna, "bActuatorSensor", "data"); - - /* XXX if eventually have Logics using RNA 100%, we could use the actuator data-block isntead of its name */ - prop = RNA_def_property(srna, "actuator", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Actuator", "Actuator name, actuator active state modifications will be detected"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_delay_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "DelaySensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Delay Sensor", "Sensor to send delayed events"); - RNA_def_struct_sdna_from(srna, "bDelaySensor", "data"); - - prop = RNA_def_property(srna, "delay", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Delay", - "Delay in number of logic tics before the positive trigger (default 60 per second)"); - RNA_def_property_range(prop, 0, 5000); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "duration", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Duration", - "If >0, delay in number of logic tics before the negative trigger following " - "the positive trigger"); - RNA_def_property_range(prop, 0, 5000); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_repeat", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_DELAY_REPEAT); - RNA_def_property_ui_text(prop, "Repeat", - "Toggle repeat option (if selected, the sensor restarts after Delay+Duration " - "logic tics)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_collision_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "CollisionSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Collision Sensor", - "Sensor to detect objects colliding with the current object, with more settings than " - "the Touch sensor"); - RNA_def_struct_sdna_from(srna, "bCollisionSensor", "data"); - - prop = RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_PULSE); - RNA_def_property_ui_text(prop, "Pulse", "Change to the set of colliding objects generates pulse"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_MATERIAL); - RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /*XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.) */ - prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "materialName"); - RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - -#if 0 - /* XXX either use a data-block look up to store the string name (material) - * or to do a doversion and use a material pointer. */ - prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Material"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_sdna(prop, NULL, "ma"); - RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); -#endif -} - -static void rna_def_radar_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - static const EnumPropertyItem axis_items[] = { - {SENS_RADAR_X_AXIS, "XAXIS", 0, "+X axis", ""}, - {SENS_RADAR_Y_AXIS, "YAXIS", 0, "+Y axis", ""}, - {SENS_RADAR_Z_AXIS, "ZAXIS", 0, "+Z axis", ""}, - {SENS_RADAR_NEG_X_AXIS, "NEGXAXIS", 0, "-X axis", ""}, - {SENS_RADAR_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""}, - {SENS_RADAR_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "RadarSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Radar Sensor", - "Sensor to detect objects in a cone shaped radar emanating from the current object"); - RNA_def_struct_sdna_from(srna, "bRadarSensor", "data"); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, axis_items); - RNA_def_property_ui_text(prop, "Axis", "Along which axis the radar cone is cast"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_range(prop, 0.0, DEG2RADF(179.9f)); - RNA_def_property_ui_text(prop, "Angle", "Opening angle of the radar cone"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "range"); - RNA_def_property_range(prop, 0.0, 10000.0); - RNA_def_property_ui_text(prop, "Distance", "Depth of the radar cone"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_random_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "RandomSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Random Sensor", "Sensor to send random events"); - RNA_def_struct_sdna_from(srna, "bRandomSensor", "data"); - - prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, 1000); - RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator (choose 0 for not random)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_ray_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - static const EnumPropertyItem axis_items[] = { - {SENS_RAY_X_AXIS, "XAXIS", 0, "+X axis", ""}, - {SENS_RAY_Y_AXIS, "YAXIS", 0, "+Y axis", ""}, - {SENS_RAY_Z_AXIS, "ZAXIS", 0, "+Z axis", ""}, - {SENS_RAY_NEG_X_AXIS, "NEGXAXIS", 0, "-X axis", ""}, - {SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""}, - {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_ray_type_items[] = { - {SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a property for ray intersections"}, - {SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a material for ray intersections"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "RaySensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Ray Sensor", - "Sensor to detect intersections with a ray emanating from the current object"); - RNA_def_struct_sdna_from(srna, "bRaySensor", "data"); - - prop = RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); - RNA_def_property_enum_items(prop, prop_ray_type_items); - RNA_def_property_ui_text(prop, "Ray Type", "Toggle collision on material or property"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "propname"); - RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "matname"); - RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - -#if 0 - /* XXX either use a data-block look up to store the string name (material) - * or to do a doversion and use a material pointer. */ - prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Material"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_sdna(prop, NULL, "ma"); - RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); -#endif - - prop = RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY); - RNA_def_property_ui_text(prop, "X-Ray Mode", - "Toggle X-Ray option (see through objects that don't have the property)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.01, 10000.0); - RNA_def_property_ui_text(prop, "Range", "Sense objects no farther than this distance"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "axisflag"); - RNA_def_property_enum_items(prop, axis_items); - RNA_def_property_ui_text(prop, "Axis", "Along which axis the ray is cast"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_message_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "MessageSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Message Sensor", "Sensor to detect incoming messages"); - RNA_def_struct_sdna_from(srna, "bMessageSensor", "data"); - - prop = RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Subject", - "Optional subject filter: only accept messages with this subject, " - "or empty to accept all"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -static void rna_def_joystick_sensor(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem event_type_joystick_items[] = { - {SENS_JOY_BUTTON, "BUTTON", 0, "Button", ""}, - {SENS_JOY_AXIS, "AXIS", 0, "Axis", ""}, - {SENS_JOY_HAT, "HAT", 0, "Hat", ""}, - {SENS_JOY_AXIS_SINGLE, "AXIS_SINGLE", 0, "Single Axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem axis_direction_items[] = { - {SENS_JOY_X_AXIS, "RIGHTAXIS", 0, "Right Axis", ""}, - {SENS_JOY_Y_AXIS, "UPAXIS", 0, "Up Axis", ""}, - {SENS_JOY_NEG_X_AXIS, "LEFTAXIS", 0, "Left Axis", ""}, - {SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", 0, "Down Axis", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem hat_direction_items[] = { - {SENS_JOY_HAT_UP, "UP", 0, "Up", ""}, - {SENS_JOY_HAT_DOWN, "DOWN", 0, "Down", ""}, - {SENS_JOY_HAT_LEFT, "LEFT", 0, "Left", ""}, - {SENS_JOY_HAT_RIGHT, "RIGHT", 0, "Right", ""}, - - {SENS_JOY_HAT_UP_RIGHT, "UPRIGHT", 0, "Up/Right", ""}, - {SENS_JOY_HAT_DOWN_LEFT, "DOWNLEFT", 0, "Down/Left", ""}, - {SENS_JOY_HAT_UP_LEFT, "UPLEFT", 0, "Up/Left", ""}, - {SENS_JOY_HAT_DOWN_RIGHT, "DOWNRIGHT", 0, "Down/Right", ""}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "JoystickSensor", "Sensor"); - RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events"); - RNA_def_struct_sdna_from(srna, "bJoystickSensor", "data"); - - prop = RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "joyindex"); - RNA_def_property_ui_text(prop, "Index", "Which joystick to use"); - RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX - 1); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, event_type_joystick_items); - RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UI_EVENTS); - RNA_def_property_ui_text(prop, "Event Type", "The type of event this joystick sensor is triggered on"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "use_all_events", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_JOY_ANY_EVENT); - RNA_def_property_ui_text(prop, "All Events", - "Triggered by all events on this joystick's current type (axis/button/hat)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Button */ - prop = RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "button"); - RNA_def_property_ui_text(prop, "Button Number", "Which button to use"); - RNA_def_property_range(prop, 0, 18); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Axis */ - prop = RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "axis"); - RNA_def_property_ui_text(prop, "Axis Number", "Which axis pair to use, 1 is usually the main direction input"); - RNA_def_property_range(prop, 1, 8); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "precision"); - RNA_def_property_ui_text(prop, "Axis Threshold", "Precision of the axis"); - RNA_def_property_range(prop, 0, 32768); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "axis_direction", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "axisf"); - RNA_def_property_enum_items(prop, axis_direction_items); - RNA_def_property_ui_text(prop, "Axis Direction", "The direction of the axis"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Single Axis */ - prop = RNA_def_property(srna, "single_axis_number", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "axis_single"); - RNA_def_property_ui_text(prop, "Axis Number", "Single axis (vertical/horizontal/other) to detect"); - RNA_def_property_range(prop, 1, 16); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* Hat */ - prop = RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "hat"); - RNA_def_property_ui_text(prop, "Hat Number", "Which hat to use"); - RNA_def_property_range(prop, 1, 2); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "hat_direction", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "hatf"); - RNA_def_property_enum_items(prop, hat_direction_items); - RNA_def_property_ui_text(prop, "Hat Direction", "Hat direction"); - RNA_def_property_update(prop, NC_LOGIC, NULL); -} - -void RNA_def_sensor(BlenderRNA *brna) -{ - rna_def_sensor(brna); - - rna_def_always_sensor(brna); - rna_def_near_sensor(brna); - rna_def_mouse_sensor(brna); - rna_def_keyboard_sensor(brna); - rna_def_property_sensor(brna); - rna_def_armature_sensor(brna); - rna_def_actuator_sensor(brna); - rna_def_delay_sensor(brna); - rna_def_collision_sensor(brna); - rna_def_radar_sensor(brna); - rna_def_random_sensor(brna); - rna_def_ray_sensor(brna); - rna_def_message_sensor(brna); - rna_def_joystick_sensor(brna); -} - -#endif diff --git a/source/blender/makesrna/intern/rna_sensor_api.c b/source/blender/makesrna/intern/rna_sensor_api.c deleted file mode 100644 index b0c4109b1df..00000000000 --- a/source/blender/makesrna/intern/rna_sensor_api.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2010 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/makesrna/intern/rna_sensor_api.c - * \ingroup RNA - */ - -#include <stdlib.h> -#include <stdio.h> - -#include "BLI_utildefines.h" - -#include "RNA_define.h" - -#include "rna_internal.h" /* own include */ - -#include "WM_types.h" - -#ifdef RNA_RUNTIME - -#include "BKE_sca.h" -#include "DNA_sensor_types.h" -#include "DNA_controller_types.h" - -static void rna_Sensor_link(bSensor *sens, bController *cont) -{ - link_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks, sizeof(bController *)); -} - -static void rna_Sensor_unlink(bSensor *sens, bController *cont) -{ - unlink_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks); -} - -#else - -void RNA_api_sensor(StructRNA *srna) -{ - FunctionRNA *func; - PropertyRNA *parm; - - func = RNA_def_function(srna, "link", "rna_Sensor_link"); - RNA_def_function_ui_description(func, "Link the sensor to a controller"); - parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to"); - RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - RNA_def_property_update(parm, NC_LOGIC, NULL); - - func = RNA_def_function(srna, "unlink", "rna_Sensor_unlink"); - RNA_def_function_ui_description(func, "Unlink the sensor from a controller"); - parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from"); - RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - RNA_def_property_update(parm, NC_LOGIC, NULL); -} - -#endif - diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 6aacede5816..0c1391fd2f7 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -32,7 +32,6 @@ #include "rna_internal.h" #include "DNA_sound_types.h" -#include "DNA_property_types.h" #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a12b4553486..1252091f84b 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -83,7 +83,6 @@ const EnumPropertyItem rna_enum_space_type_items[] = { /* Scripting */ {0, "", ICON_NONE, "Scripting", ""}, {SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, "Text Editor", "Edit scripts and in-file documentation"}, - {SPACE_LOGIC, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", "Game logic editing"}, {SPACE_CONSOLE, "CONSOLE", ICON_CONSOLE, "Python Console", "Interactive programmatic console for " "advanced editing and script development"}, {SPACE_INFO, "INFO", ICON_INFO, "Info", "Main menu bar and list of error messages " @@ -329,8 +328,6 @@ static StructRNA *rna_Space_refine(struct PointerRNA *ptr) return &RNA_SpaceTimeline; case SPACE_NODE: return &RNA_SpaceNodeEditor; - case SPACE_LOGIC: - return &RNA_SpaceLogicEditor; case SPACE_CONSOLE: return &RNA_SpaceConsole; case SPACE_USERPREF: @@ -4350,75 +4347,6 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_api_space_node(srna); } -static void rna_def_space_logic(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "SpaceLogicEditor", "Space"); - RNA_def_struct_sdna(srna, "SpaceLogic"); - RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data"); - - /* sensors */ - prop = RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_SEL); - RNA_def_property_ui_text(prop, "Show Selected Object", "Show sensors of all selected objects"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_ACT); - RNA_def_property_ui_text(prop, "Show Active Object", "Show sensors of active object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_LINK); - RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to the controller"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE); - RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* controllers */ - prop = RNA_def_property(srna, "show_controllers_selected_objects", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_SEL); - RNA_def_property_ui_text(prop, "Show Selected Object", "Show controllers of all selected objects"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_controllers_active_object", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_ACT); - RNA_def_property_ui_text(prop, "Show Active Object", "Show controllers of active object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_controllers_linked_controller", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK); - RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - /* actuators */ - prop = RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_SEL); - RNA_def_property_ui_text(prop, "Show Selected Object", "Show actuators of all selected objects"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_ACT); - RNA_def_property_ui_text(prop, "Show Active Object", "Show actuators of active object"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_actuators_linked_controller", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_LINK); - RNA_def_property_ui_text(prop, "Show Linked to Actuator", "Show linked objects to the actuator"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - - prop = RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE); - RNA_def_property_ui_text(prop, "Show Active States", "Show only actuators connected to active states"); - RNA_def_property_update(prop, NC_LOGIC, NULL); - -} - static void rna_def_space_clip(BlenderRNA *brna) { StructRNA *srna; @@ -4703,7 +4631,6 @@ void RNA_def_space(BlenderRNA *brna) rna_def_space_userpref(brna); rna_def_node_tree_path(brna); rna_def_space_node(brna); - rna_def_space_logic(brna); rna_def_space_clip(brna); } diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 88330ad2a8f..fe69b91e833 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -204,12 +204,6 @@ static void rna_userdef_load_ui_update(Main *UNUSED(bmain), Scene *UNUSED(scene) else G.fileflags &= ~G_FILE_NO_UI; } -static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP)); - rna_userdef_update(bmain, scene, ptr); -} - static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr) { GPU_set_anisotropic(U.anisotropic_filter); @@ -2282,23 +2276,6 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_userdef_update"); } -static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) -{ - StructRNA *srna; -// PropertyRNA *prop; - - /* space_logic */ - - srna = RNA_def_struct(brna, "ThemeLogicEditor", NULL); - RNA_def_struct_sdna(srna, "ThemeSpace"); - RNA_def_struct_clear_flag(srna, STRUCT_UNDO); - RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor"); - - rna_def_userdef_theme_spaces_main(srna); - -} - - static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) { StructRNA *srna; @@ -3002,7 +2979,6 @@ static void rna_def_userdef_themes(BlenderRNA *brna) {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""}, {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""}, {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""}, - {10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""}, {11, "PROPERTIES", ICON_BUTS, "Properties", ""}, {12, "OUTLINER", ICON_OOPS, "Outliner", ""}, {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""}, @@ -3102,12 +3078,6 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeNodeEditor"); RNA_def_property_ui_text(prop, "Node Editor", ""); - prop = RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tlogic"); - RNA_def_property_struct_type(prop, "ThemeLogicEditor"); - RNA_def_property_ui_text(prop, "Logic Editor", ""); - prop = RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "toops"); @@ -3232,7 +3202,6 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna) rna_def_userdef_theme_space_info(brna); rna_def_userdef_theme_space_userpref(brna); rna_def_userdef_theme_space_console(brna); - rna_def_userdef_theme_space_logic(brna); rna_def_userdef_theme_space_clip(brna); rna_def_userdef_theme_colorset(brna); rna_def_userdef_themes(brna); @@ -4116,13 +4085,6 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop = RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP); - RNA_def_property_ui_text(prop, "Mipmaps", - "Scale textures for the 3D View (looks nicer but uses more memory and slows image " - "reloading)"); - RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update"); prop = RNA_def_property(srna, "use_16bit_textures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_16bit_textures", 1); |