Blender V2.61 - r43446

rna_actuator.c

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * Contributor(s): Blender Foundation (2008).
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022 
00028 #include <stdlib.h>
00029 
00030 #include "RNA_define.h"
00031 #include "RNA_access.h"
00032 
00033 #include "rna_internal.h"
00034 #include "DNA_constraint_types.h"
00035 #include "DNA_object_types.h"
00036 #include "DNA_actuator_types.h"
00037 #include "DNA_scene_types.h" // for MAXFRAME
00038 
00039 #include "WM_types.h"
00040 
00041 #include "BLI_utildefines.h"
00042 
00043 /* Always keep in alphabetical order */
00044 EnumPropertyItem actuator_type_items[] ={
00045     {ACT_ACTION, "ACTION", 0, "Action", ""},
00046     {ACT_ARMATURE, "ARMATURE", 0, "Armature", ""},
00047     {ACT_CAMERA, "CAMERA", 0, "Camera", ""},
00048     {ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""},
00049     {ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""},
00050     {ACT_2DFILTER, "FILTER_2D", 0, "Filter 2D", ""},
00051     {ACT_GAME, "GAME", 0, "Game", ""},
00052     {ACT_MESSAGE, "MESSAGE", 0, "Message", ""},
00053     {ACT_OBJECT, "MOTION", 0, "Motion", ""},
00054     {ACT_PARENT, "PARENT", 0, "Parent", ""},
00055     {ACT_PROPERTY, "PROPERTY", 0, "Property", ""},
00056     {ACT_RANDOM, "RANDOM", 0, "Random", ""},
00057     {ACT_SCENE, "SCENE", 0, "Scene", ""},
00058     {ACT_SOUND, "SOUND", 0, "Sound", ""},
00059     {ACT_STATE, "STATE", 0, "State", ""},
00060     {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
00061     {ACT_STEERING, "STEERING", 0, "Steering", ""},
00062     {0, NULL, 0, NULL, NULL}};
00063 
00064 #ifdef RNA_RUNTIME
00065 
00066 #include "BKE_sca.h"
00067 
00068 static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
00069 {
00070     bActuator *actuator= (bActuator*)ptr->data;
00071 
00072     switch(actuator->type) {
00073         case ACT_ACTION:
00074             return &RNA_ActionActuator;
00075         case ACT_OBJECT:
00076             return &RNA_ObjectActuator;
00077         case ACT_CAMERA:
00078             return &RNA_CameraActuator;
00079         case ACT_SOUND:
00080             return &RNA_SoundActuator;
00081         case ACT_PROPERTY:
00082             return &RNA_PropertyActuator;
00083         case ACT_CONSTRAINT:
00084             return &RNA_ConstraintActuator;
00085         case ACT_EDIT_OBJECT:
00086             return &RNA_EditObjectActuator;
00087         case ACT_SCENE:
00088             return &RNA_SceneActuator;
00089         case ACT_RANDOM:
00090             return &RNA_RandomActuator;
00091         case ACT_MESSAGE:
00092             return &RNA_MessageActuator;
00093         case ACT_GAME:
00094             return &RNA_GameActuator;
00095         case ACT_VISIBILITY:
00096             return &RNA_VisibilityActuator;
00097         case ACT_2DFILTER:
00098             return &RNA_Filter2DActuator;
00099         case ACT_PARENT:
00100             return &RNA_ParentActuator;
00101         case ACT_STATE:
00102             return &RNA_StateActuator;
00103         case ACT_ARMATURE:
00104             return &RNA_ArmatureActuator;
00105         case ACT_STEERING:
00106             return &RNA_SteeringActuator;
00107         default:
00108             return &RNA_Actuator;
00109     }
00110 }
00111 
00112 void rna_Actuator_name_set(PointerRNA *ptr, const char *value)
00113 {
00114     bActuator *act= (bActuator *)ptr->data;
00115 
00116     BLI_strncpy_utf8(act->name, value, sizeof(act->name));
00117 
00118     if (ptr->id.data) {
00119         Object *ob= (Object *)ptr->id.data;
00120         BLI_uniquename(&ob->actuators, act, "Actuator", '.', offsetof(bActuator, name), sizeof(act->name));
00121     }
00122 }
00123 
00124 static void rna_Actuator_type_set(struct PointerRNA *ptr, int value)
00125 {
00126     bActuator *act= (bActuator *)ptr->data;
00127     if (value != act->type)
00128     {
00129         act->type = value;
00130         init_actuator(act);
00131     }
00132 }
00133 
00134 static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value)
00135 {
00136     bActuator *act= (bActuator *)ptr->data;
00137     bConstraintActuator *ca= act->data;
00138     if (value != ca->type)
00139     {
00140         ca->type = value;
00141         switch (ca->type) {
00142         case ACT_CONST_TYPE_ORI:
00143             /* negative axis not supported in the orientation mode */
00144             if (ELEM3(ca->mode, ACT_CONST_DIRNX,ACT_CONST_DIRNY, ACT_CONST_DIRNZ))
00145                 ca->mode = ACT_CONST_NONE;
00146             break;
00147 
00148         case ACT_CONST_TYPE_LOC:
00149         case ACT_CONST_TYPE_DIST:
00150         case ACT_CONST_TYPE_FH:
00151         default:
00152             break;
00153         }
00154     }
00155 }
00156 
00157 static float rna_ConstraintActuator_limitmin_get(struct PointerRNA *ptr)
00158 {
00159     bActuator *act = (bActuator*)ptr->data;
00160     bConstraintActuator *ca = act->data;
00161     float *fp;
00162 
00163     if(ca->flag & ACT_CONST_LOCX) fp= ca->minloc;
00164     else if(ca->flag & ACT_CONST_LOCY) fp= ca->minloc+1;
00165     else if(ca->flag & ACT_CONST_LOCZ) fp= ca->minloc+2;
00166     else if(ca->flag & ACT_CONST_ROTX) fp= ca->minrot;
00167     else if(ca->flag & ACT_CONST_ROTY) fp= ca->minrot+1;
00168     else fp= ca->minrot+2;
00169 
00170     return *fp;
00171 }
00172 
00173 static void rna_ConstraintActuator_limitmin_set(struct PointerRNA *ptr, float value)
00174 {
00175     bActuator *act = (bActuator*)ptr->data;
00176     bConstraintActuator *ca = act->data;
00177     float *fp;
00178 
00179     if(ca->flag & ACT_CONST_LOCX) fp= ca->minloc;
00180     else if(ca->flag & ACT_CONST_LOCY) fp= ca->minloc+1;
00181     else if(ca->flag & ACT_CONST_LOCZ) fp= ca->minloc+2;
00182     else if(ca->flag & ACT_CONST_ROTX) fp= ca->minrot;
00183     else if(ca->flag & ACT_CONST_ROTY) fp= ca->minrot+1;
00184     else fp= ca->minrot+2;
00185 
00186     *fp = value;
00187 }
00188 
00189 static float rna_ConstraintActuator_limitmax_get(struct PointerRNA *ptr)
00190 {
00191     bActuator *act = (bActuator*)ptr->data;
00192     bConstraintActuator *ca = act->data;
00193     float *fp;
00194 
00195     if(ca->flag & ACT_CONST_LOCX) fp= ca->maxloc;
00196     else if(ca->flag & ACT_CONST_LOCY) fp= ca->maxloc+1;
00197     else if(ca->flag & ACT_CONST_LOCZ) fp= ca->maxloc+2;
00198     else if(ca->flag & ACT_CONST_ROTX) fp= ca->maxrot;
00199     else if(ca->flag & ACT_CONST_ROTY) fp= ca->maxrot+1;
00200     else fp= ca->maxrot+2;
00201 
00202     return *fp;
00203 }
00204 
00205 static void rna_ConstraintActuator_limitmax_set(struct PointerRNA *ptr, float value)
00206 {
00207     bActuator *act = (bActuator*)ptr->data;
00208     bConstraintActuator *ca = act->data;
00209     float *fp;
00210 
00211     if(ca->flag & ACT_CONST_LOCX) fp= ca->maxloc;
00212     else if(ca->flag & ACT_CONST_LOCY) fp= ca->maxloc+1;
00213     else if(ca->flag & ACT_CONST_LOCZ) fp= ca->maxloc+2;
00214     else if(ca->flag & ACT_CONST_ROTX) fp= ca->maxrot;
00215     else if(ca->flag & ACT_CONST_ROTY) fp= ca->maxrot+1;
00216     else fp= ca->maxrot+2;
00217 
00218     *fp = value;
00219 }
00220 
00221 static float rna_ConstraintActuator_distance_get(struct PointerRNA *ptr)
00222 {
00223     bActuator *act = (bActuator*)ptr->data;
00224     bConstraintActuator *ca = act->data;
00225     float *fp;
00226 
00227     if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
00228     else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
00229     else fp= ca->minloc+2;
00230 
00231     return *fp;
00232 }
00233 
00234 static void rna_ConstraintActuator_distance_set(struct PointerRNA *ptr, float value)
00235 {
00236     bActuator *act = (bActuator*)ptr->data;
00237     bConstraintActuator *ca = act->data;
00238     float *fp;
00239 
00240     if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
00241     else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
00242     else fp= ca->minloc+2;
00243 
00244     *fp = value;
00245 }
00246 
00247 static float rna_ConstraintActuator_range_get(struct PointerRNA *ptr)
00248 {
00249     bActuator *act = (bActuator*)ptr->data;
00250     bConstraintActuator *ca = act->data;
00251     float *fp;
00252 
00253     if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
00254     else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
00255     else fp= ca->maxloc+2;
00256 
00257     return *fp;
00258 }
00259 
00260 static void rna_ConstraintActuator_range_set(struct PointerRNA *ptr, float value)
00261 {
00262     bActuator *act = (bActuator*)ptr->data;
00263     bConstraintActuator *ca = act->data;
00264     float *fp;
00265 
00266     if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
00267     else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
00268     else fp= ca->maxloc+2;
00269 
00270     *fp = value;
00271 }
00272 
00273 static float rna_ConstraintActuator_fhheight_get(struct PointerRNA *ptr)
00274 {
00275     bActuator *act = (bActuator*)ptr->data;
00276     bConstraintActuator *ca = act->data;
00277     float *fp;
00278 
00279     if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
00280     else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
00281     else fp= ca->minloc+2;
00282 
00283     return *fp;
00284 }
00285 
00286 static void rna_ConstraintActuator_fhheight_set(struct PointerRNA *ptr, float value)
00287 {
00288     bActuator *act = (bActuator*)ptr->data;
00289     bConstraintActuator *ca = act->data;
00290     float *fp;
00291 
00292     if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
00293     else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
00294     else fp= ca->minloc+2;
00295 
00296     *fp = value;
00297 }
00298 
00299 static float rna_ConstraintActuator_spring_get(struct PointerRNA *ptr)
00300 {
00301     bActuator *act = (bActuator*)ptr->data;
00302     bConstraintActuator *ca = act->data;
00303     float *fp;
00304 
00305     if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
00306     else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
00307     else fp= ca->maxloc+2;
00308 
00309     return *fp;
00310 }
00311 
00312 static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float value)
00313 {
00314     bActuator *act = (bActuator*)ptr->data;
00315     bConstraintActuator *ca = act->data;
00316     float *fp;
00317 
00318     if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
00319     else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
00320     else fp= ca->maxloc+2;
00321 
00322     *fp = value;
00323 }
00324 /* ConstraintActuator uses the same property for Material and Property.
00325    Therefore we need to clear the property when "use_material_detect" mode changes */
00326 static void rna_Actuator_constraint_detect_material_set(struct PointerRNA *ptr, int value)
00327 {
00328     bActuator *act = (bActuator*)ptr->data;
00329     bConstraintActuator *ca = act->data;
00330 
00331     short old_value = (ca->flag & ACT_CONST_MATERIAL? 1:0);
00332 
00333     if (old_value != value) {
00334         ca->flag ^= ACT_CONST_MATERIAL;
00335         ca->matprop[0] = '\0';
00336     }
00337 }
00338 
00339 static void rna_ActionActuator_add_set(struct PointerRNA *ptr, int value)
00340 {
00341     bActuator *act = (bActuator *)ptr->data;
00342     bActionActuator *aa = act->data;
00343 
00344     if(value == 1){
00345         aa->flag &= ~ACT_IPOFORCE;
00346         aa->flag |= ACT_IPOADD;
00347     }else
00348         aa->flag &= ~ACT_IPOADD;
00349 }
00350 
00351 static void rna_ActionActuator_force_set(struct PointerRNA *ptr, int value)
00352 {
00353     bActuator *act = (bActuator *)ptr->data;
00354     bActionActuator *aa = act->data;
00355 
00356     if(value == 1){
00357         aa->flag &= ~ACT_IPOADD;
00358         aa->flag |= ACT_IPOFORCE;
00359     }else
00360         aa->flag &= ~ACT_IPOFORCE;
00361 }
00362 
00363 static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value)
00364 {
00365     bActuator *act= (bActuator *)ptr->data;
00366     bObjectActuator *oa = act->data;
00367     if (value != oa->type)
00368     {
00369         oa->type = value;
00370         switch (oa->type) {
00371         case ACT_OBJECT_NORMAL:
00372             memset(oa, 0, sizeof(bObjectActuator));
00373             oa->flag = ACT_FORCE_LOCAL|ACT_TORQUE_LOCAL|ACT_DLOC_LOCAL|ACT_DROT_LOCAL;
00374             oa->type = ACT_OBJECT_NORMAL;
00375             break;
00376 
00377         case ACT_OBJECT_SERVO:
00378             memset(oa, 0, sizeof(bObjectActuator));
00379             oa->flag = ACT_LIN_VEL_LOCAL;
00380             oa->type = ACT_OBJECT_SERVO;
00381             oa->forcerot[0] = 30.0f;
00382             oa->forcerot[1] = 0.5f;
00383             oa->forcerot[2] = 0.0f;
00384             break;
00385         }
00386     }
00387 }
00388 
00389 static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, float value)
00390 {
00391     bActuator *act = (bActuator*)ptr->data;
00392     bObjectActuator *oa = act->data;
00393     
00394     oa->forcerot[1] = value;
00395     oa->forcerot[0] = 60.0f*oa->forcerot[1];
00396 }
00397 
00398 static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values)
00399 {
00400     bActuator *act = (bActuator*)ptr->data;
00401     bStateActuator *sa = act->data;
00402 
00403     int i, tot= 0;
00404 
00405     /* ensure we always have some state selected */
00406     for(i=0; i<OB_MAX_STATES; i++)
00407         if(values[i])
00408             tot++;
00409     
00410     if(tot==0)
00411         return;
00412 
00413     for(i=0; i<OB_MAX_STATES; i++) {
00414         if(values[i]) sa->mask |= (1<<i);
00415         else sa->mask &= ~(1<<i);
00416     }
00417 }
00418 
00419 /* Always keep in alphabetical order */
00420 EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
00421 {
00422     EnumPropertyItem *item= NULL;
00423     Object *ob= NULL;
00424     int totitem= 0;
00425     
00426     if (ptr->type==&RNA_Actuator || RNA_struct_is_a(ptr->type, &RNA_Actuator)){
00427         ob = (Object *)ptr->id.data;
00428     } else {
00429         /* can't use ob from ptr->id.data because that enum is also used by operators */
00430         ob = CTX_data_active_object(C);
00431     }
00432     
00433     if (ob != NULL) {
00434         if (ob->type==OB_ARMATURE) {
00435             RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE);
00436         }
00437     }
00438     
00439     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION);
00440     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA);
00441     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT);
00442     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_EDIT_OBJECT);
00443     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_2DFILTER);
00444     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_GAME);
00445     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_MESSAGE);
00446     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_OBJECT);
00447     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PARENT);
00448     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PROPERTY);
00449     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_RANDOM);
00450     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SCENE);
00451     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STEERING);
00452 
00453     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SOUND);
00454     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STATE);
00455     RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY);
00456     
00457     RNA_enum_item_end(&item, &totitem);
00458     *free= 1;
00459     
00460     return item;
00461 }
00462 
00463 static void rna_Actuator_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00464 {
00465     bActuator *act= (bActuator *)ptr->data;
00466     bArmatureActuator *aa = act->data;
00467     Object *ob = (Object *)ptr->id.data;
00468 
00469     char *posechannel= aa->posechannel;
00470     char *constraint= aa->constraint;
00471 
00472     /* check that bone exist in the active object */
00473     if (ob->type == OB_ARMATURE && ob->pose) {
00474         bPoseChannel *pchan;
00475         bPose *pose = ob->pose;
00476         for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
00477             if (!strcmp(pchan->name, posechannel)) {
00478                 /* found it, now look for constraint channel */
00479                 bConstraint *con;
00480                 for (con=pchan->constraints.first; con; con=con->next) {
00481                     if (!strcmp(con->name, constraint)) {
00482                         /* found it, all ok */
00483                         return;                     
00484                     }
00485                 }
00486                 /* didn't find constraint, make empty */
00487                 constraint[0] = 0;
00488                 return;
00489             }
00490         }
00491     }
00492     /* didn't find any */
00493     posechannel[0] = 0;
00494     constraint[0] = 0;
00495 }
00496 
00497 static void rna_SteeringActuator_navmesh_set(PointerRNA *ptr, PointerRNA value)
00498 {
00499     bActuator *act = (bActuator*)ptr->data;
00500     bSteeringActuator *sa = (bSteeringActuator*) act->data;
00501 
00502     Object* obj = value.data;
00503     if (obj && obj->body_type==OB_BODY_TYPE_NAVMESH)
00504         sa->navmesh = obj;
00505     else
00506         sa->navmesh = NULL;
00507 }
00508 
00509 /* note: the following set functions exists only to avoid id refcounting */
00510 static void rna_Actuator_editobject_mesh_set(PointerRNA *ptr, PointerRNA value)
00511 {
00512     bActuator *act = (bActuator *)ptr->data;
00513     bEditObjectActuator *eoa = (bEditObjectActuator *) act->data;
00514 
00515     eoa->me = value.data;
00516 }
00517 
00518 static void rna_Actuator_action_action_set(PointerRNA *ptr, PointerRNA value)
00519 {
00520     bActuator *act = (bActuator *)ptr->data;
00521     bActionActuator *aa = (bActionActuator *) act->data;
00522 
00523     aa->act = value.data;
00524 }
00525 
00526 #else
00527 
00528 void rna_def_actuator(BlenderRNA *brna)
00529 {
00530     StructRNA *srna;
00531     PropertyRNA *prop;
00532 
00533     srna= RNA_def_struct(brna, "Actuator", NULL);
00534     RNA_def_struct_ui_text(srna, "Actuator", "Actuator to apply actions in the game engine");
00535     RNA_def_struct_sdna(srna, "bActuator");
00536     RNA_def_struct_refine_func(srna, "rna_Actuator_refine");
00537 
00538     prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
00539     RNA_def_property_ui_text(prop, "Name", "");
00540     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Actuator_name_set");
00541     RNA_def_struct_name_property(srna, prop);
00542 
00543     prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
00544     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
00545     RNA_def_property_enum_items(prop, actuator_type_items);
00546     RNA_def_property_enum_funcs(prop, NULL, "rna_Actuator_type_set", "rna_Actuator_type_itemf");
00547     RNA_def_property_ui_text(prop, "Type", "");
00548 
00549     prop= RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
00550     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PIN);
00551     RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller");
00552     RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
00553     RNA_def_property_update(prop, NC_LOGIC, NULL);
00554 
00555     prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
00556     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SHOW);
00557     RNA_def_property_ui_text(prop, "Expanded", "Set actuator expanded in the user interface");
00558     RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
00559 
00560     RNA_api_actuator(srna);
00561 }
00562 
00563 static void rna_def_action_actuator(BlenderRNA *brna)
00564 {
00565     StructRNA *srna;
00566     PropertyRNA *prop;
00567 
00568     static EnumPropertyItem prop_type_items[] ={
00569         {ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
00570         {ACT_ACTION_PINGPONG, "PINGPONG", 0, "Ping Pong", ""},
00571         {ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
00572         {ACT_ACTION_LOOP_STOP, "LOOPSTOP", 0, "Loop Stop", ""},
00573         {ACT_ACTION_LOOP_END, "LOOPEND", 0, "Loop End", ""},
00574         {ACT_ACTION_FROM_PROP, "PROPERTY", 0, "Property", ""},
00575 #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
00576         {ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""},
00577 #endif
00578         {0, NULL, 0, NULL, NULL}};
00579 
00580     srna= RNA_def_struct(brna, "ActionActuator", "Actuator");
00581     RNA_def_struct_ui_text(srna, "Action Actuator", "Actuator to control the object movement");
00582     RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
00583 
00584     prop= RNA_def_property(srna, "play_mode", PROP_ENUM, PROP_NONE);
00585     RNA_def_property_enum_sdna(prop, NULL, "type");
00586     RNA_def_property_enum_items(prop, prop_type_items);
00587     RNA_def_property_ui_text(prop, "Action Type", "Action playback type");
00588     RNA_def_property_update(prop, NC_LOGIC, NULL);
00589 
00590     prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
00591     RNA_def_property_pointer_sdna(prop, NULL, "act");
00592     RNA_def_property_struct_type(prop, "Action");
00593     RNA_def_property_flag(prop, PROP_EDITABLE);
00594     RNA_def_property_ui_text(prop, "Action", "");
00595     /* note: custom set function is ONLY to avoid rna setting a user for this. */
00596     RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL);
00597     RNA_def_property_update(prop, NC_LOGIC, NULL);
00598 
00599     prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
00600     RNA_def_property_boolean_negative_sdna(prop, NULL, "end_reset", 1);
00601     RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time");
00602     RNA_def_property_update(prop, NC_LOGIC, NULL);
00603     
00604     prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
00605     RNA_def_property_string_sdna(prop, NULL, "name");
00606     RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
00607     RNA_def_property_update(prop, NC_LOGIC, NULL);
00608 
00609     prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
00610     RNA_def_property_float_sdna(prop, NULL, "sta");
00611     RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
00612     RNA_def_property_ui_text(prop, "Start Frame", "");
00613     RNA_def_property_update(prop, NC_LOGIC, NULL);
00614 
00615     prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
00616     RNA_def_property_float_sdna(prop, NULL, "end");
00617     RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
00618     RNA_def_property_ui_text(prop, "End Frame", "");
00619     RNA_def_property_update(prop, NC_LOGIC, NULL);
00620 
00621     prop= RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE);
00622     RNA_def_property_int_sdna(prop, NULL, "blendin");
00623     RNA_def_property_range(prop, 0, 32767);
00624     RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending");
00625     RNA_def_property_update(prop, NC_LOGIC, NULL);
00626 
00627     prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
00628     RNA_def_property_range(prop, 0, 100);
00629     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)");
00630     RNA_def_property_update(prop, NC_LOGIC, NULL);
00631 
00632     prop= RNA_def_property(srna, "layer", PROP_INT, PROP_NONE);
00633     RNA_def_property_range(prop, 0, 7); /* This should match BL_ActionManager::MAX_ACTION_LAYERS - 1 */
00634     RNA_def_property_ui_text(prop, "Layer", "The animation layer to play the action on");
00635     RNA_def_property_update(prop, NC_LOGIC, NULL);
00636 
00637     prop= RNA_def_property(srna, "layer_weight", PROP_FLOAT, PROP_NONE);
00638     RNA_def_property_range(prop, 0.0, 1.0);
00639     RNA_def_property_ui_text(prop, "Layer Weight", "How much of the previous layer to blend into this one (0 = add mode)");
00640     RNA_def_property_update(prop, NC_LOGIC, NULL);
00641 
00642     prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
00643     RNA_def_property_string_sdna(prop, NULL, "frameProp");
00644     RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
00645     RNA_def_property_update(prop, NC_LOGIC, NULL);
00646 
00647     /* booleans */
00648     prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
00649     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOADD);
00650     RNA_def_property_boolean_funcs(prop, NULL, "rna_ActionActuator_add_set");
00651     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");
00652     RNA_def_property_update(prop, NC_LOGIC, NULL);
00653 
00654     prop= RNA_def_property(srna, "use_force", PROP_BOOLEAN, PROP_NONE);
00655     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOFORCE);
00656     RNA_def_property_boolean_funcs(prop, NULL, "rna_ActionActuator_force_set");
00657     RNA_def_property_ui_text(prop, "Force", "Apply Action as a global or local force depending on the local option (dynamic objects only)");
00658     RNA_def_property_update(prop, NC_LOGIC, NULL);
00659     
00660     prop= RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE);
00661     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOLOCAL);
00662     RNA_def_property_ui_text(prop, "L", "Let the Action act in local coordinates, used in Force and Add mode");
00663     RNA_def_property_update(prop, NC_LOGIC, NULL);
00664 
00665     prop= RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE);
00666     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOCHILD);
00667     RNA_def_property_ui_text(prop, "Child", "Update Action on all children Objects as well");
00668     RNA_def_property_update(prop, NC_LOGIC, NULL);
00669 
00670 #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
00671     prop= RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
00672     RNA_def_property_float_sdna(prop, NULL, "stridelength");
00673     RNA_def_property_range(prop, 0.0, 2500.0);
00674     RNA_def_property_ui_text(prop, "Cycle", "Distance covered by a single cycle of the action");
00675     RNA_def_property_update(prop, NC_LOGIC, NULL);
00676 #endif
00677 }
00678 
00679 static void rna_def_object_actuator(BlenderRNA *brna)
00680 {
00681     StructRNA *srna;
00682     PropertyRNA* prop;
00683 
00684     static EnumPropertyItem prop_type_items[] ={
00685         {ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""},
00686         {ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""},
00687         {0, NULL, 0, NULL, NULL}};
00688 
00689     srna= RNA_def_struct(brna, "ObjectActuator", "Actuator");
00690     RNA_def_struct_ui_text(srna, "Motion Actuator", "Actuator to control the object movement");
00691     RNA_def_struct_sdna_from(srna, "bObjectActuator", "data");
00692 
00693 
00694     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
00695     RNA_def_property_enum_sdna(prop, NULL, "type");
00696     RNA_def_property_enum_items(prop, prop_type_items);
00697     RNA_def_property_enum_funcs(prop, NULL, "rna_ObjectActuator_type_set", NULL);
00698     RNA_def_property_ui_text(prop, "Motion Type", "Specify the motion system");
00699     RNA_def_property_update(prop, NC_LOGIC, NULL);
00700     
00701     prop= RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
00702     RNA_def_property_struct_type(prop, "Object");
00703     RNA_def_property_pointer_sdna(prop, NULL, "reference");
00704     RNA_def_property_flag(prop, PROP_EDITABLE);
00705     RNA_def_property_ui_text(prop, "Reference Object", "Reference object for velocity calculation, leave empty for world reference");
00706     RNA_def_property_update(prop, NC_LOGIC, NULL);
00707     
00708     prop= RNA_def_property(srna, "damping", PROP_INT, PROP_NONE);
00709     RNA_def_property_ui_range(prop, 0, 1000, 1, 1);
00710     RNA_def_property_ui_text(prop, "Damping Frames", "Number of frames to reach the target velocity");
00711     RNA_def_property_update(prop, NC_LOGIC, NULL);
00712 
00713     prop= RNA_def_property(srna, "proportional_coefficient", PROP_FLOAT, PROP_NONE);
00714     RNA_def_property_float_sdna(prop, NULL, "forcerot[0]");
00715     RNA_def_property_ui_range(prop, 0.0, 200.0, 10, 2);
00716     RNA_def_property_ui_text(prop, "Proportional Coefficient", "Typical value is 60x integral coefficient");
00717     RNA_def_property_update(prop, NC_LOGIC, NULL);
00718 
00719     prop= RNA_def_property(srna, "integral_coefficient", PROP_FLOAT, PROP_NONE);
00720     RNA_def_property_float_sdna(prop, NULL, "forcerot[1]");
00721     RNA_def_property_ui_range(prop, 0.0, 3.0, 10, 2);
00722     RNA_def_property_float_funcs(prop, NULL, "rna_ObjectActuator_integralcoefficient_set", NULL);
00723     RNA_def_property_ui_text(prop, "Integral Coefficient", "Low value (0.01) for slow response, high value (0.5) for fast response");
00724     RNA_def_property_update(prop, NC_LOGIC, NULL);
00725 
00726     prop= RNA_def_property(srna, "derivate_coefficient", PROP_FLOAT, PROP_NONE);
00727     RNA_def_property_float_sdna(prop, NULL, "forcerot[2]");
00728     RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2);
00729     RNA_def_property_ui_text(prop, "Derivate Coefficient", "Not required, high values can cause instability");
00730     RNA_def_property_update(prop, NC_LOGIC, NULL);
00731 
00732     /* Servo Limit */
00733     prop= RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE);
00734     RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
00735     RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
00736     RNA_def_property_ui_text(prop, "Max", "Upper limit for X force");
00737     RNA_def_property_update(prop, NC_LOGIC, NULL);
00738 
00739     prop= RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE);
00740     RNA_def_property_float_sdna(prop, NULL, "drot[0]");
00741     RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
00742     RNA_def_property_ui_text(prop, "Min", "Lower limit for X force");
00743     RNA_def_property_update(prop, NC_LOGIC, NULL);
00744 
00745     prop= RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE);
00746     RNA_def_property_float_sdna(prop, NULL, "dloc[1]");
00747     RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
00748     RNA_def_property_ui_text(prop, "Max", "Upper limit for Y force");
00749     RNA_def_property_update(prop, NC_LOGIC, NULL);
00750 
00751     prop= RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE);
00752     RNA_def_property_float_sdna(prop, NULL, "drot[1]");
00753     RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
00754     RNA_def_property_ui_text(prop, "Min", "Lower limit for Y force");
00755     RNA_def_property_update(prop, NC_LOGIC, NULL);
00756 
00757     prop= RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE);
00758     RNA_def_property_float_sdna(prop, NULL, "dloc[2]");
00759     RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
00760     RNA_def_property_ui_text(prop, "Max", "Upper limit for Z force");
00761     RNA_def_property_update(prop, NC_LOGIC, NULL);
00762 
00763     prop= RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE);
00764     RNA_def_property_float_sdna(prop, NULL, "drot[2]");
00765     RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
00766     RNA_def_property_ui_text(prop, "Min", "Lower limit for Z force");
00767     RNA_def_property_update(prop, NC_LOGIC, NULL);
00768 
00769     /* floats 3 Arrays*/
00770     prop= RNA_def_property(srna, "offset_location", PROP_FLOAT, PROP_XYZ);
00771     RNA_def_property_float_sdna(prop, NULL, "dloc");
00772     RNA_def_property_array(prop, 3);
00773     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
00774     RNA_def_property_ui_text(prop, "Loc", "Location");
00775     RNA_def_property_update(prop, NC_LOGIC, NULL);
00776 
00777     prop= RNA_def_property(srna, "offset_rotation", PROP_FLOAT, PROP_EULER);
00778     RNA_def_property_float_sdna(prop, NULL, "drot");
00779     RNA_def_property_array(prop, 3);
00780     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
00781     RNA_def_property_ui_text(prop, "Rot", "Rotation");
00782     RNA_def_property_update(prop, NC_LOGIC, NULL);
00783 
00784     prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_XYZ);
00785     RNA_def_property_float_sdna(prop, NULL, "forceloc");
00786     RNA_def_property_array(prop, 3);
00787     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
00788     RNA_def_property_ui_text(prop, "Force", "Force");
00789     RNA_def_property_update(prop, NC_LOGIC, NULL);
00790 
00791     prop= RNA_def_property(srna, "torque", PROP_FLOAT, PROP_XYZ);
00792     RNA_def_property_float_sdna(prop, NULL, "forcerot");
00793     RNA_def_property_array(prop, 3);
00794     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
00795     RNA_def_property_ui_text(prop, "Torque", "Torque");
00796     RNA_def_property_update(prop, NC_LOGIC, NULL);
00797 
00798     prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
00799     RNA_def_property_float_sdna(prop, NULL, "linearvelocity");
00800     RNA_def_property_array(prop, 3);
00801     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
00802     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)");
00803     RNA_def_property_update(prop, NC_LOGIC, NULL);
00804 
00805     prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
00806     RNA_def_property_float_sdna(prop, NULL, "angularvelocity");
00807     RNA_def_property_array(prop, 3);
00808     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
00809     RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity");
00810     RNA_def_property_update(prop, NC_LOGIC, NULL);
00811     
00812     /* booleans */
00813     prop= RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE);
00814     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DLOC_LOCAL);
00815     RNA_def_property_ui_text(prop, "L", "Location is defined in local coordinates");
00816     RNA_def_property_update(prop, NC_LOGIC, NULL);
00817 
00818     prop= RNA_def_property(srna, "use_local_rotation", PROP_BOOLEAN, PROP_NONE);
00819     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DROT_LOCAL);
00820     RNA_def_property_ui_text(prop, "L", "Rotation is defined in local coordinates");
00821     RNA_def_property_update(prop, NC_LOGIC, NULL);
00822 
00823     prop= RNA_def_property(srna, "use_local_force", PROP_BOOLEAN, PROP_NONE);
00824     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_FORCE_LOCAL);
00825     RNA_def_property_ui_text(prop, "L", "Force is defined in local coordinates");
00826     RNA_def_property_update(prop, NC_LOGIC, NULL);
00827 
00828     prop= RNA_def_property(srna, "use_local_torque", PROP_BOOLEAN, PROP_NONE);
00829     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TORQUE_LOCAL);
00830     RNA_def_property_ui_text(prop, "L", "Torque is defined in local coordinates");
00831     RNA_def_property_update(prop, NC_LOGIC, NULL);
00832 
00833     prop= RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
00834     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_LIN_VEL_LOCAL);
00835     RNA_def_property_ui_text(prop, "L", "Velocity is defined in local coordinates");
00836     RNA_def_property_update(prop, NC_LOGIC, NULL);
00837 
00838     prop= RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
00839     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ANG_VEL_LOCAL);
00840     RNA_def_property_ui_text(prop, "L", "Angular velocity is defined in local coordinates");
00841     RNA_def_property_update(prop, NC_LOGIC, NULL);
00842 
00843     prop= RNA_def_property(srna, "use_add_linear_velocity", PROP_BOOLEAN, PROP_NONE);
00844     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ADD_LIN_VEL);
00845     RNA_def_property_ui_text(prop, "Add", "Toggles between ADD and SET linV");
00846     RNA_def_property_update(prop, NC_LOGIC, NULL);
00847 
00848     prop= RNA_def_property(srna, "use_servo_limit_x", PROP_BOOLEAN, PROP_NONE);
00849     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_X);
00850     RNA_def_property_ui_text(prop, "X", "Set limit to force along the X axis");
00851     RNA_def_property_update(prop, NC_LOGIC, NULL);
00852 
00853     prop= RNA_def_property(srna, "use_servo_limit_y", PROP_BOOLEAN, PROP_NONE);
00854     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Y);
00855     RNA_def_property_ui_text(prop, "Y", "Set limit to force along the Y axis");
00856     RNA_def_property_update(prop, NC_LOGIC, NULL);
00857 
00858     prop= RNA_def_property(srna, "use_servo_limit_z", PROP_BOOLEAN, PROP_NONE);
00859     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Z);
00860     RNA_def_property_ui_text(prop, "Z", "Set limit to force along the Z axis");
00861     RNA_def_property_update(prop, NC_LOGIC, NULL);
00862 }
00863 
00864 static void rna_def_camera_actuator(BlenderRNA *brna)
00865 {
00866     StructRNA *srna;
00867     PropertyRNA *prop;
00868 
00869     static EnumPropertyItem prop_axis_items[] ={
00870         {OB_POSX, "POS_X", 0, "+X", "Camera tries to get behind the X axis"},
00871         {OB_POSY, "POS_Y", 0, "+Y", "Camera tries to get behind the Y axis"},
00872         {OB_NEGX, "NEG_X", 0, "-X", "Camera tries to get behind the -X axis"},
00873         {OB_NEGY, "NEG_Y", 0, "-Y", "Camera tries to get behind the -Y axis"},
00874         {0, NULL, 0, NULL, NULL}};
00875     
00876     srna= RNA_def_struct(brna, "CameraActuator", "Actuator");
00877     RNA_def_struct_ui_text(srna, "Camera Actuator", "");
00878     RNA_def_struct_sdna_from(srna, "bCameraActuator", "data");
00879 
00880     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
00881     RNA_def_property_struct_type(prop, "Object");
00882     RNA_def_property_pointer_sdna(prop, NULL, "ob");
00883     RNA_def_property_flag(prop, PROP_EDITABLE);
00884     RNA_def_property_ui_text(prop, "Camera Object", "Look at this Object");
00885     RNA_def_property_update(prop, NC_LOGIC, NULL);
00886 
00887     /* floats */
00888     prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
00889     RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
00890     RNA_def_property_ui_text(prop, "Height", "");
00891     RNA_def_property_update(prop, NC_LOGIC, NULL);
00892 
00893     prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
00894     RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
00895     RNA_def_property_ui_text(prop, "Min", "");
00896     RNA_def_property_update(prop, NC_LOGIC, NULL);
00897 
00898     prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
00899     RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
00900     RNA_def_property_ui_text(prop, "Max", "");
00901     RNA_def_property_update(prop, NC_LOGIC, NULL);
00902 
00903     prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
00904     RNA_def_property_float_sdna(prop, NULL, "damping");
00905     RNA_def_property_range(prop, 0, 10.0);
00906     RNA_def_property_ui_range(prop, 0, 5.0, 1, 2);
00907     RNA_def_property_ui_text(prop, "Damping", "Strength of the constraint that drives the camera behind the target");
00908     RNA_def_property_update(prop, NC_LOGIC, NULL);
00909 
00910     /* +x/+y/-x/-y */
00911     prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
00912     RNA_def_property_enum_sdna(prop, NULL, "axis");
00913     RNA_def_property_enum_items(prop, prop_axis_items);
00914     RNA_def_property_ui_text(prop, "Axis", "Axis the Camera will try to get behind");
00915     RNA_def_property_update(prop, NC_LOGIC, NULL);
00916 }
00917 
00918 static void rna_def_sound_actuator(BlenderRNA *brna)
00919 {
00920     StructRNA *srna;
00921     PropertyRNA *prop;
00922 
00923     static EnumPropertyItem prop_type_items[] ={
00924         {ACT_SND_PLAY_STOP_SOUND, "PLAYSTOP", 0, "Play Stop", ""},
00925         {ACT_SND_PLAY_END_SOUND, "PLAYEND", 0, "Play End", ""},
00926         {ACT_SND_LOOP_STOP_SOUND, "LOOPSTOP", 0, "Loop Stop", ""},
00927         {ACT_SND_LOOP_END_SOUND, "LOOPEND", 0, "Loop End", ""},
00928         {ACT_SND_LOOP_BIDIRECTIONAL_SOUND, "LOOPBIDIRECTIONAL", 0, "Loop Bidirectional", ""},
00929         {ACT_SND_LOOP_BIDIRECTIONAL_STOP_SOUND, "LOOPBIDIRECTIONALSTOP", 0, "Loop Bidirectional Stop", ""},
00930         {0, NULL, 0, NULL, NULL}
00931     };
00932     
00933     srna= RNA_def_struct(brna, "SoundActuator", "Actuator");
00934     RNA_def_struct_ui_text(srna, "Sound Actuator", "Actuator to handle sound");
00935     RNA_def_struct_sdna_from(srna, "bSoundActuator", "data");
00936 
00937     prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
00938     RNA_def_property_struct_type(prop, "Sound");
00939     RNA_def_property_flag(prop, PROP_EDITABLE);
00940     RNA_def_struct_ui_text(srna, "Sound", "Sound file");
00941     RNA_def_property_update(prop, NC_LOGIC, NULL);
00942 
00943     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
00944     RNA_def_property_enum_sdna(prop, NULL, "type");
00945     RNA_def_property_enum_items(prop, prop_type_items);
00946     RNA_def_property_ui_text(prop, "Play Mode", "");
00947     RNA_def_property_update(prop, NC_LOGIC, NULL);
00948 
00949     prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
00950     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
00951     RNA_def_property_range(prop, 0.0, 2.0);
00952     RNA_def_property_ui_text(prop, "Volume", "Initial volume of the sound");
00953     RNA_def_property_update(prop, NC_LOGIC, NULL);
00954 
00955     prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
00956     RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2);
00957     RNA_def_property_ui_text(prop, "Pitch", "Pitch of the sound");
00958     RNA_def_property_update(prop, NC_LOGIC, NULL);
00959     
00960     /* floats - 3D Parameters */
00961     prop= RNA_def_property(srna, "gain_3d_min", PROP_FLOAT, PROP_NONE);
00962     RNA_def_property_float_sdna(prop, NULL, "sound3D.min_gain");
00963     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
00964     RNA_def_property_ui_text(prop, "Minimum Gain", "The minimum gain of the sound, no matter how far it is away");
00965     RNA_def_property_update(prop, NC_LOGIC, NULL);
00966 
00967     prop= RNA_def_property(srna, "gain_3d_max", PROP_FLOAT, PROP_NONE);
00968     RNA_def_property_float_sdna(prop, NULL, "sound3D.max_gain");
00969     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
00970     RNA_def_property_ui_text(prop, "Maximum Gain", "The maximum gain of the sound, no matter how near it is");
00971     RNA_def_property_update(prop, NC_LOGIC, NULL);
00972 
00973     prop= RNA_def_property(srna, "distance_3d_reference", PROP_FLOAT, PROP_NONE);
00974     RNA_def_property_float_sdna(prop, NULL, "sound3D.reference_distance");
00975     RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2);
00976     RNA_def_property_ui_text(prop, "Reference Distance", "The distance where the sound has a gain of 1.0");
00977     RNA_def_property_update(prop, NC_LOGIC, NULL);
00978     
00979     prop= RNA_def_property(srna, "distance_3d_max", PROP_FLOAT, PROP_NONE);
00980     RNA_def_property_float_sdna(prop, NULL, "sound3D.max_distance");
00981     RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2);
00982     RNA_def_property_ui_text(prop, "Maximum Distance", "The maximum distance at which you can hear the sound");
00983     RNA_def_property_update(prop, NC_LOGIC, NULL);
00984 
00985     prop= RNA_def_property(srna, "rolloff_factor_3d", PROP_FLOAT, PROP_NONE);
00986     RNA_def_property_float_sdna(prop, NULL, "sound3D.rolloff_factor");
00987     RNA_def_property_ui_range(prop, 0.0, 5.0, 1, 2);
00988     RNA_def_property_ui_text(prop, "Rolloff", "The influence factor on volume depending on distance");
00989     RNA_def_property_update(prop, NC_LOGIC, NULL);
00990 
00991     prop= RNA_def_property(srna, "cone_outer_gain_3d", PROP_FLOAT, PROP_NONE);
00992     RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_gain");
00993     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
00994     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)");
00995     RNA_def_property_update(prop, NC_LOGIC, NULL);
00996 
00997     prop= RNA_def_property(srna, "cone_outer_angle_3d", PROP_FLOAT, PROP_NONE);
00998     RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_angle");
00999     RNA_def_property_ui_range(prop, 0.0, 360.0, 1, 2);
01000     RNA_def_property_ui_text(prop, "Cone Outer Angle", "The angle of the outer cone");
01001     RNA_def_property_update(prop, NC_LOGIC, NULL);
01002 
01003     prop= RNA_def_property(srna, "cone_inner_angle_3d", PROP_FLOAT, PROP_NONE);
01004     RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_inner_angle");
01005     RNA_def_property_ui_range(prop, 0.0, 360.0, 1, 2);
01006     RNA_def_property_ui_text(prop, "Cone Inner Angle", "The angle of the inner cone");
01007     RNA_def_property_update(prop, NC_LOGIC, NULL);
01008     
01009     /* booleans */
01010     prop= RNA_def_property(srna, "use_sound_3d", PROP_BOOLEAN, PROP_NONE);
01011     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SND_3D_SOUND);
01012     RNA_def_property_ui_text(prop, "3D Sound", "Enable/Disable 3D Sound");
01013     RNA_def_property_update(prop, NC_LOGIC, NULL);
01014 }
01015 
01016 static void rna_def_property_actuator(BlenderRNA *brna)
01017 {
01018     StructRNA *srna;
01019     PropertyRNA *prop;
01020 
01021     static EnumPropertyItem prop_type_items[] ={
01022         {ACT_PROP_ASSIGN, "ASSIGN", 0, "Assign", ""},
01023         {ACT_PROP_ADD, "ADD", 0, "Add", ""},
01024         {ACT_PROP_COPY, "COPY", 0, "Copy", ""},
01025         {ACT_PROP_TOGGLE, "TOGGLE", 0, "Toggle", "For bool/int/float/timer properties only"},
01026         {0, NULL, 0, NULL, NULL}
01027     };
01028 
01029     srna= RNA_def_struct(brna, "PropertyActuator", "Actuator");
01030     RNA_def_struct_ui_text(srna, "Property Actuator", "Actuator to handle properties");
01031     RNA_def_struct_sdna_from(srna, "bPropertyActuator", "data");
01032 
01033     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01034     RNA_def_property_enum_sdna(prop, NULL, "type");
01035     RNA_def_property_enum_items(prop, prop_type_items);
01036     RNA_def_property_ui_text(prop, "Mode", "");
01037     RNA_def_property_update(prop, NC_LOGIC, NULL);
01038 
01039     prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
01040     RNA_def_property_string_sdna(prop, NULL, "name");
01041     RNA_def_property_ui_text(prop, "Property", "The name of the property");
01042     RNA_def_property_update(prop, NC_LOGIC, NULL);
01043 
01044     prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
01045     RNA_def_property_ui_text(prop, "Value", "The name of the property or the value to use (use \"\" around strings)");
01046     RNA_def_property_update(prop, NC_LOGIC, NULL);
01047 
01048     /* Copy Mode */
01049     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01050     RNA_def_property_struct_type(prop, "Object");
01051     RNA_def_property_pointer_sdna(prop, NULL, "ob");
01052     RNA_def_property_flag(prop, PROP_EDITABLE);
01053     RNA_def_property_ui_text(prop, "Object", "Copy from this Object");
01054     RNA_def_property_update(prop, NC_LOGIC, NULL);
01055 
01056     //XXX add even magic'er property lookup (need to look for the property list of the target object)
01057     prop= RNA_def_property(srna, "object_property", PROP_STRING, PROP_NONE);
01058     RNA_def_property_string_sdna(prop, NULL, "value");
01059     RNA_def_property_ui_text(prop, "Property Name", "Copy this property");
01060     RNA_def_property_update(prop, NC_LOGIC, NULL);
01061 }
01062 
01063 static void rna_def_constraint_actuator(BlenderRNA *brna)
01064 {
01065     StructRNA *srna;
01066     PropertyRNA *prop;
01067 
01068     static EnumPropertyItem prop_type_items[] ={
01069         {ACT_CONST_TYPE_LOC, "LOC", 0, "Location Constraint", ""},
01070         {ACT_CONST_TYPE_DIST, "DIST", 0, "Distance Constraint", ""},
01071         {ACT_CONST_TYPE_ORI, "ORI", 0, "Orientation Constraint", ""},
01072         {ACT_CONST_TYPE_FH, "FH", 0, "Force Field Constraint", ""},
01073         {0, NULL, 0, NULL, NULL}
01074     };
01075 
01076     static EnumPropertyItem prop_limit_items[] ={
01077         {ACT_CONST_NONE, "NONE", 0, "None", ""},
01078         {ACT_CONST_LOCX, "LOCX", 0, "Loc X", ""},
01079         {ACT_CONST_LOCY, "LOCY", 0, "Loc Y", ""},
01080         {ACT_CONST_LOCZ, "LOCZ", 0, "Loc Z", ""},
01081         {0, NULL, 0, NULL, NULL}
01082     };
01083 
01084     static EnumPropertyItem prop_direction_items[] ={
01085         {ACT_CONST_NONE, "NONE", 0, "None", ""},
01086         {ACT_CONST_DIRPX, "DIRPX", 0, "X axis", ""},
01087         {ACT_CONST_DIRPY, "DIRPY", 0, "Y axis", ""},
01088         {ACT_CONST_DIRPZ, "DIRPZ", 0, "Z axis", ""},
01089         {ACT_CONST_DIRNX, "DIRNX", 0, "-X axis", ""},
01090         {ACT_CONST_DIRNY, "DIRNY", 0, "-Y axis", ""},
01091         {ACT_CONST_DIRNZ, "DIRNZ", 0, "-Z axis", ""},
01092         {0, NULL, 0, NULL, NULL}
01093     };
01094 
01095     static EnumPropertyItem prop_direction_pos_items[] ={
01096         {ACT_CONST_NONE, "NONE", 0, "None", ""},
01097         {ACT_CONST_DIRPX, "DIRPX", 0, "X axis", ""},
01098         {ACT_CONST_DIRPY, "DIRPY", 0, "Y axis", ""},
01099         {ACT_CONST_DIRPZ, "DIRPZ", 0, "Z axis", ""},
01100         {0, NULL, 0, NULL, NULL}
01101     };
01102 
01103     srna= RNA_def_struct(brna, "ConstraintActuator", "Actuator");
01104     RNA_def_struct_ui_text(srna, "Constraint Actuator", "Actuator to handle Constraints");
01105     RNA_def_struct_sdna_from(srna, "bConstraintActuator", "data");
01106 
01107     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01108     RNA_def_property_enum_sdna(prop, NULL, "type");
01109     RNA_def_property_enum_items(prop, prop_type_items);
01110     RNA_def_property_enum_funcs(prop, NULL, "rna_ConstraintActuator_type_set", NULL);
01111     RNA_def_property_ui_text(prop, "Constraints Mode", "The type of the constraint");
01112     RNA_def_property_update(prop, NC_LOGIC, NULL);
01113 
01114     prop= RNA_def_property(srna, "limit", PROP_ENUM, PROP_NONE);
01115     RNA_def_property_enum_sdna(prop, NULL, "flag");
01116     RNA_def_property_enum_items(prop, prop_limit_items);
01117     RNA_def_property_ui_text(prop, "Limit", "");
01118     RNA_def_property_update(prop, NC_LOGIC, NULL);
01119 
01120     prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
01121     RNA_def_property_enum_sdna(prop, NULL, "mode");
01122     RNA_def_property_enum_items(prop, prop_direction_items);
01123     RNA_def_property_ui_text(prop, "Direction", "Direction of the ray");
01124     RNA_def_property_update(prop, NC_LOGIC, NULL);
01125 
01126     prop= RNA_def_property(srna, "direction_axis", PROP_ENUM, PROP_NONE);
01127     RNA_def_property_enum_sdna(prop, NULL, "mode");
01128     RNA_def_property_enum_items(prop, prop_direction_items);
01129     RNA_def_property_ui_text(prop, "Direction", "Select the axis to be aligned along the reference direction");
01130     RNA_def_property_update(prop, NC_LOGIC, NULL);
01131 
01132     /* ACT_CONST_TYPE_LOC */
01133     prop= RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
01134     RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmin_get", "rna_ConstraintActuator_limitmin_set", NULL);
01135     RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
01136     RNA_def_property_ui_text(prop, "Min", "");
01137     RNA_def_property_update(prop, NC_LOGIC, NULL);
01138 
01139     prop= RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
01140     RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmax_get", "rna_ConstraintActuator_limitmax_set", NULL);
01141     RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
01142     RNA_def_property_ui_text(prop, "Max", "");
01143     RNA_def_property_update(prop, NC_LOGIC, NULL);
01144 
01145     prop= RNA_def_property(srna, "damping", PROP_INT, PROP_NONE);
01146     RNA_def_property_int_sdna(prop, NULL, "damp");
01147     RNA_def_property_ui_range(prop, 0, 100, 1, 1);
01148     RNA_def_property_ui_text(prop, "Damping", "Damping factor: time constant (in frame) of low pass filter");
01149     RNA_def_property_update(prop, NC_LOGIC, NULL);
01150 
01151     /* ACT_CONST_TYPE_DIST */
01152     prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
01153     RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_range_get", "rna_ConstraintActuator_range_set", NULL);
01154     RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2);
01155     RNA_def_property_ui_text(prop, "Range", "Maximum length of ray");
01156     RNA_def_property_update(prop, NC_LOGIC, NULL);
01157 
01158     prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
01159     RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_distance_get", "rna_ConstraintActuator_distance_set", NULL);
01160     RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
01161     RNA_def_property_ui_text(prop, "Distance", "Keep this distance to target");
01162     RNA_def_property_update(prop, NC_LOGIC, NULL);
01163 
01164     //XXX to use a pointer or add a material lookup
01165     prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
01166     RNA_def_property_string_sdna(prop, NULL, "matprop");
01167     RNA_def_property_flag(prop, PROP_EDITABLE);
01168     RNA_def_property_ui_text(prop, "Material", "Ray detects only Objects with this material");
01169     RNA_def_property_update(prop, NC_LOGIC, NULL);
01170 
01171     //XXX add magic property lookup
01172     prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
01173     RNA_def_property_string_sdna(prop, NULL, "matprop");
01174     RNA_def_property_ui_text(prop, "Property", "Ray detects only Objects with this property");
01175     RNA_def_property_update(prop, NC_LOGIC, NULL);
01176 
01177     prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
01178     RNA_def_property_ui_range(prop, 0, 1000, 1, 2);
01179     RNA_def_property_ui_text(prop, "Time", "Maximum activation time in frame, 0 for unlimited");
01180     RNA_def_property_update(prop, NC_LOGIC, NULL);
01181 
01182     prop= RNA_def_property(srna, "damping_rotation", PROP_INT, PROP_NONE);
01183     RNA_def_property_int_sdna(prop, NULL, "rotdamp");
01184     RNA_def_property_ui_range(prop, 0, 100, 1, 1);
01185     RNA_def_property_ui_text(prop, "RotDamp", "Use a different damping for orientation");
01186     RNA_def_property_update(prop, NC_LOGIC, NULL);
01187 
01188     /* ACT_CONST_TYPE_ORI */
01189     prop= RNA_def_property(srna, "direction_axis_pos", PROP_ENUM, PROP_NONE);
01190     RNA_def_property_enum_sdna(prop, NULL, "mode");
01191     RNA_def_property_enum_items(prop, prop_direction_pos_items);
01192     RNA_def_property_ui_text(prop, "Direction", "Select the axis to be aligned along the reference direction");
01193     RNA_def_property_update(prop, NC_LOGIC, NULL);
01194 
01195     prop= RNA_def_property(srna, "rotation_max", PROP_FLOAT, PROP_XYZ);
01196     RNA_def_property_float_sdna(prop, NULL, "maxrot");
01197     RNA_def_property_array(prop, 3);
01198     RNA_def_property_ui_range(prop, -2000.0, 2000.0, 10, 2);
01199     RNA_def_property_ui_text(prop, "Reference Direction", "Reference Direction");
01200     RNA_def_property_update(prop, NC_LOGIC, NULL);
01201 
01202     //XXX TODO - use radians internally then change to PROP_ANGLE
01203     prop= RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_NONE);
01204     RNA_def_property_float_sdna(prop, NULL, "minloc[0]");
01205     RNA_def_property_range(prop, 0.0, 180.0);
01206     RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle (in degree) to maintain with target direction (no correction is done if angle with target direction is between min and max)");
01207     RNA_def_property_update(prop, NC_LOGIC, NULL);
01208 
01209     //XXX TODO - use radians internally then change to PROP_ANGLE
01210     prop= RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_NONE);
01211     RNA_def_property_float_sdna(prop, NULL, "maxloc[0]");
01212     RNA_def_property_range(prop, 0.0, 180.0);
01213     RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle (in degree) allowed with target direction (no correction is done if angle with target direction is between min and max)");
01214     RNA_def_property_update(prop, NC_LOGIC, NULL);
01215 
01216     /* ACT_CONST_TYPE_FH */
01217     prop= RNA_def_property(srna, "fh_height", PROP_FLOAT, PROP_NONE);
01218     RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_fhheight_get", "rna_ConstraintActuator_fhheight_set", NULL);
01219     RNA_def_property_ui_range(prop, 0.01, 2000.0, 10, 2);
01220     RNA_def_property_ui_text(prop, "Distance", "Height of the force field area");
01221     RNA_def_property_update(prop, NC_LOGIC, NULL);
01222 
01223     prop= RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE);
01224     RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_spring_get", "rna_ConstraintActuator_spring_set", NULL);
01225     RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
01226     RNA_def_property_ui_text(prop, "Force", "Spring force within the force field area");
01227     RNA_def_property_update(prop, NC_LOGIC, NULL);
01228 
01229     prop= RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
01230     RNA_def_property_float_sdna(prop, NULL, "maxrot[0]");
01231     RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
01232     RNA_def_property_ui_text(prop, "Damping", "Damping factor of the force field spring");
01233     RNA_def_property_update(prop, NC_LOGIC, NULL);
01234 
01235     /* booleans */
01236     prop= RNA_def_property(srna, "use_force_distance", PROP_BOOLEAN, PROP_NONE);
01237     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DISTANCE);
01238     RNA_def_property_ui_text(prop, "Force Distance", "Force distance of object to point of impact of ray");
01239     RNA_def_property_update(prop, NC_LOGIC, NULL);
01240 
01241     prop= RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE);
01242     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_LOCAL);
01243     RNA_def_property_ui_text(prop, "L", "Set ray along object's axis or global axis");
01244     RNA_def_property_update(prop, NC_LOGIC, NULL);
01245 
01246     prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
01247     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL);
01248     RNA_def_property_ui_text(prop, "N", "Set object axis along (local axis) or parallel (global axis) to the normal at hit position");
01249     RNA_def_property_update(prop, NC_LOGIC, NULL);
01250 
01251     prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
01252     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_PERMANENT);
01253     RNA_def_property_ui_text(prop, "PER", "Persistent actuator: stays active even if ray does not reach target");
01254     RNA_def_property_update(prop, NC_LOGIC, NULL);
01255 
01256     //XXX to use an enum instead of a flag if possible
01257     prop= RNA_def_property(srna, "use_material_detect", PROP_BOOLEAN, PROP_NONE);
01258     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_MATERIAL);
01259     RNA_def_property_ui_text(prop, "M/P", "Detect material instead of property");
01260     RNA_def_property_boolean_funcs(prop, NULL, "rna_Actuator_constraint_detect_material_set");
01261     RNA_def_property_update(prop, NC_LOGIC, NULL);
01262 
01263     prop= RNA_def_property(srna, "use_fh_paralel_axis", PROP_BOOLEAN, PROP_NONE);
01264     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DOROTFH);
01265     RNA_def_property_ui_text(prop, "Rot Fh", "Keep object axis parallel to normal");
01266     RNA_def_property_update(prop, NC_LOGIC, NULL);
01267 
01268     prop= RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE);
01269     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL);
01270     RNA_def_property_ui_text(prop, "N", "Add a horizontal spring force on slopes");
01271     RNA_def_property_update(prop, NC_LOGIC, NULL);
01272 }
01273 
01274 static void rna_def_edit_object_actuator(BlenderRNA *brna)
01275 {
01276     StructRNA *srna;
01277     PropertyRNA *prop;
01278 
01279     static EnumPropertyItem prop_dyn_items[] ={
01280         {ACT_EDOB_RESTORE_DYN, "RESTOREDYN", 0, "Restore Dynamics", ""},
01281         {ACT_EDOB_SUSPEND_DYN, "SUSPENDDYN", 0, "Suspend Dynamics", ""},
01282         {ACT_EDOB_ENABLE_RB, "ENABLERIGIDBODY", 0, "Enable Rigid Body", ""},
01283         {ACT_EDOB_DISABLE_RB, "DISABLERIGIDBODY", 0, "Disable Rigid Body", ""},
01284         {ACT_EDOB_SET_MASS, "SETMASS", 0, "Set Mass", ""},
01285         {0, NULL, 0, NULL, NULL} };
01286 
01287     static EnumPropertyItem prop_type_items[] ={
01288     {ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""},
01289     {ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""},
01290     {ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""},
01291     {ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""},
01292     {ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""},
01293     {0, NULL, 0, NULL, NULL} };
01294 
01295     srna= RNA_def_struct(brna, "EditObjectActuator", "Actuator");
01296     RNA_def_struct_ui_text(srna, "Edit Object Actuator", "Actuator used to edit objects");
01297     RNA_def_struct_sdna_from(srna, "bEditObjectActuator", "data");
01298 
01299     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01300     RNA_def_property_enum_sdna(prop, NULL, "type");
01301     RNA_def_property_enum_items(prop, prop_type_items);
01302     RNA_def_property_ui_text(prop, "Edit Object", "The mode of the actuator");
01303     RNA_def_property_update(prop, NC_LOGIC, NULL);
01304 
01305     prop= RNA_def_property(srna, "dynamic_operation", PROP_ENUM, PROP_NONE);
01306     RNA_def_property_enum_sdna(prop, NULL, "dyn_operation");
01307     RNA_def_property_enum_items(prop, prop_dyn_items);
01308     RNA_def_property_ui_text(prop, "Dynamic Operation", "");
01309     RNA_def_property_update(prop, NC_LOGIC, NULL);
01310 
01311     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01312     RNA_def_property_struct_type(prop, "Object");
01313     RNA_def_property_pointer_sdna(prop, NULL, "ob");
01314     RNA_def_property_flag(prop, PROP_EDITABLE);
01315     RNA_def_property_ui_text(prop, "Object", "Add this Object and all its children (can't be on a visible layer)");
01316     RNA_def_property_update(prop, NC_LOGIC, NULL);
01317 
01318     prop= RNA_def_property(srna, "track_object", PROP_POINTER, PROP_NONE);
01319     RNA_def_property_struct_type(prop, "Object");
01320     RNA_def_property_pointer_sdna(prop, NULL, "ob");
01321     RNA_def_property_flag(prop, PROP_EDITABLE);
01322     RNA_def_property_ui_text(prop, "Object", "Track to this Object");
01323     RNA_def_property_update(prop, NC_LOGIC, NULL);
01324     
01325     prop= RNA_def_property(srna, "mesh", PROP_POINTER, PROP_NONE);
01326     RNA_def_property_struct_type(prop, "Mesh");
01327     RNA_def_property_pointer_sdna(prop, NULL, "me");
01328     RNA_def_property_flag(prop, PROP_EDITABLE);
01329     RNA_def_property_ui_text(prop, "Mesh", "Replace the existing, when left blank 'Phys' will remake the existing physics mesh");
01330     /* note: custom set function is ONLY to avoid rna setting a user for this. */
01331     RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_editobject_mesh_set", NULL, NULL);
01332     RNA_def_property_update(prop, NC_LOGIC, NULL);
01333 
01334     prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
01335     RNA_def_property_ui_range(prop, 0, 2000, 1, 1);
01336     RNA_def_property_ui_text(prop, "Time", "Duration the new Object lives or the track takes");
01337     RNA_def_property_update(prop, NC_LOGIC, NULL);
01338 
01339     prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
01340     RNA_def_property_ui_range(prop, 0, 10000, 1, 2);
01341     RNA_def_property_ui_text(prop, "Mass", "The mass of the object");
01342     RNA_def_property_update(prop, NC_LOGIC, NULL);
01343 
01344     /* floats 3 Arrays*/
01345     prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
01346     RNA_def_property_float_sdna(prop, NULL, "linVelocity");
01347     RNA_def_property_array(prop, 3);
01348     RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2);
01349     RNA_def_property_ui_text(prop, "Linear Velocity", "Velocity upon creation");
01350     RNA_def_property_update(prop, NC_LOGIC, NULL);
01351 
01352     prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
01353     RNA_def_property_float_sdna(prop, NULL, "angVelocity");
01354     RNA_def_property_array(prop, 3);
01355     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
01356     RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity upon creation");
01357     RNA_def_property_update(prop, NC_LOGIC, NULL);
01358 
01359     /* booleans */
01360     prop= RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
01361     RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_LINV);
01362     RNA_def_property_ui_text(prop, "L", "Apply the transformation locally");
01363     RNA_def_property_update(prop, NC_LOGIC, NULL);
01364 
01365     prop= RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
01366     RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_ANGV);
01367     RNA_def_property_ui_text(prop, "L", "Apply the rotation locally");
01368     RNA_def_property_update(prop, NC_LOGIC, NULL);
01369 
01370     prop= RNA_def_property(srna, "use_replace_display_mesh", PROP_BOOLEAN, PROP_NONE);
01371     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_NOGFX);
01372     RNA_def_property_ui_text(prop, "Gfx", "Replace the display mesh");
01373     RNA_def_property_update(prop, NC_LOGIC, NULL);
01374 
01375     prop= RNA_def_property(srna, "use_replace_physics_mesh", PROP_BOOLEAN, PROP_NONE);
01376     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_PHYS);
01377     RNA_def_property_ui_text(prop, "Phys", "Replace the physics mesh (triangle bounds only - compound shapes not supported)");
01378     RNA_def_property_update(prop, NC_LOGIC, NULL);
01379 
01380     prop= RNA_def_property(srna, "use_3d_tracking", PROP_BOOLEAN, PROP_NONE);
01381     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TRACK_3D);
01382     RNA_def_property_ui_text(prop, "3D", "Enable 3D tracking");
01383     RNA_def_property_update(prop, NC_LOGIC, NULL);
01384 }
01385 
01386 static void rna_def_scene_actuator(BlenderRNA *brna)
01387 {
01388     StructRNA *srna;
01389     PropertyRNA *prop;
01390 
01391     static EnumPropertyItem prop_type_items[] ={
01392         {ACT_SCENE_RESTART, "RESTART", 0, "Restart", ""},
01393         {ACT_SCENE_SET, "SET", 0, "Set Scene", ""},
01394         {ACT_SCENE_CAMERA, "CAMERA", 0, "Set Camera", ""},
01395         {ACT_SCENE_ADD_FRONT, "ADDFRONT", 0, "Add Overlay Scene", ""},
01396         {ACT_SCENE_ADD_BACK, "ADDBACK", 0, "Add Background Scene", ""},
01397         {ACT_SCENE_REMOVE, "REMOVE", 0, "Remove Scene", ""},
01398         {ACT_SCENE_SUSPEND, "SUSPEND", 0, "Suspend Scene", ""},
01399         {ACT_SCENE_RESUME, "RESUME", 0, "Resume Scene", ""},
01400         {0, NULL, 0, NULL, NULL}};  
01401         
01402     srna= RNA_def_struct(brna, "SceneActuator", "Actuator");
01403     RNA_def_struct_ui_text(srna, "Scene Actuator", "");
01404     RNA_def_struct_sdna_from(srna, "bSceneActuator", "data");
01405 
01406     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01407     RNA_def_property_enum_sdna(prop, NULL, "type");
01408     RNA_def_property_enum_items(prop, prop_type_items);
01409     RNA_def_property_ui_text(prop, "Mode", "");
01410     RNA_def_property_update(prop, NC_LOGIC, NULL);
01411     
01412     //XXX filter only camera objects
01413     prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
01414     RNA_def_property_struct_type(prop, "Object");
01415     RNA_def_property_flag(prop, PROP_EDITABLE);
01416     RNA_def_property_ui_text(prop, "Camera Object", "Set this Camera (leave empty to refer to self object)");
01417     RNA_def_property_update(prop, NC_LOGIC, NULL);
01418 
01419     prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
01420     RNA_def_property_struct_type(prop, "Scene");
01421     RNA_def_property_flag(prop, PROP_EDITABLE);
01422     RNA_def_property_ui_text(prop, "Scene", "Scene to be added/removed/paused/resumed");
01423     RNA_def_property_update(prop, NC_LOGIC, NULL);
01424 
01425     /* XXX no need for those tooltips. to remove soon
01426     Originally we had different 'scene' tooltips for different values of 'type'.
01427     They were:
01428     ACT_SCENE_RESTART   ""
01429     ACT_SCENE_CAMERA    ""
01430     ACT_SCENE_SET       "Set this Scene"
01431     ACT_SCENE_ADD_FRONT "Add an Overlay Scene"
01432     ACT_SCENE_ADD_BACK  "Add a Background Scene"
01433     ACT_SCENE_REMOVE    "Remove a Scene"
01434     ACT_SCENE_SUSPEND   "Pause a Scene"
01435     ACT_SCENE_RESUME    "Unpause a Scene"
01436 
01437     It can be done in the ui script if still needed.
01438     */
01439     
01440 }
01441 
01442 static void rna_def_random_actuator(BlenderRNA *brna)
01443 {
01444     StructRNA *srna;
01445     PropertyRNA *prop;
01446 
01447     static EnumPropertyItem prop_distribution_items[] ={
01448         {ACT_RANDOM_BOOL_CONST, "BOOL_CONSTANT", 0, "Bool Constant", ""},
01449         {ACT_RANDOM_BOOL_UNIFORM, "BOOL_UNIFORM", 0, "Bool Uniform", ""},
01450         {ACT_RANDOM_BOOL_BERNOUILLI, "BOOL_BERNOUILLI", 0, "Bool Bernoulli", ""},
01451         {ACT_RANDOM_INT_CONST, "INT_CONSTANT", 0, "Int Constant", ""},
01452         {ACT_RANDOM_INT_UNIFORM, "INT_UNIFORM", 0, "Int Uniform", ""},
01453         {ACT_RANDOM_INT_POISSON, "INT_POISSON", 0, "Int Poisson", ""},
01454         {ACT_RANDOM_FLOAT_CONST, "FLOAT_CONSTANT", 0, "Float Constant", ""},
01455         {ACT_RANDOM_FLOAT_UNIFORM, "FLOAT_UNIFORM", 0, "Float Uniform", ""},
01456         {ACT_RANDOM_FLOAT_NORMAL, "FLOAT_NORMAL", 0, "Float Normal", ""},
01457         {ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL, "FLOAT_NEGATIVE_EXPONENTIAL", 0, "Float Neg. Exp.", ""},
01458         {0, NULL, 0, NULL, NULL}};  
01459 
01460     srna= RNA_def_struct(brna, "RandomActuator", "Actuator");
01461     RNA_def_struct_ui_text(srna, "Random Actuator", "");
01462     RNA_def_struct_sdna_from(srna, "bRandomActuator", "data");
01463 
01464     prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
01465     RNA_def_property_ui_range(prop, 0, 1000, 1, 1);
01466     RNA_def_property_range(prop, 0, MAXFRAME);
01467     RNA_def_property_ui_text(prop, "Seed", "Initial seed of the random generator, use Python for more freedom (choose 0 for not random)");
01468     RNA_def_property_update(prop, NC_LOGIC, NULL);
01469 
01470     prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
01471     RNA_def_property_string_sdna(prop, NULL, "propname");
01472     RNA_def_property_ui_text(prop, "Property", "Assign the random value to this property");
01473     RNA_def_property_update(prop, NC_LOGIC, NULL);
01474 
01475     prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
01476     RNA_def_property_enum_items(prop, prop_distribution_items);
01477     RNA_def_property_ui_text(prop, "Distribution", "Choose the type of distribution");
01478     RNA_def_property_update(prop, NC_LOGIC, NULL);
01479     
01480     /* arguments for the distribution */
01481     /* int_arg_1, int_arg_2, float_arg_1, float_arg_2 */
01482 
01483     /* ACT_RANDOM_BOOL_CONST */
01484     prop= RNA_def_property(srna, "use_always_true", PROP_BOOLEAN, PROP_NONE);
01485     RNA_def_property_boolean_sdna(prop, NULL, "int_arg_1", 1);
01486     RNA_def_property_ui_text(prop, "Always True", "Always false or always true");
01487     RNA_def_property_update(prop, NC_LOGIC, NULL);
01488 
01489     /* ACT_RANDOM_BOOL_UNIFORM */
01490     // label => "Choose between true and false, 50% chance each"
01491 
01492     /* ACT_RANDOM_BOOL_BERNOUILLI */
01493     prop= RNA_def_property(srna, "chance", PROP_FLOAT, PROP_PERCENTAGE);
01494     RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
01495     RNA_def_property_range(prop, 0.0, 1.0);
01496     RNA_def_property_ui_text(prop, "Chance", "Pick a number between 0 and 1, success if it's below this value");
01497     RNA_def_property_update(prop, NC_LOGIC, NULL);
01498 
01499     /* ACT_RANDOM_INT_CONST */
01500     prop= RNA_def_property(srna, "int_value", PROP_INT, PROP_NONE);
01501     RNA_def_property_int_sdna(prop, NULL, "int_arg_1");
01502     RNA_def_property_ui_range(prop, -1000, 1000, 1, 1);
01503     RNA_def_property_ui_text(prop, "Value", "Always return this number");
01504     RNA_def_property_update(prop, NC_LOGIC, NULL);
01505 
01506     /* ACT_RANDOM_INT_UNIFORM */
01507     prop= RNA_def_property(srna, "int_min", PROP_INT, PROP_NONE);
01508     RNA_def_property_int_sdna(prop, NULL, "int_arg_1");
01509     RNA_def_property_range(prop, -1000, 1000);
01510     RNA_def_property_ui_text(prop, "Min", "Choose a number from a range: lower boundary of the range");
01511     RNA_def_property_update(prop, NC_LOGIC, NULL);
01512 
01513     prop= RNA_def_property(srna, "int_max", PROP_INT, PROP_NONE);
01514     RNA_def_property_int_sdna(prop, NULL, "int_arg_2");
01515     RNA_def_property_range(prop, -1000, 1000);
01516     RNA_def_property_ui_text(prop, "Max", "Choose a number from a range: upper boundary of the range");
01517     RNA_def_property_update(prop, NC_LOGIC, NULL);
01518 
01519     /* ACT_RANDOM_INT_POISSON */
01520     prop= RNA_def_property(srna, "int_mean", PROP_FLOAT, PROP_NONE);
01521     RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
01522     RNA_def_property_range(prop, 0.01, 100.0);
01523     RNA_def_property_ui_text(prop, "Mean", "Expected mean value of the distribution");
01524     RNA_def_property_update(prop, NC_LOGIC, NULL);
01525 
01526     /* ACT_RANDOM_FLOAT_CONST */
01527     prop= RNA_def_property(srna, "float_value", PROP_FLOAT, PROP_NONE);
01528     RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
01529     RNA_def_property_range(prop, 0.0, 1.0);
01530     RNA_def_property_ui_text(prop, "Value", "Always return this number");
01531     RNA_def_property_update(prop, NC_LOGIC, NULL);
01532 
01533     /* ACT_RANDOM_FLOAT_UNIFORM */
01534     prop= RNA_def_property(srna, "float_min", PROP_FLOAT, PROP_NONE);
01535     RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
01536     RNA_def_property_range(prop, -1000.0, 1000.0);
01537     RNA_def_property_ui_text(prop, "Min", "Choose a number from a range: lower boundary of the range");
01538     RNA_def_property_update(prop, NC_LOGIC, NULL);
01539 
01540     prop= RNA_def_property(srna, "float_max", PROP_FLOAT, PROP_NONE);
01541     RNA_def_property_float_sdna(prop, NULL, "float_arg_2");
01542     RNA_def_property_range(prop, -1000.0, 1000.0);
01543     RNA_def_property_ui_text(prop, "Max", "Choose a number from a range: upper boundary of the range");
01544     RNA_def_property_update(prop, NC_LOGIC, NULL);
01545 
01546     /* ACT_RANDOM_FLOAT_NORMAL */
01547     prop= RNA_def_property(srna, "float_mean", PROP_FLOAT, PROP_NONE);
01548     RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
01549     RNA_def_property_range(prop, -1000.0, 1000.0);
01550     RNA_def_property_ui_text(prop, "Mean", "A normal distribution: mean of the distribution");
01551     RNA_def_property_update(prop, NC_LOGIC, NULL);
01552 
01553     prop= RNA_def_property(srna, "standard_derivation", PROP_FLOAT, PROP_NONE);
01554     RNA_def_property_float_sdna(prop, NULL, "float_arg_2");
01555     RNA_def_property_range(prop, -1000.0, 1000.0);
01556     RNA_def_property_ui_text(prop, "SD", "A normal distribution: standard deviation of the distribution");
01557     RNA_def_property_update(prop, NC_LOGIC, NULL);
01558 
01559     /* ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL */
01560     prop= RNA_def_property(srna, "half_life_time", PROP_FLOAT, PROP_NONE);
01561     RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
01562     RNA_def_property_range(prop, -1000.0, 1000.0);
01563     RNA_def_property_ui_text(prop, "Half-Life Time", "Negative exponential dropoff");
01564     RNA_def_property_update(prop, NC_LOGIC, NULL);
01565 }
01566 
01567 static void rna_def_message_actuator(BlenderRNA *brna)
01568 {
01569     StructRNA *srna;
01570     PropertyRNA *prop;
01571 
01572     static EnumPropertyItem prop_body_type_items[] ={
01573         {ACT_MESG_MESG, "TEXT", 0, "Text", ""},
01574         {ACT_MESG_PROP, "PROPERTY", 0, "Property", ""},
01575         {0, NULL, 0, NULL, NULL}};
01576 
01577     srna= RNA_def_struct(brna, "MessageActuator", "Actuator");
01578     RNA_def_struct_ui_text(srna, "Message Actuator", "");
01579     RNA_def_struct_sdna_from(srna, "bMessageActuator", "data");
01580 
01581     prop= RNA_def_property(srna, "to_property", PROP_STRING, PROP_NONE);
01582     RNA_def_property_string_sdna(prop, NULL, "toPropName");
01583     RNA_def_property_ui_text(prop, "To", "Optional, send message to objects with this name only, or empty to broadcast");
01584     RNA_def_property_update(prop, NC_LOGIC, NULL);
01585 
01586     prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
01587     RNA_def_property_ui_text(prop, "Subject", "Optional, message subject (this is what can be filtered on)");
01588     RNA_def_property_update(prop, NC_LOGIC, NULL);
01589 
01590     prop= RNA_def_property(srna, "body_type", PROP_ENUM, PROP_NONE);
01591     RNA_def_property_enum_sdna(prop, NULL, "bodyType");
01592     RNA_def_property_enum_items(prop, prop_body_type_items);
01593     RNA_def_property_ui_text(prop, "Body", "Toggle message type: either Text or a PropertyName");
01594 
01595     /* ACT_MESG_MESG */
01596     prop= RNA_def_property(srna, "body_message", PROP_STRING, PROP_NONE);
01597     RNA_def_property_string_sdna(prop, NULL, "body");
01598     RNA_def_property_ui_text(prop, "Body", "Optional, message body Text");
01599     RNA_def_property_update(prop, NC_LOGIC, NULL);
01600     
01601     /* ACT_MESG_PROP */
01602     prop= RNA_def_property(srna, "body_property", PROP_STRING, PROP_NONE);
01603     RNA_def_property_string_sdna(prop, NULL, "body");
01604     RNA_def_property_ui_text(prop, "Prop Name", "The message body will be set by the Property Value");
01605     RNA_def_property_update(prop, NC_LOGIC, NULL);
01606 }
01607 
01608 static void rna_def_game_actuator(BlenderRNA *brna)
01609 {
01610     StructRNA *srna;
01611     PropertyRNA *prop;
01612 
01613     static EnumPropertyItem prop_type_items[] ={
01614 //      {ACT_GAME_LOAD, "LOAD", 0, "Load Game", ""},
01615 //      {ACT_GAME_START, "START", 0, "Start Loaded Game", ""},  
01616 //      keeping the load/start hacky for compatibility with 2.49
01617 //      ideally we could use ACT_GAME_START again and do a do_version()
01618 
01619         {ACT_GAME_LOAD, "START", 0, "Start Game From File", ""},
01620         {ACT_GAME_RESTART, "RESTART", 0, "Restart Game", ""},
01621         {ACT_GAME_QUIT, "QUIT", 0, "Quit Game", ""},
01622         {ACT_GAME_SAVECFG, "SAVECFG", 0, "Save bge.logic.globalDict", ""},
01623         {ACT_GAME_LOADCFG, "LOADCFG", 0, "Load bge.logic.globalDict", ""},
01624         {0, NULL, 0, NULL, NULL}};
01625     
01626     srna= RNA_def_struct(brna, "GameActuator", "Actuator");
01627     RNA_def_struct_ui_text(srna, "Game Actuator", "");
01628     RNA_def_struct_sdna_from(srna, "bGameActuator", "data");
01629 
01630     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01631     RNA_def_property_enum_sdna(prop, NULL, "type");
01632     RNA_def_property_enum_items(prop, prop_type_items);
01633     RNA_def_property_ui_text(prop, "Game", "");
01634     RNA_def_property_update(prop, NC_LOGIC, NULL);
01635 
01636     /* ACT_GAME_LOAD */
01637     prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
01638     RNA_def_property_ui_text(prop, "File", "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
01639     RNA_def_property_update(prop, NC_LOGIC, NULL);
01640     //XXX to do: an operator that calls file_browse with relative_path on and blender filtering active
01641 }
01642 
01643 static void rna_def_visibility_actuator(BlenderRNA *brna)
01644 {
01645     StructRNA *srna;
01646     PropertyRNA *prop;
01647     
01648     srna= RNA_def_struct(brna, "VisibilityActuator", "Actuator");
01649     RNA_def_struct_ui_text(srna, "Visibility Actuator", "Actuator to set visibility and occlusion of the object");
01650     RNA_def_struct_sdna_from(srna, "bVisibilityActuator", "data");
01651 
01652     prop= RNA_def_property(srna, "use_visible", PROP_BOOLEAN, PROP_NONE);
01653     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE);
01654     RNA_def_property_ui_text(prop, "Visible", "Set the objects visible (initialized from the object render restriction toggle in physics button)");
01655     RNA_def_property_update(prop, NC_LOGIC, NULL);
01656 
01657     prop= RNA_def_property(srna, "use_occlusion", PROP_BOOLEAN, PROP_NONE);
01658     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_OCCLUSION);
01659     RNA_def_property_ui_text(prop, "Occlusion", "Set the object to occlude objects behind it (initialized from the object type in physics button)");
01660     RNA_def_property_update(prop, NC_LOGIC, NULL);
01661 
01662     prop= RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE);
01663     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_RECURSIVE);
01664     RNA_def_property_ui_text(prop, "Children", "Set all the children of this object to the same visibility/occlusion recursively");
01665     RNA_def_property_update(prop, NC_LOGIC, NULL);
01666 }
01667 
01668 static void rna_def_twodfilter_actuator(BlenderRNA *brna)
01669 {
01670     StructRNA *srna;
01671     PropertyRNA *prop;
01672 
01673     static EnumPropertyItem prop_type_items[] ={
01674         {ACT_2DFILTER_ENABLED, "ENABLE", 0, "Enable Filter", ""},
01675         {ACT_2DFILTER_DISABLED, "DISABLE", 0, "Disable Filter", ""},
01676         {ACT_2DFILTER_NOFILTER, "REMOVE", 0, "Remove Filter", ""},
01677         {ACT_2DFILTER_MOTIONBLUR, "MOTIONBLUR", 0, "Motion Blur", ""},
01678         {ACT_2DFILTER_BLUR, "BLUR", 0, "Blur", ""},
01679         {ACT_2DFILTER_SHARPEN, "SHARPEN", 0, "Sharpen", ""},
01680         {ACT_2DFILTER_DILATION, "DILATION", 0, "Dilation", ""},
01681         {ACT_2DFILTER_EROSION, "EROSION", 0, "Erosion", ""},
01682         {ACT_2DFILTER_LAPLACIAN, "LAPLACIAN", 0, "Laplacian", ""},
01683         {ACT_2DFILTER_SOBEL, "SOBEL", 0, "Sobel", ""},
01684         {ACT_2DFILTER_PREWITT, "PREWITT", 0, "Prewitt", ""},
01685         {ACT_2DFILTER_GRAYSCALE, "GRAYSCALE", 0, "Gray Scale", ""},
01686         {ACT_2DFILTER_SEPIA, "SEPIA", 0, "Sepia", ""},
01687         {ACT_2DFILTER_INVERT, "INVERT", 0, "Invert", ""},
01688         {ACT_2DFILTER_CUSTOMFILTER, "CUSTOMFILTER", 0, "Custom Filter", ""},
01689 //      {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""},
01690         {0, NULL, 0, NULL, NULL}};
01691 
01692     srna= RNA_def_struct(brna, "Filter2DActuator", "Actuator");
01693     RNA_def_struct_ui_text(srna, "Filter 2D Actuator", "Actuator to apply screen graphic effects");
01694     RNA_def_struct_sdna_from(srna, "bTwoDFilterActuator", "data");
01695 
01696     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01697     RNA_def_property_enum_sdna(prop, NULL, "type");
01698     RNA_def_property_enum_items(prop, prop_type_items);
01699     RNA_def_property_ui_text(prop, "Filter 2D Type", "");
01700     RNA_def_property_update(prop, NC_LOGIC, NULL);
01701 
01702     prop= RNA_def_property(srna, "glsl_shader", PROP_POINTER, PROP_NONE);
01703     RNA_def_property_pointer_sdna(prop, NULL, "text");
01704     RNA_def_property_struct_type(prop, "Text");
01705     RNA_def_property_flag(prop, PROP_EDITABLE);
01706     RNA_def_property_ui_text(prop, "Script", "");
01707     RNA_def_property_update(prop, NC_LOGIC, NULL);
01708 
01709     prop= RNA_def_property(srna, "filter_pass", PROP_INT, PROP_NONE);
01710     RNA_def_property_int_sdna(prop, NULL, "int_arg");
01711     RNA_def_property_ui_text(prop, "Pass Number", "Set filter order");
01712     RNA_def_property_range(prop, 0, 99); //MAX_RENDER_PASS-1
01713     RNA_def_property_update(prop, NC_LOGIC, NULL);
01714 
01715     prop= RNA_def_property(srna, "motion_blur_factor", PROP_FLOAT, PROP_NONE);
01716     RNA_def_property_float_sdna(prop, NULL, "float_arg");
01717     RNA_def_property_ui_text(prop, "Value", "Motion blur factor");
01718     RNA_def_property_range(prop, 0.0, 1.0);
01719     RNA_def_property_update(prop, NC_LOGIC, NULL);
01720     
01721     /* booleans */
01722     prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
01723     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1);
01724     RNA_def_property_ui_text(prop, "Enable", "Enable/Disable Motion Blur");
01725     RNA_def_property_update(prop, NC_LOGIC, NULL);
01726 }
01727 
01728 static void rna_def_parent_actuator(BlenderRNA *brna)
01729 {
01730     StructRNA *srna;
01731     PropertyRNA *prop;
01732     
01733     static EnumPropertyItem prop_type_items[] ={
01734         {ACT_PARENT_SET, "SETPARENT", 0, "Set Parent", ""},
01735         {ACT_PARENT_REMOVE, "REMOVEPARENT", 0, "Remove Parent", ""},
01736         {0, NULL, 0, NULL, NULL}};
01737 
01738     srna= RNA_def_struct(brna, "ParentActuator", "Actuator");
01739     RNA_def_struct_ui_text(srna, "Parent Actuator", "");
01740     RNA_def_struct_sdna_from(srna, "bParentActuator", "data");
01741 
01742     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01743     RNA_def_property_enum_sdna(prop, NULL, "type");
01744     RNA_def_property_enum_items(prop, prop_type_items);
01745     RNA_def_property_ui_text(prop, "Scene", "");
01746     RNA_def_property_update(prop, NC_LOGIC, NULL);
01747     
01748     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01749     RNA_def_property_struct_type(prop, "Object");
01750     RNA_def_property_pointer_sdna(prop, NULL, "ob");
01751     RNA_def_property_flag(prop, PROP_EDITABLE);
01752     RNA_def_property_ui_text(prop, "Parent Object", "Set this object as parent");
01753     RNA_def_property_update(prop, NC_LOGIC, NULL);
01754 
01755     /* booleans */
01756     prop= RNA_def_property(srna, "use_compound", PROP_BOOLEAN, PROP_NONE);
01757     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_PARENT_COMPOUND);
01758     RNA_def_property_ui_text(prop, "Compound", "Add this object shape to the parent shape (only if the parent shape is already compound)");
01759     RNA_def_property_update(prop, NC_LOGIC, NULL);
01760 
01761     prop= RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
01762     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_PARENT_GHOST);
01763     RNA_def_property_ui_text(prop, "Ghost", "Make this object ghost while parented");
01764     RNA_def_property_update(prop, NC_LOGIC, NULL);
01765 }
01766 
01767 static void rna_def_shape_action_actuator(BlenderRNA *brna)
01768 {
01769     StructRNA *srna;
01770     PropertyRNA *prop;
01771 
01772     static EnumPropertyItem prop_type_items[] ={
01773         {ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
01774         {ACT_ACTION_PINGPONG, "PINGPONG", 0, "Ping Pong", ""},
01775         {ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
01776         {ACT_ACTION_LOOP_STOP, "LOOPSTOP", 0, "Loop Stop", ""},
01777         {ACT_ACTION_LOOP_END, "LOOPEND", 0, "Loop End", ""},
01778         {ACT_ACTION_FROM_PROP, "PROPERTY", 0, "Property", ""},
01779 #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
01780         {ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""},
01781 #endif
01782         {0, NULL, 0, NULL, NULL}};
01783 
01784     srna= RNA_def_struct(brna, "ShapeActionActuator", "Actuator");
01785     RNA_def_struct_ui_text(srna, "Shape Action Actuator", "Actuator to control shape key animations");
01786     RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
01787 
01788     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01789     RNA_def_property_enum_sdna(prop, NULL, "type");
01790     RNA_def_property_enum_items(prop, prop_type_items);
01791     RNA_def_property_ui_text(prop, "Action Type", "Action playback type");
01792     RNA_def_property_update(prop, NC_LOGIC, NULL);
01793 
01794     prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
01795     RNA_def_property_pointer_sdna(prop, NULL, "act");
01796     RNA_def_property_struct_type(prop, "Action");
01797     RNA_def_property_flag(prop, PROP_EDITABLE);
01798     RNA_def_property_ui_text(prop, "Action", "");
01799     /* note: custom set function is ONLY to avoid rna setting a user for this. */
01800     RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL);
01801     RNA_def_property_update(prop, NC_LOGIC, NULL);
01802 
01803     prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
01804     RNA_def_property_boolean_negative_sdna(prop, NULL, "end_reset", 1);
01805     RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time");
01806     RNA_def_property_update(prop, NC_LOGIC, NULL);
01807     
01808     prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
01809     RNA_def_property_string_sdna(prop, NULL, "name");
01810     RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
01811     RNA_def_property_update(prop, NC_LOGIC, NULL);
01812 
01813     prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
01814     RNA_def_property_float_sdna(prop, NULL, "sta");
01815     RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
01816     RNA_def_property_ui_text(prop, "Start Frame", "");
01817     RNA_def_property_update(prop, NC_LOGIC, NULL);
01818 
01819     prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
01820     RNA_def_property_float_sdna(prop, NULL, "end");
01821     RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
01822     RNA_def_property_ui_text(prop, "End Frame", "");
01823     RNA_def_property_update(prop, NC_LOGIC, NULL);
01824 
01825     prop= RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE);
01826     RNA_def_property_int_sdna(prop, NULL, "blendin");
01827     RNA_def_property_range(prop, 0, 32767);
01828     RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending");
01829     RNA_def_property_update(prop, NC_LOGIC, NULL);
01830 
01831     prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
01832     RNA_def_property_range(prop, 0, 100);
01833     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)");
01834     RNA_def_property_update(prop, NC_LOGIC, NULL);
01835 
01836     prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
01837     RNA_def_property_string_sdna(prop, NULL, "frameProp");
01838     RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
01839     RNA_def_property_update(prop, NC_LOGIC, NULL);
01840 
01841 #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
01842     prop= RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
01843     RNA_def_property_float_sdna(prop, NULL, "stridelength");
01844     RNA_def_property_range(prop, 0.0, 2500.0);
01845     RNA_def_property_ui_text(prop, "Cycle", "Distance covered by a single cycle of the action");
01846     RNA_def_property_update(prop, NC_LOGIC, NULL);
01847 #endif
01848 }
01849 
01850 static void rna_def_state_actuator(BlenderRNA *brna)
01851 {
01852     StructRNA *srna;
01853     PropertyRNA *prop;
01854 
01855     static EnumPropertyItem prop_type_items[] ={
01856         {ACT_STATE_SET, "SET", 0, "Set State", ""},
01857         {ACT_STATE_ADD, "ADD", 0, "Add State", ""},
01858         {ACT_STATE_REMOVE, "REMOVE", 0, "Remove State", ""},
01859         {ACT_STATE_CHANGE, "CHANGE", 0, "Change State", ""},
01860         {0, NULL, 0, NULL, NULL}};
01861     
01862     srna= RNA_def_struct(brna, "StateActuator", "Actuator");
01863     RNA_def_struct_ui_text(srna, "State Actuator", "Actuator to handle states");
01864     RNA_def_struct_sdna_from(srna, "bStateActuator", "data");
01865 
01866     prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
01867     RNA_def_property_enum_sdna(prop, NULL, "type");
01868     RNA_def_property_enum_items(prop, prop_type_items);
01869     RNA_def_property_ui_text(prop, "Operation", "Select the bit operation on object state mask");
01870     RNA_def_property_update(prop, NC_LOGIC, NULL);
01871 
01872     prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
01873     RNA_def_property_boolean_sdna(prop, NULL, "mask", 1);
01874     RNA_def_property_array(prop, OB_MAX_STATES);
01875     RNA_def_property_ui_text(prop, "State", "");
01876     RNA_def_property_boolean_funcs(prop, NULL, "rna_StateActuator_state_set");
01877 }
01878 
01879 static void rna_def_armature_actuator(BlenderRNA *brna)
01880 {
01881     StructRNA *srna;
01882     PropertyRNA* prop;
01883 
01884     static EnumPropertyItem prop_type_items[] ={
01885         {ACT_ARM_RUN, "RUN", 0, "Run Armature", ""},
01886         {ACT_ARM_ENABLE, "ENABLE", 0, "Enable", ""},
01887         {ACT_ARM_DISABLE, "DISABLE", 0, "Disable", ""},
01888         {ACT_ARM_SETTARGET, "SETTARGET", 0, "Set Target", ""},
01889         {ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set Weight", ""},
01890         {0, NULL, 0, NULL, NULL}};
01891 
01892     srna= RNA_def_struct(brna, "ArmatureActuator", "Actuator");
01893     RNA_def_struct_ui_text(srna, "Armature Actuator", "");
01894     RNA_def_struct_sdna_from(srna, "bArmatureActuator", "data");
01895 
01896     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01897     RNA_def_property_enum_sdna(prop, NULL, "type");
01898     RNA_def_property_enum_items(prop, prop_type_items);
01899     RNA_def_property_ui_text(prop, "Constraint Type", "");
01900     RNA_def_property_update(prop, NC_LOGIC, NULL);
01901 
01902     prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
01903     RNA_def_property_string_sdna(prop, NULL, "posechannel");
01904     RNA_def_property_ui_text(prop, "Bone", "Bone on which the constraint is defined");
01905     RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update");
01906 
01907     prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
01908     RNA_def_property_string_sdna(prop, NULL, "constraint");
01909     RNA_def_property_ui_text(prop, "Constraint", "Name of the constraint to control");
01910     RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update");
01911 
01912     prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
01913     RNA_def_property_struct_type(prop, "Object");
01914     RNA_def_property_flag(prop, PROP_EDITABLE);
01915     RNA_def_property_ui_text(prop, "Target", "Set this object as the target of the constraint");
01916     RNA_def_property_update(prop, NC_LOGIC, NULL);
01917 
01918     prop= RNA_def_property(srna, "secondary_target", PROP_POINTER, PROP_NONE);
01919     RNA_def_property_pointer_sdna(prop, NULL, "subtarget");
01920     RNA_def_property_struct_type(prop, "Object");
01921     RNA_def_property_flag(prop, PROP_EDITABLE);
01922     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)");
01923     RNA_def_property_update(prop, NC_LOGIC, NULL);
01924 
01925     prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
01926     RNA_def_property_float_sdna(prop, NULL, "weight");
01927     RNA_def_property_range(prop, 0.0, 1.0);
01928     RNA_def_property_ui_text(prop, "Weight", "Weight of this constraint");
01929     RNA_def_property_update(prop, NC_LOGIC, NULL);
01930 }
01931 
01932 static void rna_def_steering_actuator(BlenderRNA *brna)
01933 {
01934     StructRNA *srna;
01935     PropertyRNA *prop;
01936 
01937     static EnumPropertyItem prop_type_items[] ={
01938         {ACT_STEERING_SEEK, "SEEK", 0, "Seek", ""},
01939         {ACT_STEERING_FLEE, "FLEE", 0, "Flee", ""},
01940         {ACT_STEERING_PATHFOLLOWING, "PATHFOLLOWING", 0, "Path following", ""},
01941         {0, NULL, 0, NULL, NULL}};
01942 
01943     static EnumPropertyItem facingaxis_items[] ={
01944         {1, "X", 0, "X", ""},
01945         {2, "Y", 0, "Y", ""},
01946         {3, "Z", 0, "Z", ""},
01947         {4, "NEG_X", 0, "-X", ""},
01948         {5, "NEG_Y", 0, "-Y", ""},
01949         {6, "NEG_Z", 0, "-Z", ""},
01950         {0, NULL, 0, NULL, NULL}};
01951 
01952     srna= RNA_def_struct(brna, "SteeringActuator", "Actuator");
01953     RNA_def_struct_ui_text(srna, "Steering Actuator", "");
01954     RNA_def_struct_sdna_from(srna, "bSteeringActuator", "data");
01955 
01956     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01957     RNA_def_property_enum_sdna(prop, NULL, "type");
01958     RNA_def_property_enum_items(prop, prop_type_items);
01959     RNA_def_property_ui_text(prop, "Behavior", "");
01960     RNA_def_property_update(prop, NC_LOGIC, NULL);
01961 
01962     prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_NONE);
01963     RNA_def_property_float_sdna(prop, NULL, "velocity");
01964     RNA_def_property_range(prop, 0.0, 1000.0);
01965     RNA_def_property_ui_text(prop, "Velocity", "Velocity magnitude");
01966     RNA_def_property_update(prop, NC_LOGIC, NULL);
01967 
01968     prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_NONE);
01969     RNA_def_property_float_sdna(prop, NULL, "acceleration");
01970     RNA_def_property_range(prop, 0.0, 1000.0);
01971     RNA_def_property_ui_text(prop, "Acceleration", "Max acceleration");
01972     RNA_def_property_update(prop, NC_LOGIC, NULL);
01973 
01974     prop= RNA_def_property(srna, "turn_speed", PROP_FLOAT, PROP_NONE);
01975     RNA_def_property_float_sdna(prop, NULL, "turnspeed");
01976     RNA_def_property_range(prop, 0.0, 720.0);
01977     RNA_def_property_ui_text(prop, "Turn Speed", "Max turn speed");
01978     RNA_def_property_update(prop, NC_LOGIC, NULL);
01979 
01980     prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
01981     RNA_def_property_float_sdna(prop, NULL, "dist");
01982     RNA_def_property_range(prop, 0.0, 1000.0);
01983     RNA_def_property_ui_text(prop, "Dist", "Relax distance");
01984     RNA_def_property_update(prop, NC_LOGIC, NULL);
01985 
01986     prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
01987     RNA_def_property_struct_type(prop, "Object");
01988     RNA_def_property_pointer_sdna(prop, NULL, "target");
01989     RNA_def_property_flag(prop, PROP_EDITABLE);
01990     RNA_def_property_ui_text(prop, "Target Object", "Target object");
01991     RNA_def_property_update(prop, NC_LOGIC, NULL);
01992 
01993     prop= RNA_def_property(srna, "self_terminated", PROP_BOOLEAN, PROP_NONE);
01994     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_SELFTERMINATED);
01995     RNA_def_property_ui_text(prop, "Self Terminated", "Terminate when target is reached");
01996     RNA_def_property_update(prop, NC_LOGIC, NULL);
01997 
01998     prop= RNA_def_property(srna, "show_visualization", PROP_BOOLEAN, PROP_NONE);
01999     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_ENABLEVISUALIZATION);
02000     RNA_def_property_ui_text(prop, "Visualize", "Enable debug visualization");
02001     RNA_def_property_update(prop, NC_LOGIC, NULL);
02002 
02003     prop= RNA_def_property(srna, "update_period", PROP_INT, PROP_NONE);
02004     RNA_def_property_int_sdna(prop, NULL, "updateTime");
02005     RNA_def_property_ui_range(prop, -1, 100000, 1, 1);
02006     RNA_def_property_ui_text(prop, "Update period", "Path update period");
02007     RNA_def_property_update(prop, NC_LOGIC, NULL);
02008 
02009     prop= RNA_def_property(srna, "navmesh", PROP_POINTER, PROP_NONE);
02010     RNA_def_property_struct_type(prop, "Object");
02011     RNA_def_property_pointer_sdna(prop, NULL, "navmesh");
02012     RNA_def_property_flag(prop, PROP_EDITABLE);
02013     RNA_def_property_ui_text(prop, "Navigation Mesh Object", "Navigation mesh");
02014     RNA_def_property_pointer_funcs(prop, NULL, "rna_SteeringActuator_navmesh_set", NULL, NULL);
02015     RNA_def_property_update(prop, NC_LOGIC, NULL);
02016 
02017     prop= RNA_def_property(srna, "facing", PROP_BOOLEAN, PROP_NONE);
02018     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_AUTOMATICFACING);
02019     RNA_def_property_ui_text(prop, "Facing", "Enable automatic facing");
02020     RNA_def_property_update(prop, NC_LOGIC, NULL);
02021 
02022     prop= RNA_def_property(srna, "facing_axis", PROP_ENUM, PROP_NONE);
02023     RNA_def_property_enum_sdna(prop, NULL, "facingaxis");
02024     RNA_def_property_enum_items(prop, facingaxis_items);
02025     RNA_def_property_ui_text(prop, "Axis", "Axis for automatic facing");
02026     RNA_def_property_update(prop, NC_LOGIC, NULL);
02027 
02028     prop= RNA_def_property(srna, "normal_up", PROP_BOOLEAN, PROP_NONE);
02029     RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_NORMALUP);
02030     RNA_def_property_ui_text(prop, "N", "Use normal of the navmesh to set \"UP\" vector");
02031     RNA_def_property_update(prop, NC_LOGIC, NULL);
02032 }
02033 
02034 void RNA_def_actuator(BlenderRNA *brna)
02035 {
02036     rna_def_actuator(brna);
02037 
02038     rna_def_action_actuator(brna);
02039     rna_def_object_actuator(brna);
02040     rna_def_camera_actuator(brna);
02041     rna_def_sound_actuator(brna);
02042     rna_def_property_actuator(brna);
02043     rna_def_constraint_actuator(brna);
02044     rna_def_edit_object_actuator(brna);
02045     rna_def_scene_actuator(brna);
02046     rna_def_random_actuator(brna);
02047     rna_def_message_actuator(brna);
02048     rna_def_game_actuator(brna);
02049     rna_def_visibility_actuator(brna);
02050     rna_def_twodfilter_actuator(brna);
02051     rna_def_parent_actuator(brna);
02052     rna_def_shape_action_actuator(brna);
02053     rna_def_state_actuator(brna);
02054     rna_def_armature_actuator(brna);
02055     rna_def_steering_actuator(brna);
02056 }
02057 
02058 #endif
02059