Blender V2.61 - r43446

rna_space.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 "MEM_guardedalloc.h"
00031 
00032 #include "RNA_access.h"
00033 #include "RNA_define.h"
00034 
00035 #include "rna_internal.h"
00036 
00037 #include "BKE_key.h"
00038 #include "BKE_movieclip.h"
00039 
00040 #include "DNA_action_types.h"
00041 #include "DNA_key_types.h"
00042 #include "DNA_node_types.h"
00043 #include "DNA_object_types.h"
00044 #include "DNA_space_types.h"
00045 #include "DNA_sequence_types.h"
00046 #include "DNA_view3d_types.h"
00047 
00048 #include "WM_api.h"
00049 #include "WM_types.h"
00050 
00051 #include "RE_engine.h"
00052 #include "RE_pipeline.h"
00053 
00054 #include "RNA_enum_types.h"
00055 
00056 EnumPropertyItem space_type_items[] = {
00057     {SPACE_EMPTY, "EMPTY", 0, "Empty", ""},
00058     {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""},
00059     {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""},
00060     {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""},
00061     {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""},
00062     {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""},
00063     {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""},
00064     {SPACE_INFO, "INFO", 0, "Info", ""},
00065     {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""},
00066     {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""},
00067     {SPACE_ACTION, "DOPESHEET_EDITOR", 0, "DopeSheet Editor", ""},
00068     {SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""},
00069     {SPACE_TIME, "TIMELINE", 0, "Timeline", ""},
00070     {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""},
00071     {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""},
00072     {SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""},
00073     {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
00074     {SPACE_CLIP, "CLIP_EDITOR", 0, "Clip Editor", ""},
00075     {0, NULL, 0, NULL, NULL}};
00076 
00077 static EnumPropertyItem draw_channels_items[] = {
00078     {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
00079     {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
00080     {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
00081     {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer",
00082                    "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
00083     {0, NULL, 0, NULL, NULL}};
00084 
00085 static EnumPropertyItem transform_orientation_items[] = {
00086     {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"},
00087     {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
00088     {V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
00089     {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal",
00090                        "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
00091     {V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"},
00092     {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
00093     {0, NULL, 0, NULL, NULL}};
00094 
00095 EnumPropertyItem autosnap_items[] = {
00096     {SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""},
00097     {SACTSNAP_STEP, "STEP", 0, "Time Step", "Snap to 1.0 frame/second intervals"},
00098     {SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames/seconds (nla-action time)"},
00099     {SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
00100     {0, NULL, 0, NULL, NULL}};
00101 
00102 EnumPropertyItem viewport_shade_items[] = {
00103     {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
00104     {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
00105     {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
00106     {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Texture", "Display the object solid, with a texture"},
00107     {OB_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Display objects solid, with GLSL material"},
00108     {OB_RENDER, "RENDERED", ICON_SMOOTH, "Rendered", "Display render preview"},
00109     {0, NULL, 0, NULL, NULL}};
00110 
00111 #ifdef RNA_RUNTIME
00112 
00113 #include "DNA_anim_types.h"
00114 #include "DNA_scene_types.h"
00115 #include "DNA_screen_types.h"
00116 
00117 #include "BLI_math.h"
00118 
00119 #include "BKE_animsys.h"
00120 #include "BKE_brush.h"
00121 #include "BKE_colortools.h"
00122 #include "BKE_context.h"
00123 #include "BKE_depsgraph.h"
00124 #include "BKE_paint.h"
00125 #include "BKE_scene.h"
00126 #include "BKE_screen.h"
00127 
00128 #include "ED_image.h"
00129 #include "ED_node.h"
00130 #include "ED_screen.h"
00131 #include "ED_view3d.h"
00132 #include "ED_sequencer.h"
00133 #include "ED_clip.h"
00134 
00135 #include "IMB_imbuf_types.h"
00136 
00137 static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
00138 {
00139     SpaceLink *space= (SpaceLink*)ptr->data;
00140 
00141     switch(space->spacetype) {
00142         case SPACE_VIEW3D:
00143             return &RNA_SpaceView3D;
00144         case SPACE_IPO:
00145             return &RNA_SpaceGraphEditor;
00146         case SPACE_OUTLINER:
00147             return &RNA_SpaceOutliner;
00148         case SPACE_BUTS:
00149             return &RNA_SpaceProperties;
00150         case SPACE_FILE:
00151             return &RNA_SpaceFileBrowser;
00152         case SPACE_IMAGE:
00153             return &RNA_SpaceImageEditor;
00154         case SPACE_INFO:
00155             return &RNA_SpaceInfo;
00156         case SPACE_SEQ:
00157             return &RNA_SpaceSequenceEditor;
00158         case SPACE_TEXT:
00159             return &RNA_SpaceTextEditor;
00160         case SPACE_ACTION:
00161             return &RNA_SpaceDopeSheetEditor;
00162         case SPACE_NLA:
00163             return &RNA_SpaceNLA;
00164         case SPACE_TIME:
00165             return &RNA_SpaceTimeline;
00166         case SPACE_NODE:
00167             return &RNA_SpaceNodeEditor;
00168         case SPACE_LOGIC:
00169             return &RNA_SpaceLogicEditor;
00170         case SPACE_CONSOLE:
00171             return &RNA_SpaceConsole;
00172         case SPACE_USERPREF:
00173             return &RNA_SpaceUserPreferences;
00174         case SPACE_CLIP:
00175             return &RNA_SpaceClipEditor;
00176         default:
00177             return &RNA_Space;
00178     }
00179 }
00180 
00181 static ScrArea *rna_area_from_space(PointerRNA *ptr)
00182 {
00183     bScreen *sc = (bScreen*)ptr->id.data;
00184     SpaceLink *link= (SpaceLink*)ptr->data;
00185     ScrArea *sa;
00186 
00187     for(sa=sc->areabase.first; sa; sa=sa->next)
00188         if(BLI_findindex(&sa->spacedata, link) != -1)
00189             return sa;
00190 
00191     return NULL;
00192 }
00193 
00194 static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **sa_r, ARegion **ar_r)
00195 {
00196     bScreen *sc = (bScreen*)ptr->id.data;
00197     ScrArea *sa;
00198     ARegion *ar;
00199     void *regiondata= ptr->data;
00200 
00201     *sa_r= NULL;
00202     *ar_r= NULL;
00203 
00204     for(sa=sc->areabase.first; sa; sa=sa->next) {
00205         for(ar=sa->regionbase.first; ar; ar=ar->next) {
00206             if(ar->regiondata == regiondata) {
00207                 *sa_r= sa;
00208                 *ar_r= ar;
00209                 return;
00210             }
00211         }
00212     }
00213 }
00214 
00215 static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
00216 {
00217     Scene *scene = ((bScreen*)ptr->id.data)->scene;
00218     View3D *v3d= (View3D*)ptr->data;
00219     
00220     if (v3d->twmode < V3D_MANIP_CUSTOM)
00221         return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
00222     else
00223         return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation,
00224                                           BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
00225 }
00226 
00227 EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
00228 {
00229     Scene *scene = NULL;
00230     ListBase *transform_spaces;
00231     TransformOrientation *ts= NULL;
00232     EnumPropertyItem tmp = {0, "", 0, "", ""};
00233     EnumPropertyItem *item= NULL;
00234     int i = V3D_MANIP_CUSTOM, totitem= 0;
00235 
00236     RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GLOBAL);
00237     RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_NORMAL);
00238     RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GIMBAL);
00239     RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_LOCAL);
00240     RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_VIEW);
00241 
00242     if (ptr->type == &RNA_SpaceView3D)
00243         scene = ((bScreen*)ptr->id.data)->scene;
00244     else
00245         scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
00246 
00247     if(scene) {
00248         transform_spaces = &scene->transform_spaces;
00249         ts = transform_spaces->first;
00250     }
00251 
00252     if(ts)
00253     {
00254         RNA_enum_item_add_separator(&item, &totitem);
00255 
00256         for(; ts; ts = ts->next) {
00257             tmp.identifier = ts->name;
00258             tmp.name= ts->name;
00259             tmp.value = i++;
00260             RNA_enum_item_add(&item, &totitem, &tmp);
00261         }
00262     }
00263 
00264     RNA_enum_item_end(&item, &totitem);
00265     *free= 1;
00266 
00267     return item;
00268 }
00269 
00270 /* Space 3D View */
00271 static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
00272 {
00273     View3D *v3d= (View3D*)(ptr->data);
00274     bScreen *sc= (bScreen*)ptr->id.data;
00275 
00276     v3d->scenelock = value;
00277 
00278     if(value) {
00279         int bit;
00280         v3d->lay= sc->scene->lay;
00281         /* seek for layact */
00282         bit= 0;
00283         while(bit<32) {
00284             if(v3d->lay & (1<<bit)) {
00285                 v3d->layact= 1<<bit;
00286                 break;
00287             }
00288             bit++;
00289         }
00290         v3d->camera= sc->scene->camera;
00291     }
00292 }
00293 
00294 static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
00295 {
00296     View3D *v3d= (View3D*)(ptr->data);
00297     bScreen *sc= (bScreen*)ptr->id.data;
00298     Scene *scene= (Scene *)sc->scene;
00299     float *loc = give_cursor(scene, v3d);
00300     
00301     copy_v3_v3(values, loc);
00302 }
00303 
00304 static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
00305 {
00306     View3D *v3d= (View3D*)(ptr->data);
00307     bScreen *sc= (bScreen*)ptr->id.data;
00308     Scene *scene= (Scene *)sc->scene;
00309     float *cursor = give_cursor(scene, v3d);
00310     
00311     copy_v3_v3(cursor, values);
00312 }
00313 
00314 static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
00315 {
00316     View3D *v3d= (View3D*)(ptr->data);
00317     
00318     v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
00319 }
00320 
00321 static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
00322 {
00323     DAG_on_visible_update(bmain, FALSE);
00324 }
00325 
00326 static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00327 {
00328     View3D *v3d= (View3D*)(ptr->data);
00329     ScrArea *sa= rna_area_from_space(ptr);
00330 
00331     if(v3d->drawtype != OB_RENDER) {
00332         ARegion *ar;
00333 
00334         for(ar=sa->regionbase.first; ar; ar=ar->next) {
00335             RegionView3D *rv3d = ar->regiondata;
00336 
00337             if(rv3d && rv3d->render_engine) {
00338                 RE_engine_free(rv3d->render_engine);
00339                 rv3d->render_engine= NULL;
00340             }
00341         }
00342     }
00343 }
00344 
00345 static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
00346 {
00347     if (U.uiflag & USER_LOCKAROUND) {
00348         View3D *v3d_act= (View3D*)(ptr->data);
00349 
00350         /* TODO, space looper */
00351         bScreen *screen;
00352         for(screen= bmain->screen.first; screen; screen= screen->id.next) {
00353             ScrArea *sa;
00354             for(sa= screen->areabase.first; sa; sa= sa->next) {
00355                 SpaceLink *sl;
00356                 for(sl= sa->spacedata.first; sl ;sl= sl->next) {
00357                     if(sl->spacetype==SPACE_VIEW3D) {
00358                         View3D *v3d= (View3D *)sl;
00359                         if (v3d != v3d_act) {
00360                             v3d->around= v3d_act->around;
00361                             v3d->flag= (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN);
00362                             ED_area_tag_redraw_regiontype(sa, RGN_TYPE_HEADER);
00363                         }
00364                     }
00365                 }
00366             }
00367         }
00368     }
00369 }
00370 
00371 static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
00372 {
00373     View3D *v3d= (View3D*)(ptr->data);
00374     ScrArea *sa= rna_area_from_space(ptr);
00375     void *regiondata= NULL;
00376     if(sa) {
00377         ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
00378         ARegion *ar= regionbase->last; /* always last in list, weak .. */
00379         regiondata= ar->regiondata;
00380     }
00381 
00382     return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
00383 }
00384 
00385 static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
00386 {
00387     View3D *v3d= (View3D*)(ptr->data);
00388     ScrArea *sa= rna_area_from_space(ptr);
00389     void *regiondata= NULL;
00390     if(sa) {
00391         ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
00392         ARegion *ar= regionbase->last; /* always before last in list, weak .. */
00393 
00394         ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
00395         if(ar) {
00396             regiondata= ar->regiondata;
00397         }
00398     }
00399 
00400     return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
00401 }
00402 
00403 static void rna_RegionView3D_quadview_update(Main *UNUSED(main), Scene *UNUSED(scene), PointerRNA *ptr)
00404 {
00405     ScrArea *sa;
00406     ARegion *ar;
00407 
00408     rna_area_region_from_regiondata(ptr, &sa, &ar);
00409     if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
00410         ED_view3d_quadview_update(sa, ar, FALSE);
00411 }
00412 
00413 /* same as above but call clip==TRUE */
00414 static void rna_RegionView3D_quadview_clip_update(Main *UNUSED(main), Scene *UNUSED(scene), PointerRNA *ptr)
00415 {
00416     ScrArea *sa;
00417     ARegion *ar;
00418 
00419     rna_area_region_from_regiondata(ptr, &sa, &ar);
00420     if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
00421         ED_view3d_quadview_update(sa, ar, TRUE);
00422 }
00423 
00424 static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
00425 {
00426     RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00427     negate_v3_v3(values, rv3d->ofs);
00428 }
00429 
00430 static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
00431 {
00432     RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00433     negate_v3_v3(rv3d->ofs, values);
00434 }
00435 
00436 static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
00437 {
00438     RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00439     invert_qt_qt(values, rv3d->viewquat);
00440 }
00441 
00442 static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
00443 {
00444     RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00445     invert_qt_qt(rv3d->viewquat, values);
00446 }
00447 
00448 static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
00449 {
00450     RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00451     negate_v3_v3(rv3d->ofs, values);
00452     ED_view3d_from_m4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
00453 }
00454 
00455 static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
00456 {
00457     Scene *scene = ((bScreen*)ptr->id.data)->scene;
00458     RenderEngineType *type = RE_engines_find(scene->r.engine);
00459     
00460     EnumPropertyItem *item= NULL;
00461     int totitem= 0;
00462 
00463     RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_BOUNDBOX);
00464     RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_WIRE);
00465     RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_SOLID);
00466     RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_TEXTURE);
00467 
00468     if(scene_use_new_shading_nodes(scene))
00469         RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_MATERIAL);
00470     
00471     if(type->view_draw)
00472         RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_RENDER);
00473 
00474     RNA_enum_item_end(&item, &totitem);
00475     *free= 1;
00476 
00477     return item;
00478 }
00479 
00480 /* Space Image Editor */
00481 
00482 static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
00483 {
00484     return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
00485 }
00486 
00487 static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
00488 {
00489     paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
00490 
00491     ED_space_image_paint_update(bmain->wm.first, scene->toolsettings);
00492 }
00493 
00494 static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
00495 {
00496     SpaceImage *sima= (SpaceImage*)(ptr->data);
00497     return ED_space_image_show_render(sima);
00498 }
00499 
00500 static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
00501 {
00502     SpaceImage *sima= (SpaceImage*)(ptr->data);
00503     return ED_space_image_show_paint(sima);
00504 }
00505 
00506 static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
00507 {
00508     SpaceImage *sima= (SpaceImage*)(ptr->data);
00509     bScreen *sc= (bScreen*)ptr->id.data;
00510     return ED_space_image_show_uvedit(sima, sc->scene->obedit);
00511 }
00512 
00513 static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
00514 {
00515     SpaceImage *sima= (SpaceImage*)(ptr->data);
00516     bScreen *sc= (bScreen*)ptr->id.data;
00517 
00518     ED_space_image_set(sima, sc->scene, sc->scene->obedit, (Image*)value.data);
00519 }
00520 
00521 static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr,
00522                                                                   PropertyRNA *UNUSED(prop), int *free)
00523 {
00524     SpaceImage *sima= (SpaceImage*)ptr->data;
00525     EnumPropertyItem *item= NULL;
00526     ImBuf *ibuf;
00527     void *lock;
00528     int zbuf, alpha, totitem= 0;
00529 
00530     ibuf= ED_space_image_acquire_buffer(sima, &lock);
00531     
00532     alpha= ibuf && (ibuf->channels == 4);
00533     zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
00534 
00535     ED_space_image_release_buffer(sima, lock);
00536 
00537     if(alpha && zbuf)
00538         return draw_channels_items;
00539 
00540     RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
00541 
00542     if(alpha) {
00543         RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
00544         RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
00545     }
00546     else if(zbuf) {
00547         RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
00548     }
00549 
00550     RNA_enum_item_end(&item, &totitem);
00551     *free= 1;
00552 
00553     return item;
00554 }
00555 
00556 static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
00557 {
00558     SpaceImage *sima= (SpaceImage*)ptr->data;
00559     ScrArea *sa;
00560     ARegion *ar;
00561 
00562     values[0] = values[1] = 1;
00563 
00564     /* find aregion */
00565     sa= rna_area_from_space(ptr); /* can be NULL */
00566     ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
00567     if(ar) {
00568         ED_space_image_zoom(sima, ar, &values[0], &values[1]);
00569     }
00570 }
00571 
00572 static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
00573 {
00574     SpaceImage *sima= (SpaceImage*)ptr->data;
00575     
00576     if (sima->flag & SI_COORDFLOATS) {
00577         copy_v2_v2(values, sima->cursor);
00578     } else {
00579         int w, h;
00580         ED_space_image_size(sima, &w, &h);
00581         
00582         values[0] = sima->cursor[0] * w;
00583         values[1] = sima->cursor[1] * h;
00584     }
00585 }
00586 
00587 static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
00588 {
00589     SpaceImage *sima= (SpaceImage*)ptr->data;
00590     
00591     if (sima->flag & SI_COORDFLOATS) {
00592         copy_v2_v2(sima->cursor, values);
00593     } else {
00594         int w, h;
00595         ED_space_image_size(sima, &w, &h);
00596         
00597         sima->cursor[0] = values[0] / w;
00598         sima->cursor[1] = values[1] / h;
00599     }
00600 }
00601 
00602 static void rna_SpaceImageEditor_curves_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00603 {
00604     SpaceImage *sima= (SpaceImage*)ptr->data;
00605     ImBuf *ibuf;
00606     void *lock;
00607 
00608     ibuf= ED_space_image_acquire_buffer(sima, &lock);
00609     if(ibuf->rect_float)
00610         curvemapping_do_ibuf(sima->cumap, ibuf);
00611     ED_space_image_release_buffer(sima, lock);
00612 
00613     WM_main_add_notifier(NC_IMAGE, sima->image);
00614 }
00615 
00616 static void rna_SpaceImageEditor_scopes_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
00617 {
00618     SpaceImage *sima= (SpaceImage*)ptr->data;
00619     ImBuf *ibuf;
00620     void *lock;
00621     
00622     ibuf= ED_space_image_acquire_buffer(sima, &lock);
00623     if(ibuf) {
00624         scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_COLOR_MANAGEMENT);
00625         WM_main_add_notifier(NC_IMAGE, sima->image);
00626     }
00627     ED_space_image_release_buffer(sima, lock);
00628 }
00629 
00630 /* Space Text Editor */
00631 
00632 static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
00633 {
00634     SpaceText *st= (SpaceText*)(ptr->data);
00635 
00636     st->wordwrap= value;
00637     st->left= 0;
00638 }
00639 
00640 static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
00641 {
00642     SpaceText *st= (SpaceText*)(ptr->data);
00643 
00644     st->text= value.data;
00645 
00646     WM_main_add_notifier(NC_TEXT|NA_SELECTED, st->text);
00647 }
00648 
00649 static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00650 {
00651     SpaceText *st= (SpaceText*)ptr->data;
00652 
00653     if(st->text)
00654         WM_main_add_notifier(NC_TEXT|NA_EDITED, st->text);
00655 }
00656 
00657 
00658 /* Space Properties */
00659 
00660 /* note: this function exists only to avoid id refcounting */
00661 static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value)
00662 {
00663     SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00664     sbuts->pinid= value.data;
00665 }
00666 
00667 static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
00668 {
00669     SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00670 
00671     if(sbuts->pinid)
00672         return ID_code_to_RNA_type(GS(sbuts->pinid->name));
00673 
00674     return &RNA_ID;
00675 }
00676 
00677 static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00678 {
00679     SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00680     ID *id = sbuts->pinid;
00681     
00682     if (id == NULL) {
00683         sbuts->flag &= ~SB_PIN_CONTEXT;
00684         return;
00685     }
00686     
00687     switch (GS(id->name)) {
00688         case ID_MA:
00689             WM_main_add_notifier(NC_MATERIAL|ND_SHADING, NULL);
00690             break;
00691         case ID_TE:
00692             WM_main_add_notifier(NC_TEXTURE, NULL);
00693             break;
00694         case ID_WO:
00695             WM_main_add_notifier(NC_WORLD, NULL);
00696             break;
00697         case ID_LA:
00698             WM_main_add_notifier(NC_LAMP, NULL);
00699             break;
00700     }
00701 }
00702 
00703 
00704 static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
00705 {
00706     SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00707     
00708     sbuts->mainb= value;
00709     sbuts->mainbuser = value;
00710 }
00711 
00712 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
00713 {
00714     SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00715 
00716     sbuts->align= value;
00717     sbuts->re_align= 1;
00718 }
00719 
00720 /* Space Console */
00721 static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
00722 {
00723     ConsoleLine *ci= (ConsoleLine*)ptr->data;
00724     strcpy(value, ci->line);
00725 }
00726 
00727 static int rna_ConsoleLine_body_length(PointerRNA *ptr)
00728 {
00729     ConsoleLine *ci= (ConsoleLine*)ptr->data;
00730     return ci->len;
00731 }
00732 
00733 static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
00734 {
00735     ConsoleLine *ci= (ConsoleLine*)ptr->data;
00736     int len= strlen(value);
00737     
00738     if((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */
00739         MEM_freeN(ci->line);
00740         ci->line= MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
00741         ci->len_alloc= len + 1;
00742     }
00743     memcpy(ci->line, value, len + 1);
00744     ci->len= len;
00745 
00746     if(ci->cursor > len) /* clamp the cursor */
00747         ci->cursor= len;
00748 }
00749 
00750 static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max)
00751 {
00752     ConsoleLine *ci= (ConsoleLine*)ptr->data;
00753 
00754     *min= 0;
00755     *max= ci->len; /* intentionally _not_ -1 */
00756 }
00757 
00758 /* Space Dopesheet */
00759 
00760 static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
00761 {
00762     SpaceAction *saction= (SpaceAction*)(ptr->data);
00763     bAction *act = (bAction*)value.data;
00764     
00765     if ((act == NULL) || (act->idroot == 0)) {
00766         /* just set if we're clearing the action or if the action is "amorphous" still */
00767         saction->action= act;
00768     }
00769     else {
00770         /* action to set must strictly meet the mode criteria... */
00771         if (saction->mode == SACTCONT_ACTION) {
00772             /* currently, this is "object-level" only, until we have some way of specifying this */
00773             if (act->idroot == ID_OB)
00774                 saction->action = act;
00775             else
00776                 printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n",
00777                        act->id.name+2);
00778         }
00779         else if (saction->mode == SACTCONT_SHAPEKEY) {
00780             /* as the name says, "shapekey-level" only... */
00781             if (act->idroot == ID_KE)
00782                 saction->action = act;
00783             else
00784                 printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n",
00785                        act->id.name+2);
00786         }
00787         else {
00788             printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n");
00789         }
00790     }
00791 }
00792 
00793 static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
00794 {
00795     SpaceAction *saction= (SpaceAction*)(ptr->data);
00796     Object *obact= (scene->basact)? scene->basact->object: NULL;
00797 
00798     /* we must set this action to be the one used by active object (if not pinned) */
00799     if (obact/* && saction->pin == 0*/) {
00800         AnimData *adt = NULL;
00801         
00802         if (saction->mode == SACTCONT_ACTION) {
00803             // TODO: context selector could help decide this with more control?
00804             adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
00805         }
00806         else if (saction->mode == SACTCONT_SHAPEKEY) {
00807             Key *key = ob_get_key(obact);
00808             if (key)
00809                 adt= BKE_id_add_animdata(&key->id); /* this only adds if non-existant */
00810         }
00811         
00812         /* set action */
00813         if (adt) {
00814             /* fix id-count of action we're replacing */
00815             id_us_min(&adt->action->id);
00816             
00817             /* show new id-count of action we're replacing */
00818             adt->action= saction->action;
00819             id_us_plus(&adt->action->id);
00820         }
00821         
00822         /* force depsgraph flush too */
00823         DAG_id_tag_update(&obact->id, OB_RECALC_OB|OB_RECALC_DATA);
00824     }
00825 }
00826 
00827 static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
00828 {
00829     SpaceAction *saction= (SpaceAction*)(ptr->data);
00830     Object *obact= (scene->basact)? scene->basact->object: NULL;
00831     
00832     /* special exceptions for ShapeKey Editor mode */
00833     if (saction->mode == SACTCONT_SHAPEKEY) {
00834         Key *key = ob_get_key(obact);
00835         
00836         /* 1)   update the action stored for the editor */
00837         if (key)
00838             saction->action = (key->adt)? key->adt->action : NULL;
00839         else
00840             saction->action = NULL;
00841         
00842         /* 2)   enable 'show sliders' by default, since one of the main
00843          *      points of the ShapeKey Editor is to provide a one-stop shop
00844          *      for controlling the shapekeys, whose main control is the value
00845          */
00846         saction->flag |= SACTION_SLIDERS;
00847     }
00848     /* make sure action stored is valid */
00849     else if (saction->mode == SACTCONT_ACTION) {
00850         /* 1)   update the action stored for the editor */
00851         // TODO: context selector could help decide this with more control?
00852         if (obact)
00853             saction->action = (obact->adt)? obact->adt->action : NULL;
00854         else
00855             saction->action = NULL;
00856     }
00857 }
00858 
00859 /* Space Graph Editor */
00860 
00861 static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00862 {
00863     ScrArea *sa= rna_area_from_space(ptr);
00864     
00865     /* after changing view mode, must force recalculation of F-Curve colors 
00866      * which can only be achieved using refresh as opposed to redraw
00867      */
00868     ED_area_tag_refresh(sa);
00869 }
00870 
00871 static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
00872 {
00873     SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
00874     return (sipo->ghostCurves.first != NULL);
00875 }
00876 
00877 static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00878 {
00879     ScrArea *sa= rna_area_from_space(ptr);
00880     ED_area_tag_refresh(sa);
00881 }
00882 
00883 static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
00884 {
00885     BGpic *bgpic= (BGpic *)ptr->data;
00886     return 1.0f-bgpic->blend;
00887 }
00888 
00889 static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
00890 {
00891     BGpic *bgpic= (BGpic *)ptr->data;
00892     bgpic->blend = 1.0f - value;
00893 }
00894 
00895 static BGpic *rna_BackgroundImage_new(View3D *v3d)
00896 {
00897     BGpic *bgpic= ED_view3D_background_image_new(v3d);
00898 
00899     WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d);
00900 
00901     return bgpic;
00902 }
00903 
00904 static void rna_BackgroundImage_remove(View3D *v3d, ReportList *reports, BGpic *bgpic)
00905 {
00906     if (BLI_findindex(&v3d->bgpicbase, bgpic) == -1) {
00907         BKE_report(reports, RPT_ERROR, "BackgroundImage can't be removed");
00908     }
00909     else {
00910         ED_view3D_background_image_remove(v3d, bgpic);
00911         WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d);
00912     }
00913 }
00914 
00915 static void rna_BackgroundImage_clear(View3D *v3d)
00916 {
00917     ED_view3D_background_image_clear(v3d);
00918     WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d);
00919 }
00920 
00921 /* Space Node Editor */
00922 
00923 static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value)
00924 {
00925     SpaceNode *snode= (SpaceNode*)ptr->data;
00926     bNodeTree *ntree= (bNodeTree*)value.data;
00927     
00928     /* exclude group trees, only trees of the active type */
00929     return (ntree->nodetype==0 && ntree->type == snode->treetype);
00930 }
00931 
00932 static void rna_SpaceNodeEditor_node_tree_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
00933 {
00934     SpaceNode *snode= (SpaceNode*)ptr->data;
00935     
00936     ED_node_tree_update(snode, scene);
00937 }
00938 
00939 static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *UNUSED(ptr),
00940                                                                    PropertyRNA *UNUSED(prop), int *free)
00941 {
00942     Scene *scene = CTX_data_scene(C);
00943     Object *ob = CTX_data_active_object(C);
00944     EnumPropertyItem *item= NULL;
00945     EnumPropertyItem tmp= {0, "", 0, "", ""};
00946     int totitem= 0;
00947 
00948     if(ob) {
00949         if(ob->type == OB_LAMP) {
00950             tmp.value = SB_TEXC_MAT_OR_LAMP;
00951             tmp.description = "Show Lamp Textures";
00952             tmp.identifier = "LAMP";
00953             tmp.icon = ICON_LAMP_POINT;
00954             RNA_enum_item_add(&item, &totitem, &tmp);
00955         }
00956         else if(ob->totcol) {
00957             tmp.value = SB_TEXC_MAT_OR_LAMP;
00958             tmp.description = "Show Material Textures";
00959             tmp.identifier = "MATERIAL";
00960             tmp.icon = ICON_MATERIAL;
00961             RNA_enum_item_add(&item, &totitem, &tmp);
00962         }
00963 
00964         if(ob->particlesystem.first) {
00965             tmp.value = SB_TEXC_PARTICLES;
00966             tmp.description = "Show Particle Textures";
00967             tmp.identifier = "PARTICLE";
00968             tmp.icon = ICON_PARTICLES;
00969             RNA_enum_item_add(&item, &totitem, &tmp);
00970         }
00971     }
00972 
00973     if(scene && scene->world) {
00974         tmp.value = SB_TEXC_WORLD;
00975         tmp.description = "Show World Textures";
00976         tmp.identifier = "WORLD";
00977         tmp.icon = ICON_WORLD;
00978         RNA_enum_item_add(&item, &totitem, &tmp);
00979     }
00980 
00981     tmp.value = SB_TEXC_BRUSH;
00982     tmp.description = "Show Brush Textures";
00983     tmp.identifier = "BRUSH";
00984     tmp.icon = ICON_BRUSH_DATA;
00985     RNA_enum_item_add(&item, &totitem, &tmp);
00986     
00987     RNA_enum_item_end(&item, &totitem);
00988     *free = 1;
00989 
00990     return item;
00991 }
00992 
00993 static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
00994 {
00995     SpaceClip *sc= (SpaceClip*)(ptr->data);
00996 
00997     ED_space_clip_set(NULL, sc, (MovieClip*)value.data);
00998 }
00999 
01000 static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
01001 {
01002     SpaceClip *sc= (SpaceClip*)(ptr->data);
01003 
01004     sc->scopes.ok= 0;
01005 }
01006 
01007 static void rna_SpaceClipEditor_lock_selection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
01008 {
01009     SpaceClip *sc= (SpaceClip*)(ptr->data);
01010 
01011     sc->xlockof= 0.f;
01012     sc->ylockof= 0.f;
01013 }
01014 
01015 static void rna_SpaceClipEditor_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
01016 {
01017     ScrArea *sa= rna_area_from_space(ptr);
01018     ED_area_tag_refresh(sa);
01019 }
01020 
01021 #else
01022 
01023 static void rna_def_space(BlenderRNA *brna)
01024 {
01025     StructRNA *srna;
01026     PropertyRNA *prop;
01027     
01028     srna= RNA_def_struct(brna, "Space", NULL);
01029     RNA_def_struct_sdna(srna, "SpaceLink");
01030     RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
01031     RNA_def_struct_refine_func(srna, "rna_Space_refine");
01032     
01033     prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
01034     RNA_def_property_enum_sdna(prop, NULL, "spacetype");
01035     RNA_def_property_enum_items(prop, space_type_items);
01036     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01037     RNA_def_property_ui_text(prop, "Type", "Space data type");
01038 }
01039 
01040 static void rna_def_space_image_uv(BlenderRNA *brna)
01041 {
01042     StructRNA *srna;
01043     PropertyRNA *prop;
01044 
01045     static EnumPropertyItem sticky_mode_items[] = {
01046         {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled"},
01047         {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location",
01048                         "Select UVs that are at the same location and share a mesh vertex"},
01049         {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex",
01050                            "Select UVs that share mesh vertex, irrespective if they are in the same location"},
01051         {0, NULL, 0, NULL, NULL}};
01052 
01053     static EnumPropertyItem dt_uv_items[] = {
01054         {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"},
01055         {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"},
01056         {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"},
01057         {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"},
01058         {0, NULL, 0, NULL, NULL}};
01059 
01060     static EnumPropertyItem dt_uvstretch_items[] = {
01061         {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
01062         {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
01063         {0, NULL, 0, NULL, NULL}};
01064 
01065     static EnumPropertyItem pivot_items[] = {
01066         {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
01067         {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
01068         {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
01069         {0, NULL, 0, NULL, NULL}};
01070 
01071     srna= RNA_def_struct(brna, "SpaceUVEditor", NULL);
01072     RNA_def_struct_sdna(srna, "SpaceImage");
01073     RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
01074     RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
01075 
01076     /* selection */
01077     prop= RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
01078     RNA_def_property_enum_sdna(prop, NULL, "sticky");
01079     RNA_def_property_enum_items(prop, sticky_mode_items);
01080     RNA_def_property_ui_text(prop, "Sticky Selection Mode",
01081                              "Automatically select also UVs sharing the same vertex as the ones being selected");
01082     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01083 
01084     /* drawing */
01085     prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
01086     RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
01087     RNA_def_property_enum_items(prop, dt_uv_items);
01088     RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges");
01089     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01090 
01091     prop= RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
01092     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
01093     RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased");
01094     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01095 
01096     prop= RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
01097     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
01098     RNA_def_property_ui_text(prop, "Draw Stretch",
01099                              "Draw faces colored according to the difference in shape between UVs and "
01100                              "their 3D coordinates (blue for low distortion, red for high distortion)");
01101     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01102 
01103     prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
01104     RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
01105     RNA_def_property_enum_items(prop, dt_uvstretch_items);
01106     RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw");
01107     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01108 
01109     prop= RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
01110     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
01111     RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied");
01112     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01113 
01114     prop= RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
01115     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
01116     RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
01117     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01118 
01119     prop= RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
01120     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
01121     RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
01122     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01123 
01124     prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
01125     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES);
01126     RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image");
01127     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01128 
01129     prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
01130     RNA_def_property_array(prop, 2);
01131     RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get",
01132                                  "rna_SpaceImageEditor_cursor_location_set", NULL);
01133     RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
01134     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01135 
01136     /* todo: move edge and face drawing options here from G.f */
01137 
01138     prop= RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
01139     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
01140     RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing");
01141     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01142 
01143     prop= RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
01144     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
01145     RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing");
01146     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01147 
01148     prop= RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
01149     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
01150     RNA_def_property_ui_text(prop, "Live Unwrap",
01151                              "Continuously unwrap the selected UV island while transforming pinned vertices");
01152     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01153 
01154     prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
01155     RNA_def_property_enum_sdna(prop, NULL, "around");
01156     RNA_def_property_enum_items(prop, pivot_items);
01157     RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
01158     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01159 }
01160 
01161 static void rna_def_space_outliner(BlenderRNA *brna)
01162 {
01163     StructRNA *srna;
01164     PropertyRNA *prop;
01165 
01166     static EnumPropertyItem display_mode_items[] = {
01167         {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display datablocks in all scenes"},
01168         {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display datablocks in current scene"},
01169         {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display datablocks in visible layers"},
01170         {SO_SELECTED, "SELECTED", 0, "Selected", "Display datablocks of selected objects"},
01171         {SO_ACTIVE, "ACTIVE", 0, "Active", "Display datablocks of active object"},
01172         {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", "Display datablocks of all objects of same type as selected object"},
01173         {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their datablocks"},
01174         {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", "Display libraries"},
01175         {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence datablocks"},
01176         {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", "Display raw datablocks"},
01177         {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display the user preference datablocks"},
01178         {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", "Display keymap datablocks"},
01179         {0, NULL, 0, NULL, NULL}};
01180     
01181     srna= RNA_def_struct(brna, "SpaceOutliner", "Space");
01182     RNA_def_struct_sdna(srna, "SpaceOops");
01183     RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
01184     
01185     prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
01186     RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
01187     RNA_def_property_enum_items(prop, display_mode_items);
01188     RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
01189     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01190     
01191     prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
01192     RNA_def_property_string_sdna(prop, NULL, "search_string");
01193     RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
01194     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01195     
01196     prop= RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
01197     RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE);
01198     RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
01199     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01200     
01201     prop= RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
01202     RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE);
01203     RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
01204     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01205     
01206     prop= RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
01207     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
01208     RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
01209     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01210 }
01211 
01212 static void rna_def_background_image(BlenderRNA *brna)
01213 {
01214     StructRNA *srna;
01215     PropertyRNA *prop;
01216 
01217     /* note: combinations work but dont flip so arnt that useful */
01218     static EnumPropertyItem bgpic_axis_items[] = {
01219         {0, "", 0, "X Axis", ""},
01220         {(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"},
01221         {(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", "Show background image while looking to the right"},
01222         /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/
01223         {0, "", 0, "Y Axis", ""},
01224         {(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", "Show background image in back view"},
01225         {(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", "Show background image in front view"},
01226         /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/
01227         {0, "", 0, "Z Axis", ""},
01228         {(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", "Show background image in bottom view"},
01229         {(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", "Show background image in top view"},
01230         /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/
01231         {0, "", 0, "Other", ""},
01232         {0, "ALL", 0, "All Views", "Show background image in all views"},
01233         {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"},
01234         {0, NULL, 0, NULL, NULL}};
01235 
01236     static EnumPropertyItem bgpic_source_items[] = {
01237         {V3D_BGPIC_IMAGE, "IMAGE", 0, "Image", ""},
01238         {V3D_BGPIC_MOVIE, "MOVIE_CLIP", 0, "Movie Clip", ""},
01239         {0, NULL, 0, NULL, NULL}
01240     };
01241 
01242     srna= RNA_def_struct(brna, "BackgroundImage", NULL);
01243     RNA_def_struct_sdna(srna, "BGpic");
01244     RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background");
01245 
01246     prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
01247     RNA_def_property_enum_sdna(prop, NULL, "source");
01248     RNA_def_property_enum_items(prop, bgpic_source_items);
01249     RNA_def_property_ui_text(prop, "Background Source", "Data source used for background");
01250     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01251 
01252     prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
01253     RNA_def_property_pointer_sdna(prop, NULL, "ima");
01254     RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
01255     RNA_def_property_flag(prop, PROP_EDITABLE);
01256     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01257 
01258     prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
01259     RNA_def_property_pointer_sdna(prop, NULL, "clip");
01260     RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space");
01261     RNA_def_property_flag(prop, PROP_EDITABLE);
01262     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01263 
01264     prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
01265     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01266     RNA_def_property_pointer_sdna(prop, NULL, "iuser");
01267     RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
01268     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01269 
01270     prop= RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
01271     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01272     RNA_def_property_struct_type(prop, "MovieClipUser");
01273     RNA_def_property_pointer_sdna(prop, NULL, "cuser");
01274     RNA_def_property_ui_text(prop, "Clip User", "Parameters defining which frame of the movie clip is displayed");
01275     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01276     
01277     prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
01278     RNA_def_property_float_sdna(prop, NULL, "xof");
01279     RNA_def_property_ui_text(prop, "X Offset", "Offset image horizontally from the world origin");
01280     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01281     
01282     prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
01283     RNA_def_property_float_sdna(prop, NULL, "yof");
01284     RNA_def_property_ui_text(prop, "Y Offset", "Offset image vertically from the world origin");
01285     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01286     
01287     prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
01288     RNA_def_property_float_sdna(prop, NULL, "size");
01289     RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image");
01290     RNA_def_property_range(prop, 0.0, FLT_MAX);
01291     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01292     
01293     prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
01294     RNA_def_property_float_sdna(prop, NULL, "blend");
01295     RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);
01296     RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color");
01297     RNA_def_property_range(prop, 0.0, 1.0);
01298     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01299 
01300     prop= RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
01301     RNA_def_property_enum_sdna(prop, NULL, "view");
01302     RNA_def_property_enum_items(prop, bgpic_axis_items);
01303     RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the image on");
01304     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01305 
01306     prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
01307     RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED);
01308     RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
01309     RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
01310 
01311     prop= RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE);
01312     RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_CAMERACLIP);
01313     RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera");
01314     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01315 
01316     prop= RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE);
01317     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_BGPIC_DISABLED);
01318     RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background");
01319     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01320 }
01321 
01322 static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop)
01323 {
01324     StructRNA *srna;
01325     FunctionRNA *func;
01326     PropertyRNA *parm;
01327 
01328     RNA_def_property_srna(cprop, "BackgroundImages");
01329     srna= RNA_def_struct(brna, "BackgroundImages", NULL);
01330     RNA_def_struct_sdna(srna, "View3D");
01331     RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images");
01332 
01333     func= RNA_def_function(srna, "new", "rna_BackgroundImage_new");
01334     RNA_def_function_ui_description(func, "Add new background image");
01335     parm= RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
01336     RNA_def_function_return(func, parm);
01337 
01338     func= RNA_def_function(srna, "remove", "rna_BackgroundImage_remove");
01339     RNA_def_function_ui_description(func, "Remove background image");
01340     RNA_def_function_flag(func, FUNC_USE_REPORTS);
01341     parm= RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
01342     RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
01343 
01344     func= RNA_def_function(srna, "clear", "rna_BackgroundImage_clear");
01345     RNA_def_function_ui_description(func, "Remove all background images");
01346 }
01347 
01348 static void rna_def_space_view3d(BlenderRNA *brna)
01349 {
01350     StructRNA *srna;
01351     PropertyRNA *prop;
01352     const int matrix_dimsize[]= {4, 4};
01353         
01354     static EnumPropertyItem pivot_items[] = {
01355         {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
01356                      "Pivot around bounding box center of selected object(s)"},
01357         {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
01358         {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", "Pivot around each object's own origin"},
01359         {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", "Pivot around the median point of selected objects"},
01360         {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"},
01361         {0, NULL, 0, NULL, NULL}};
01362 
01363     static EnumPropertyItem rv3d_persp_items[] = {
01364         {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
01365         {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
01366         {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
01367         {0, NULL, 0, NULL, NULL}};
01368     
01369     static EnumPropertyItem bundle_drawtype_items[] = {
01370         {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
01371         {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
01372         {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
01373         {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
01374         {OB_CUBE, "CUBE", 0, "Cube", ""},
01375         {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
01376         {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
01377         {0, NULL, 0, NULL, NULL}};
01378     
01379     srna= RNA_def_struct(brna, "SpaceView3D", "Space");
01380     RNA_def_struct_sdna(srna, "View3D");
01381     RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
01382     
01383     prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
01384     RNA_def_property_flag(prop, PROP_EDITABLE);
01385     RNA_def_property_pointer_sdna(prop, NULL, "camera");
01386     RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera)");
01387     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01388     
01389     prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
01390     RNA_def_property_flag(prop, PROP_EDITABLE);
01391     RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
01392     RNA_def_property_ui_text(prop, "Lock to Object", "3D View center is locked to this object's position");
01393     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01394     
01395     prop= RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
01396     RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone");
01397     RNA_def_property_ui_text(prop, "Lock to Bone", "3D View center is locked to this bone's position");
01398     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01399 
01400     prop= RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
01401     RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1);
01402     RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
01403     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01404 
01405     prop= RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
01406     RNA_def_property_enum_sdna(prop, NULL, "drawtype");
01407     RNA_def_property_enum_items(prop, viewport_shade_items);
01408     RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceView3D_viewport_shade_itemf");
01409     RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
01410     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_viewport_shade_update");
01411 
01412     prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
01413     RNA_def_property_pointer_sdna(prop, NULL, "localvd");
01414     RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility");
01415     
01416     prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
01417     RNA_def_property_array(prop, 3);
01418     RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", NULL);
01419     RNA_def_property_ui_text(prop, "3D Cursor Location", "3D cursor location for this view (dependent on local view setting)");
01420     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
01421     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01422     
01423     prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
01424     RNA_def_property_float_sdna(prop, NULL, "lens");
01425     RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view");
01426     RNA_def_property_range(prop, 1.0f, 250.0f);
01427     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01428     
01429     prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
01430     RNA_def_property_float_sdna(prop, NULL, "near");
01431     RNA_def_property_range(prop, 0.001f, FLT_MAX);
01432     RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance");
01433     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01434 
01435     prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
01436     RNA_def_property_float_sdna(prop, NULL, "far");
01437     RNA_def_property_range(prop, 1.0f, FLT_MAX);
01438     RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
01439     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01440 
01441     prop= RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
01442     RNA_def_property_float_sdna(prop, NULL, "grid");
01443     RNA_def_property_ui_text(prop, "Grid Scale", "Distance between 3D View grid lines");
01444     RNA_def_property_range(prop, 0.0f, FLT_MAX);
01445     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01446 
01447     prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
01448     RNA_def_property_int_sdna(prop, NULL, "gridlines");
01449     RNA_def_property_ui_text(prop, "Grid Lines", "Number of grid lines to display in perspective view");
01450     RNA_def_property_range(prop, 0, 1024);
01451     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01452     
01453     prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
01454     RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
01455     RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
01456     RNA_def_property_range(prop, 1, 1024);
01457     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01458     
01459     prop= RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
01460     RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
01461     RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
01462     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01463     
01464     prop= RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
01465     RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
01466     RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
01467     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01468     
01469     prop= RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
01470     RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
01471     RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view");
01472     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01473     
01474     prop= RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
01475     RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
01476     RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view");
01477     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01478     
01479     prop= RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
01480     RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
01481     RNA_def_property_ui_text(prop, "Outline Selected",
01482                              "Show an outline highlight around selected objects in non-wireframe views");
01483     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01484     
01485     prop= RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
01486     RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
01487     RNA_def_property_ui_text(prop, "All Object Origins",
01488                              "Show the object origin center dot for all (selected and unselected) objects");
01489     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01490 
01491     prop= RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
01492     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
01493     RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships");
01494     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01495     
01496     prop= RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
01497     RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
01498     RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
01499     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01500 
01501     prop= RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
01502     RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA);
01503     RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view");
01504     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01505 
01506     prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
01507     RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE);
01508     RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
01509     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01510     
01511     prop= RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
01512     RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT);
01513     RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");
01514     RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
01515     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01516 
01517     prop= RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
01518     RNA_def_property_collection_sdna(prop, NULL, "bgpicbase", NULL);
01519     RNA_def_property_struct_type(prop, "BackgroundImage");
01520     RNA_def_property_ui_text(prop, "Background Images", "List of background images");
01521     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01522     rna_def_backgroundImages(brna, prop);
01523 
01524     prop= RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
01525     RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS);
01526     RNA_def_property_ui_text(prop, "Display Background Images", "Display reference images behind objects in the 3D View");
01527     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01528 
01529     prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
01530     RNA_def_property_enum_sdna(prop, NULL, "around");
01531     RNA_def_property_enum_items(prop, pivot_items);
01532     RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
01533     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
01534     
01535     prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
01536     RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
01537     RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object and pose mode only)");
01538     RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
01539     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
01540 
01541     prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
01542     RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
01543     RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
01544     RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
01545     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01546     
01547     prop= RNA_def_property(srna, "use_manipulator_translate", PROP_BOOLEAN, PROP_NONE);
01548     RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE);
01549     RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations");
01550     RNA_def_property_ui_icon(prop, ICON_MAN_TRANS, 0);
01551     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01552     
01553     prop= RNA_def_property(srna, "use_manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
01554     RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE);
01555     RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations");
01556     RNA_def_property_ui_icon(prop, ICON_MAN_ROT, 0);
01557     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01558     
01559     prop= RNA_def_property(srna, "use_manipulator_scale", PROP_BOOLEAN, PROP_NONE);
01560     RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE);
01561     RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations");
01562     RNA_def_property_ui_icon(prop, ICON_MAN_SCALE, 0);
01563     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01564     
01565     prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
01566     RNA_def_property_enum_sdna(prop, NULL, "twmode");
01567     RNA_def_property_enum_items(prop, transform_orientation_items);
01568     RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_itemf");
01569     RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation");
01570     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01571 
01572     prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
01573     RNA_def_property_struct_type(prop, "TransformOrientation");
01574     RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
01575     RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current transformation orientation");
01576 
01577     prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
01578     RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
01579     RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
01580     RNA_def_property_ui_text(prop, "Lock Camera and Layers",
01581                              "Use the scene's active camera and layers in this view, rather than local layers");
01582     RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
01583     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01584 
01585     prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
01586     RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
01587     RNA_def_property_array(prop, 20);
01588     RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set");
01589     RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
01590     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_layer_update");
01591     
01592     prop= RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
01593     RNA_def_property_boolean_sdna(prop, NULL, "lay_used", 1);
01594     RNA_def_property_array(prop, 20);
01595     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01596     RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something");
01597 
01598     prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
01599     RNA_def_property_struct_type(prop, "RegionView3D");
01600     RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
01601     RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region");
01602 
01603     prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE);
01604     RNA_def_property_struct_type(prop, "RegionView3D");
01605     RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL, NULL);
01606     RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings");
01607 
01608     prop= RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
01609     RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_RECONSTRUCTION);
01610     RNA_def_property_ui_text(prop, "Show Reconstruction", "Display reconstruction data from active movie clip");
01611     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01612 
01613     prop= RNA_def_property(srna, "tracks_draw_size", PROP_FLOAT, PROP_NONE);
01614     RNA_def_property_range(prop, 0.0, FLT_MAX);
01615     RNA_def_property_float_sdna(prop, NULL, "bundle_size");
01616     RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data");
01617     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01618 
01619     prop= RNA_def_property(srna, "tracks_draw_type", PROP_ENUM, PROP_NONE);
01620     RNA_def_property_enum_sdna(prop, NULL, "bundle_drawtype");
01621     RNA_def_property_enum_items(prop, bundle_drawtype_items);
01622     RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks");
01623     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01624 
01625     prop= RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
01626     RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_CAMERAPATH);
01627     RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path");
01628     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01629 
01630     prop= RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
01631     RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_BUNDLENAME);
01632     RNA_def_property_ui_text(prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
01633     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01634 
01635     /* region */
01636 
01637     srna= RNA_def_struct(brna, "RegionView3D", NULL);
01638     RNA_def_struct_sdna(srna, "RegionView3D");
01639     RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
01640 
01641     prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
01642     RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED);
01643     RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views");
01644     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
01645     
01646     prop= RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
01647     RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW);
01648     RNA_def_property_ui_text(prop, "Box", "Sync view position between side views");
01649     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
01650     
01651     prop= RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
01652     RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
01653     RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
01654     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
01655     
01656     prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
01657     RNA_def_property_float_sdna(prop, NULL, "persmat");
01658     RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
01659     RNA_def_property_multi_array(prop, 2, matrix_dimsize);
01660     RNA_def_property_ui_text(prop, "Perspective Matrix", "Current perspective matrix of the 3D region");
01661     
01662     prop= RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
01663     RNA_def_property_float_sdna(prop, NULL, "viewmat");
01664     RNA_def_property_multi_array(prop, 2, matrix_dimsize);
01665     RNA_def_property_float_funcs(prop, NULL, "rna_RegionView3D_view_matrix_set", NULL);
01666     RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region");
01667     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01668 
01669     prop= RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
01670     RNA_def_property_enum_sdna(prop, NULL, "persp");
01671     RNA_def_property_enum_items(prop, rv3d_persp_items);
01672     RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
01673     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01674 
01675     prop= RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
01676     RNA_def_property_boolean_sdna(prop, NULL, "is_persp", 1);
01677     RNA_def_property_ui_text(prop, "Is Perspective", "");
01678     RNA_def_property_flag(prop, PROP_EDITABLE);
01679     
01680     prop= RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
01681 #if 0
01682     RNA_def_property_float_sdna(prop, NULL, "ofs"); // cant use because its negated
01683 #else
01684     RNA_def_property_array(prop, 3);
01685     RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", NULL);
01686 #endif
01687     RNA_def_property_ui_text(prop, "View Location", "View pivot location");
01688     RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
01689     RNA_def_property_update(prop, NC_WINDOW, NULL);
01690     
01691     prop= RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); // cant use because its inverted
01692 #if 0
01693     RNA_def_property_float_sdna(prop, NULL, "viewquat");
01694 #else
01695     RNA_def_property_array(prop, 4);
01696     RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", NULL);
01697 #endif
01698     RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
01699     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01700     
01701     /* not sure we need rna access to these but adding anyway */
01702     prop= RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
01703     RNA_def_property_float_sdna(prop, NULL, "dist");
01704     RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
01705     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01706 
01707     prop= RNA_def_property(srna, "view_camera_zoom", PROP_INT, PROP_UNSIGNED);
01708     RNA_def_property_int_sdna(prop, NULL, "camzoom");
01709     RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view");
01710     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01711 
01712     prop= RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
01713     RNA_def_property_float_sdna(prop, NULL, "camdx");
01714     RNA_def_property_array(prop, 2);
01715     RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view");
01716     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01717 }
01718 
01719 static void rna_def_space_buttons(BlenderRNA *brna)
01720 {
01721     StructRNA *srna;
01722     PropertyRNA *prop;
01723 
01724     static EnumPropertyItem buttons_context_items[] = {
01725         {BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"},
01726         {BCONTEXT_RENDER, "RENDER", ICON_SCENE_DATA, "Render", "Render"},
01727         {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
01728         {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
01729         {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Constraints"},
01730         {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifiers"},
01731         {BCONTEXT_DATA, "DATA", 0, "Data", "Data"},
01732         {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
01733         {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT, "Bone Constraints", "Bone Constraints"},
01734         {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
01735         {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
01736         {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"},
01737         {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
01738         {0, NULL, 0, NULL, NULL}};
01739         
01740     static EnumPropertyItem align_items[] = {
01741         {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
01742         {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
01743         {0, NULL, 0, NULL, NULL}};
01744 
01745     static EnumPropertyItem buttons_texture_context_items[] = {
01746         {SB_TEXC_MAT_OR_LAMP, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
01747         {0, NULL, 0, NULL, NULL}}; //actually populated dynamically trough a function
01748         
01749     srna= RNA_def_struct(brna, "SpaceProperties", "Space");
01750     RNA_def_struct_sdna(srna, "SpaceButs");
01751     RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
01752     
01753     prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
01754     RNA_def_property_enum_sdna(prop, NULL, "mainb");
01755     RNA_def_property_enum_items(prop, buttons_context_items);
01756     RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", NULL);
01757     RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
01758     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
01759     
01760     prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
01761     RNA_def_property_enum_sdna(prop, NULL, "align");
01762     RNA_def_property_enum_items(prop, align_items);
01763     RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
01764     RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
01765     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
01766 
01767     prop= RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE);
01768     RNA_def_property_enum_items(prop, buttons_texture_context_items);
01769     RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceProperties_texture_context_itemf");
01770     RNA_def_property_ui_text(prop, "Texture Context", "Type of texture data to display and edit");
01771     RNA_def_property_update(prop, NC_TEXTURE, NULL);
01772 
01773     /* pinned data */
01774     prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
01775     RNA_def_property_pointer_sdna(prop, NULL, "pinid");
01776     RNA_def_property_struct_type(prop, "ID");
01777     /* note: custom set function is ONLY to avoid rna setting a user for this. */
01778     RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef", NULL);
01779     RNA_def_property_flag(prop, PROP_EDITABLE);
01780     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
01781 
01782     prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
01783     RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
01784     RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
01785 }
01786 
01787 static void rna_def_space_image(BlenderRNA *brna)
01788 {
01789     StructRNA *srna;
01790     PropertyRNA *prop;
01791 
01792     srna= RNA_def_struct(brna, "SpaceImageEditor", "Space");
01793     RNA_def_struct_sdna(srna, "SpaceImage");
01794     RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
01795 
01796     /* image */
01797     prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
01798     RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL);
01799     RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
01800     RNA_def_property_flag(prop, PROP_EDITABLE);
01801     RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); // is handled in image editor too
01802 
01803     prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
01804     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01805     RNA_def_property_pointer_sdna(prop, NULL, "iuser");
01806     RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
01807     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01808 
01809     prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
01810     RNA_def_property_pointer_sdna(prop, NULL, "cumap");
01811     RNA_def_property_ui_text(prop, "Curve", "Color curve mapping to use for displaying the image");
01812     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_curves_update");
01813 
01814     prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
01815     RNA_def_property_pointer_sdna(prop, NULL, "scopes");
01816     RNA_def_property_struct_type(prop, "Scopes");
01817     RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
01818     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
01819 
01820     prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
01821     RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
01822     RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
01823     RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
01824     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01825 
01826     prop= RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
01827     RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist");
01828     RNA_def_property_struct_type(prop, "Histogram");
01829     RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
01830 
01831     prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
01832     RNA_def_property_array(prop, 2);
01833     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01834     RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", NULL, NULL);
01835     RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
01836     
01837     /* image draw */
01838     prop= RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
01839     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
01840     RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
01841     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01842 
01843     prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
01844     RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
01845     RNA_def_property_enum_items(prop, draw_channels_items);
01846     RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
01847     RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
01848     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01849 
01850     /* uv */
01851     prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
01852     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01853     RNA_def_property_struct_type(prop, "SpaceUVEditor");
01854     RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
01855     RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
01856     
01857     /* paint */
01858     prop= RNA_def_property(srna, "use_image_paint", PROP_BOOLEAN, PROP_NONE);
01859     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL);
01860     RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode");
01861     RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
01862     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_paint_update");
01863 
01864     /* grease pencil */
01865     prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
01866     RNA_def_property_pointer_sdna(prop, NULL, "gpd");
01867     RNA_def_property_flag(prop, PROP_EDITABLE);
01868     RNA_def_property_struct_type(prop, "GreasePencil");
01869     RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
01870     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01871 
01872     prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
01873     RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DISPGP);
01874     RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
01875 
01876     /* update */
01877     prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
01878     RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
01879     RNA_def_property_ui_text(prop, "Update Automatically",
01880                              "Update other affected window spaces automatically to reflect changes "
01881                              "during interactive operations such as transform");
01882 
01883     /* state */
01884     prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
01885     RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
01886     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01887     RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
01888 
01889     prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
01890     RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
01891     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01892     RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
01893 
01894     prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
01895     RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
01896     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01897     RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
01898 
01899     rna_def_space_image_uv(brna);
01900 }
01901 
01902 static void rna_def_space_sequencer(BlenderRNA *brna)
01903 {
01904     StructRNA *srna;
01905     PropertyRNA *prop;
01906     
01907     static EnumPropertyItem view_type_items[] = {
01908         {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
01909         {SEQ_VIEW_PREVIEW,  "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
01910         {SEQ_VIEW_SEQUENCE_PREVIEW,  "SEQUENCER_PREVIEW", ICON_SEQ_SPLITVIEW, "Sequencer and Image Preview", ""},
01911         {0, NULL, 0, NULL, NULL}};
01912 
01913     static EnumPropertyItem display_mode_items[] = {
01914         {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
01915         {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
01916         {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
01917         {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
01918         {0, NULL, 0, NULL, NULL}};
01919 
01920     static EnumPropertyItem proxy_render_size_items[] = {
01921         {SEQ_PROXY_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
01922         {SEQ_PROXY_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""},
01923         {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""},
01924         {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""},
01925         {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""},
01926         {SEQ_PROXY_RENDER_SIZE_100, "PROXY_100", 0, "Proxy size 100%", ""},
01927         {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
01928         {0, NULL, 0, NULL, NULL}};
01929     
01930     srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
01931     RNA_def_struct_sdna(srna, "SpaceSeq");
01932     RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
01933     
01934     /* view type, fairly important */
01935     prop= RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
01936     RNA_def_property_enum_sdna(prop, NULL, "view");
01937     RNA_def_property_enum_items(prop, view_type_items);
01938     RNA_def_property_ui_text(prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
01939     RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
01940 
01941     /* display type, fairly important */
01942     prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
01943     RNA_def_property_enum_sdna(prop, NULL, "mainb");
01944     RNA_def_property_enum_items(prop, display_mode_items);
01945     RNA_def_property_ui_text(prop, "Display Mode", "View mode to use for displaying sequencer output");
01946     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01947         
01948     /* flag's */
01949     prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
01950     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM);
01951     RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
01952     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01953     
01954     prop= RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
01955     RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
01956     RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than seconds");
01957     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01958     
01959     prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
01960     RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
01961     RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
01962     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01963     
01964     prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
01965     RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
01966     RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview");
01967     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01968 
01969     prop= RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE);
01970     RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
01971     RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview");    
01972     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01973     
01974     prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
01975     RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
01976     RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
01977     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01978     
01979     /* grease pencil */
01980     prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
01981     RNA_def_property_pointer_sdna(prop, NULL, "gpd");
01982     RNA_def_property_struct_type(prop, "UnknownType");
01983     RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
01984     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01985     
01986     prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
01987     RNA_def_property_int_sdna(prop, NULL, "chanshown");
01988     RNA_def_property_ui_text(prop, "Display Channel",
01989                              "The channel number shown in the image preview. 0 is the result of all strips combined");
01990     RNA_def_property_range(prop, -5, MAXSEQ);
01991     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01992     
01993     prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
01994     RNA_def_property_int_sdna(prop, NULL, "zebra");
01995     RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
01996     RNA_def_property_range(prop, 0, 110);
01997     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01998     
01999     prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
02000     RNA_def_property_enum_sdna(prop, NULL, "render_size");
02001     RNA_def_property_enum_items(prop, proxy_render_size_items);
02002     RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions");
02003     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
02004 }
02005 
02006 static void rna_def_space_text(BlenderRNA *brna)
02007 {
02008     StructRNA *srna;
02009     PropertyRNA *prop;
02010 
02011     srna= RNA_def_struct(brna, "SpaceTextEditor", "Space");
02012     RNA_def_struct_sdna(srna, "SpaceText");
02013     RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
02014 
02015     /* text */
02016     prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
02017     RNA_def_property_flag(prop, PROP_EDITABLE);
02018     RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
02019     RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL);
02020     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02021 
02022     /* display */
02023     prop= RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
02024     RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
02025     RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
02026     RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
02027     RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
02028     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02029 
02030     prop= RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
02031     RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
02032     RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
02033     RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
02034     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02035 
02036     prop= RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
02037     RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
02038     RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
02039     RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
02040     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02041     
02042     prop= RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
02043     RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0);
02044     RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
02045     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02046 
02047     prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
02048     RNA_def_property_int_sdna(prop, NULL, "tabnumber");
02049     RNA_def_property_range(prop, 2, 8);
02050     RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
02051     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
02052 
02053     prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
02054     RNA_def_property_int_sdna(prop, NULL, "lheight");
02055     RNA_def_property_range(prop, 8, 32);
02056     RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
02057     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02058 
02059     prop= RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
02060     RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_SHOW_MARGIN);
02061     RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
02062     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02063 
02064     prop= RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
02065     RNA_def_property_int_sdna(prop, NULL, "margin_column");
02066     RNA_def_property_range(prop, 0, 1024);
02067     RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
02068     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02069 
02070     /* functionality options */
02071     prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
02072     RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1);
02073     RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
02074     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02075     
02076     prop= RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
02077     RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1);
02078     RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
02079     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02080     
02081     /* find */
02082     prop= RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
02083     RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
02084     RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one");
02085     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02086 
02087     prop= RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
02088     RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
02089     RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end");
02090     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02091 
02092     prop= RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
02093     RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_MATCH_CASE);
02094     RNA_def_property_ui_text(prop, "Match case", "Search string is sensitive to uppercase and lowercase letters");
02095     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02096 
02097     prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
02098     RNA_def_property_string_sdna(prop, NULL, "findstr");
02099     RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
02100     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02101 
02102     prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
02103     RNA_def_property_string_sdna(prop, NULL, "replacestr");
02104     RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool");
02105     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
02106 }
02107 
02108 static void rna_def_space_dopesheet(BlenderRNA *brna)
02109 {
02110     StructRNA *srna;
02111     PropertyRNA *prop;
02112     
02113     // XXX: action-editor is currently for object-level only actions, so show that using object-icon hint
02114     static EnumPropertyItem mode_items[] = {
02115         {SACTCONT_DOPESHEET, "DOPESHEET", ICON_OOPS, "DopeSheet", "DopeSheet Editor"},
02116         {SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", "Action Editor"},
02117         {SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, "ShapeKey Editor", "ShapeKey Editor"},
02118         {SACTCONT_GPENCIL, "GPENCIL", ICON_GREASEPENCIL, "Grease Pencil", "Grease Pencil"},
02119         {0, NULL, 0, NULL, NULL}};
02120         
02121     
02122     srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
02123     RNA_def_struct_sdna(srna, "SpaceAction");
02124     RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data");
02125 
02126     /* data */
02127     prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
02128     RNA_def_property_flag(prop, PROP_EDITABLE);
02129     RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, "rna_Action_actedit_assign_poll");
02130     RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
02131     RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
02132     
02133     /* mode */
02134     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
02135     RNA_def_property_enum_sdna(prop, NULL, "mode");
02136     RNA_def_property_enum_items(prop, mode_items);
02137     RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
02138     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
02139     
02140     /* display */
02141     prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
02142     RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
02143     RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
02144     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
02145     
02146     prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
02147     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
02148     RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
02149     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
02150     
02151     prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
02152     RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
02153     RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
02154     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
02155     
02156     prop= RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
02157     RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_POSEMARKERS_SHOW);
02158     RNA_def_property_ui_text(prop, "Show Pose Markers",
02159                              "Show markers belonging to the active action instead of Scene markers "
02160                              "(Action and Shape Key Editors only)");
02161     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
02162     
02163     /* editing */
02164     prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
02165     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
02166     RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
02167     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
02168     
02169     prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
02170     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
02171     RNA_def_property_ui_text(prop, "Realtime Updates",
02172                              "When transforming keyframes, changes to the animation data are flushed to other views");
02173     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
02174 
02175     prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
02176     RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_MARKERS_MOVE);
02177     RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
02178 
02179     /* dopesheet */
02180     prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
02181     RNA_def_property_struct_type(prop, "DopeSheet");
02182     RNA_def_property_pointer_sdna(prop, NULL, "ads");
02183     RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
02184 
02185     /* autosnap */
02186     prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
02187     RNA_def_property_enum_sdna(prop, NULL, "autosnap");
02188     RNA_def_property_enum_items(prop, autosnap_items);
02189     RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
02190     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
02191 }
02192 
02193 static void rna_def_space_graph(BlenderRNA *brna)
02194 {
02195     StructRNA *srna;
02196     PropertyRNA *prop;
02197     
02198     static EnumPropertyItem mode_items[] = {
02199         {SIPO_MODE_ANIMATION, "FCURVES", ICON_IPO, "F-Curve Editor", "Edit animation/keyframes displayed as 2D curves"},
02200         {SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, "Drivers", "Edit drivers"},
02201         {0, NULL, 0, NULL, NULL}};
02202         
02203         /* this is basically the same as the one for the 3D-View, but with some entries ommitted */
02204     static EnumPropertyItem gpivot_items[] = {
02205         {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
02206         {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
02207         {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
02208         //{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
02209         //{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
02210         {0, NULL, 0, NULL, NULL}};
02211 
02212     
02213     srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
02214     RNA_def_struct_sdna(srna, "SpaceIpo");
02215     RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
02216     
02217     /* mode */
02218     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
02219     RNA_def_property_enum_sdna(prop, NULL, "mode");
02220     RNA_def_property_enum_items(prop, mode_items);
02221     RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
02222     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
02223     
02224     /* display */
02225     prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
02226     RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
02227     RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
02228     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02229     
02230     prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
02231     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
02232     RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
02233     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02234     
02235     prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
02236     RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
02237     RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
02238     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02239     
02240     prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
02241     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
02242     RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points");
02243     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02244     
02245     prop= RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
02246     RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
02247     RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes",
02248                              "Only keyframes of selected F-Curves are visible and editable");
02249     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02250     
02251     prop= RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
02252     RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY);
02253     RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
02254     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02255     
02256     prop= RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE);
02257     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF);
02258     RNA_def_property_ui_text(prop, "Use High Quality Drawing",
02259                              "Draw F-Curves using Anti-Aliasing and other fancy effects (disable for better performance)");
02260     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02261     
02262     /* editing */
02263     prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
02264     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
02265     RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
02266     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02267     
02268     prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
02269     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
02270     RNA_def_property_ui_text(prop, "Realtime Updates",
02271                              "When transforming keyframes, changes to the animation data are flushed to other views");
02272     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02273     
02274     /* cursor */
02275     prop= RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
02276     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR);
02277     RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
02278     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02279     
02280     prop= RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
02281     RNA_def_property_float_sdna(prop, NULL, "cursorVal");
02282     RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
02283     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02284     
02285     prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
02286     RNA_def_property_enum_sdna(prop, NULL, "around");
02287     RNA_def_property_enum_items(prop, gpivot_items);
02288     RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
02289     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02290 
02291     /* dopesheet */
02292     prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
02293     RNA_def_property_struct_type(prop, "DopeSheet");
02294     RNA_def_property_pointer_sdna(prop, NULL, "ads");
02295     RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
02296 
02297     /* autosnap */
02298     prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
02299     RNA_def_property_enum_sdna(prop, NULL, "autosnap");
02300     RNA_def_property_enum_items(prop, autosnap_items);
02301     RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
02302     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02303     
02304     /* readonly state info */
02305     prop= RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
02306     RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); /* XXX: hack to make this compile, since this property doesn't actually exist*/
02307     RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", NULL);
02308     RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
02309     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02310 }
02311 
02312 static void rna_def_space_nla(BlenderRNA *brna)
02313 {
02314     StructRNA *srna;
02315     PropertyRNA *prop;
02316     
02317     srna= RNA_def_struct(brna, "SpaceNLA", "Space");
02318     RNA_def_struct_sdna(srna, "SpaceNla");
02319     RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
02320     
02321     /* display */
02322     prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
02323     RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
02324     RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
02325     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02326     
02327     prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
02328     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
02329     RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
02330     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02331     
02332     prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
02333     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
02334     RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
02335     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02336     
02337     /* editing */
02338     prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
02339     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
02340     RNA_def_property_ui_text(prop, "Realtime Updates",
02341                              "When transforming strips, changes to the animation data are flushed to other views");
02342     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02343 
02344     /* dopesheet */
02345     prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
02346     RNA_def_property_struct_type(prop, "DopeSheet");
02347     RNA_def_property_pointer_sdna(prop, NULL, "ads");
02348     RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
02349 
02350     /* autosnap */
02351     prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
02352     RNA_def_property_enum_sdna(prop, NULL, "autosnap");
02353     RNA_def_property_enum_items(prop, autosnap_items);
02354     RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
02355     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02356 }
02357 
02358 static void rna_def_space_time(BlenderRNA *brna)
02359 {
02360     StructRNA *srna;
02361     PropertyRNA *prop;
02362     
02363     srna= RNA_def_struct(brna, "SpaceTimeline", "Space");
02364     RNA_def_struct_sdna(srna, "SpaceTime");
02365     RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
02366     
02367     /* view settings */ 
02368     prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
02369     RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
02370     RNA_def_property_ui_text(prop, "Only Selected Channels", "Show keyframes for active Object and/or its selected bones only");
02371     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02372     
02373     prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
02374     RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM);
02375     RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
02376     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02377     
02378     /* displaying cache status */
02379     prop= RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
02380     RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY);
02381     RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");   
02382     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02383     
02384     prop= RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
02385     RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SOFTBODY);
02386     RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");    
02387     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02388     
02389     prop= RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
02390     RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_PARTICLES);
02391     RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");   
02392     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02393     
02394     prop= RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
02395     RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_CLOTH);
02396     RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");  
02397     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02398     
02399     prop= RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
02400     RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SMOKE);
02401     RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");    
02402     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02403         
02404     prop= RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
02405     RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DYNAMICPAINT);
02406     RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");    
02407     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02408 }
02409 
02410 static void rna_def_console_line(BlenderRNA *brna)
02411 {
02412     StructRNA *srna;
02413     PropertyRNA *prop;
02414     
02415     srna = RNA_def_struct(brna, "ConsoleLine", NULL);
02416     RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
02417     // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02418     
02419     prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
02420     RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
02421     RNA_def_property_ui_text(prop, "Line", "Text in the line");
02422     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02423     
02424     prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
02425     RNA_def_property_int_sdna(prop, NULL, "cursor");
02426     RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range");
02427     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02428 }
02429     
02430 static void rna_def_space_console(BlenderRNA *brna)
02431 {
02432     StructRNA *srna;
02433     PropertyRNA *prop;
02434     
02435     srna= RNA_def_struct(brna, "SpaceConsole", "Space");
02436     RNA_def_struct_sdna(srna, "SpaceConsole");
02437     RNA_def_struct_ui_text(srna, "Space Console", "Interactive python console");
02438     
02439     /* display */
02440     prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
02441     RNA_def_property_int_sdna(prop, NULL, "lheight");
02442     RNA_def_property_range(prop, 8, 32);
02443     RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
02444     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02445 
02446 
02447     prop= RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
02448     RNA_def_property_int_sdna(prop, NULL, "sel_start");
02449     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02450     
02451     prop= RNA_def_property(srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
02452     RNA_def_property_int_sdna(prop, NULL, "sel_end");
02453     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02454 
02455     prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
02456     RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
02457     
02458     prop= RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
02459     RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
02460 
02461     prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
02462     RNA_def_property_collection_sdna(prop, NULL, "history", NULL);
02463     RNA_def_property_struct_type(prop, "ConsoleLine");
02464     RNA_def_property_ui_text(prop, "History", "Command history");
02465     
02466     prop= RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
02467     RNA_def_property_collection_sdna(prop, NULL, "scrollback", NULL);
02468     RNA_def_property_struct_type(prop, "ConsoleLine");
02469     RNA_def_property_ui_text(prop, "Output", "Command output");
02470 }
02471 
02472 static void rna_def_fileselect_params(BlenderRNA *brna)
02473 {
02474     StructRNA *srna;
02475     PropertyRNA *prop;
02476     
02477     static EnumPropertyItem file_display_items[] = {
02478         {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
02479         {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
02480         {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
02481         {0, NULL, 0, NULL, NULL}};
02482 
02483     static EnumPropertyItem file_sort_items[] = {
02484         {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically"},
02485         {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension"},
02486         {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time"},
02487         {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size"},
02488         {0, NULL, 0, NULL, NULL}};
02489 
02490     srna= RNA_def_struct(brna, "FileSelectParams", NULL);
02491     RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
02492 
02493     prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
02494     RNA_def_property_string_sdna(prop, NULL, "title");
02495     RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
02496     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02497 
02498     prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
02499     RNA_def_property_string_sdna(prop, NULL, "dir");
02500     RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
02501     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02502 
02503     prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
02504     RNA_def_property_string_sdna(prop, NULL, "file");
02505     RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
02506     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02507 
02508     prop= RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
02509     RNA_def_property_enum_sdna(prop, NULL, "display");
02510     RNA_def_property_enum_items(prop, file_display_items);
02511     RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
02512     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02513 
02514     prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
02515     RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER);
02516     RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
02517     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02518 
02519     prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
02520     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
02521     RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
02522     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL);
02523 
02524     prop= RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
02525     RNA_def_property_enum_sdna(prop, NULL, "sort");
02526     RNA_def_property_enum_items(prop, file_sort_items);
02527     RNA_def_property_ui_text(prop, "Sort", "");
02528     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02529 
02530     prop= RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
02531     RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE);
02532     RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
02533     RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
02534     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02535 
02536     prop= RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
02537     RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE);
02538     RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
02539     RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
02540     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02541 
02542     prop= RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
02543     RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE);
02544     RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
02545     RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
02546     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02547 
02548     prop= RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
02549     RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE);
02550     RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
02551     RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
02552     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02553 
02554     prop= RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
02555     RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE);
02556     RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
02557     RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
02558     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02559 
02560     prop= RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
02561     RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE);
02562     RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
02563     RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
02564     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02565 
02566     prop= RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
02567     RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE);
02568     RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
02569     RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0);
02570     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02571 
02572     prop= RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
02573     RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE);
02574     RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
02575     RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
02576     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02577     
02578     prop= RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
02579     RNA_def_property_string_sdna(prop, NULL, "filter_glob");
02580     RNA_def_property_ui_text(prop, "Extension Filter", "");
02581     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
02582 
02583 }
02584 
02585 static void rna_def_space_filebrowser(BlenderRNA *brna)
02586 {
02587     StructRNA *srna;
02588     PropertyRNA *prop;
02589 
02590     srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space");
02591     RNA_def_struct_sdna(srna, "SpaceFile");
02592     RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
02593 
02594     prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
02595     RNA_def_property_pointer_sdna(prop, NULL, "params");
02596     RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
02597     
02598     prop= RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE);
02599     RNA_def_property_pointer_sdna(prop, NULL, "op");
02600     RNA_def_property_ui_text(prop, "Active Operator", "");
02601 
02602     /* keep this for compatibility with existing presets,
02603        not exposed in c++ api because of keyword conflict */
02604     prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
02605     RNA_def_property_pointer_sdna(prop, NULL, "op");
02606     RNA_def_property_ui_text(prop, "Active Operator", "");
02607 }
02608 
02609 static void rna_def_space_info(BlenderRNA *brna)
02610 {
02611     StructRNA *srna;
02612     PropertyRNA *prop;
02613 
02614     srna= RNA_def_struct(brna, "SpaceInfo", "Space");
02615     RNA_def_struct_sdna(srna, "SpaceInfo");
02616     RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
02617     
02618     /* reporting display */
02619     prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
02620     RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_DEBUG);
02621     RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
02622     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
02623     
02624     prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
02625     RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_INFO);
02626     RNA_def_property_ui_text(prop, "Show Info", "Display general information");
02627     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
02628     
02629     prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
02630     RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_OP);
02631     RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
02632     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
02633     
02634     prop= RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
02635     RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_WARN);
02636     RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
02637     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
02638     
02639     prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
02640     RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_ERR);
02641     RNA_def_property_ui_text(prop, "Show Error", "Display error text");
02642     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL); 
02643 }
02644 
02645 static void rna_def_space_userpref(BlenderRNA *brna)
02646 {
02647     StructRNA *srna;
02648     PropertyRNA *prop;
02649     
02650     srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
02651     RNA_def_struct_sdna(srna, "SpaceUserPref");
02652     RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data");
02653     
02654     prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
02655     RNA_def_property_string_sdna(prop, NULL, "filter");
02656     RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
02657 
02658 }
02659 
02660 static void rna_def_space_node(BlenderRNA *brna)
02661 {
02662     StructRNA *srna;
02663     PropertyRNA *prop;
02664 
02665     static EnumPropertyItem texture_type_items[] = {
02666         {SNODE_TEX_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit texture nodes from Object"},
02667         {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World"},
02668         {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"},
02669         {0, NULL, 0, NULL, NULL}};
02670 
02671     static EnumPropertyItem shader_type_items[] = {
02672         {SNODE_SHADER_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit shader nodes from Object"},
02673         {SNODE_SHADER_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit shader nodes from World"},
02674         {0, NULL, 0, NULL, NULL}};
02675 
02676     static EnumPropertyItem backdrop_channels_items[] = {
02677         {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
02678         {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
02679                           "Draw image with RGB colors and alpha transparency"},
02680         {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
02681         {0, NULL, 0, NULL, NULL}};
02682 
02683     srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space");
02684     RNA_def_struct_sdna(srna, "SpaceNode");
02685     RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");
02686 
02687     prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
02688     RNA_def_property_enum_sdna(prop, NULL, "treetype");
02689     RNA_def_property_enum_items(prop, nodetree_type_items);
02690     RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
02691     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
02692 
02693     prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
02694     RNA_def_property_enum_sdna(prop, NULL, "texfrom");
02695     RNA_def_property_enum_items(prop, texture_type_items);
02696     RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
02697     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
02698 
02699     prop= RNA_def_property(srna, "shader_type", PROP_ENUM, PROP_NONE);
02700     RNA_def_property_enum_sdna(prop, NULL, "shaderfrom");
02701     RNA_def_property_enum_items(prop, shader_type_items);
02702     RNA_def_property_ui_text(prop, "Shader Type", "Type of data to take shader from");
02703     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
02704 
02705     prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
02706     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02707     RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited");
02708 
02709     prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
02710     RNA_def_property_pointer_sdna(prop, NULL, "from");
02711     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02712     RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked");
02713 
02714     prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
02715     RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
02716     RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_SpaceNodeEditor_node_tree_poll");
02717     RNA_def_property_flag(prop, PROP_EDITABLE);
02718     RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited");
02719     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
02720 
02721     prop= RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
02722     RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
02723     RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
02724     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02725 
02726     prop= RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE);
02727     RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_AUTO_RENDER);
02728     RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite changed layers on 3D edits");
02729     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02730     
02731     prop= RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
02732     RNA_def_property_float_sdna(prop, NULL, "zoom");
02733     RNA_def_property_float_default(prop, 1.0f);
02734     RNA_def_property_range(prop, 0.01f, FLT_MAX);
02735     RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
02736     RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
02737     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02738     
02739     prop= RNA_def_property(srna, "backdrop_x", PROP_FLOAT, PROP_NONE);
02740     RNA_def_property_float_sdna(prop, NULL, "xof");
02741     RNA_def_property_ui_text(prop, "Backdrop X", "Backdrop X offset");
02742     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02743 
02744     prop= RNA_def_property(srna, "backdrop_y", PROP_FLOAT, PROP_NONE);
02745     RNA_def_property_float_sdna(prop, NULL, "yof");
02746     RNA_def_property_ui_text(prop, "Backdrop Y", "Backdrop Y offset");
02747     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02748 
02749     prop= RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
02750     RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
02751     RNA_def_property_enum_items(prop, backdrop_channels_items);
02752     RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
02753     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02754 }
02755 
02756 static void rna_def_space_logic(BlenderRNA *brna)
02757 {
02758     StructRNA *srna;
02759     PropertyRNA *prop;
02760 
02761     srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
02762     RNA_def_struct_sdna(srna, "SpaceLogic");
02763     RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data");
02764 
02765     /* sensors */
02766     prop= RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLEAN, PROP_NONE);
02767     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_SEL);
02768     RNA_def_property_ui_text(prop, "Show Selected Object", "Show sensors of all selected objects");
02769     RNA_def_property_update(prop, NC_LOGIC, NULL);
02770     
02771     prop= RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE);
02772     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_ACT);
02773     RNA_def_property_ui_text(prop, "Show Active Object", "Show sensors of active object");
02774     RNA_def_property_update(prop, NC_LOGIC, NULL);
02775     
02776     prop= RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOLEAN, PROP_NONE);
02777     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_LINK);
02778     RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to the controller");
02779     RNA_def_property_update(prop, NC_LOGIC, NULL);
02780 
02781     prop= RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE);
02782     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE);
02783     RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states");
02784     RNA_def_property_update(prop, NC_LOGIC, NULL);
02785 
02786     /* controllers */
02787     prop= RNA_def_property(srna, "show_controllers_selected_objects", PROP_BOOLEAN, PROP_NONE);
02788     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_SEL);
02789     RNA_def_property_ui_text(prop, "Show Selected Object", "Show controllers of all selected objects");
02790     RNA_def_property_update(prop, NC_LOGIC, NULL);
02791     
02792     prop= RNA_def_property(srna, "show_controllers_active_object", PROP_BOOLEAN, PROP_NONE);
02793     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_ACT);
02794     RNA_def_property_ui_text(prop, "Show Active Object", "Show controllers of active object");
02795     RNA_def_property_update(prop, NC_LOGIC, NULL);
02796 
02797     prop= RNA_def_property(srna, "show_controllers_linked_controller", PROP_BOOLEAN, PROP_NONE);
02798     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK);
02799     RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator");
02800     RNA_def_property_update(prop, NC_LOGIC, NULL);
02801 
02802     /* actuators */
02803     prop= RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOOLEAN, PROP_NONE);
02804     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_SEL);
02805     RNA_def_property_ui_text(prop, "Show Selected Object", "Show actuators of all selected objects");
02806     RNA_def_property_update(prop, NC_LOGIC, NULL);
02807     
02808     prop= RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEAN, PROP_NONE);
02809     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_ACT);
02810     RNA_def_property_ui_text(prop, "Show Active Object", "Show actuators of active object");
02811     RNA_def_property_update(prop, NC_LOGIC, NULL);
02812     
02813     prop= RNA_def_property(srna, "show_actuators_linked_controller", PROP_BOOLEAN, PROP_NONE);
02814     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_LINK);
02815     RNA_def_property_ui_text(prop, "Show Linked to Actuator", "Show linked objects to the actuator");
02816     RNA_def_property_update(prop, NC_LOGIC, NULL);
02817 
02818     prop= RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEAN, PROP_NONE);
02819     RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE);
02820     RNA_def_property_ui_text(prop, "Show Active States", "Show only actuators connected to active states");
02821     RNA_def_property_update(prop, NC_LOGIC, NULL);
02822 
02823 }
02824 
02825 static void rna_def_space_clip(BlenderRNA *brna)
02826 {
02827     StructRNA *srna;
02828     PropertyRNA *prop;
02829 
02830     static EnumPropertyItem mode_items[] = {
02831         {SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
02832         {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction", "Show tracking/reconstruction tools"},
02833         {SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distortion tools"},
02834         {0, NULL, 0, NULL, NULL}};
02835 
02836     static EnumPropertyItem view_items[] = {
02837         {SC_VIEW_CLIP, "CLIP", ICON_SEQUENCE, "Clip", "Show editing clip preview"},
02838         {SC_VIEW_GRAPH, "GRAPH", ICON_IPO, "Graph", "Show graph view for active element"},
02839         {0, NULL, 0, NULL, NULL}};
02840 
02841     srna= RNA_def_struct(brna, "SpaceClipEditor", "Space");
02842     RNA_def_struct_sdna(srna, "SpaceClip");
02843     RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
02844 
02845     /* movieclip */
02846     prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
02847     RNA_def_property_flag(prop, PROP_EDITABLE);
02848     RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip displayed and edited in this space");
02849     RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceClipEditor_clip_set", NULL, NULL);
02850     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02851 
02852     /* clip user */
02853     prop= RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
02854     RNA_def_property_flag(prop, PROP_NEVER_NULL);
02855     RNA_def_property_struct_type(prop, "MovieClipUser");
02856     RNA_def_property_pointer_sdna(prop, NULL, "user");
02857     RNA_def_property_ui_text(prop, "Movie Clip User", "Parameters defining which frame of the movie clip is displayed");
02858     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02859 
02860     /* mode */
02861     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
02862     RNA_def_property_enum_sdna(prop, NULL, "mode");
02863     RNA_def_property_enum_items(prop, mode_items);
02864     RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
02865     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_clip_mode_update");
02866 
02867     /* view */
02868     prop= RNA_def_property(srna, "view", PROP_ENUM, PROP_NONE);
02869     RNA_def_property_enum_sdna(prop, NULL, "view");
02870     RNA_def_property_enum_items(prop, view_items);
02871     RNA_def_property_ui_text(prop, "View", "Type of the clip editor view");
02872     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_view_type_update");
02873 
02874     /* show pattern */
02875     prop= RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE);
02876     RNA_def_property_ui_text(prop, "Show Marker Pattern", "Show pattern boundbox for markers");
02877     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_PATTERN);
02878     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02879 
02880     /* show search */
02881     prop= RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE);
02882     RNA_def_property_ui_text(prop, "Show Marker Search", "Show search boundbox for markers");
02883     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_SEARCH);
02884     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02885 
02886     /* show pyramid */
02887     prop= RNA_def_property(srna, "show_pyramid_levels", PROP_BOOLEAN, PROP_NONE);
02888     RNA_def_property_ui_text(prop, "Show Pyramid ", "Show patterns for each pyramid level for markers (KLT only)");
02889     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_PYRAMID_LEVELS);
02890     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02891 
02892     /* lock to selection */
02893     prop= RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
02894     RNA_def_property_ui_text(prop, "Lock to Selection", "Lock viewport to selected markers during playback");
02895     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_SELECTION);
02896     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_lock_selection_update");
02897 
02898     /* show markers pathes */
02899     prop= RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE);
02900     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TRACK_PATH);
02901     RNA_def_property_ui_text(prop, "Show Track Path", "Show path of how track moves");
02902     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02903 
02904     /* path length */
02905     prop= RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
02906     RNA_def_property_int_sdna(prop, NULL, "path_length");
02907     RNA_def_property_range(prop, 0, 50);
02908     RNA_def_property_ui_text(prop, "Path Length", "Length of displaying path, in frames");
02909     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02910 
02911     /* show tiny markers */
02912     prop= RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
02913     RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers in a more compact manner");
02914     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TINY_MARKER);
02915     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02916 
02917     /* show bundles */
02918     prop= RNA_def_property(srna, "show_bundles", PROP_BOOLEAN, PROP_NONE);
02919     RNA_def_property_ui_text(prop, "Show Bundles", "Show projection of 3D markers into footage");
02920     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_BUNDLES);
02921     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02922 
02923     /* mute footage */
02924     prop= RNA_def_property(srna, "use_mute_footage", PROP_BOOLEAN, PROP_NONE);
02925     RNA_def_property_ui_text(prop, "Mute Footage", "Mute footage and show black background instead");
02926     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_MUTE_FOOTAGE);
02927     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02928 
02929     /* hide disabled */
02930     prop= RNA_def_property(srna, "show_disabled", PROP_BOOLEAN, PROP_NONE);
02931     RNA_def_property_ui_text(prop, "Show Disabled", "Show disabled tracks from the footage");
02932     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SC_HIDE_DISABLED);
02933     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02934 
02935     /* scopes */
02936     prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
02937     RNA_def_property_pointer_sdna(prop, NULL, "scopes");
02938     RNA_def_property_struct_type(prop, "MovieClipScopes");
02939     RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize movie clip statistics");
02940 
02941     /* show names */
02942     prop= RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
02943     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_NAMES);
02944     RNA_def_property_ui_text(prop, "Show Names", "Show track names and status");
02945     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02946 
02947     /* show grid */
02948     prop= RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
02949     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRID);
02950     RNA_def_property_ui_text(prop, "Show Grid", "Show grid showing lens distortion");
02951     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02952 
02953     /* show stable */
02954     prop= RNA_def_property(srna, "show_stable", PROP_BOOLEAN, PROP_NONE);
02955     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_STABLE);
02956     RNA_def_property_ui_text(prop, "Show Stable", "Show stable footage in editor (if stabilization is enabled)");
02957     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02958 
02959     /* manual calibration */
02960     prop= RNA_def_property(srna, "use_manual_calibration", PROP_BOOLEAN, PROP_NONE);
02961     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_MANUAL_CALIBRATION);
02962     RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers");
02963     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02964 
02965     /* show stable */
02966     prop= RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
02967     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GPENCIL);
02968     RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show grease pencil strokes over the footage");
02969     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02970 
02971     /* show filters */
02972     prop= RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE);
02973     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_FILTERS);
02974     RNA_def_property_ui_text(prop, "Show Filters", "Show filters for graph editor");
02975     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02976 
02977     /* show graph_frames */
02978     prop= RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE);
02979     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_FRAMES);
02980     RNA_def_property_ui_text(prop, "Show Frames", "Show curve for per-frame average error (camera motion should be solved first)");
02981     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02982 
02983     /* show graph_tracks */
02984     prop= RNA_def_property(srna, "show_graph_tracks", PROP_BOOLEAN, PROP_NONE);
02985     RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_TRACKS);
02986     RNA_def_property_ui_text(prop, "Show Tracks", "Display the speed curves (in \"x\" direction red, in \"y\" direction green) for the selected tracks");
02987     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02988 
02989     /* ** channels ** */
02990 
02991     /* show_red_channel */
02992     prop= RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE);
02993     RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_RED);
02994     RNA_def_property_ui_text(prop, "Show Red Channel", "Show red channel in the frame");
02995     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
02996 
02997     /* show_green_channel */
02998     prop= RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE);
02999     RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_GREEN);
03000     RNA_def_property_ui_text(prop, "Show Green Channel", "Show green channel in the frame");
03001     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
03002 
03003     /* show_blue_channel */
03004     prop= RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE);
03005     RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_BLUE);
03006     RNA_def_property_ui_text(prop, "Show Blue Channel", "Show blue channel in the frame");
03007     RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
03008 
03009     /* preview_grayscale */
03010     prop= RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
03011     RNA_def_property_boolean_sdna(prop, NULL, "postproc_flag", MOVIECLIP_PREVIEW_GRAYSCALE);
03012     RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode");
03013     RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
03014 }
03015 
03016 
03017 void RNA_def_space(BlenderRNA *brna)
03018 {
03019     rna_def_space(brna);
03020     rna_def_space_image(brna);
03021     rna_def_space_sequencer(brna);
03022     rna_def_space_text(brna);
03023     rna_def_fileselect_params(brna);
03024     rna_def_space_filebrowser(brna);
03025     rna_def_space_outliner(brna);
03026     rna_def_background_image(brna);
03027     rna_def_space_view3d(brna);
03028     rna_def_space_buttons(brna);
03029     rna_def_space_dopesheet(brna);
03030     rna_def_space_graph(brna);
03031     rna_def_space_nla(brna);
03032     rna_def_space_time(brna);
03033     rna_def_space_console(brna);
03034     rna_def_console_line(brna);
03035     rna_def_space_info(brna);
03036     rna_def_space_userpref(brna);
03037     rna_def_space_node(brna);
03038     rna_def_space_logic(brna);
03039     rna_def_space_clip(brna);
03040 }
03041 
03042 #endif
03043