4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * Contributor(s): Blender Foundation (2008)
22 * ***** END GPL LICENSE BLOCK *****
25 /** \file blender/makesrna/intern/rna_space.c
32 #include "MEM_guardedalloc.h"
34 #include "RNA_access.h"
35 #include "RNA_define.h"
37 #include "rna_internal.h"
41 #include "DNA_action_types.h"
42 #include "DNA_key_types.h"
43 #include "DNA_node_types.h"
44 #include "DNA_object_types.h"
45 #include "DNA_space_types.h"
46 #include "DNA_view3d_types.h"
51 EnumPropertyItem space_type_items[] = {
52 {SPACE_EMPTY, "EMPTY", 0, "Empty", ""},
53 {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""},
54 {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""},
55 {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""},
56 {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""},
57 {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""},
58 {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""},
59 {SPACE_INFO, "INFO", 0, "Info", ""},
60 {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""},
61 {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""},
62 //{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""},
63 {SPACE_SOUND, "AUDIO_WINDOW", 0, "Audio Window", ""},
64 {SPACE_ACTION, "DOPESHEET_EDITOR", 0, "DopeSheet Editor", ""},
65 {SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""},
66 {SPACE_SCRIPT, "SCRIPTS_WINDOW", 0, "Scripts Window", ""},
67 {SPACE_TIME, "TIMELINE", 0, "Timeline", ""},
68 {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""},
69 {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""},
70 {SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""},
71 {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
72 {0, NULL, 0, NULL, NULL}};
74 static EnumPropertyItem draw_channels_items[] = {
75 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
76 {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
77 {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
78 {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
79 {0, NULL, 0, NULL, NULL}};
81 static EnumPropertyItem transform_orientation_items[] = {
82 {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"},
83 {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
84 {V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
85 {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
86 {V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"},
87 {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
88 {0, NULL, 0, NULL, NULL}};
90 EnumPropertyItem autosnap_items[] = {
91 {SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""},
92 {SACTSNAP_STEP, "STEP", 0, "Time Step", "Snap to 1.0 frame/second intervals"},
93 {SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames/seconds (nla-action time)"},
94 {SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
95 {0, NULL, 0, NULL, NULL}};
97 EnumPropertyItem viewport_shade_items[] = {
98 {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
99 {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
100 {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
101 //{OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
102 {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"},
103 {0, NULL, 0, NULL, NULL}};
107 #include "DNA_anim_types.h"
108 #include "DNA_scene_types.h"
109 #include "DNA_screen_types.h"
111 #include "BLI_math.h"
113 #include "BKE_screen.h"
114 #include "BKE_animsys.h"
115 #include "BKE_brush.h"
116 #include "BKE_colortools.h"
117 #include "BKE_context.h"
118 #include "BKE_depsgraph.h"
119 #include "BKE_paint.h"
121 #include "ED_image.h"
122 #include "ED_screen.h"
123 #include "ED_view3d.h"
124 #include "ED_sequencer.h"
126 #include "IMB_imbuf_types.h"
128 static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
130 SpaceLink *space= (SpaceLink*)ptr->data;
132 switch(space->spacetype) {
134 return &RNA_SpaceView3D;
136 return &RNA_SpaceGraphEditor;
138 return &RNA_SpaceOutliner;
140 return &RNA_SpaceProperties;
142 return &RNA_SpaceFileBrowser;
144 return &RNA_SpaceImageEditor;
146 return &RNA_SpaceInfo;
148 return &RNA_SpaceSequenceEditor;
150 return &RNA_SpaceTextEditor;
152 // return &RNA_SpaceImageBrowser;
154 return &RNA_SpaceAudioWindow;*/
156 return &RNA_SpaceDopeSheetEditor;
158 return &RNA_SpaceNLA;
160 return &RNA_SpaceScriptsWindow;*/
162 return &RNA_SpaceTimeline;
164 return &RNA_SpaceNodeEditor;
166 return &RNA_SpaceLogicEditor;
168 return &RNA_SpaceConsole;
170 return &RNA_SpaceUserPreferences;
176 static ScrArea *rna_area_from_space(PointerRNA *ptr)
178 bScreen *sc = (bScreen*)ptr->id.data;
179 SpaceLink *link= (SpaceLink*)ptr->data;
182 for(sa=sc->areabase.first; sa; sa=sa->next)
183 if(BLI_findindex(&sa->spacedata, link) != -1)
189 static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **sa_r, ARegion **ar_r)
191 bScreen *sc = (bScreen*)ptr->id.data;
194 void *regiondata= ptr->data;
199 for(sa=sc->areabase.first; sa; sa=sa->next) {
200 for(ar=sa->regionbase.first; ar; ar=ar->next) {
201 if(ar->regiondata == regiondata) {
210 static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
212 Scene *scene = ((bScreen*)ptr->id.data)->scene;
213 View3D *v3d= (View3D*)ptr->data;
215 if (v3d->twmode < V3D_MANIP_CUSTOM)
216 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
218 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
221 EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
224 ListBase *transform_spaces;
225 TransformOrientation *ts= NULL;
226 EnumPropertyItem tmp = {0, "", 0, "", ""};
227 EnumPropertyItem *item= NULL;
228 int i = V3D_MANIP_CUSTOM, totitem= 0;
230 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GLOBAL);
231 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_NORMAL);
232 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GIMBAL);
233 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_LOCAL);
234 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_VIEW);
236 if (ptr->type == &RNA_SpaceView3D)
237 scene = ((bScreen*)ptr->id.data)->scene;
239 scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
242 transform_spaces = &scene->transform_spaces;
243 ts = transform_spaces->first;
248 RNA_enum_item_add_separator(&item, &totitem);
250 for(; ts; ts = ts->next) {
251 tmp.identifier = ts->name;
254 RNA_enum_item_add(&item, &totitem, &tmp);
258 RNA_enum_item_end(&item, &totitem);
265 static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
267 View3D *v3d= (View3D*)(ptr->data);
268 bScreen *sc= (bScreen*)ptr->id.data;
270 v3d->scenelock = value;
274 v3d->lay= sc->scene->lay;
275 /* seek for layact */
278 if(v3d->lay & (1<<bit)) {
284 v3d->camera= sc->scene->camera;
288 static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
290 View3D *v3d= (View3D*)(ptr->data);
291 bScreen *sc= (bScreen*)ptr->id.data;
292 Scene *scene= (Scene *)sc->scene;
293 float *loc = give_cursor(scene, v3d);
295 copy_v3_v3(values, loc);
298 static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
300 View3D *v3d= (View3D*)(ptr->data);
301 bScreen *sc= (bScreen*)ptr->id.data;
302 Scene *scene= (Scene *)sc->scene;
303 float *cursor = give_cursor(scene, v3d);
305 copy_v3_v3(cursor, values);
308 static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
310 View3D *v3d= (View3D*)(ptr->data);
312 v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
315 static void rna_SpaceView3D_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
317 DAG_on_visible_update(bmain, FALSE);
320 static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
322 if (U.uiflag & USER_LOCKAROUND) {
323 View3D *v3d_act= (View3D*)(ptr->data);
325 /* TODO, space looper */
327 for(screen= bmain->screen.first; screen; screen= screen->id.next) {
329 for(sa= screen->areabase.first; sa; sa= sa->next) {
331 for(sl= sa->spacedata.first; sl ;sl= sl->next) {
332 if(sl->spacetype==SPACE_VIEW3D) {
333 View3D *v3d= (View3D *)sl;
334 if (v3d != v3d_act) {
335 v3d->around= v3d_act->around;
336 v3d->flag= (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN);
337 ED_area_tag_redraw_regiontype(sa, RGN_TYPE_HEADER);
346 static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
348 View3D *v3d= (View3D*)(ptr->data);
349 ScrArea *sa= rna_area_from_space(ptr);
350 void *regiondata= NULL;
352 ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
353 ARegion *ar= regionbase->last; /* always last in list, weak .. */
354 regiondata= ar->regiondata;
357 return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
360 static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
362 View3D *v3d= (View3D*)(ptr->data);
363 ScrArea *sa= rna_area_from_space(ptr);
364 void *regiondata= NULL;
366 ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
367 ARegion *ar= regionbase->last; /* always before last in list, weak .. */
369 ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
371 regiondata= ar->regiondata;
375 return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
378 static void rna_RegionView3D_quadview_update(Main *main, Scene *scene, PointerRNA *ptr)
383 rna_area_region_from_regiondata(ptr, &sa, &ar);
384 if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
385 ED_view3d_quadview_update(sa, ar, FALSE);
388 /* same as above but call clip==TRUE */
389 static void rna_RegionView3D_quadview_clip_update(Main *main, Scene *scene, PointerRNA *ptr)
394 rna_area_region_from_regiondata(ptr, &sa, &ar);
395 if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
396 ED_view3d_quadview_update(sa, ar, TRUE);
399 static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
401 RegionView3D *rv3d= (RegionView3D *)(ptr->data);
402 negate_v3_v3(values, rv3d->ofs);
405 static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
407 RegionView3D *rv3d= (RegionView3D *)(ptr->data);
408 negate_v3_v3(rv3d->ofs, values);
411 static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
413 RegionView3D *rv3d= (RegionView3D *)(ptr->data);
414 invert_qt_qt(values, rv3d->viewquat);
417 static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
419 RegionView3D *rv3d= (RegionView3D *)(ptr->data);
420 invert_qt_qt(rv3d->viewquat, values);
423 static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
425 RegionView3D *rv3d= (RegionView3D *)(ptr->data);
426 negate_v3_v3(rv3d->ofs, values);
427 ED_view3d_from_m4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
430 /* Space Image Editor */
432 static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
434 return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
437 static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, PointerRNA *ptr)
439 paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
441 ED_space_image_paint_update(bmain->wm.first, scene->toolsettings);
444 static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
446 SpaceImage *sima= (SpaceImage*)(ptr->data);
447 return ED_space_image_show_render(sima);
450 static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
452 SpaceImage *sima= (SpaceImage*)(ptr->data);
453 return ED_space_image_show_paint(sima);
456 static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
458 SpaceImage *sima= (SpaceImage*)(ptr->data);
459 bScreen *sc= (bScreen*)ptr->id.data;
460 return ED_space_image_show_uvedit(sima, sc->scene->obedit);
463 static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
465 SpaceImage *sima= (SpaceImage*)(ptr->data);
466 bScreen *sc= (bScreen*)ptr->id.data;
468 ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data);
471 static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
473 SpaceImage *sima= (SpaceImage*)ptr->data;
474 EnumPropertyItem *item= NULL;
477 int zbuf, alpha, totitem= 0;
479 ibuf= ED_space_image_acquire_buffer(sima, &lock);
481 alpha= ibuf && (ibuf->channels == 4);
482 zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
484 ED_space_image_release_buffer(sima, lock);
487 return draw_channels_items;
489 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
492 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
493 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
496 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
499 RNA_enum_item_end(&item, &totitem);
505 static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
507 SpaceImage *sima= (SpaceImage*)ptr->data;
511 values[0] = values[1] = 1;
514 sa= rna_area_from_space(ptr); /* can be NULL */
515 ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
517 ED_space_image_zoom(sima, ar, &values[0], &values[1]);
521 static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
523 SpaceImage *sima= (SpaceImage*)ptr->data;
525 if (sima->flag & SI_COORDFLOATS) {
526 copy_v2_v2(values, sima->cursor);
529 ED_space_image_size(sima, &w, &h);
531 values[0] = sima->cursor[0] * w;
532 values[1] = sima->cursor[1] * h;
536 static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
538 SpaceImage *sima= (SpaceImage*)ptr->data;
540 if (sima->flag & SI_COORDFLOATS) {
541 copy_v2_v2(sima->cursor, values);
544 ED_space_image_size(sima, &w, &h);
546 sima->cursor[0] = values[0] / w;
547 sima->cursor[1] = values[1] / h;
551 static void rna_SpaceImageEditor_curves_update(Main *bmain, Scene *scene, PointerRNA *ptr)
553 SpaceImage *sima= (SpaceImage*)ptr->data;
557 ibuf= ED_space_image_acquire_buffer(sima, &lock);
559 curvemapping_do_ibuf(sima->cumap, ibuf);
560 ED_space_image_release_buffer(sima, lock);
562 WM_main_add_notifier(NC_IMAGE, sima->image);
565 static void rna_SpaceImageEditor_scopes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
567 SpaceImage *sima= (SpaceImage*)ptr->data;
571 ibuf= ED_space_image_acquire_buffer(sima, &lock);
573 scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_COLOR_MANAGEMENT);
574 WM_main_add_notifier(NC_IMAGE, sima->image);
576 ED_space_image_release_buffer(sima, lock);
579 /* Space Text Editor */
581 static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
583 SpaceText *st= (SpaceText*)(ptr->data);
589 static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
591 SpaceText *st= (SpaceText*)(ptr->data);
593 st->text= value.data;
597 static void rna_SpaceTextEditor_updateEdited(Main *bmain, Scene *scene, PointerRNA *ptr)
599 SpaceText *st= (SpaceText*)ptr->data;
602 WM_main_add_notifier(NC_TEXT|NA_EDITED, st->text);
606 /* Space Properties */
608 /* note: this function exists only to avoid id refcounting */
609 static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value)
611 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
612 sbuts->pinid= value.data;
615 static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
617 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
620 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
625 static void rna_SpaceProperties_pin_id_update(Main *bmain, Scene *scene, PointerRNA *ptr)
627 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
628 ID *id = sbuts->pinid;
631 sbuts->flag &= ~SB_PIN_CONTEXT;
635 switch (GS(id->name)) {
637 WM_main_add_notifier(NC_MATERIAL|ND_SHADING, NULL);
640 WM_main_add_notifier(NC_TEXTURE, NULL);
643 WM_main_add_notifier(NC_WORLD, NULL);
646 WM_main_add_notifier(NC_LAMP, NULL);
652 static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
654 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
657 sbuts->mainbuser = value;
660 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
662 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
669 static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
671 ConsoleLine *ci= (ConsoleLine*)ptr->data;
672 strcpy(value, ci->line);
675 static int rna_ConsoleLine_body_length(PointerRNA *ptr)
677 ConsoleLine *ci= (ConsoleLine*)ptr->data;
681 static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
683 ConsoleLine *ci= (ConsoleLine*)ptr->data;
684 int len= strlen(value);
686 if((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */
688 ci->line= MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
689 ci->len_alloc= len + 1;
691 memcpy(ci->line, value, len + 1);
694 if(ci->cursor > len) /* clamp the cursor */
698 static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max)
700 ConsoleLine *ci= (ConsoleLine*)ptr->data;
706 /* Space Dopesheet */
708 static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
710 SpaceAction *saction= (SpaceAction*)(ptr->data);
711 bAction *act = (bAction*)value.data;
713 if ((act == NULL) || (act->idroot == 0)) {
714 /* just set if we're clearing the action or if the action is "amorphous" still */
715 saction->action= act;
718 /* action to set must strictly meet the mode criteria... */
719 if (saction->mode == SACTCONT_ACTION) {
720 /* currently, this is "object-level" only, until we have some way of specifying this */
721 if (act->idroot == ID_OB)
722 saction->action = act;
724 printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n", act->id.name+2);
726 else if (saction->mode == SACTCONT_SHAPEKEY) {
727 /* as the name says, "shapekey-level" only... */
728 if (act->idroot == ID_KE)
729 saction->action = act;
731 printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n", act->id.name+2);
734 printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n");
739 static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, PointerRNA *ptr)
741 SpaceAction *saction= (SpaceAction*)(ptr->data);
742 Object *obact= (scene->basact)? scene->basact->object: NULL;
744 /* we must set this action to be the one used by active object (if not pinned) */
745 if (obact/* && saction->pin == 0*/) {
746 AnimData *adt = NULL;
748 if (saction->mode == SACTCONT_ACTION) {
749 // TODO: context selector could help decide this with more control?
750 adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
752 else if (saction->mode == SACTCONT_SHAPEKEY) {
753 Key *key = ob_get_key(obact);
755 adt= BKE_id_add_animdata(&key->id); /* this only adds if non-existant */
760 /* fix id-count of action we're replacing */
761 id_us_min(&adt->action->id);
763 /* show new id-count of action we're replacing */
764 adt->action= saction->action;
765 id_us_plus(&adt->action->id);
768 /* force depsgraph flush too */
769 DAG_id_tag_update(&obact->id, OB_RECALC_OB|OB_RECALC_DATA);
773 static void rna_SpaceDopeSheetEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
775 SpaceAction *saction= (SpaceAction*)(ptr->data);
776 Object *obact= (scene->basact)? scene->basact->object: NULL;
778 /* special exceptions for ShapeKey Editor mode */
779 if (saction->mode == SACTCONT_SHAPEKEY) {
780 Key *key = ob_get_key(obact);
782 /* 1) update the action stored for the editor */
784 saction->action = (key->adt)? key->adt->action : NULL;
786 saction->action = NULL;
788 /* 2) enable 'show sliders' by default, since one of the main
789 * points of the ShapeKey Editor is to provide a one-stop shop
790 * for controlling the shapekeys, whose main control is the value
792 saction->flag |= SACTION_SLIDERS;
794 /* make sure action stored is valid */
795 else if (saction->mode == SACTCONT_ACTION) {
796 /* 1) update the action stored for the editor */
797 // TODO: context selector could help decide this with more control?
799 saction->action = (obact->adt)? obact->adt->action : NULL;
801 saction->action = NULL;
805 /* Space Graph Editor */
807 static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *ptr)
809 //SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
810 ScrArea *sa= CTX_wm_area(C);
812 /* after changing view mode, must force recalculation of F-Curve colors
813 * which can only be achieved using refresh as opposed to redraw
815 ED_area_tag_refresh(sa);
818 static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
820 SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
821 return (sipo->ghostCurves.first != NULL);
824 static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr)
826 int view = RNA_enum_get(ptr, "view_type");
828 ED_sequencer_update_view(C, view);
831 static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
833 BGpic *bgpic= (BGpic *)ptr->data;
834 return 1.0f-bgpic->blend;
837 static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
839 BGpic *bgpic= (BGpic *)ptr->data;
840 bgpic->blend = 1.0f - value;
843 static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
845 Scene *scene = CTX_data_scene(C);
846 Object *ob = CTX_data_active_object(C);
847 EnumPropertyItem *item= NULL;
848 EnumPropertyItem tmp= {0, "", 0, "", ""};
852 if(ob->type == OB_LAMP) {
853 tmp.value = SB_TEXC_MAT_OR_LAMP;
854 tmp.description = "Show Lamp Textures";
855 tmp.identifier = "LAMP";
856 tmp.icon = ICON_LAMP_POINT;
857 RNA_enum_item_add(&item, &totitem, &tmp);
859 else if(ob->totcol) {
860 tmp.value = SB_TEXC_MAT_OR_LAMP;
861 tmp.description = "Show Material Textures";
862 tmp.identifier = "MATERIAL";
863 tmp.icon = ICON_MATERIAL;
864 RNA_enum_item_add(&item, &totitem, &tmp);
867 if(ob->particlesystem.first) {
868 tmp.value = SB_TEXC_PARTICLES;
869 tmp.description = "Show Particle Textures";
870 tmp.identifier = "PARTICLE";
871 tmp.icon = ICON_PARTICLES;
872 RNA_enum_item_add(&item, &totitem, &tmp);
876 if(scene && scene->world) {
877 tmp.value = SB_TEXC_WORLD;
878 tmp.description = "Show World Textures";
879 tmp.identifier = "WORLD";
880 tmp.icon = ICON_WORLD;
881 RNA_enum_item_add(&item, &totitem, &tmp);
884 tmp.value = SB_TEXC_BRUSH;
885 tmp.description = "Show Brush Textures";
886 tmp.identifier = "BRUSH";
887 tmp.icon = ICON_BRUSH_DATA;
888 RNA_enum_item_add(&item, &totitem, &tmp);
890 RNA_enum_item_end(&item, &totitem);
898 static void rna_def_space(BlenderRNA *brna)
903 srna= RNA_def_struct(brna, "Space", NULL);
904 RNA_def_struct_sdna(srna, "SpaceLink");
905 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
906 RNA_def_struct_refine_func(srna, "rna_Space_refine");
908 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
909 RNA_def_property_enum_sdna(prop, NULL, "spacetype");
910 RNA_def_property_enum_items(prop, space_type_items);
911 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
912 RNA_def_property_ui_text(prop, "Type", "Space data type");
915 static void rna_def_space_image_uv(BlenderRNA *brna)
920 static EnumPropertyItem sticky_mode_items[] = {
921 {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled"},
922 {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location", "Select UVs that are at the same location and share a mesh vertex"},
923 {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex", "Select UVs that share mesh vertex, irrespective if they are in the same location"},
924 {0, NULL, 0, NULL, NULL}};
926 static EnumPropertyItem dt_uv_items[] = {
927 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"},
928 {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"},
929 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"},
930 {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"},
931 {0, NULL, 0, NULL, NULL}};
933 static EnumPropertyItem dt_uvstretch_items[] = {
934 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
935 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
936 {0, NULL, 0, NULL, NULL}};
938 static EnumPropertyItem pivot_items[] = {
939 {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
940 {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
941 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
942 {0, NULL, 0, NULL, NULL}};
944 srna= RNA_def_struct(brna, "SpaceUVEditor", NULL);
945 RNA_def_struct_sdna(srna, "SpaceImage");
946 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
947 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
950 prop= RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
951 RNA_def_property_enum_sdna(prop, NULL, "sticky");
952 RNA_def_property_enum_items(prop, sticky_mode_items);
953 RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected");
954 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
957 prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
958 RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
959 RNA_def_property_enum_items(prop, dt_uv_items);
960 RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges");
961 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
963 prop= RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
964 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
965 RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased");
966 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
968 prop= RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
969 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
970 RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)");
971 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
973 prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
974 RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
975 RNA_def_property_enum_items(prop, dt_uvstretch_items);
976 RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw");
977 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
979 prop= RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
980 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
981 RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied");
982 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
984 prop= RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
985 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
986 RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
987 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
989 prop= RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
990 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
991 RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
992 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
994 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
995 RNA_def_property_array(prop, 2);
996 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get", "rna_SpaceImageEditor_cursor_location_set", NULL);
997 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
998 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1000 /* todo: move edge and face drawing options here from G.f */
1002 prop= RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
1003 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
1004 RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing");
1005 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1007 prop= RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
1008 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
1009 RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing");
1010 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1012 prop= RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
1013 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
1014 RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices");
1015 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1017 prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
1018 RNA_def_property_enum_sdna(prop, NULL, "around");
1019 RNA_def_property_enum_items(prop, pivot_items);
1020 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
1021 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1024 static void rna_def_space_outliner(BlenderRNA *brna)
1029 static EnumPropertyItem display_mode_items[] = {
1030 {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display datablocks in all scenes"},
1031 {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display datablocks in current scene"},
1032 {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display datablocks in visible layers"},
1033 {SO_SELECTED, "SELECTED", 0, "Selected", "Display datablocks of selected objects"},
1034 {SO_ACTIVE, "ACTIVE", 0, "Active", "Display datablocks of active object"},
1035 {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", "Display datablocks of all objects of same type as selected object"},
1036 {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their datablocks"},
1037 {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", "Display libraries"},
1038 {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence datablocks"},
1039 {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", "Display raw datablocks"},
1040 {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display the user preference datablocks"},
1041 {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", "Display keymap datablocks"},
1042 {0, NULL, 0, NULL, NULL}};
1044 srna= RNA_def_struct(brna, "SpaceOutliner", "Space");
1045 RNA_def_struct_sdna(srna, "SpaceOops");
1046 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
1048 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
1049 RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
1050 RNA_def_property_enum_items(prop, display_mode_items);
1051 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
1052 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
1054 prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
1055 RNA_def_property_string_sdna(prop, NULL, "search_string");
1056 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
1057 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
1059 prop= RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
1060 RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE);
1061 RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
1062 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
1064 prop= RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
1065 RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE);
1066 RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
1067 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
1069 prop= RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
1070 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
1071 RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
1072 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
1075 static void rna_def_background_image(BlenderRNA *brna)
1080 /* note: combinations work but dont flip so arnt that useful */
1081 static EnumPropertyItem bgpic_axis_items[] = {
1082 {0, "", 0, "X Axis", ""},
1083 {(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"},
1084 {(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", "Show background image while looking to the right"},
1085 /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/
1086 {0, "", 0, "Y Axis", ""},
1087 {(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", "Show background image in back view"},
1088 {(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", "Show background image in front view"},
1089 /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/
1090 {0, "", 0, "Z Axis", ""},
1091 {(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", "Show background image in bottom view"},
1092 {(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", "Show background image in top view"},
1093 /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/
1094 {0, "", 0, "Other", ""},
1095 {0, "ALL", 0, "All Views", "Show background image in all views"},
1096 {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"},
1097 {0, NULL, 0, NULL, NULL}};
1099 srna= RNA_def_struct(brna, "BackgroundImage", NULL);
1100 RNA_def_struct_sdna(srna, "BGpic");
1101 RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background");
1103 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
1104 RNA_def_property_pointer_sdna(prop, NULL, "ima");
1105 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
1106 RNA_def_property_flag(prop, PROP_EDITABLE);
1107 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1109 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
1110 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1111 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
1112 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
1113 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1115 prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
1116 RNA_def_property_float_sdna(prop, NULL, "xof");
1117 RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the world origin");
1118 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1120 prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
1121 RNA_def_property_float_sdna(prop, NULL, "yof");
1122 RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the world origin");
1123 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1125 prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
1126 RNA_def_property_float_sdna(prop, NULL, "size");
1127 RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image");
1128 RNA_def_property_range(prop, 0.0, FLT_MAX);
1129 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1131 prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
1132 RNA_def_property_float_sdna(prop, NULL, "blend");
1133 RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);
1134 RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color");
1135 RNA_def_property_range(prop, 0.0, 1.0);
1136 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1138 prop= RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
1139 RNA_def_property_enum_sdna(prop, NULL, "view");
1140 RNA_def_property_enum_items(prop, bgpic_axis_items);
1141 RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the image on");
1142 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1144 prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
1145 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED);
1146 RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
1147 RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
1151 static void rna_def_space_view3d(BlenderRNA *brna)
1155 const int matrix_dimsize[]= {4, 4};
1157 static EnumPropertyItem pivot_items[] = {
1158 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", "Pivot around bounding box center of selected object(s)"},
1159 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
1160 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", "Pivot around each object's own origin"},
1161 {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", "Pivot around the median point of selected objects"},
1162 {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"},
1163 {0, NULL, 0, NULL, NULL}};
1165 static EnumPropertyItem rv3d_persp_items[] = {
1166 {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
1167 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
1168 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
1169 {0, NULL, 0, NULL, NULL}};
1171 srna= RNA_def_struct(brna, "SpaceView3D", "Space");
1172 RNA_def_struct_sdna(srna, "View3D");
1173 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
1175 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
1176 RNA_def_property_flag(prop, PROP_EDITABLE);
1177 RNA_def_property_pointer_sdna(prop, NULL, "camera");
1178 RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera)");
1179 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1181 prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
1182 RNA_def_property_flag(prop, PROP_EDITABLE);
1183 RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
1184 RNA_def_property_ui_text(prop, "Lock to Object", "3D View center is locked to this object's position");
1185 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1187 prop= RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
1188 RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone");
1189 RNA_def_property_ui_text(prop, "Lock to Bone", "3D View center is locked to this bone's position");
1190 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1192 prop= RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
1193 RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1);
1194 RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
1195 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1197 prop= RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
1198 RNA_def_property_enum_sdna(prop, NULL, "drawtype");
1199 RNA_def_property_enum_items(prop, viewport_shade_items);
1200 RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
1201 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1203 prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
1204 RNA_def_property_pointer_sdna(prop, NULL, "localvd");
1205 RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility");
1207 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
1208 RNA_def_property_array(prop, 3);
1209 RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", NULL);
1210 RNA_def_property_ui_text(prop, "3D Cursor Location", "3D cursor location for this view (dependent on local view setting)");
1211 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
1212 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1214 prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
1215 RNA_def_property_float_sdna(prop, NULL, "lens");
1216 RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view");
1217 RNA_def_property_range(prop, 1.0f, 250.0f);
1218 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1220 prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
1221 RNA_def_property_float_sdna(prop, NULL, "near");
1222 RNA_def_property_range(prop, 0.001f, FLT_MAX);
1223 RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance");
1224 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1226 prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
1227 RNA_def_property_float_sdna(prop, NULL, "far");
1228 RNA_def_property_range(prop, 1.0f, FLT_MAX);
1229 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
1230 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1232 prop= RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
1233 RNA_def_property_float_sdna(prop, NULL, "grid");
1234 RNA_def_property_ui_text(prop, "Grid Scale", "The distance between 3D View grid lines");
1235 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1236 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1238 prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
1239 RNA_def_property_int_sdna(prop, NULL, "gridlines");
1240 RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view");
1241 RNA_def_property_range(prop, 0, 1024);
1242 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1244 prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
1245 RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
1246 RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines");
1247 RNA_def_property_range(prop, 1, 1024);
1248 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1250 prop= RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
1251 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
1252 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
1253 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1255 prop= RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
1256 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
1257 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
1258 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1260 prop= RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
1261 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
1262 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view");
1263 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1265 prop= RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
1266 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
1267 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view");
1268 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1270 prop= RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
1271 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
1272 RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views");
1273 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1275 prop= RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
1276 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
1277 RNA_def_property_ui_text(prop, "All Object Origins", "Show the object origin center dot for all (selected and unselected) objects");
1278 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1280 prop= RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
1281 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
1282 RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships");
1283 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1285 prop= RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
1286 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
1287 RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
1288 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1290 prop= RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
1291 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA);
1292 RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view");
1293 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1295 prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
1296 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE);
1297 RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
1298 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1300 prop= RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
1301 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT);
1302 RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");
1303 RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
1304 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1306 prop= RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
1307 RNA_def_property_collection_sdna(prop, NULL, "bgpicbase", NULL);
1308 RNA_def_property_struct_type(prop, "BackgroundImage");
1309 RNA_def_property_ui_text(prop, "Background Images", "List of background images");
1310 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1312 prop= RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
1313 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS);
1314 RNA_def_property_ui_text(prop, "Display Background Images", "Display reference images behind objects in the 3D View");
1315 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1317 prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
1318 RNA_def_property_enum_sdna(prop, NULL, "around");
1319 RNA_def_property_enum_items(prop, pivot_items);
1320 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
1321 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
1323 prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
1324 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
1325 RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only");
1326 RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
1327 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
1329 prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
1330 RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
1331 RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
1332 RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
1333 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1335 prop= RNA_def_property(srna, "use_manipulator_translate", PROP_BOOLEAN, PROP_NONE);
1336 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE);
1337 RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations");
1338 RNA_def_property_ui_icon(prop, ICON_MAN_TRANS, 0);
1339 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1341 prop= RNA_def_property(srna, "use_manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
1342 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE);
1343 RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations");
1344 RNA_def_property_ui_icon(prop, ICON_MAN_ROT, 0);
1345 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1347 prop= RNA_def_property(srna, "use_manipulator_scale", PROP_BOOLEAN, PROP_NONE);
1348 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE);
1349 RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations");
1350 RNA_def_property_ui_icon(prop, ICON_MAN_SCALE, 0);
1351 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1353 prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
1354 RNA_def_property_enum_sdna(prop, NULL, "twmode");
1355 RNA_def_property_enum_items(prop, transform_orientation_items);
1356 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_itemf");
1357 RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation");
1358 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1360 prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
1361 RNA_def_property_struct_type(prop, "TransformOrientation");
1362 RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
1363 RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation");
1365 prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
1366 RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
1367 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
1368 RNA_def_property_ui_text(prop, "Lock Camera and Layers", "Use the scene's active camera and layers in this view, rather than local layers");
1369 RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
1370 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1372 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1373 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
1374 RNA_def_property_array(prop, 20);
1375 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set");
1376 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
1377 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_layer_update");
1379 prop= RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1380 RNA_def_property_boolean_sdna(prop, NULL, "lay_used", 1);
1381 RNA_def_property_array(prop, 20);
1382 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1383 RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something");
1385 prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
1386 RNA_def_property_struct_type(prop, "RegionView3D");
1387 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
1388 RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region");
1390 prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE);
1391 RNA_def_property_struct_type(prop, "RegionView3D");
1392 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL, NULL);
1393 RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings");
1397 srna= RNA_def_struct(brna, "RegionView3D", NULL);
1398 RNA_def_struct_sdna(srna, "RegionView3D");
1399 RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
1401 prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
1402 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED);
1403 RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views");
1404 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
1406 prop= RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
1407 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW);
1408 RNA_def_property_ui_text(prop, "Box", "Sync view position between side views");
1409 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
1411 prop= RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
1412 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
1413 RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
1414 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
1416 prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
1417 RNA_def_property_float_sdna(prop, NULL, "persmat");
1418 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
1419 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
1420 RNA_def_property_ui_text(prop, "Perspective Matrix", "Current perspective matrix of the 3D region");
1422 prop= RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
1423 RNA_def_property_float_sdna(prop, NULL, "viewmat");
1424 RNA_def_property_multi_array(prop, 2, matrix_dimsize);
1425 RNA_def_property_float_funcs(prop, NULL, "rna_RegionView3D_view_matrix_set", NULL);
1426 RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region");
1427 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1429 prop= RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
1430 RNA_def_property_enum_sdna(prop, NULL, "persp");
1431 RNA_def_property_enum_items(prop, rv3d_persp_items);
1432 RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
1433 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1435 prop= RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
1436 RNA_def_property_boolean_sdna(prop, NULL, "is_persp", 1);
1437 RNA_def_property_ui_text(prop, "Is Perspective", "");
1438 RNA_def_property_flag(prop, PROP_EDITABLE);
1440 prop= RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
1442 RNA_def_property_float_sdna(prop, NULL, "ofs"); // cant use because its negated
1444 RNA_def_property_array(prop, 3);
1445 RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", NULL);
1447 RNA_def_property_ui_text(prop, "View Location", "View pivot location");
1448 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
1449 RNA_def_property_update(prop, NC_WINDOW, NULL);
1451 prop= RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); // cant use because its inverted
1453 RNA_def_property_float_sdna(prop, NULL, "viewquat");
1455 RNA_def_property_array(prop, 4);
1456 RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", NULL);
1458 RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
1459 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1461 /* not sure we need rna access to these but adding anyway */
1462 prop= RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
1463 RNA_def_property_float_sdna(prop, NULL, "dist");
1464 RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
1465 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
1468 static void rna_def_space_buttons(BlenderRNA *brna)
1473 static EnumPropertyItem buttons_context_items[] = {
1474 {BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"},
1475 {BCONTEXT_RENDER, "RENDER", ICON_SCENE_DATA, "Render", "Render"},
1476 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
1477 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
1478 {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Constraints"},
1479 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifiers"},
1480 {BCONTEXT_DATA, "DATA", 0, "Data", "Data"},
1481 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
1482 {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT, "Bone Constraints", "Bone Constraints"},
1483 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
1484 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
1485 {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"},
1486 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
1487 {0, NULL, 0, NULL, NULL}};
1489 static EnumPropertyItem align_items[] = {
1490 {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
1491 {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
1492 {0, NULL, 0, NULL, NULL}};
1494 static EnumPropertyItem buttons_texture_context_items[] = {
1495 {SB_TEXC_MAT_OR_LAMP, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
1496 {0, NULL, 0, NULL, NULL}}; //actually populated dynamically trough a function
1498 srna= RNA_def_struct(brna, "SpaceProperties", "Space");
1499 RNA_def_struct_sdna(srna, "SpaceButs");
1500 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
1502 prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
1503 RNA_def_property_enum_sdna(prop, NULL, "mainb");
1504 RNA_def_property_enum_items(prop, buttons_context_items);
1505 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", NULL);
1506 RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
1507 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
1509 prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
1510 RNA_def_property_enum_sdna(prop, NULL, "align");
1511 RNA_def_property_enum_items(prop, align_items);
1512 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
1513 RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
1514 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
1516 prop= RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE);
1517 RNA_def_property_enum_items(prop, buttons_texture_context_items);
1518 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceProperties_texture_context_itemf");
1519 RNA_def_property_ui_text(prop, "Texture Context", "Type of texture data to display and edit");
1520 RNA_def_property_update(prop, NC_TEXTURE, NULL);
1523 prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
1524 RNA_def_property_pointer_sdna(prop, NULL, "pinid");
1525 RNA_def_property_struct_type(prop, "ID");
1526 /* note: custom set function is ONLY to avoid rna setting a user for this. */
1527 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef", NULL);
1528 RNA_def_property_flag(prop, PROP_EDITABLE);
1529 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
1531 prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
1532 RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
1533 RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
1536 static void rna_def_space_image(BlenderRNA *brna)
1541 srna= RNA_def_struct(brna, "SpaceImageEditor", "Space");
1542 RNA_def_struct_sdna(srna, "SpaceImage");
1543 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
1546 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
1547 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL);
1548 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
1549 RNA_def_property_flag(prop, PROP_EDITABLE);
1550 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); // is handled in image editor too
1552 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
1553 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1554 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
1555 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
1556 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1558 prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
1559 RNA_def_property_pointer_sdna(prop, NULL, "cumap");
1560 RNA_def_property_ui_text(prop, "Curve", "Color curve mapping to use for displaying the image");
1561 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_curves_update");
1563 prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
1564 RNA_def_property_pointer_sdna(prop, NULL, "scopes");
1565 RNA_def_property_struct_type(prop, "Scopes");
1566 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics.");
1567 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
1569 prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
1570 RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
1571 RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
1572 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1573 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1575 prop= RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
1576 RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist");
1577 RNA_def_property_struct_type(prop, "Histogram");
1578 RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
1580 prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
1581 RNA_def_property_array(prop, 2);
1582 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1583 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", NULL, NULL);
1584 RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
1587 prop= RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
1588 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
1589 RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
1590 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1592 prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
1593 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1594 RNA_def_property_enum_items(prop, draw_channels_items);
1595 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
1596 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
1597 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
1600 prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
1601 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1602 RNA_def_property_struct_type(prop, "SpaceUVEditor");
1603 RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
1604 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
1607 prop= RNA_def_property(srna, "use_image_paint", PROP_BOOLEAN, PROP_NONE);
1608 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL);
1609 RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode");
1610 RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
1611 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_paint_update");
1614 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
1615 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
1616 RNA_def_property_flag(prop, PROP_EDITABLE);
1617 RNA_def_property_struct_type(prop, "GreasePencil");
1618 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
1620 prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
1621 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DISPGP);
1622 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
1625 prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
1626 RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
1627 RNA_def_property_ui_text(prop, "Update Automatically", "Update other affected window spaces automatically to reflect changes during interactive operations such as transform");
1630 prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
1631 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
1632 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1633 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
1635 prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
1636 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
1637 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1638 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
1640 prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
1641 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
1642 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1643 RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
1645 rna_def_space_image_uv(brna);
1648 static void rna_def_space_sequencer(BlenderRNA *brna)
1653 static EnumPropertyItem view_type_items[] = {
1654 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
1655 {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
1656 {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SPLITVIEW, "Sequencer and Image Preview", ""},
1657 {0, NULL, 0, NULL, NULL}};
1659 static EnumPropertyItem display_mode_items[] = {
1660 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
1661 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
1662 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
1663 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
1664 {0, NULL, 0, NULL, NULL}};
1666 static EnumPropertyItem proxy_render_size_items[] = {
1667 {SEQ_PROXY_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
1668 {SEQ_PROXY_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""},
1669 {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""},
1670 {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""},
1671 {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""},
1672 {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
1673 {0, NULL, 0, NULL, NULL}};
1675 srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
1676 RNA_def_struct_sdna(srna, "SpaceSeq");
1677 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
1679 /* view type, fairly important */
1680 prop= RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
1681 RNA_def_property_enum_sdna(prop, NULL, "view");
1682 RNA_def_property_enum_items(prop, view_type_items);
1683 RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencer view (sequencer, preview or both)");
1684 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1685 RNA_def_property_update(prop, 0, "rna_Sequencer_display_mode_update");
1687 /* display type, fairly important */
1688 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
1689 RNA_def_property_enum_sdna(prop, NULL, "mainb");
1690 RNA_def_property_enum_items(prop, display_mode_items);
1691 RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output");
1692 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1695 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
1696 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM);
1697 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
1698 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1700 prop= RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
1701 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
1702 RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than seconds");
1703 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1705 prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
1706 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
1707 RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips");
1708 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1710 prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
1711 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
1712 RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview");
1713 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1715 prop= RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE);
1716 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
1717 RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview");
1718 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1720 prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
1721 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
1722 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
1723 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1726 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
1727 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
1728 RNA_def_property_struct_type(prop, "UnknownType");
1729 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
1730 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1732 prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
1733 RNA_def_property_int_sdna(prop, NULL, "chanshown");
1734 RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined");
1735 RNA_def_property_range(prop, -5, 32); // MAXSEQ --- todo, move from BKE_sequencer.h, allow up to 5 layers up the metastack. Should be dynamic...
1736 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1738 prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
1739 RNA_def_property_int_sdna(prop, NULL, "zebra");
1740 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
1741 RNA_def_property_range(prop, 0, 110);
1742 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1744 prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
1745 RNA_def_property_enum_sdna(prop, NULL, "render_size");
1746 RNA_def_property_enum_items(prop, proxy_render_size_items);
1747 RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions");
1748 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1751 /* not sure we need rna access to these but adding anyway */
1752 prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
1753 RNA_def_property_float_sdna(prop, NULL, "xof");
1754 RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
1755 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1757 prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
1758 RNA_def_property_float_sdna(prop, NULL, "yof");
1759 RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center");
1760 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1762 prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
1763 RNA_def_property_float_sdna(prop, NULL, "zoom");
1764 RNA_def_property_ui_text(prop, "Zoom", "Display zoom level");
1765 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1768 static void rna_def_space_text(BlenderRNA *brna)
1773 srna= RNA_def_struct(brna, "SpaceTextEditor", "Space");
1774 RNA_def_struct_sdna(srna, "SpaceText");
1775 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
1778 prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
1779 RNA_def_property_flag(prop, PROP_EDITABLE);
1780 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
1781 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL);
1782 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1785 prop= RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
1786 RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
1787 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
1788 RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
1789 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
1790 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1792 prop= RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
1793 RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
1794 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
1795 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
1796 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1798 prop= RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
1799 RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
1800 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
1801 RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
1802 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1804 prop= RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
1805 RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0);
1806 RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
1807 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1809 prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
1810 RNA_def_property_int_sdna(prop, NULL, "tabnumber");
1811 RNA_def_property_range(prop, 2, 8);
1812 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
1813 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
1815 prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
1816 RNA_def_property_int_sdna(prop, NULL, "lheight");
1817 RNA_def_property_range(prop, 8, 32);
1818 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
1819 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1821 prop= RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
1822 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_SHOW_MARGIN);
1823 RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
1824 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1826 prop= RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
1827 RNA_def_property_int_sdna(prop, NULL, "margin_column");
1828 RNA_def_property_range(prop, 0, 1024);
1829 RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
1830 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1832 /* functionality options */
1833 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
1834 RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1);
1835 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
1836 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1838 prop= RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
1839 RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1);
1840 RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
1841 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1844 prop= RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
1845 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
1846 RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one");
1847 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1849 prop= RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
1850 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
1851 RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end");
1852 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1854 prop= RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
1855 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_MATCH_CASE);
1856 RNA_def_property_ui_text(prop, "Match case", "Search string is sensitive to uppercase and lowercase letters");
1857 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1859 prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
1860 RNA_def_property_string_sdna(prop, NULL, "findstr");
1861 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
1862 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1864 prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
1865 RNA_def_property_string_sdna(prop, NULL, "replacestr");
1866 RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool");
1867 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1870 static void rna_def_space_dopesheet(BlenderRNA *brna)
1875 static EnumPropertyItem mode_items[] = {
1876 {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", "DopeSheet Editor"},
1877 {SACTCONT_ACTION, "ACTION", 0, "Action Editor", "Action Editor"},
1878 {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", "ShapeKey Editor"},
1879 {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", "Grease Pencil"},
1880 {0, NULL, 0, NULL, NULL}};
1883 srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
1884 RNA_def_struct_sdna(srna, "SpaceAction");
1885 RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data");
1888 prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
1889 RNA_def_property_flag(prop, PROP_EDITABLE);
1890 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, "rna_Action_actedit_assign_poll");
1891 RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
1892 RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
1895 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1896 RNA_def_property_enum_sdna(prop, NULL, "mode");
1897 RNA_def_property_enum_items(prop, mode_items);
1898 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
1899 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
1902 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
1903 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
1904 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
1905 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
1906 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1908 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
1909 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
1910 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
1911 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1913 prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
1914 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
1915 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
1916 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1918 prop= RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
1919 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_POSEMARKERS_SHOW);
1920 RNA_def_property_ui_text(prop, "Show Pose Markers", "Show markers belonging to the active action instead of Scene markers (Action and Shape Key Editors only)");
1921 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1924 prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
1925 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
1926 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
1927 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1929 prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
1930 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
1931 RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
1932 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1934 prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
1935 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_MARKERS_MOVE);
1936 RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
1939 prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
1940 RNA_def_property_struct_type(prop, "DopeSheet");
1941 RNA_def_property_pointer_sdna(prop, NULL, "ads");
1942 RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
1945 prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
1946 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
1947 RNA_def_property_enum_items(prop, autosnap_items);
1948 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
1949 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1952 static void rna_def_space_graph(BlenderRNA *brna)
1957 static EnumPropertyItem mode_items[] = {
1958 {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", "Edit f-curves"},
1959 {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", "Edit drivers"},
1960 {0, NULL, 0, NULL, NULL}};
1962 /* this is basically the same as the one for the 3D-View, but with some entries ommitted */
1963 static EnumPropertyItem gpivot_items[] = {
1964 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
1965 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
1966 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
1967 //{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
1968 //{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
1969 {0, NULL, 0, NULL, NULL}};
1972 srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
1973 RNA_def_struct_sdna(srna, "SpaceIpo");
1974 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
1977 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1978 RNA_def_property_enum_sdna(prop, NULL, "mode");
1979 RNA_def_property_enum_items(prop, mode_items);
1980 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
1981 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1982 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
1985 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
1986 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
1987 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
1988 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
1989 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1991 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
1992 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
1993 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
1994 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1996 prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
1997 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
1998 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
1999 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2001 prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
2002 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
2003 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points");
2004 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2006 prop= RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
2007 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
2008 RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable");
2009 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2011 prop= RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
2012 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY);
2013 RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
2014 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2016 prop= RNA_def_property(srna, "use_fancy_drawing", PROP_BOOLEAN, PROP_NONE);
2017 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF);
2018 RNA_def_property_ui_text(prop, "Use Fancy Drawing", "Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance");
2019 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2022 prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
2023 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
2024 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
2025 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2027 prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
2028 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
2029 RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
2030 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2033 prop= RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
2034 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR);
2035 RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
2036 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2038 prop= RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
2039 RNA_def_property_float_sdna(prop, NULL, "cursorVal");
2040 RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
2041 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2043 prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
2044 RNA_def_property_enum_sdna(prop, NULL, "around");
2045 RNA_def_property_enum_items(prop, gpivot_items);
2046 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
2047 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2050 prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
2051 RNA_def_property_struct_type(prop, "DopeSheet");
2052 RNA_def_property_pointer_sdna(prop, NULL, "ads");
2053 RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
2056 prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
2057 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
2058 RNA_def_property_enum_items(prop, autosnap_items);
2059 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
2060 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2062 /* readonly state info */
2063 prop= RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
2064 RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); /* XXX: hack to make this compile, since this property doesn't actually exist*/
2065 RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", NULL);
2066 RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
2067 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
2070 static void rna_def_space_nla(BlenderRNA *brna)
2075 srna= RNA_def_struct(brna, "SpaceNLA", "Space");
2076 RNA_def_struct_sdna(srna, "SpaceNla");
2077 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
2080 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
2081 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
2082 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
2083 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
2084 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
2086 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
2087 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
2088 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
2089 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
2091 prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
2092 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
2093 RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips");
2094 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
2097 prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
2098 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
2099 RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming strips, changes to the animation data are flushed to other views");
2100 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
2103 prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
2104 RNA_def_property_struct_type(prop, "DopeSheet");
2105 RNA_def_property_pointer_sdna(prop, NULL, "ads");
2106 RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
2109 prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
2110 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
2111 RNA_def_property_enum_items(prop, autosnap_items);
2112 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
2113 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
2116 static void rna_def_space_time(BlenderRNA *brna)
2121 srna= RNA_def_struct(brna, "SpaceTimeline", "Space");
2122 RNA_def_struct_sdna(srna, "SpaceTime");
2123 RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
2126 prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
2127 RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
2128 RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes for active Object and/or its selected channels only");
2129 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
2131 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
2132 RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM);
2133 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
2134 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
2136 /* displaying cache status */
2137 prop= RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
2138 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY);
2139 RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
2140 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
2142 prop= RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
2143 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SOFTBODY);
2144 RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
2145 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
2147 prop= RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
2148 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_PARTICLES);
2149 RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
2150 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
2152 prop= RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
2153 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_CLOTH);
2154 RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
2155 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
2157 prop= RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
2158 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SMOKE);
2159 RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");
2160 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
2163 static void rna_def_console_line(BlenderRNA *brna)
2168 srna = RNA_def_struct(brna, "ConsoleLine", NULL);
2169 RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
2170 // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
2172 prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
2173 RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
2174 RNA_def_property_ui_text(prop, "Line", "Text in the line");
2175 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
2177 prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
2178 RNA_def_property_int_sdna(prop, NULL, "cursor");
2179 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range");
2180 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
2183 static void rna_def_space_console(BlenderRNA *brna)
2188 srna= RNA_def_struct(brna, "SpaceConsole", "Space");
2189 RNA_def_struct_sdna(srna, "SpaceConsole");
2190 RNA_def_struct_ui_text(srna, "Space Console", "Interactive python console");
2193 prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
2194 RNA_def_property_int_sdna(prop, NULL, "lheight");
2195 RNA_def_property_range(prop, 8, 32);
2196 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
2197 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
2200 prop= RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
2201 RNA_def_property_int_sdna(prop, NULL, "sel_start");
2202 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
2204 prop= RNA_def_property(srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
2205 RNA_def_property_int_sdna(prop, NULL, "sel_end");
2206 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
2208 prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
2209 RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
2211 prop= RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
2212 RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
2214 prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
2215 RNA_def_property_collection_sdna(prop, NULL, "history", NULL);
2216 RNA_def_property_struct_type(prop, "ConsoleLine");
2217 RNA_def_property_ui_text(prop, "History", "Command history");
2219 prop= RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
2220 RNA_def_property_collection_sdna(prop, NULL, "scrollback", NULL);
2221 RNA_def_property_struct_type(prop, "ConsoleLine");
2222 RNA_def_property_ui_text(prop, "Output", "Command output");
2225 static void rna_def_fileselect_params(BlenderRNA *brna)
2230 static EnumPropertyItem file_display_items[] = {
2231 {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
2232 {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
2233 {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
2234 {0, NULL, 0, NULL, NULL}};
2236 static EnumPropertyItem file_sort_items[] = {
2237 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically"},
2238 {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension"},
2239 {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time"},
2240 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size"},
2241 {0, NULL, 0, NULL, NULL}};
2243 srna= RNA_def_struct(brna, "FileSelectParams", NULL);
2244 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
2246 prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
2247 RNA_def_property_string_sdna(prop, NULL, "title");
2248 RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
2249 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2251 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
2252 RNA_def_property_string_sdna(prop, NULL, "dir");
2253 RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
2254 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2256 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
2257 RNA_def_property_string_sdna(prop, NULL, "file");
2258 RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
2259 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2261 prop= RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
2262 RNA_def_property_enum_sdna(prop, NULL, "display");
2263 RNA_def_property_enum_items(prop, file_display_items);
2264 RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
2265 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2267 prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
2268 RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER);
2269 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
2270 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2272 prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
2273 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
2274 RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
2275 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL);
2277 prop= RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
2278 RNA_def_property_enum_sdna(prop, NULL, "sort");
2279 RNA_def_property_enum_items(prop, file_sort_items);
2280 RNA_def_property_ui_text(prop, "Sort", "");
2281 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2283 prop= RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
2284 RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE);
2285 RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
2286 RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
2287 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2289 prop= RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
2290 RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE);
2291 RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
2292 RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
2293 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2295 prop= RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
2296 RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE);
2297 RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
2298 RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
2299 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2301 prop= RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
2302 RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE);
2303 RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
2304 RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
2305 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2307 prop= RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
2308 RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE);
2309 RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
2310 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
2311 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2313 prop= RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
2314 RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE);
2315 RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
2316 RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
2317 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2319 prop= RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
2320 RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE);
2321 RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
2322 RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0);
2323 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2325 prop= RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
2326 RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE);
2327 RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
2328 RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
2329 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
2331 prop= RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
2332 RNA_def_property_string_sdna(prop, NULL, "filter_glob");
2333 RNA_def_property_ui_text(prop, "Extension Filter", "");
2334 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
2338 static void rna_def_space_filebrowser(BlenderRNA *brna)
2343 srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space");
2344 RNA_def_struct_sdna(srna, "SpaceFile");
2345 RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
2347 prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
2348 RNA_def_property_pointer_sdna(prop, NULL, "params");
2349 RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
2351 prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
2352 RNA_def_property_pointer_sdna(prop, NULL, "op");
2353 RNA_def_property_ui_text(prop, "Operator", "");
2356 static void rna_def_space_info(BlenderRNA *brna)
2361 srna= RNA_def_struct(brna, "SpaceInfo", "Space");
2362 RNA_def_struct_sdna(srna, "SpaceInfo");
2363 RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
2365 /* reporting display */
2366 prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
2367 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_DEBUG);
2368 RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
2369 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
2371 prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
2372 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_INFO);
2373 RNA_def_property_ui_text(prop, "Show Info", "Display general information");
2374 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
2376 prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
2377 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_OP);
2378 RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
2379 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
2381 prop= RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
2382 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_WARN);
2383 RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
2384 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
2386 prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
2387 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_ERR);
2388 RNA_def_property_ui_text(prop, "Show Error", "Display error text");
2389 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
2392 static void rna_def_space_userpref(BlenderRNA *brna)
2397 srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
2398 RNA_def_struct_sdna(srna, "SpaceUserPref");
2399 RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data");
2401 prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
2402 RNA_def_property_string_sdna(prop, NULL, "filter");
2403 RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
2407 static void rna_def_space_node(BlenderRNA *brna)
2412 static EnumPropertyItem tree_type_items[] = {
2413 {NTREE_SHADER, "MATERIAL", ICON_MATERIAL, "Material", "Material nodes"},
2414 {NTREE_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture nodes"},
2415 {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDERLAYERS, "Compositing", "Compositing nodes"},
2416 {0, NULL, 0, NULL, NULL}};
2418 static EnumPropertyItem texture_type_items[] = {
2419 {SNODE_TEX_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit texture nodes from Object"},
2420 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World"},
2421 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"},
2422 {0, NULL, 0, NULL, NULL}};
2424 static EnumPropertyItem backdrop_channels_items[] = {
2425 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
2426 {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
2427 {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
2428 {0, NULL, 0, NULL, NULL}};
2430 srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space");
2431 RNA_def_struct_sdna(srna, "SpaceNode");
2432 RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");
2434 prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
2435 RNA_def_property_enum_sdna(prop, NULL, "treetype");
2436 RNA_def_property_enum_items(prop, tree_type_items);
2437 RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
2438 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
2440 prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
2441 RNA_def_property_enum_sdna(prop, NULL, "texfrom");
2442 RNA_def_property_enum_items(prop, texture_type_items);
2443 RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
2444 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
2446 prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
2447 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2448 RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited");
2450 prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
2451 RNA_def_property_pointer_sdna(prop, NULL, "from");
2452 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2453 RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked");
2455 prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
2456 RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
2457 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2458 RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited");
2460 prop= RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
2461 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
2462 RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
2463 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
2465 prop= RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE);
2466 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_AUTO_RENDER);
2467 RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite changed layer on 3D edits");
2468 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
2470 prop= RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
2471 RNA_def_property_float_sdna(prop, NULL, "zoom");
2472 RNA_def_property_float_default(prop, 1.0f);
2473 RNA_def_property_range(prop, 0.01f, FLT_MAX);
2474 RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
2475 RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
2476 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
2478 prop= RNA_def_property(srna, "backdrop_x", PROP_FLOAT, PROP_NONE);
2479 RNA_def_property_float_sdna(prop, NULL, "xof");
2480 RNA_def_property_ui_text(prop, "Backdrop X", "Backdrop X offset");
2481 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
2483 prop= RNA_def_property(srna, "backdrop_y", PROP_FLOAT, PROP_NONE);
2484 RNA_def_property_float_sdna(prop, NULL, "yof");
2485 RNA_def_property_ui_text(prop, "Backdrop Y", "Backdrop Y offset");
2486 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
2488 prop= RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
2489 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2490 RNA_def_property_enum_items(prop, backdrop_channels_items);
2491 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
2492 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
2495 static void rna_def_space_logic(BlenderRNA *brna)
2500 srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
2501 RNA_def_struct_sdna(srna, "SpaceLogic");
2502 RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data");
2505 prop= RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLEAN, PROP_NONE);
2506 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_SEL);
2507 RNA_def_property_ui_text(prop, "Show Selected Object", "Show sensors of all selected objects");
2508 RNA_def_property_update(prop, NC_LOGIC, NULL);
2510 prop= RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE);
2511 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_ACT);
2512 RNA_def_property_ui_text(prop, "Show Active Object", "Show sensors of active object");
2513 RNA_def_property_update(prop, NC_LOGIC, NULL);
2515 prop= RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOLEAN, PROP_NONE);
2516 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_LINK);
2517 RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to the controller");
2518 RNA_def_property_update(prop, NC_LOGIC, NULL);
2520 prop= RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE);
2521 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE);
2522 RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states");
2523 RNA_def_property_update(prop, NC_LOGIC, NULL);
2526 prop= RNA_def_property(srna, "show_controllers_selected_objects", PROP_BOOLEAN, PROP_NONE);
2527 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_SEL);
2528 RNA_def_property_ui_text(prop, "Show Selected Object", "Show controllers of all selected objects");
2529 RNA_def_property_update(prop, NC_LOGIC, NULL);
2531 prop= RNA_def_property(srna, "show_controllers_active_object", PROP_BOOLEAN, PROP_NONE);
2532 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_ACT);
2533 RNA_def_property_ui_text(prop, "Show Active Object", "Show controllers of active object");
2534 RNA_def_property_update(prop, NC_LOGIC, NULL);
2536 prop= RNA_def_property(srna, "show_controllers_linked_controller", PROP_BOOLEAN, PROP_NONE);
2537 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK);
2538 RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator");
2539 RNA_def_property_update(prop, NC_LOGIC, NULL);
2542 prop= RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOOLEAN, PROP_NONE);
2543 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_SEL);
2544 RNA_def_property_ui_text(prop, "Show Selected Object", "Show actuators of all selected objects");
2545 RNA_def_property_update(prop, NC_LOGIC, NULL);
2547 prop= RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEAN, PROP_NONE);
2548 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_ACT);
2549 RNA_def_property_ui_text(prop, "Show Active Object", "Show actuators of active object");
2550 RNA_def_property_update(prop, NC_LOGIC, NULL);
2552 prop= RNA_def_property(srna, "show_actuators_linked_controller", PROP_BOOLEAN, PROP_NONE);
2553 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_LINK);
2554 RNA_def_property_ui_text(prop, "Show Linked to Actuator", "Show linked objects to the actuator");
2555 RNA_def_property_update(prop, NC_LOGIC, NULL);
2557 prop= RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEAN, PROP_NONE);
2558 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE);
2559 RNA_def_property_ui_text(prop, "Show Active States", "Show only actuators connected to active states");
2560 RNA_def_property_update(prop, NC_LOGIC, NULL);
2564 void RNA_def_space(BlenderRNA *brna)
2566 rna_def_space(brna);
2567 rna_def_space_image(brna);
2568 rna_def_space_sequencer(brna);
2569 rna_def_space_text(brna);
2570 rna_def_fileselect_params(brna);
2571 rna_def_space_filebrowser(brna);
2572 rna_def_space_outliner(brna);
2573 rna_def_background_image(brna);
2574 rna_def_space_view3d(brna);
2575 rna_def_space_buttons(brna);
2576 rna_def_space_dopesheet(brna);
2577 rna_def_space_graph(brna);
2578 rna_def_space_nla(brna);
2579 rna_def_space_time(brna);
2580 rna_def_space_console(brna);
2581 rna_def_console_line(brna);
2582 rna_def_space_info(brna);
2583 rna_def_space_userpref(brna);
2584 rna_def_space_node(brna);
2585 rna_def_space_logic(brna);