Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_actuator.c')
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 0114ffa35c0..5dba21dda40 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -35,7 +35,7 @@
#include "BLI_utildefines.h"
#include "BLI_math.h"
-#include "BLF_translation.h"
+#include "BLT_translation.h"
#include "RNA_define.h"
#include "RNA_access.h"
@@ -55,16 +55,16 @@ static EnumPropertyItem actuator_type_items[] = {
{ACT_2DFILTER, "FILTER_2D", 0, "Filter 2D", ""},
{ACT_GAME, "GAME", 0, "Game", ""},
{ACT_MESSAGE, "MESSAGE", 0, "Message", ""},
- {ACT_MOUSE, "MOUSE", 0, "Mouse", ""},
{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_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
{ACT_STEERING, "STEERING", 0, "Steering", ""},
+ {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -120,14 +120,10 @@ static StructRNA *rna_Actuator_refine(struct PointerRNA *ptr)
static void rna_Actuator_name_set(PointerRNA *ptr, const char *value)
{
- bActuator *act = (bActuator *)ptr->data;
-
+ Object *ob = ptr->id.data;
+ bActuator *act = ptr->data;
BLI_strncpy_utf8(act->name, value, sizeof(act->name));
-
- if (ptr->id.data) {
- Object *ob = (Object *)ptr->id.data;
- BLI_uniquename(&ob->actuators, act, DATA_("Actuator"), '.', offsetof(bActuator, name), 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)
@@ -494,11 +490,11 @@ static void rna_Actuator_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scen
bPoseChannel *pchan;
bPose *pose = ob->pose;
for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
- if (!strcmp(pchan->name, posechannel)) {
+ if (STREQ(pchan->name, posechannel)) {
/* found it, now look for constraint channel */
bConstraint *con;
for (con = pchan->constraints.first; con; con = con->next) {
- if (!strcmp(con->name, constraint)) {
+ if (STREQ(con->name, constraint)) {
/* found it, all ok */
return;
}
@@ -535,14 +531,6 @@ static void rna_Actuator_editobject_mesh_set(PointerRNA *ptr, PointerRNA value)
eoa->me = value.data;
}
-static void rna_Actuator_action_action_set(PointerRNA *ptr, PointerRNA value)
-{
- bActuator *act = (bActuator *)ptr->data;
- bActionActuator *aa = (bActionActuator *) act->data;
-
- aa->act = value.data;
-}
-
#else
static void rna_def_actuator(BlenderRNA *brna)
@@ -622,10 +610,8 @@ static void rna_def_action_actuator(BlenderRNA *brna)
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);
+ RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
RNA_def_property_ui_text(prop, "Action", "");
- /* note: custom set function is ONLY to avoid rna setting a user for this. */
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop = RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
@@ -1013,13 +999,13 @@ static void rna_def_sound_actuator(BlenderRNA *brna)
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, BLF_I18NCONTEXT_ID_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, BLF_I18NCONTEXT_ID_SOUND);
+ RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats - 3D Parameters */
@@ -2070,6 +2056,11 @@ static void rna_def_steering_actuator(BlenderRNA *brna)
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)