2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * Contributor(s): Blender Foundation (2008)
20 * ***** END GPL LICENSE BLOCK *****
23 /** \file blender/makesrna/intern/rna_space.c
30 #include "MEM_guardedalloc.h"
32 #include "BLF_translation.h"
35 #include "BKE_movieclip.h"
38 #include "DNA_action_types.h"
39 #include "DNA_key_types.h"
40 #include "DNA_material_types.h"
41 #include "DNA_node_types.h"
42 #include "DNA_object_types.h"
43 #include "DNA_space_types.h"
44 #include "DNA_sequence_types.h"
45 #include "DNA_mask_types.h"
46 #include "DNA_view3d_types.h"
48 #include "RNA_access.h"
49 #include "RNA_define.h"
51 #include "rna_internal.h"
56 #include "RE_engine.h"
57 #include "RE_pipeline.h"
59 #include "RNA_enum_types.h"
62 EnumPropertyItem space_type_items[] = {
63 /* empty must be here for python, is skipped for UI */
64 {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""},
65 {SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, "3D View", "3D viewport"},
66 {0, "", ICON_NONE, NULL, NULL},
67 {SPACE_TIME, "TIMELINE", ICON_TIME, "Timeline", "Timeline and playback controls"},
68 {SPACE_IPO, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", "Edit drivers and keyframe interpolation"},
69 {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"},
70 {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "NLA Editor", "Combine and layer Actions"},
71 {0, "", ICON_NONE, NULL, NULL},
72 {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", "View and edit images and UV Maps"},
73 {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", "Video editing tools"},
74 {SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", "Motion tracking tools"},
75 {SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, "Text Editor", "Edit scripts and in-file documentation"},
76 {SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", "Editor for node-based shading and compositing tools"},
77 {SPACE_LOGIC, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", "Game logic editing"},
78 {0, "", ICON_NONE, NULL, NULL},
79 {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related datablocks"},
80 {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", "Overview of scene graph and all available datablocks"},
81 {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", "Edit persistent configuration settings"},
82 {SPACE_INFO, "INFO", ICON_INFO, "Info", "Main menu bar and list of error messages (drag down to expand and display)"},
83 {0, "", ICON_NONE, NULL, NULL},
84 {SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", "Browse for files and assets"},
85 {0, "", ICON_NONE, NULL, NULL},
86 {SPACE_CONSOLE, "CONSOLE", ICON_CONSOLE, "Python Console", "Interactive programmatic console for advanced editing and script development"},
87 {0, NULL, 0, NULL, NULL}
90 static EnumPropertyItem pivot_items_full[] = {
91 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
92 "Pivot around bounding box center of selected object(s)"},
93 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
94 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
95 "Individual Origins", "Pivot around each object's own origin"},
96 {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point",
97 "Pivot around the median point of selected objects"},
98 {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"},
99 {0, NULL, 0, NULL, NULL}
102 static EnumPropertyItem draw_channels_items[] = {
103 {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
104 "Draw image with RGB colors and alpha transparency"},
105 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
106 {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
107 {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer",
108 "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
109 {0, NULL, 0, NULL, NULL}
112 static EnumPropertyItem transform_orientation_items[] = {
113 {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"},
114 {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
115 {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal",
116 "Align the transformation axes to average normal of selected elements "
117 "(bone Y axis for pose mode)"},
118 {V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
119 {V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"},
120 // {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
121 {0, NULL, 0, NULL, NULL}
125 static EnumPropertyItem autosnap_items[] = {
126 {SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""},
127 /* {-1, "", 0, "", ""}, */
128 {SACTSNAP_STEP, "STEP", 0, "Frame Step", "Snap to 1.0 frame intervals"},
129 {SACTSNAP_TSTEP, "TIME_STEP", 0, "Second Step", "Snap to 1.0 second intervals"},
130 /* {-1, "", 0, "", ""}, */
131 {SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames (nla-action time)"},
132 {SACTSNAP_SECOND, "SECOND", 0, "Nearest Second", "Snap to actual seconds (nla-action time)"},
133 /* {-1, "", 0, "", ""}, */
134 {SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
135 {0, NULL, 0, NULL, NULL}
139 EnumPropertyItem viewport_shade_items[] = {
140 {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
141 {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
142 {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
143 {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Texture", "Display the object solid, with a texture"},
144 {OB_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Display objects solid, with GLSL material"},
145 {OB_RENDER, "RENDERED", ICON_SMOOTH, "Rendered", "Display render preview"},
146 {0, NULL, 0, NULL, NULL}
150 EnumPropertyItem clip_editor_mode_items[] = {
151 {SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
152 {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"},
153 {0, NULL, 0, NULL, NULL}
156 /* Actually populated dynamically trough a function, but helps for context-less access (e.g. doc, i18n...). */
157 static EnumPropertyItem buttons_context_items[] = {
158 {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene"},
159 {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render"},
160 {BCONTEXT_RENDER_LAYER, "RENDER_LAYER", ICON_RENDERLAYERS, "Render Layers", "Render layers"},
161 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
162 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
163 {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Object constraints"},
164 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Object modifiers"},
165 {BCONTEXT_DATA, "DATA", ICON_NONE, "Data", "Object data"},
166 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
167 {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT_BONE, "Bone Constraints", "Bone constraints"},
168 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
169 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
170 {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"},
171 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
172 {0, NULL, 0, NULL, NULL}
175 /* Actually populated dynamically trough a function, but helps for context-less access (e.g. doc, i18n...). */
176 static EnumPropertyItem buttons_texture_context_items[] = {
177 {SB_TEXC_MATERIAL, "MATERIAL", ICON_MATERIAL, "", "Show material textures"},
178 {SB_TEXC_WORLD, "WORLD", ICON_WORLD, "", "Show world textures"},
179 {SB_TEXC_LAMP, "LAMP", ICON_LAMP, "", "Show lamp textures"},
180 {SB_TEXC_PARTICLES, "PARTICLES", ICON_PARTICLES, "", "Show particles textures"},
181 {SB_TEXC_LINESTYLE, "LINESTYLE", ICON_LINE_DATA, "", "Show linestyle textures"},
182 {SB_TEXC_OTHER, "OTHER", ICON_TEXTURE, "", "Show other data textures"},
183 {0, NULL, 0, NULL, NULL}
188 #include "DNA_anim_types.h"
189 #include "DNA_mask_types.h"
190 #include "DNA_scene_types.h"
191 #include "DNA_screen_types.h"
192 #include "DNA_userdef_types.h"
194 #include "BLI_math.h"
196 #include "BKE_animsys.h"
197 #include "BKE_brush.h"
198 #include "BKE_colortools.h"
199 #include "BKE_context.h"
200 #include "BKE_depsgraph.h"
201 #include "BKE_paint.h"
202 #include "BKE_scene.h"
203 #include "BKE_screen.h"
204 #include "BKE_icons.h"
206 #include "ED_buttons.h"
207 #include "ED_image.h"
209 #include "ED_screen.h"
210 #include "ED_view3d.h"
211 #include "ED_sequencer.h"
214 #include "GPU_material.h"
216 #include "IMB_imbuf_types.h"
218 #include "UI_interface.h"
219 #include "UI_view2d.h"
221 static StructRNA *rna_Space_refine(struct PointerRNA *ptr)
223 SpaceLink *space = (SpaceLink *)ptr->data;
225 switch (space->spacetype) {
227 return &RNA_SpaceView3D;
229 return &RNA_SpaceGraphEditor;
231 return &RNA_SpaceOutliner;
233 return &RNA_SpaceProperties;
235 return &RNA_SpaceFileBrowser;
237 return &RNA_SpaceImageEditor;
239 return &RNA_SpaceInfo;
241 return &RNA_SpaceSequenceEditor;
243 return &RNA_SpaceTextEditor;
245 return &RNA_SpaceDopeSheetEditor;
247 return &RNA_SpaceNLA;
249 return &RNA_SpaceTimeline;
251 return &RNA_SpaceNodeEditor;
253 return &RNA_SpaceLogicEditor;
255 return &RNA_SpaceConsole;
257 return &RNA_SpaceUserPreferences;
259 return &RNA_SpaceClipEditor;
265 static ScrArea *rna_area_from_space(PointerRNA *ptr)
267 bScreen *sc = (bScreen *)ptr->id.data;
268 SpaceLink *link = (SpaceLink *)ptr->data;
269 return BKE_screen_find_area_from_space(sc, link);
272 static void area_region_from_regiondata(bScreen *sc, void *regiondata, ScrArea **r_sa, ARegion **r_ar)
280 for (sa = sc->areabase.first; sa; sa = sa->next) {
281 for (ar = sa->regionbase.first; ar; ar = ar->next) {
282 if (ar->regiondata == regiondata) {
291 static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARegion **r_ar)
293 bScreen *sc = (bScreen *)ptr->id.data;
294 void *regiondata = ptr->data;
296 area_region_from_regiondata(sc, regiondata, r_sa, r_ar);
299 static int rna_Space_view2d_sync_get(PointerRNA *ptr)
304 sa = rna_area_from_space(ptr); /* can be NULL */
305 ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
307 View2D *v2d = &ar->v2d;
308 return (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME) != 0;
314 static void rna_Space_view2d_sync_set(PointerRNA *ptr, int value)
319 sa = rna_area_from_space(ptr); /* can be NULL */
320 ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
322 View2D *v2d = &ar->v2d;
324 v2d->flag |= V2D_VIEWSYNC_SCREEN_TIME;
327 v2d->flag &= ~V2D_VIEWSYNC_SCREEN_TIME;
332 static void rna_Space_view2d_sync_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
337 sa = rna_area_from_space(ptr); /* can be NULL */
338 ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
341 bScreen *sc = (bScreen *)ptr->id.data;
342 View2D *v2d = &ar->v2d;
344 UI_view2d_sync(sc, sa, v2d, V2D_LOCK_SET);
348 static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
350 Scene *scene = ((bScreen *)ptr->id.data)->scene;
351 View3D *v3d = (View3D *)ptr->data;
353 if (v3d->twmode < V3D_MANIP_CUSTOM)
354 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
356 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation,
357 BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
360 EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
363 ListBase *transform_spaces;
364 TransformOrientation *ts = NULL;
365 EnumPropertyItem tmp = {0, "", 0, "", ""};
366 EnumPropertyItem *item = NULL;
367 int i = V3D_MANIP_CUSTOM, totitem = 0;
369 RNA_enum_items_add(&item, &totitem, transform_orientation_items);
371 if (ptr->type == &RNA_SpaceView3D)
372 scene = ((bScreen *)ptr->id.data)->scene;
374 scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
377 transform_spaces = &scene->transform_spaces;
378 ts = transform_spaces->first;
382 RNA_enum_item_add_separator(&item, &totitem);
384 for (; ts; ts = ts->next) {
385 tmp.identifier = ts->name;
388 RNA_enum_item_add(&item, &totitem, &tmp);
392 RNA_enum_item_end(&item, &totitem);
399 static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
401 View3D *v3d = (View3D *)(ptr->data);
402 bScreen *sc = (bScreen *)ptr->id.data;
404 v3d->scenelock = value;
408 v3d->lay = sc->scene->lay;
409 /* seek for layact */
412 if (v3d->lay & (1 << bit)) {
413 v3d->layact = 1 << bit;
418 v3d->camera = sc->scene->camera;
422 static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
424 View3D *v3d = (View3D *)(ptr->data);
425 bScreen *sc = (bScreen *)ptr->id.data;
426 Scene *scene = (Scene *)sc->scene;
427 const float *loc = ED_view3d_cursor3d_get(scene, v3d);
429 copy_v3_v3(values, loc);
432 static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
434 View3D *v3d = (View3D *)(ptr->data);
435 bScreen *sc = (bScreen *)ptr->id.data;
436 Scene *scene = (Scene *)sc->scene;
437 float *cursor = ED_view3d_cursor3d_get(scene, v3d);
439 copy_v3_v3(cursor, values);
442 static float rna_View3D_GridScaleUnit_get(PointerRNA *ptr)
444 View3D *v3d = (View3D *)(ptr->data);
445 bScreen *sc = (bScreen *)ptr->id.data;
446 Scene *scene = (Scene *)sc->scene;
448 return ED_view3d_grid_scale(scene, v3d, NULL);
451 static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
453 View3D *v3d = (View3D *)(ptr->data);
455 v3d->lay = ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
458 static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
460 DAG_on_visible_update(bmain, false);
463 static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *scene, PointerRNA *ptr)
465 View3D *v3d = (View3D *)(ptr->data);
466 ScrArea *sa = rna_area_from_space(ptr);
468 ED_view3d_shade_update(bmain, scene, v3d, sa);
471 static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
473 View3D *v3d = (View3D *)(ptr->data);
475 if (v3d->defmaterial) {
476 Material *ma = v3d->defmaterial;
479 BKE_previewimg_free(&ma->preview);
481 if (ma->gpumaterial.first)
482 GPU_material_free(&ma->gpumaterial);
484 WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
488 static void rna_SpaceView3D_matcap_enable(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
490 View3D *v3d = (View3D *)(ptr->data);
492 if (v3d->matcap_icon == 0)
493 v3d->matcap_icon = ICON_MATCAP_01;
496 static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
498 if (U.uiflag & USER_LOCKAROUND) {
499 View3D *v3d_act = (View3D *)(ptr->data);
501 /* TODO, space looper */
503 for (screen = bmain->screen.first; screen; screen = screen->id.next) {
505 for (sa = screen->areabase.first; sa; sa = sa->next) {
507 for (sl = sa->spacedata.first; sl; sl = sl->next) {
508 if (sl->spacetype == SPACE_VIEW3D) {
509 View3D *v3d = (View3D *)sl;
510 if (v3d != v3d_act) {
511 v3d->around = v3d_act->around;
512 v3d->flag = (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN);
513 ED_area_tag_redraw_regiontype(sa, RGN_TYPE_HEADER);
522 static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
524 View3D *v3d = (View3D *)(ptr->data);
525 ScrArea *sa = rna_area_from_space(ptr);
526 void *regiondata = NULL;
528 ListBase *regionbase = (sa->spacedata.first == v3d) ? &sa->regionbase : &v3d->regionbase;
529 ARegion *ar = regionbase->last; /* always last in list, weak .. */
530 regiondata = ar->regiondata;
533 return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
536 static void rna_SpaceView3D_region_quadviews_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
538 View3D *v3d = (View3D *)(ptr->data);
539 ScrArea *sa = rna_area_from_space(ptr);
542 ARegion *ar = ((sa && sa->spacedata.first == v3d) ? &sa->regionbase : &v3d->regionbase)->last;
543 ListBase lb = {NULL, NULL};
545 if (ar && ar->alignment == RGN_ALIGN_QSPLIT) {
555 rna_iterator_listbase_begin(iter, &lb, NULL);
558 static PointerRNA rna_SpaceView3D_region_quadviews_get(CollectionPropertyIterator *iter)
560 void *regiondata = ((ARegion *)rna_iterator_listbase_get(iter))->regiondata;
562 return rna_pointer_inherit_refine(&iter->parent, &RNA_RegionView3D, regiondata);
565 static void rna_RegionView3D_quadview_update(Main *UNUSED(main), Scene *UNUSED(scene), PointerRNA *ptr)
570 rna_area_region_from_regiondata(ptr, &sa, &ar);
571 if (sa && ar && ar->alignment == RGN_ALIGN_QSPLIT)
572 ED_view3d_quadview_update(sa, ar, false);
575 /* same as above but call clip==true */
576 static void rna_RegionView3D_quadview_clip_update(Main *UNUSED(main), Scene *UNUSED(scene), PointerRNA *ptr)
581 rna_area_region_from_regiondata(ptr, &sa, &ar);
582 if (sa && ar && ar->alignment == RGN_ALIGN_QSPLIT)
583 ED_view3d_quadview_update(sa, ar, true);
586 static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
588 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
589 negate_v3_v3(values, rv3d->ofs);
592 static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
594 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
595 negate_v3_v3(rv3d->ofs, values);
598 static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
600 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
601 invert_qt_qt(values, rv3d->viewquat);
604 static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
606 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
607 invert_qt_qt(rv3d->viewquat, values);
610 static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
612 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
614 invert_m4_m4(mat, (float (*)[4])values);
615 ED_view3d_from_m4(mat, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
618 static int rna_SpaceView3D_viewport_shade_get(PointerRNA *ptr)
620 Scene *scene = ((bScreen *)ptr->id.data)->scene;
621 RenderEngineType *type = RE_engines_find(scene->r.engine);
622 View3D *v3d = (View3D *)ptr->data;
623 int drawtype = v3d->drawtype;
625 if (drawtype == OB_RENDER && !(type && type->view_draw))
631 static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C), PointerRNA *ptr,
632 PropertyRNA *UNUSED(prop), bool *r_free)
634 Scene *scene = ((bScreen *)ptr->id.data)->scene;
635 RenderEngineType *type = RE_engines_find(scene->r.engine);
637 EnumPropertyItem *item = NULL;
640 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_BOUNDBOX);
641 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_WIRE);
642 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_SOLID);
643 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_TEXTURE);
644 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_MATERIAL);
646 if (type && type->view_draw)
647 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_RENDER);
649 RNA_enum_item_end(&item, &totitem);
655 /* Space Image Editor */
657 static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
659 return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
662 static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
664 ED_space_image_paint_update(bmain->wm.first, scene->toolsettings);
667 static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
669 SpaceImage *sima = (SpaceImage *)(ptr->data);
670 return ED_space_image_show_render(sima);
673 static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
675 SpaceImage *sima = (SpaceImage *)(ptr->data);
676 return ED_space_image_show_paint(sima);
679 static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
681 SpaceImage *sima = (SpaceImage *)(ptr->data);
682 bScreen *sc = (bScreen *)ptr->id.data;
683 return ED_space_image_show_uvedit(sima, sc->scene->obedit);
686 static int rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
688 SpaceImage *sima = (SpaceImage *)(ptr->data);
689 bScreen *sc = (bScreen *)ptr->id.data;
690 return ED_space_image_check_show_maskedit(sc->scene, sima);
693 static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
695 SpaceImage *sima = (SpaceImage *)(ptr->data);
696 bScreen *sc = (bScreen *)ptr->id.data;
698 ED_space_image_set(sima, sc->scene, sc->scene->obedit, (Image *)value.data);
701 static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr, PointerRNA value)
703 SpaceImage *sima = (SpaceImage *)(ptr->data);
705 ED_space_image_set_mask(NULL, sima, (Mask *)value.data);
708 static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr,
709 PropertyRNA *UNUSED(prop), bool *r_free)
711 SpaceImage *sima = (SpaceImage *)ptr->data;
712 EnumPropertyItem *item = NULL;
715 int zbuf, alpha, totitem = 0;
717 ibuf = ED_space_image_acquire_buffer(sima, &lock);
719 alpha = ibuf && (ibuf->channels == 4);
720 zbuf = ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels == 1));
722 ED_space_image_release_buffer(sima, ibuf, lock);
725 return draw_channels_items;
728 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
729 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
730 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
733 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
734 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
737 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
740 RNA_enum_item_end(&item, &totitem);
746 static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
748 SpaceImage *sima = (SpaceImage *)ptr->data;
752 values[0] = values[1] = 1;
755 sa = rna_area_from_space(ptr); /* can be NULL */
756 ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
758 ED_space_image_get_zoom(sima, ar, &values[0], &values[1]);
762 static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
764 SpaceImage *sima = (SpaceImage *)ptr->data;
766 if (sima->flag & SI_COORDFLOATS) {
767 copy_v2_v2(values, sima->cursor);
771 ED_space_image_get_size(sima, &w, &h);
773 values[0] = sima->cursor[0] * w;
774 values[1] = sima->cursor[1] * h;
778 static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
780 SpaceImage *sima = (SpaceImage *)ptr->data;
782 if (sima->flag & SI_COORDFLOATS) {
783 copy_v2_v2(sima->cursor, values);
787 ED_space_image_get_size(sima, &w, &h);
789 sima->cursor[0] = values[0] / w;
790 sima->cursor[1] = values[1] / h;
794 static void rna_SpaceImageEditor_scopes_update(struct bContext *C, struct PointerRNA *ptr)
796 SpaceImage *sima = (SpaceImage *)ptr->data;
800 ibuf = ED_space_image_acquire_buffer(sima, &lock);
802 ED_space_image_scopes_update(C, sima, ibuf, true);
803 WM_main_add_notifier(NC_IMAGE, sima->image);
805 ED_space_image_release_buffer(sima, ibuf, lock);
808 static EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext *UNUSED(C), PointerRNA *ptr,
809 PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
811 static EnumPropertyItem pivot_items[] = {
812 {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
813 {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
814 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
815 {0, NULL, 0, NULL, NULL}
818 SpaceImage *sima = (SpaceImage *)ptr->data;
820 if (sima->mode == SI_MODE_PAINT)
821 return pivot_items_full;
826 /* Space Text Editor */
828 static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
830 SpaceText *st = (SpaceText *)(ptr->data);
832 st->wordwrap = value;
836 static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
838 SpaceText *st = (SpaceText *)(ptr->data);
840 st->text = value.data;
842 WM_main_add_notifier(NC_TEXT | NA_SELECTED, st->text);
845 static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
847 SpaceText *st = (SpaceText *)ptr->data;
850 WM_main_add_notifier(NC_TEXT | NA_EDITED, st->text);
853 /* Space Properties */
855 /* note: this function exists only to avoid id refcounting */
856 static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value)
858 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
859 sbuts->pinid = value.data;
862 static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
864 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
867 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
872 static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
874 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
875 ID *id = sbuts->pinid;
878 sbuts->flag &= ~SB_PIN_CONTEXT;
882 switch (GS(id->name)) {
884 WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL);
887 WM_main_add_notifier(NC_TEXTURE, NULL);
890 WM_main_add_notifier(NC_WORLD, NULL);
893 WM_main_add_notifier(NC_LAMP, NULL);
899 static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
901 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
903 sbuts->mainb = value;
904 sbuts->mainbuser = value;
907 static EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext *UNUSED(C), PointerRNA *ptr,
908 PropertyRNA *UNUSED(prop), bool *r_free)
910 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
911 EnumPropertyItem *item = NULL;
914 if (sbuts->pathflag & (1 << BCONTEXT_RENDER)) {
915 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER);
918 if (sbuts->pathflag & (1 << BCONTEXT_RENDER_LAYER)) {
919 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER_LAYER);
922 if (sbuts->pathflag & (1 << BCONTEXT_SCENE)) {
923 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_SCENE);
926 if (sbuts->pathflag & (1 << BCONTEXT_WORLD)) {
927 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORLD);
930 if (sbuts->pathflag & (1 << BCONTEXT_OBJECT)) {
931 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_OBJECT);
934 if (sbuts->pathflag & (1 << BCONTEXT_CONSTRAINT)) {
935 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_CONSTRAINT);
938 if (sbuts->pathflag & (1 << BCONTEXT_MODIFIER)) {
939 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_MODIFIER);
942 if (sbuts->pathflag & (1 << BCONTEXT_DATA)) {
943 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_DATA);
944 (item + totitem - 1)->icon = sbuts->dataicon;
947 if (sbuts->pathflag & (1 << BCONTEXT_BONE)) {
948 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_BONE);
951 if (sbuts->pathflag & (1 << BCONTEXT_BONE_CONSTRAINT)) {
952 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_BONE_CONSTRAINT);
955 if (sbuts->pathflag & (1 << BCONTEXT_MATERIAL)) {
956 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_MATERIAL);
959 if (sbuts->pathflag & (1 << BCONTEXT_TEXTURE)) {
960 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_TEXTURE);
963 if (sbuts->pathflag & (1 << BCONTEXT_PARTICLE)) {
964 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_PARTICLE);
967 if (sbuts->pathflag & (1 << BCONTEXT_PHYSICS)) {
968 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_PHYSICS);
971 RNA_enum_item_end(&item, &totitem);
977 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
979 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
981 sbuts->align = value;
985 static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *UNUSED(ptr),
986 PropertyRNA *UNUSED(prop), bool *r_free)
988 EnumPropertyItem *item = NULL;
991 if (ED_texture_context_check_world(C)) {
992 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_WORLD);
995 if (ED_texture_context_check_lamp(C)) {
996 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_LAMP);
998 else if (ED_texture_context_check_material(C)) {
999 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_MATERIAL);
1002 if (ED_texture_context_check_particles(C)) {
1003 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_PARTICLES);
1006 if (ED_texture_context_check_linestyle(C)) {
1007 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_LINESTYLE);
1010 if (ED_texture_context_check_others(C)) {
1011 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_OTHER);
1014 RNA_enum_item_end(&item, &totitem);
1020 static void rna_SpaceProperties_texture_context_set(PointerRNA *ptr, int value)
1022 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
1024 /* User action, no need to keep "better" value in prev here! */
1025 sbuts->texture_context = sbuts->texture_context_prev = value;
1029 static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
1031 ConsoleLine *ci = (ConsoleLine *)ptr->data;
1032 memcpy(value, ci->line, ci->len + 1);
1035 static int rna_ConsoleLine_body_length(PointerRNA *ptr)
1037 ConsoleLine *ci = (ConsoleLine *)ptr->data;
1041 static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
1043 ConsoleLine *ci = (ConsoleLine *)ptr->data;
1044 int len = strlen(value);
1046 if ((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */
1047 MEM_freeN(ci->line);
1048 ci->line = MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
1049 ci->len_alloc = len + 1;
1051 memcpy(ci->line, value, len + 1);
1054 if (ci->cursor > len) /* clamp the cursor */
1058 static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max,
1059 int *UNUSED(softmin), int *UNUSED(softmax))
1061 ConsoleLine *ci = (ConsoleLine *)ptr->data;
1064 *max = ci->len; /* intentionally _not_ -1 */
1067 /* Space Dopesheet */
1069 static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
1071 SpaceAction *saction = (SpaceAction *)(ptr->data);
1072 bAction *act = (bAction *)value.data;
1074 if ((act == NULL) || (act->idroot == 0)) {
1075 /* just set if we're clearing the action or if the action is "amorphous" still */
1076 saction->action = act;
1079 /* action to set must strictly meet the mode criteria... */
1080 if (saction->mode == SACTCONT_ACTION) {
1081 /* currently, this is "object-level" only, until we have some way of specifying this */
1082 if (act->idroot == ID_OB)
1083 saction->action = act;
1085 printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n",
1088 else if (saction->mode == SACTCONT_SHAPEKEY) {
1089 /* as the name says, "shapekey-level" only... */
1090 if (act->idroot == ID_KE)
1091 saction->action = act;
1093 printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n",
1097 printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n");
1102 static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
1104 SpaceAction *saction = (SpaceAction *)(ptr->data);
1105 Object *obact = (scene->basact) ? scene->basact->object : NULL;
1107 /* we must set this action to be the one used by active object (if not pinned) */
1108 if (obact /* && saction->pin == 0*/) {
1109 AnimData *adt = NULL;
1111 if (saction->mode == SACTCONT_ACTION) {
1112 /* TODO: context selector could help decide this with more control? */
1113 adt = BKE_id_add_animdata(&obact->id); /* this only adds if non-existent */
1115 else if (saction->mode == SACTCONT_SHAPEKEY) {
1116 Key *key = BKE_key_from_object(obact);
1118 adt = BKE_id_add_animdata(&key->id); /* this only adds if non-existent */
1123 /* fix id-count of action we're replacing */
1124 id_us_min(&adt->action->id);
1126 /* show new id-count of action we're replacing */
1127 adt->action = saction->action;
1128 id_us_plus(&adt->action->id);
1130 /* force update of animdata */
1131 adt->recalc |= ADT_RECALC_ANIM;
1134 /* force depsgraph flush too */
1135 DAG_id_tag_update(&obact->id, OB_RECALC_OB | OB_RECALC_DATA);
1139 static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
1141 SpaceAction *saction = (SpaceAction *)(ptr->data);
1142 Object *obact = (scene->basact) ? scene->basact->object : NULL;
1144 /* special exceptions for ShapeKey Editor mode */
1145 if (saction->mode == SACTCONT_SHAPEKEY) {
1146 Key *key = BKE_key_from_object(obact);
1148 /* 1) update the action stored for the editor */
1150 saction->action = (key->adt) ? key->adt->action : NULL;
1152 saction->action = NULL;
1154 /* 2) enable 'show sliders' by default, since one of the main
1155 * points of the ShapeKey Editor is to provide a one-stop shop
1156 * for controlling the shapekeys, whose main control is the value
1158 saction->flag |= SACTION_SLIDERS;
1160 /* make sure action stored is valid */
1161 else if (saction->mode == SACTCONT_ACTION) {
1162 /* 1) update the action stored for the editor */
1163 /* TODO: context selector could help decide this with more control? */
1165 saction->action = (obact->adt) ? obact->adt->action : NULL;
1167 saction->action = NULL;
1170 /* recalculate extents of channel list */
1171 saction->flag |= SACTION_TEMP_NEEDCHANSYNC;
1174 /* Space Graph Editor */
1176 static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1178 ScrArea *sa = rna_area_from_space(ptr);
1180 /* after changing view mode, must force recalculation of F-Curve colors
1181 * which can only be achieved using refresh as opposed to redraw
1183 ED_area_tag_refresh(sa);
1186 static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
1188 SpaceIpo *sipo = (SpaceIpo *)(ptr->data);
1189 return (BLI_listbase_is_empty(&sipo->ghostCurves) == false);
1192 static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1194 ScrArea *sa = rna_area_from_space(ptr);
1195 ED_area_tag_refresh(sa);
1198 static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
1200 BGpic *bgpic = (BGpic *)ptr->data;
1201 return 1.0f - bgpic->blend;
1204 static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
1206 BGpic *bgpic = (BGpic *)ptr->data;
1207 bgpic->blend = 1.0f - value;
1210 static BGpic *rna_BackgroundImage_new(View3D *v3d)
1212 BGpic *bgpic = ED_view3D_background_image_new(v3d);
1214 WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
1219 static void rna_BackgroundImage_remove(View3D *v3d, ReportList *reports, PointerRNA *bgpic_ptr)
1221 BGpic *bgpic = bgpic_ptr->data;
1222 if (BLI_findindex(&v3d->bgpicbase, bgpic) == -1) {
1223 BKE_report(reports, RPT_ERROR, "Background image cannot be removed");
1226 ED_view3D_background_image_remove(v3d, bgpic);
1227 RNA_POINTER_INVALIDATE(bgpic_ptr);
1229 WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
1232 static void rna_BackgroundImage_clear(View3D *v3d)
1234 ED_view3D_background_image_clear(v3d);
1235 WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
1238 /* Space Node Editor */
1240 static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr, const PointerRNA value)
1242 SpaceNode *snode = (SpaceNode *)ptr->data;
1243 ED_node_tree_start(snode, (bNodeTree *)value.data, NULL, NULL);
1246 static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, const PointerRNA value)
1248 SpaceNode *snode = (SpaceNode *)ptr->data;
1249 bNodeTree *ntree = (bNodeTree *)value.data;
1251 /* node tree type must match the selected type in node editor */
1252 return (STREQ(snode->tree_idname, ntree->idname));
1255 static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA *UNUSED(ptr))
1257 ED_node_tree_update(C);
1260 static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr)
1262 SpaceNode *snode = (SpaceNode *)ptr->data;
1263 return rna_node_tree_idname_to_enum(snode->tree_idname);
1265 static void rna_SpaceNodeEditor_tree_type_set(PointerRNA *ptr, int value)
1267 SpaceNode *snode = (SpaceNode *)ptr->data;
1268 ED_node_set_tree_type(snode, rna_node_tree_type_from_enum(value));
1270 static int rna_SpaceNodeEditor_tree_type_poll(void *Cv, bNodeTreeType *type)
1272 bContext *C = (bContext *)Cv;
1274 return type->poll(C, type);
1278 static EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C, PointerRNA *UNUSED(ptr),
1279 PropertyRNA *UNUSED(prop), bool *r_free)
1281 return rna_node_tree_type_itemf(C, rna_SpaceNodeEditor_tree_type_poll, r_free);
1284 static void rna_SpaceNodeEditor_path_get(PointerRNA *ptr, char *value)
1286 SpaceNode *snode = ptr->data;
1287 ED_node_tree_path_get(snode, value);
1290 static int rna_SpaceNodeEditor_path_length(PointerRNA *ptr)
1292 SpaceNode *snode = ptr->data;
1293 return ED_node_tree_path_length(snode);
1296 static void rna_SpaceNodeEditor_path_clear(SpaceNode *snode, bContext *C)
1298 ED_node_tree_start(snode, NULL, NULL, NULL);
1299 ED_node_tree_update(C);
1302 static void rna_SpaceNodeEditor_path_start(SpaceNode *snode, bContext *C, PointerRNA *node_tree)
1304 ED_node_tree_start(snode, (bNodeTree *)node_tree->data, NULL, NULL);
1305 ED_node_tree_update(C);
1308 static void rna_SpaceNodeEditor_path_append(SpaceNode *snode, bContext *C, PointerRNA *node_tree, PointerRNA *node)
1310 ED_node_tree_push(snode, node_tree->data, node->data);
1311 ED_node_tree_update(C);
1314 static void rna_SpaceNodeEditor_path_pop(SpaceNode *snode, bContext *C)
1316 ED_node_tree_pop(snode);
1317 ED_node_tree_update(C);
1320 static void rna_SpaceNodeEditor_show_backdrop_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
1322 WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
1323 WM_main_add_notifier(NC_SCENE | ND_NODES, NULL);
1326 static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode, bContext *C, int x, int y)
1328 ARegion *ar = CTX_wm_region(C);
1330 UI_view2d_region_to_view(&ar->v2d, x, y, &snode->cursor[0], &snode->cursor[1]);
1331 snode->cursor[0] /= UI_DPI_FAC;
1332 snode->cursor[1] /= UI_DPI_FAC;
1335 static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
1337 SpaceClip *sc = (SpaceClip *)(ptr->data);
1338 bScreen *screen = (bScreen *)ptr->id.data;
1340 ED_space_clip_set_clip(NULL, screen, sc, (MovieClip *)value.data);
1343 static void rna_SpaceClipEditor_mask_set(PointerRNA *ptr, PointerRNA value)
1345 SpaceClip *sc = (SpaceClip *)(ptr->data);
1347 ED_space_clip_set_mask(NULL, sc, (Mask *)value.data);
1350 static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1352 SpaceClip *sc = (SpaceClip *)(ptr->data);
1357 static void rna_SpaceClipEditor_lock_selection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1359 SpaceClip *sc = (SpaceClip *)(ptr->data);
1365 static void rna_SpaceClipEditor_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1367 ScrArea *sa = rna_area_from_space(ptr);
1368 ED_area_tag_refresh(sa);
1373 static EnumPropertyItem dt_uv_items[] = {
1374 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"},
1375 {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"},
1376 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"},
1377 {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"},
1378 {0, NULL, 0, NULL, NULL}
1381 static void rna_def_space(BlenderRNA *brna)
1386 srna = RNA_def_struct(brna, "Space", NULL);
1387 RNA_def_struct_sdna(srna, "SpaceLink");
1388 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
1389 RNA_def_struct_refine_func(srna, "rna_Space_refine");
1391 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1392 RNA_def_property_enum_sdna(prop, NULL, "spacetype");
1393 RNA_def_property_enum_items(prop, space_type_items);
1394 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1395 RNA_def_property_ui_text(prop, "Type", "Space data type");
1397 /* access to V2D_VIEWSYNC_SCREEN_TIME */
1398 prop = RNA_def_property(srna, "show_locked_time", PROP_BOOLEAN, PROP_NONE);
1399 RNA_def_property_boolean_funcs(prop, "rna_Space_view2d_sync_get", "rna_Space_view2d_sync_set");
1400 RNA_def_property_ui_text(prop, "Lock Time to Other Windows", "");
1401 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Space_view2d_sync_update");
1404 /* for all spaces that use a mask */
1405 static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *mask_set_func)
1409 static EnumPropertyItem overlay_mode_items[] = {
1410 {MASK_OVERLAY_ALPHACHANNEL, "ALPHACHANNEL", ICON_NONE, "Alpha Channel", "Show alpha channel of the mask"},
1411 {MASK_OVERLAY_COMBINED, "COMBINED", ICON_NONE, "Combined", "Combine space background image with the mask"},
1412 {0, NULL, 0, NULL, NULL}
1415 prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
1416 RNA_def_property_pointer_sdna(prop, NULL, "mask_info.mask");
1417 RNA_def_property_flag(prop, PROP_EDITABLE);
1418 RNA_def_property_ui_text(prop, "Mask", "Mask displayed and edited in this space");
1419 RNA_def_property_pointer_funcs(prop, NULL, mask_set_func, NULL, NULL);
1420 RNA_def_property_update(prop, noteflag, NULL);
1423 prop = RNA_def_property(srna, "mask_draw_type", PROP_ENUM, PROP_NONE);
1424 RNA_def_property_enum_sdna(prop, NULL, "mask_info.draw_type");
1425 RNA_def_property_enum_items(prop, dt_uv_items);
1426 RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for mask splines");
1427 RNA_def_property_update(prop, noteflag, NULL);
1429 prop = RNA_def_property(srna, "show_mask_smooth", PROP_BOOLEAN, PROP_NONE);
1430 RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_SMOOTH);
1431 RNA_def_property_ui_text(prop, "Draw Smooth Splines", "");
1432 RNA_def_property_update(prop, noteflag, NULL);
1434 prop = RNA_def_property(srna, "show_mask_overlay", PROP_BOOLEAN, PROP_NONE);
1435 RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_OVERLAY);
1436 RNA_def_property_ui_text(prop, "Show Mask Overlay", "");
1437 RNA_def_property_update(prop, noteflag, NULL);
1439 prop = RNA_def_property(srna, "mask_overlay_mode", PROP_ENUM, PROP_NONE);
1440 RNA_def_property_enum_sdna(prop, NULL, "mask_info.overlay_mode");
1441 RNA_def_property_enum_items(prop, overlay_mode_items);
1442 RNA_def_property_ui_text(prop, "Overlay Mode", "Overlay mode of rasterized mask");
1443 RNA_def_property_update(prop, noteflag, NULL);
1446 static void rna_def_space_image_uv(BlenderRNA *brna)
1451 static EnumPropertyItem sticky_mode_items[] = {
1452 {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled"},
1453 {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location",
1454 "Select UVs that are at the same location and share a mesh vertex"},
1455 {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex",
1456 "Select UVs that share mesh vertex, irrespective if they are in the same location"},
1457 {0, NULL, 0, NULL, NULL}
1460 static EnumPropertyItem dt_uvstretch_items[] = {
1461 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
1462 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
1463 {0, NULL, 0, NULL, NULL}
1466 srna = RNA_def_struct(brna, "SpaceUVEditor", NULL);
1467 RNA_def_struct_sdna(srna, "SpaceImage");
1468 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
1469 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
1472 prop = RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
1473 RNA_def_property_enum_sdna(prop, NULL, "sticky");
1474 RNA_def_property_enum_items(prop, sticky_mode_items);
1475 RNA_def_property_ui_text(prop, "Sticky Selection Mode",
1476 "Automatically select also UVs sharing the same vertex as the ones being selected");
1477 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1480 prop = RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
1481 RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
1482 RNA_def_property_enum_items(prop, dt_uv_items);
1483 RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges");
1484 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1486 prop = RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
1487 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
1488 RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased");
1489 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1491 prop = RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
1492 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
1493 RNA_def_property_ui_text(prop, "Draw Stretch",
1494 "Draw faces colored according to the difference in shape between UVs and "
1495 "their 3D coordinates (blue for low distortion, red for high distortion)");
1496 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1498 prop = RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
1499 RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
1500 RNA_def_property_enum_items(prop, dt_uvstretch_items);
1501 RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw");
1502 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1504 prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
1505 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
1506 RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied");
1507 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1509 prop = RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
1510 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
1511 RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
1512 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1514 prop = RNA_def_property(srna, "show_texpaint", PROP_BOOLEAN, PROP_NONE);
1515 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAW_TEXPAINT);
1516 RNA_def_property_ui_text(prop, "Draw Texture Paint UVs", "Draw overlay of texture paint uv layer");
1517 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1519 prop = RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
1520 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
1521 RNA_def_property_ui_text(prop, "Normalized Coordinates",
1522 "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
1523 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1525 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
1526 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES);
1527 RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image");
1528 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1530 /* todo: move edge and face drawing options here from G.f */
1532 prop = RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
1533 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
1534 RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing");
1535 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1537 prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
1538 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
1539 RNA_def_property_ui_text(prop, "Constrain to Image Bounds",
1540 "Constraint to stay within the image bounds while editing");
1541 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1543 prop = RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
1544 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
1545 RNA_def_property_ui_text(prop, "Live Unwrap",
1546 "Continuously unwrap the selected UV island while transforming pinned vertices");
1547 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1550 static void rna_def_space_outliner(BlenderRNA *brna)
1555 static EnumPropertyItem display_mode_items[] = {
1556 {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display datablocks in all scenes"},
1557 {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display datablocks in current scene"},
1558 {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display datablocks in visible layers"},
1559 {SO_SELECTED, "SELECTED", 0, "Selected", "Display datablocks of selected objects"},
1560 {SO_ACTIVE, "ACTIVE", 0, "Active", "Display datablocks of active object"},
1561 {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types",
1562 "Display datablocks of all objects of same type as selected object"},
1563 {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their datablocks"},
1564 {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence datablocks"},
1565 {SO_LIBRARIES, "LIBRARIES", 0, "Blender File", "Display data of current file and linked libraries"},
1566 {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", "Display all raw datablocks"},
1567 {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display the user preference datablocks"},
1568 {0, NULL, 0, NULL, NULL}
1571 srna = RNA_def_struct(brna, "SpaceOutliner", "Space");
1572 RNA_def_struct_sdna(srna, "SpaceOops");
1573 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
1575 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
1576 RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
1577 RNA_def_property_enum_items(prop, display_mode_items);
1578 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
1579 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1581 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
1582 RNA_def_property_string_sdna(prop, NULL, "search_string");
1583 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
1584 RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE);
1585 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1587 prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
1588 RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE);
1589 RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
1590 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1592 prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
1593 RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE);
1594 RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
1595 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1597 prop = RNA_def_property(srna, "use_sort_alpha", PROP_BOOLEAN, PROP_NONE);
1598 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_SKIP_SORT_ALPHA);
1599 RNA_def_property_ui_text(prop, "Sort Alphabetically", "");
1600 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1602 prop = RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
1603 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
1604 RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
1605 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1608 static void rna_def_background_image(BlenderRNA *brna)
1613 /* note: combinations work but don't flip so arnt that useful */
1614 static EnumPropertyItem bgpic_axis_items[] = {
1615 {0, "", 0, N_("X Axis"), ""},
1616 {(1 << RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"},
1617 {(1 << RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", "Show background image while looking to the right"},
1618 /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/
1619 {0, "", 0, N_("Y Axis"), ""},
1620 {(1 << RV3D_VIEW_BACK), "BACK", 0, "Back", "Show background image in back view"},
1621 {(1 << RV3D_VIEW_FRONT), "FRONT", 0, "Front", "Show background image in front view"},
1622 /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/
1623 {0, "", 0, N_("Z Axis"), ""},
1624 {(1 << RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", "Show background image in bottom view"},
1625 {(1 << RV3D_VIEW_TOP), "TOP", 0, "Top", "Show background image in top view"},
1626 /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/
1627 {0, "", 0, N_("Other"), ""},
1628 {0, "ALL", 0, "All Views", "Show background image in all views"},
1629 {(1 << RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"},
1630 {0, NULL, 0, NULL, NULL}
1633 static EnumPropertyItem bgpic_source_items[] = {
1634 {V3D_BGPIC_IMAGE, "IMAGE", 0, "Image", ""},
1635 {V3D_BGPIC_MOVIE, "MOVIE_CLIP", 0, "Movie Clip", ""},
1636 {0, NULL, 0, NULL, NULL}
1639 static const EnumPropertyItem bgpic_camera_frame_items[] = {
1640 {0, "STRETCH", 0, "Stretch", ""},
1641 {V3D_BGPIC_CAMERA_ASPECT, "FIT", 0, "Fit", ""},
1642 {V3D_BGPIC_CAMERA_ASPECT | V3D_BGPIC_CAMERA_CROP, "CROP", 0, "Crop", ""},
1643 {0, NULL, 0, NULL, NULL}
1646 static const EnumPropertyItem bgpic_draw_depth_items[] = {
1647 {0, "BACK", 0, "Back", ""},
1648 {V3D_BGPIC_FOREGROUND, "FRONT", 0, "Front", ""},
1649 {0, NULL, 0, NULL, NULL}
1652 srna = RNA_def_struct(brna, "BackgroundImage", NULL);
1653 RNA_def_struct_sdna(srna, "BGpic");
1654 RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3D View background");
1656 prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
1657 RNA_def_property_enum_sdna(prop, NULL, "source");
1658 RNA_def_property_enum_items(prop, bgpic_source_items);
1659 RNA_def_property_ui_text(prop, "Background Source", "Data source used for background");
1660 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1662 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
1663 RNA_def_property_pointer_sdna(prop, NULL, "ima");
1664 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
1665 RNA_def_property_flag(prop, PROP_EDITABLE);
1666 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1668 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
1669 RNA_def_property_pointer_sdna(prop, NULL, "clip");
1670 RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space");
1671 RNA_def_property_flag(prop, PROP_EDITABLE);
1672 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1674 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
1675 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1676 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
1677 RNA_def_property_ui_text(prop, "Image User",
1678 "Parameters defining which layer, pass and frame of the image is displayed");
1679 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1681 prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
1682 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1683 RNA_def_property_struct_type(prop, "MovieClipUser");
1684 RNA_def_property_pointer_sdna(prop, NULL, "cuser");
1685 RNA_def_property_ui_text(prop, "Clip User", "Parameters defining which frame of the movie clip is displayed");
1686 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1688 prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
1689 RNA_def_property_float_sdna(prop, NULL, "xof");
1690 RNA_def_property_ui_text(prop, "X Offset", "Offset image horizontally from the world origin");
1691 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1693 prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
1694 RNA_def_property_float_sdna(prop, NULL, "yof");
1695 RNA_def_property_ui_text(prop, "Y Offset", "Offset image vertically from the world origin");
1696 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1698 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
1699 RNA_def_property_float_sdna(prop, NULL, "size");
1700 RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image");
1701 RNA_def_property_range(prop, 0.0, FLT_MAX);
1702 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1704 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
1705 RNA_def_property_float_sdna(prop, NULL, "rotation");
1706 RNA_def_property_ui_text(prop, "Rotation", "Rotation for the background image");
1707 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1709 prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
1710 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_FLIP_X);
1711 RNA_def_property_ui_text(prop, "Flip Horizontally", "Flip the background image horizontally");
1712 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1714 prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
1715 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_FLIP_Y);
1716 RNA_def_property_ui_text(prop, "Flip Vertically", "Flip the background image vertically");
1717 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1719 prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
1720 RNA_def_property_float_sdna(prop, NULL, "blend");
1721 RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);
1722 RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color");
1723 RNA_def_property_range(prop, 0.0, 1.0);
1724 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1726 prop = RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
1727 RNA_def_property_enum_sdna(prop, NULL, "view");
1728 RNA_def_property_enum_items(prop, bgpic_axis_items);
1729 RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the image on");
1730 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1732 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
1733 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED);
1734 RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
1735 RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
1737 prop = RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE);
1738 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_CAMERACLIP);
1739 RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera");
1740 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1742 prop = RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE);
1743 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_BGPIC_DISABLED);
1744 RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background");
1745 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1747 prop = RNA_def_property(srna, "show_on_foreground", PROP_BOOLEAN, PROP_NONE);
1748 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_FOREGROUND);
1749 RNA_def_property_ui_text(prop, "Show On Foreground", "Show this image in front of objects in viewport");
1750 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1752 /* expose 1 flag as a enum of 2 items */
1753 prop = RNA_def_property(srna, "draw_depth", PROP_ENUM, PROP_NONE);
1754 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1755 RNA_def_property_enum_items(prop, bgpic_draw_depth_items);
1756 RNA_def_property_ui_text(prop, "Depth", "Draw under or over everything");
1757 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1759 /* expose 2 flags as a enum of 3 items */
1760 prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE);
1761 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1762 RNA_def_property_enum_items(prop, bgpic_camera_frame_items);
1763 RNA_def_property_ui_text(prop, "Frame Method", "How the image fits in the camera frame");
1764 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1767 static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop)
1773 RNA_def_property_srna(cprop, "BackgroundImages");
1774 srna = RNA_def_struct(brna, "BackgroundImages", NULL);
1775 RNA_def_struct_sdna(srna, "View3D");
1776 RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images");
1778 func = RNA_def_function(srna, "new", "rna_BackgroundImage_new");
1779 RNA_def_function_ui_description(func, "Add new background image");
1780 parm = RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
1781 RNA_def_function_return(func, parm);
1783 func = RNA_def_function(srna, "remove", "rna_BackgroundImage_remove");
1784 RNA_def_function_ui_description(func, "Remove background image");
1785 RNA_def_function_flag(func, FUNC_USE_REPORTS);
1786 parm = RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
1787 RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
1788 RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
1790 func = RNA_def_function(srna, "clear", "rna_BackgroundImage_clear");
1791 RNA_def_function_ui_description(func, "Remove all background images");
1795 static void rna_def_space_view3d(BlenderRNA *brna)
1800 static EnumPropertyItem manipulators_items[] = {
1801 {V3D_MANIP_TRANSLATE, "TRANSLATE", ICON_MAN_TRANS, "Translate",
1802 "Use the manipulator for movement transformations"},
1803 {V3D_MANIP_ROTATE, "ROTATE", ICON_MAN_ROT, "Rotate",
1804 "Use the manipulator for rotation transformations"},
1805 {V3D_MANIP_SCALE, "SCALE", ICON_MAN_SCALE, "Scale",
1806 "Use the manipulator for scale transformations"},
1807 {0, NULL, 0, NULL, NULL}
1810 static EnumPropertyItem rv3d_persp_items[] = {
1811 {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
1812 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
1813 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
1814 {0, NULL, 0, NULL, NULL}
1817 static EnumPropertyItem bundle_drawtype_items[] = {
1818 {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
1819 {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
1820 {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
1821 {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
1822 {OB_CUBE, "CUBE", 0, "Cube", ""},
1823 {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
1824 {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
1825 {0, NULL, 0, NULL, NULL}
1828 static EnumPropertyItem view3d_matcap_items[] = {
1829 {ICON_MATCAP_01, "01", ICON_MATCAP_01, "", ""},
1830 {ICON_MATCAP_02, "02", ICON_MATCAP_02, "", ""},
1831 {ICON_MATCAP_03, "03", ICON_MATCAP_03, "", ""},
1832 {ICON_MATCAP_04, "04", ICON_MATCAP_04, "", ""},
1833 {ICON_MATCAP_05, "05", ICON_MATCAP_05, "", ""},
1834 {ICON_MATCAP_06, "06", ICON_MATCAP_06, "", ""},
1835 {ICON_MATCAP_07, "07", ICON_MATCAP_07, "", ""},
1836 {ICON_MATCAP_08, "08", ICON_MATCAP_08, "", ""},
1837 {ICON_MATCAP_09, "09", ICON_MATCAP_09, "", ""},
1838 {ICON_MATCAP_10, "10", ICON_MATCAP_10, "", ""},
1839 {ICON_MATCAP_11, "11", ICON_MATCAP_11, "", ""},
1840 {ICON_MATCAP_12, "12", ICON_MATCAP_12, "", ""},
1841 {ICON_MATCAP_13, "13", ICON_MATCAP_13, "", ""},
1842 {ICON_MATCAP_14, "14", ICON_MATCAP_14, "", ""},
1843 {ICON_MATCAP_15, "15", ICON_MATCAP_15, "", ""},
1844 {ICON_MATCAP_16, "16", ICON_MATCAP_16, "", ""},
1845 {ICON_MATCAP_17, "17", ICON_MATCAP_17, "", ""},
1846 {ICON_MATCAP_18, "18", ICON_MATCAP_18, "", ""},
1847 {ICON_MATCAP_19, "19", ICON_MATCAP_19, "", ""},
1848 {ICON_MATCAP_20, "20", ICON_MATCAP_20, "", ""},
1849 {ICON_MATCAP_21, "21", ICON_MATCAP_21, "", ""},
1850 {ICON_MATCAP_22, "22", ICON_MATCAP_22, "", ""},
1851 {ICON_MATCAP_23, "23", ICON_MATCAP_23, "", ""},
1852 {ICON_MATCAP_24, "24", ICON_MATCAP_24, "", ""},
1853 {0, NULL, 0, NULL, NULL}
1857 srna = RNA_def_struct(brna, "SpaceView3D", "Space");
1858 RNA_def_struct_sdna(srna, "View3D");
1859 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
1861 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
1862 RNA_def_property_flag(prop, PROP_EDITABLE);
1863 RNA_def_property_pointer_sdna(prop, NULL, "camera");
1864 RNA_def_property_ui_text(prop, "Camera",
1865 "Active camera used in this view (when unlocked from the scene's active camera)");
1866 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1869 prop = RNA_def_property(srna, "use_render_border", PROP_BOOLEAN, PROP_NONE);
1870 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_BORDER);
1871 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1872 RNA_def_property_ui_text(prop, "Render Border", "Use a region within the frame size for rendered viewport "
1873 "(when not viewing through the camera)");
1874 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1876 prop = RNA_def_property(srna, "render_border_min_x", PROP_FLOAT, PROP_NONE);
1877 RNA_def_property_float_sdna(prop, NULL, "render_border.xmin");
1878 RNA_def_property_range(prop, 0.0f, 1.0f);
1879 RNA_def_property_ui_text(prop, "Border Minimum X", "Minimum X value to for the render border");
1880 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1882 prop = RNA_def_property(srna, "render_border_min_y", PROP_FLOAT, PROP_NONE);
1883 RNA_def_property_float_sdna(prop, NULL, "render_border.ymin");
1884 RNA_def_property_range(prop, 0.0f, 1.0f);
1885 RNA_def_property_ui_text(prop, "Border Minimum Y", "Minimum Y value for the render border");
1886 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1888 prop = RNA_def_property(srna, "render_border_max_x", PROP_FLOAT, PROP_NONE);
1889 RNA_def_property_float_sdna(prop, NULL, "render_border.xmax");
1890 RNA_def_property_range(prop, 0.0f, 1.0f);
1891 RNA_def_property_ui_text(prop, "Border Maximum X", "Maximum X value for the render border");
1892 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1894 prop = RNA_def_property(srna, "render_border_max_y", PROP_FLOAT, PROP_NONE);
1895 RNA_def_property_float_sdna(prop, NULL, "render_border.ymax");
1896 RNA_def_property_range(prop, 0.0f, 1.0f);
1897 RNA_def_property_ui_text(prop, "Border Maximum Y", "Maximum Y value for the render border");
1898 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1900 prop = RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
1901 RNA_def_property_flag(prop, PROP_EDITABLE);
1902 RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
1903 RNA_def_property_ui_text(prop, "Lock to Object", "3D View center is locked to this object's position");
1904 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1906 prop = RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
1907 RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone");
1908 RNA_def_property_ui_text(prop, "Lock to Bone", "3D View center is locked to this bone's position");
1909 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1911 prop = RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
1912 RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1);
1913 RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
1914 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1916 prop = RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
1917 RNA_def_property_enum_sdna(prop, NULL, "drawtype");
1918 RNA_def_property_enum_items(prop, viewport_shade_items);
1919 RNA_def_property_enum_funcs(prop, "rna_SpaceView3D_viewport_shade_get", NULL,
1920 "rna_SpaceView3D_viewport_shade_itemf");
1921 RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
1922 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_viewport_shade_update");
1924 prop = RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
1925 RNA_def_property_pointer_sdna(prop, NULL, "localvd");
1926 RNA_def_property_ui_text(prop, "Local View",
1927 "Display an isolated sub-set of objects, apart from the scene visibility");
1929 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
1930 RNA_def_property_array(prop, 3);
1931 RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", NULL);
1932 RNA_def_property_ui_text(prop, "3D Cursor Location",
1933 "3D cursor location for this view (dependent on local view setting)");
1934 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
1935 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1937 prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_UNIT_CAMERA);
1938 RNA_def_property_float_sdna(prop, NULL, "lens");
1939 RNA_def_property_ui_text(prop, "Lens", "Viewport lens angle");
1940 RNA_def_property_range(prop, 1.0f, 250.0f);
1941 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1943 prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
1944 RNA_def_property_float_sdna(prop, NULL, "near");
1945 RNA_def_property_range(prop, 0.001f, FLT_MAX);
1946 RNA_def_property_float_default(prop, 0.1f);
1947 RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance (perspective view only)");
1948 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1950 prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
1951 RNA_def_property_float_sdna(prop, NULL, "far");
1952 RNA_def_property_range(prop, 1.0f, FLT_MAX);
1953 RNA_def_property_float_default(prop, 1000.0f);
1954 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
1955 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1957 prop = RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
1958 RNA_def_property_float_sdna(prop, NULL, "grid");
1959 RNA_def_property_ui_text(prop, "Grid Scale", "Distance between 3D View grid lines");
1960 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1961 RNA_def_property_ui_range(prop, 0.001f, 1000.0f, 0.1f, 3);
1962 RNA_def_property_float_default(prop, 1.0f);
1963 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1965 prop = RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
1966 RNA_def_property_int_sdna(prop, NULL, "gridlines");
1967 RNA_def_property_ui_text(prop, "Grid Lines", "Number of grid lines to display in perspective view");
1968 RNA_def_property_range(prop, 0, 1024);
1969 RNA_def_property_int_default(prop, 16);
1970 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1972 prop = RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
1973 RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
1974 RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
1975 RNA_def_property_range(prop, 1, 1024);
1976 RNA_def_property_int_default(prop, 10);
1977 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1979 prop = RNA_def_property(srna, "grid_scale_unit", PROP_FLOAT, PROP_NONE);
1980 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1981 RNA_def_property_float_funcs(prop, "rna_View3D_GridScaleUnit_get", NULL, NULL);
1982 RNA_def_property_ui_text(prop, "Grid Scale Unit", "Grid cell size scaled by scene unit system settings");
1984 prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
1985 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
1986 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
1987 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1989 prop = RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
1990 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
1991 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
1992 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1994 prop = RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
1995 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
1996 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view");
1997 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1999 prop = RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
2000 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
2001 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view");
2002 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2004 prop = RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
2005 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
2006 RNA_def_property_ui_text(prop, "Outline Selected",
2007 "Show an outline highlight around selected objects in non-wireframe views");
2008 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2010 prop = RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
2011 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
2012 RNA_def_property_ui_text(prop, "All Object Origins",
2013 "Show the object origin center dot for all (selected and unselected) objects");
2014 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2016 prop = RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
2017 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
2018 RNA_def_property_ui_text(prop, "Relationship Lines",
2019 "Show dashed lines indicating parent or constraint relationships");
2020 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2022 prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
2023 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_GPENCIL);
2024 RNA_def_property_ui_text(prop, "Show Grease Pencil",
2025 "Show grease pencil for this view");
2026 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2028 prop = RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
2029 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
2030 RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
2031 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2033 prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE);
2034 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_BACKFACE_CULLING);
2035 RNA_def_property_ui_text(prop, "Backface Culling", "Use back face culling to hide the back side of faces");
2036 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2038 prop = RNA_def_property(srna, "show_textured_shadeless", PROP_BOOLEAN, PROP_NONE);
2039 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHADELESS_TEX);
2040 RNA_def_property_ui_text(prop, "Shadeless", "Show shadeless texture without lighting in textured draw mode");
2041 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2043 prop = RNA_def_property(srna, "show_occlude_wire", PROP_BOOLEAN, PROP_NONE);
2044 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_OCCLUDE_WIRE);
2045 RNA_def_property_ui_text(prop, "Hidden Wire", "Use hidden wireframe display");
2046 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2048 prop = RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
2049 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA);
2050 RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view");
2051 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2053 prop = RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
2054 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE);
2055 RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
2056 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2058 prop = RNA_def_property(srna, "show_world", PROP_BOOLEAN, PROP_NONE);
2059 RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_SHOW_WORLD);
2060 RNA_def_property_ui_text(prop, "World Background", "Display world colors in the background");
2061 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2063 prop = RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
2064 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT);
2065 RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");
2066 RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
2067 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2069 prop = RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
2070 RNA_def_property_collection_sdna(prop, NULL, "bgpicbase", NULL);
2071 RNA_def_property_struct_type(prop, "BackgroundImage");
2072 RNA_def_property_ui_text(prop, "Background Images", "List of background images");
2073 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2074 rna_def_backgroundImages(brna, prop);
2076 prop = RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
2077 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS);
2078 RNA_def_property_ui_text(prop, "Display Background Images",
2079 "Display reference images behind objects in the 3D View");
2080 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2082 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
2083 RNA_def_property_enum_sdna(prop, NULL, "around");
2084 RNA_def_property_enum_items(prop, pivot_items_full);
2085 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
2086 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
2088 prop = RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
2089 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
2090 RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object and pose mode only)");
2091 RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
2092 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
2094 prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
2095 RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
2096 RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
2097 RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
2098 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2100 prop = RNA_def_property(srna, "transform_manipulators", PROP_ENUM, PROP_NONE);
2101 RNA_def_property_enum_sdna(prop, NULL, "twtype");
2102 RNA_def_property_enum_items(prop, manipulators_items);
2103 RNA_def_property_flag(prop, PROP_ENUM_FLAG);
2104 RNA_def_property_ui_text(prop, "Transform Manipulators", "Transformation manipulators");
2105 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2107 prop = RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
2108 RNA_def_property_enum_sdna(prop, NULL, "twmode");
2109 RNA_def_property_enum_items(prop, transform_orientation_items);
2110 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_itemf");
2111 RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation");
2112 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2114 prop = RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
2115 RNA_def_property_struct_type(prop, "TransformOrientation");
2116 RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
2117 RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current transformation orientation");
2119 prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
2120 RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
2121 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
2122 RNA_def_property_ui_text(prop, "Lock Camera and Layers",
2123 "Use the scene's active camera and layers in this view, rather than local layers");
2124 RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
2125 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2127 prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2128 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
2129 RNA_def_property_array(prop, 20);
2130 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set");
2131 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
2132 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_layer_update");
2134 prop = RNA_def_property(srna, "layers_local_view", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2135 RNA_def_property_boolean_sdna(prop, NULL, "lay", 0x01000000);
2136 RNA_def_property_array(prop, 8);
2137 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2138 RNA_def_property_ui_text(prop, "Local View Layers", "Local view layers visible in this 3D View");
2140 prop = RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2141 RNA_def_property_boolean_sdna(prop, NULL, "lay_used", 1);
2142 RNA_def_property_array(prop, 20);
2143 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2144 RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something");
2146 prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
2147 RNA_def_property_struct_type(prop, "RegionView3D");
2148 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
2149 RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region");
2151 prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE);
2152 RNA_def_property_struct_type(prop, "RegionView3D");
2153 RNA_def_property_collection_funcs(prop, "rna_SpaceView3D_region_quadviews_begin", "rna_iterator_listbase_next",
2154 "rna_iterator_listbase_end", "rna_SpaceView3D_region_quadviews_get",
2155 NULL, NULL, NULL, NULL);
2156 RNA_def_property_ui_text(prop, "Quad View Regions", "3D regions (the third one defines quad view settings, "
2157 "the forth one is same as 'region_3d')");
2159 prop = RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
2160 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_RECONSTRUCTION);
2161 RNA_def_property_ui_text(prop, "Show Reconstruction", "Display reconstruction data from active movie clip");
2162 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2164 prop = RNA_def_property(srna, "tracks_draw_size", PROP_FLOAT, PROP_NONE);
2165 RNA_def_property_range(prop, 0.0, FLT_MAX);
2166 RNA_def_property_ui_range(prop, 0, 5, 1, 3);
2167 RNA_def_property_float_sdna(prop, NULL, "bundle_size");
2168 RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data");
2169 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2171 prop = RNA_def_property(srna, "tracks_draw_type", PROP_ENUM, PROP_NONE);
2172 RNA_def_property_enum_sdna(prop, NULL, "bundle_drawtype");
2173 RNA_def_property_enum_items(prop, bundle_drawtype_items);
2174 RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks");
2175 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2177 prop = RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
2178 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_CAMERAPATH);
2179 RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path");
2180 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2182 prop = RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
2183 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_BUNDLENAME);
2184 RNA_def_property_ui_text(prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
2185 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2187 prop = RNA_def_property(srna, "use_matcap", PROP_BOOLEAN, PROP_NONE);
2188 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_MATCAP);
2189 RNA_def_property_ui_text(prop, "Matcap", "Active Objects draw images mapped on normals, enhancing Solid Draw Mode");
2190 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_matcap_enable");
2192 prop = RNA_def_property(srna, "matcap_icon", PROP_ENUM, PROP_NONE);
2193 RNA_def_property_enum_sdna(prop, NULL, "matcap_icon");
2194 RNA_def_property_enum_items(prop, view3d_matcap_items);
2195 RNA_def_property_ui_text(prop, "Matcap", "Image to use for Material Capture, active objects only");
2196 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_matcap_update");
2200 srna = RNA_def_struct(brna, "RegionView3D", NULL);
2201 RNA_def_struct_sdna(srna, "RegionView3D");
2202 RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
2204 prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
2205 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED);
2206 RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views");
2207 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
2209 prop = RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
2210 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW);
2211 RNA_def_property_ui_text(prop, "Box", "Sync view position between side views");
2212 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
2214 prop = RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
2215 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
2216 RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
2217 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
2219 prop = RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
2220 RNA_def_property_float_sdna(prop, NULL, "persmat");
2221 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* XXX: for now, it's too risky for users to do this */
2222 RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
2223 RNA_def_property_ui_text(prop, "Perspective Matrix",
2224 "Current perspective matrix (``window_matrix * view_matrix``)");
2226 prop = RNA_def_property(srna, "window_matrix", PROP_FLOAT, PROP_MATRIX);
2227 RNA_def_property_float_sdna(prop, NULL, "winmat");
2228 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2229 RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
2230 RNA_def_property_ui_text(prop, "Window Matrix", "Current window matrix");
2232 prop = RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
2233 RNA_def_property_float_sdna(prop, NULL, "viewmat");
2234 RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
2235 RNA_def_property_float_funcs(prop, NULL, "rna_RegionView3D_view_matrix_set", NULL);
2236 RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix");
2237 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2239 prop = RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
2240 RNA_def_property_enum_sdna(prop, NULL, "persp");
2241 RNA_def_property_enum_items(prop, rv3d_persp_items);
2242 RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
2243 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2245 prop = RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
2246 RNA_def_property_boolean_sdna(prop, NULL, "is_persp", 1);
2247 RNA_def_property_ui_text(prop, "Is Perspective", "");
2248 RNA_def_property_flag(prop, PROP_EDITABLE);
2250 prop = RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
2252 RNA_def_property_float_sdna(prop, NULL, "ofs"); /* cant use because its negated */
2254 RNA_def_property_array(prop, 3);
2255 RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get",
2256 "rna_RegionView3D_view_location_set", NULL);
2258 RNA_def_property_ui_text(prop, "View Location", "View pivot location");
2259 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
2260 RNA_def_property_update(prop, NC_WINDOW, NULL);
2262 prop = RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); /* cant use because its inverted */
2264 RNA_def_property_float_sdna(prop, NULL, "viewquat");
2266 RNA_def_property_array(prop, 4);
2267 RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_rotation_get",
2268 "rna_RegionView3D_view_rotation_set", NULL);
2270 RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
2271 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2273 /* not sure we need rna access to these but adding anyway */
2274 prop = RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
2275 RNA_def_property_float_sdna(prop, NULL, "dist");
2276 RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
2277 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2279 prop = RNA_def_property(srna, "view_camera_zoom", PROP_FLOAT, PROP_UNSIGNED);
2280 RNA_def_property_float_sdna(prop, NULL, "camzoom");
2281 RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view");
2282 RNA_def_property_range(prop, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
2283 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2285 prop = RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
2286 RNA_def_property_float_sdna(prop, NULL, "camdx");
2287 RNA_def_property_array(prop, 2);
2288 RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view");
2289 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2291 RNA_api_region_view3d(srna);
2294 static void rna_def_space_buttons(BlenderRNA *brna)
2299 static EnumPropertyItem align_items[] = {
2300 {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
2301 {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
2302 {0, NULL, 0, NULL, NULL}
2305 srna = RNA_def_struct(brna, "SpaceProperties", "Space");
2306 RNA_def_struct_sdna(srna, "SpaceButs");
2307 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
2309 prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
2310 RNA_def_property_enum_sdna(prop, NULL, "mainb");
2311 RNA_def_property_enum_items(prop, buttons_context_items);
2312 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf");
2313 RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
2314 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
2316 prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
2317 RNA_def_property_enum_sdna(prop, NULL, "align");
2318 RNA_def_property_enum_items(prop, align_items);
2319 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
2320 RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
2321 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
2323 prop = RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE);
2324 RNA_def_property_enum_items(prop, buttons_texture_context_items);
2325 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_texture_context_set",
2326 "rna_SpaceProperties_texture_context_itemf");
2327 RNA_def_property_ui_text(prop, "Texture Context", "Type of texture data to display and edit");
2328 RNA_def_property_update(prop, NC_TEXTURE, NULL);
2330 prop = RNA_def_property(srna, "use_limited_texture_context", PROP_BOOLEAN, PROP_NONE);
2331 RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_TEX_USER_LIMITED);
2332 RNA_def_property_ui_text(prop, "Limited Texture Context",
2333 "Use the limited version of texture user (for 'old shading' mode)");
2336 prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
2337 RNA_def_property_pointer_sdna(prop, NULL, "pinid");
2338 RNA_def_property_struct_type(prop, "ID");
2339 /* note: custom set function is ONLY to avoid rna setting a user for this. */
2340 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set",
2341 "rna_SpaceProperties_pin_id_typef", NULL);
2342 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
2343 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
2345 prop = RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
2346 RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
2347 RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
2350 static void rna_def_space_image(BlenderRNA *brna)
2352 static EnumPropertyItem image_space_mode_items[] = {
2353 {SI_MODE_VIEW, "VIEW", ICON_FILE_IMAGE, "View", "View the image and UV edit in mesh editmode"},
2354 {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode"},
2355 {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing"},
2356 {0, NULL, 0, NULL, NULL}
2362 srna = RNA_def_struct(brna, "SpaceImageEditor", "Space");
2363 RNA_def_struct_sdna(srna, "SpaceImage");
2364 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
2367 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
2368 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL);
2369 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
2370 RNA_def_property_flag(prop, PROP_EDITABLE);
2371 RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL); /* is handled in image editor too */
2373 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
2374 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2375 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
2376 RNA_def_property_ui_text(prop, "Image User",
2377 "Parameters defining which layer, pass and frame of the image is displayed");
2378 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2380 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
2381 RNA_def_property_pointer_sdna(prop, NULL, "scopes");
2382 RNA_def_property_struct_type(prop, "Scopes");
2383 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
2384 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
2385 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
2387 prop = RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
2388 RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
2389 RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
2390 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
2391 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2393 prop = RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
2394 RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist");
2395 RNA_def_property_struct_type(prop, "Histogram");
2396 RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
2398 prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
2399 RNA_def_property_array(prop, 2);
2400 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2401 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", NULL, NULL);
2402 RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
2405 prop = RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
2406 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
2407 RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
2408 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2410 prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
2411 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SHOW_GPENCIL);
2412 RNA_def_property_ui_text(prop, "Show Grease Pencil",
2413 "Show grease pencil for this view");
2414 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2416 prop = RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
2417 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2418 RNA_def_property_enum_items(prop, draw_channels_items);
2419 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
2420 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
2421 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2424 prop = RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
2425 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2426 RNA_def_property_struct_type(prop, "SpaceUVEditor");
2427 RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
2428 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
2431 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
2432 RNA_def_property_enum_sdna(prop, NULL, "mode");
2433 RNA_def_property_enum_items(prop, image_space_mode_items);
2434 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
2435 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
2438 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
2439 RNA_def_property_array(prop, 2);
2440 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get",
2441 "rna_SpaceImageEditor_cursor_location_set", NULL);
2442 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
2443 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2445 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
2446 RNA_def_property_enum_sdna(prop, NULL, "around");
2447 RNA_def_property_enum_items(prop, pivot_items_full);
2448 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_pivot_itemf");
2449 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
2450 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2453 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
2454 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
2455 RNA_def_property_struct_type(prop, "GreasePencil");
2456 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
2457 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
2458 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2461 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
2462 RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
2463 RNA_def_property_ui_text(prop, "Update Automatically",
2464 "Update other affected window spaces automatically to reflect changes "
2465 "during interactive operations such as transform");
2468 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
2469 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
2470 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2471 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
2473 prop = RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
2474 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
2475 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2476 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
2478 prop = RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
2479 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
2480 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2481 RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
2483 prop = RNA_def_property(srna, "show_maskedit", PROP_BOOLEAN, PROP_NONE);
2484 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_maskedit_get", NULL);
2485 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2486 RNA_def_property_ui_text(prop, "Show Mask Editor", "Show Mask editing related properties");
2488 rna_def_space_image_uv(brna);
2491 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mask_set");
2494 static void rna_def_space_sequencer(BlenderRNA *brna)
2499 static EnumPropertyItem view_type_items[] = {
2500 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
2501 {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
2502 {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SPLITVIEW, "Sequencer and Image Preview", ""},
2503 {0, NULL, 0, NULL, NULL}
2506 static EnumPropertyItem display_mode_items[] = {
2507 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
2508 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
2509 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
2510 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
2511 {0, NULL, 0, NULL, NULL}
2514 static EnumPropertyItem proxy_render_size_items[] = {
2515 {SEQ_PROXY_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
2516 {SEQ_PROXY_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""},
2517 {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""},
2518 {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""},
2519 {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""},
2520 {SEQ_PROXY_RENDER_SIZE_100, "PROXY_100", 0, "Proxy size 100%", ""},
2521 {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
2522 {0, NULL, 0, NULL, NULL}
2525 static EnumPropertyItem overlay_type_items[] = {
2526 {SEQ_DRAW_OVERLAY_RECT, "RECTANGLE", 0, "Rectangle", "Show rectangle area overlay"},
2527 {SEQ_DRAW_OVERLAY_REFERENCE, "REFERENCE", 0, "Reference", "Show reference frame only"},
2528 {SEQ_DRAW_OVERLAY_CURRENT, "CURRENT", 0, "Current", "Show current frame only"},
2529 {0, NULL, 0, NULL, NULL}
2532 static EnumPropertyItem preview_channels_items[] = {
2533 {SEQ_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
2534 "Draw image with RGB colors and alpha transparency"},
2535 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
2536 {0, NULL, 0, NULL, NULL}
2539 static EnumPropertyItem waveform_type_draw_items[] = {
2540 {SEQ_NO_WAVEFORMS, "NO_WAVEFORMS", 0, "Waveforms Off",
2541 "No waveforms drawn for any sound strips"},
2542 {SEQ_ALL_WAVEFORMS, "ALL_WAVEFORMS", 0, "Waveforms On",
2543 "Waveforms drawn for all sound strips"},
2544 {0, "DEFAULT_WAVEFORMS", 0, "Use Strip Option",
2545 "Waveforms drawn according to strip setting"},
2546 {0, NULL, 0, NULL, NULL}
2549 srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
2550 RNA_def_struct_sdna(srna, "SpaceSeq");
2551 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
2553 /* view type, fairly important */
2554 prop = RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
2555 RNA_def_property_enum_sdna(prop, NULL, "view");
2556 RNA_def_property_enum_items(prop, view_type_items);
2557 RNA_def_property_ui_text(prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
2558 RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
2560 /* display type, fairly important */
2561 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2562 RNA_def_property_enum_sdna(prop, NULL, "mainb");
2563 RNA_def_property_enum_items(prop, display_mode_items);
2564 RNA_def_property_ui_text(prop, "Display Mode", "View mode to use for displaying sequencer output");
2565 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2568 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
2569 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM);
2570 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
2571 "Show frame number beside the current frame indicator line");
2572 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2574 prop = RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
2575 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
2576 RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than seconds");
2577 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2579 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
2580 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
2581 RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
2582 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2584 prop = RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
2585 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPARATED);
2586 RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview");
2587 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2589 prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE);
2590 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_SAFE_MARGINS);
2591 RNA_def_property_ui_text(prop, "Safe Areas", "Show TV title safe and action safe areas in preview");
2592 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2594 prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE);
2595 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_SAFE_CENTER);
2596 RNA_def_property_ui_text(prop, "Center-Cut Safe Areas", "Show safe areas to fit content in a different aspect ratio");
2597 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2599 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
2600 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
2601 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
2602 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2604 prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
2605 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_GPENCIL);
2606 RNA_def_property_ui_text(prop, "Show Grease Pencil",
2607 "Show grease pencil for this view");
2608 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2610 prop = RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
2611 RNA_def_property_int_sdna(prop, NULL, "chanshown");
2612 RNA_def_property_ui_text(prop, "Display Channel",
2613 "The channel number shown in the image preview. 0 is the result of all strips combined");
2614 RNA_def_property_range(prop, -5, MAXSEQ);
2615 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2617 prop = RNA_def_property(srna, "preview_channels", PROP_ENUM, PROP_NONE);
2618 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2619 RNA_def_property_enum_items(prop, preview_channels_items);
2620 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the preview to draw");
2621 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2623 prop = RNA_def_property(srna, "waveform_draw_type", PROP_ENUM, PROP_NONE);
2624 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2625 RNA_def_property_enum_items(prop, waveform_type_draw_items);
2626 RNA_def_property_ui_text(prop, "Waveform Drawing", "How Waveforms are drawn");
2627 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2629 prop = RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
2630 RNA_def_property_int_sdna(prop, NULL, "zebra");
2631 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
2632 RNA_def_property_range(prop, 0, 110);
2633 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2635 prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
2636 RNA_def_property_enum_sdna(prop, NULL, "render_size");
2637 RNA_def_property_enum_items(prop, proxy_render_size_items);
2638 RNA_def_property_ui_text(prop, "Proxy render size",
2639 "Draw preview using full resolution or different proxy resolutions");
2640 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2643 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
2644 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
2645 RNA_def_property_struct_type(prop, "GreasePencil");
2646 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
2647 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
2648 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2650 prop = RNA_def_property(srna, "overlay_type", PROP_ENUM, PROP_NONE);
2651 RNA_def_property_enum_sdna(prop, NULL, "overlay_type");
2652 RNA_def_property_enum_items(prop, overlay_type_items);
2653 RNA_def_property_ui_text(prop, "Overlay Type", "Overlay draw type");
2654 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2656 prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
2657 RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_BACKDROP);
2658 RNA_def_property_ui_text(prop, "Use Backdrop", "Display result under strips");
2659 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2661 prop = RNA_def_property(srna, "show_strip_offset", PROP_BOOLEAN, PROP_NONE);
2662 RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_OFFSET_EXT);
2663 RNA_def_property_ui_text(prop, "Show Offsets", "Display strip in/out offsets");
2664 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2667 static void rna_def_space_text(BlenderRNA *brna)
2672 srna = RNA_def_struct(brna, "SpaceTextEditor", "Space");
2673 RNA_def_struct_sdna(srna, "SpaceText");
2674 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
2677 prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
2678 RNA_def_property_flag(prop, PROP_EDITABLE);
2679 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
2680 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL);
2681 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2684 prop = RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
2685 RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
2686 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
2687 RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
2688 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
2689 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2691 prop = RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
2692 RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
2693 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
2694 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
2695 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2697 prop = RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
2698 RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
2699 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
2700 RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
2701 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2703 prop = RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
2704 RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0);
2705 RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
2706 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2708 prop = RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
2709 RNA_def_property_int_sdna(prop, NULL, "tabnumber");
2710 RNA_def_property_range(prop, 2, 8);
2711 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
2712 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
2714 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
2715 RNA_def_property_int_sdna(prop, NULL, "lheight");
2716 RNA_def_property_range(prop, 8, 32);
2717 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
2718 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2720 prop = RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
2721 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_SHOW_MARGIN);
2722 RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
2723 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2725 prop = RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
2726 RNA_def_property_int_sdna(prop, NULL, "margin_column");
2727 RNA_def_property_range(prop, 0, 1024);
2728 RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
2729 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2731 prop = RNA_def_property(srna, "top", PROP_INT, PROP_NONE);
2732 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2733 RNA_def_property_int_sdna(prop, NULL, "top");
2734 RNA_def_property_ui_text(prop, "Top Line", "Top line visible");
2736 prop = RNA_def_property(srna, "visible_lines", PROP_INT, PROP_NONE);
2737 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2738 RNA_def_property_int_sdna(prop, NULL, "viewlines");
2739 RNA_def_property_ui_text(prop, "Top Line", "Amount of lines that can be visible in current editor");
2741 /* functionality options */
2742 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2743 RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1);
2744 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
2745 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2747 prop = RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
2748 RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1);
2749 RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
2750 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2753 prop = RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
2754 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
2755 RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one");
2756 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2758 prop = RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
2759 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
2760 RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end");
2761 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2763 prop = RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
2764 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_MATCH_CASE);
2765 RNA_def_property_ui_text(prop, "Match case", "Search string is sensitive to uppercase and lowercase letters");
2766 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2768 prop = RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
2769 RNA_def_property_string_sdna(prop, NULL, "findstr");
2770 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
2771 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2773 prop = RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
2774 RNA_def_property_string_sdna(prop, NULL, "replacestr");
2775 RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool");
2776 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2778 RNA_api_space_text(srna);
2781 static void rna_def_space_dopesheet(BlenderRNA *brna)
2786 /* XXX: action-editor is currently for object-level only actions, so show that using object-icon hint */
2787 static EnumPropertyItem mode_items[] = {
2788 {SACTCONT_DOPESHEET, "DOPESHEET", ICON_OOPS, "Dope Sheet", "Edit all keyframes in scene"},
2789 {SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", "Edit keyframes in active object's Object-level action"},
2790 {SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, "Shape Key Editor", "Edit keyframes in active object's Shape Keys action"},
2791 {SACTCONT_GPENCIL, "GPENCIL", ICON_GREASEPENCIL, "Grease Pencil", "Edit timings for all Grease Pencil sketches in file"},
2792 {SACTCONT_MASK, "MASK", ICON_MOD_MASK, "Mask", "Edit timings for Mask Editor splines"},
2793 {0, NULL, 0, NULL, NULL}
2797 srna = RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
2798 RNA_def_struct_sdna(srna, "SpaceAction");
2799 RNA_def_struct_ui_text(srna, "Space Dope Sheet Editor", "Dope Sheet space data");
2802 prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
2803 RNA_def_property_flag(prop, PROP_EDITABLE);
2804 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL,
2805 "rna_Action_actedit_assign_poll");
2806 RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
2807 RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
2810 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
2811 RNA_def_property_enum_sdna(prop, NULL, "mode");
2812 RNA_def_property_enum_items(prop, mode_items);
2813 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
2814 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
2817 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
2818 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
2819 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
2820 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2822 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
2823 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
2824 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
2825 "Show frame number beside the current frame indicator line");
2826 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2828 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
2829 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
2830 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
2831 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2833 prop = RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
2834 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_POSEMARKERS_SHOW);
2835 RNA_def_property_ui_text(prop, "Show Pose Markers",
2836 "Show markers belonging to the active action instead of Scene markers "
2837 "(Action and Shape Key Editors only)");
2838 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2840 prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
2841 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWGCOLORS);
2842 RNA_def_property_ui_text(prop, "Show Group Colors",
2843 "Draw groups and channels with colors matching their corresponding groups "
2844 "(pose bones only currently)");
2845 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2848 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
2849 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
2850 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
2851 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2853 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
2854 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
2855 RNA_def_property_ui_text(prop, "Realtime Updates",
2856 "When transforming keyframes, changes to the animation data are flushed to other views");
2857 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2859 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
2860 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_MARKERS_MOVE);
2861 RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
2864 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
2865 RNA_def_property_struct_type(prop, "DopeSheet");
2866 RNA_def_property_pointer_sdna(prop, NULL, "ads");
2867 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
2870 prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
2871 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
2872 RNA_def_property_enum_items(prop, autosnap_items);
2873 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
2874 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2877 static void rna_def_space_graph(BlenderRNA *brna)
2882 static EnumPropertyItem mode_items[] = {
2883 {SIPO_MODE_ANIMATION, "FCURVES", ICON_IPO, "F-Curve",
2884 "Edit animation/keyframes displayed as 2D curves"},
2885 {SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, "Drivers", "Edit drivers"},
2886 {0, NULL, 0, NULL, NULL}
2889 /* this is basically the same as the one for the 3D-View, but with some entries omitted */
2890 static EnumPropertyItem gpivot_items[] = {
2891 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
2892 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
2893 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
2894 /*{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""}, */
2895 /*{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""}, */
2896 {0, NULL, 0, NULL, NULL}
2900 srna = RNA_def_struct(brna, "SpaceGraphEditor", "Space");
2901 RNA_def_struct_sdna(srna, "SpaceIpo");
2902 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
2905 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
2906 RNA_def_property_enum_sdna(prop, NULL, "mode");
2907 RNA_def_property_enum_items(prop, mode_items);
2908 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
2909 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
2912 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
2913 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
2914 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
2915 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2917 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
2918 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
2919 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
2920 "Show frame number beside the current frame indicator line");
2921 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2923 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
2924 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
2925 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
2926 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2928 prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
2929 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
2930 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points");
2931 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2933 prop = RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
2934 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
2935 RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes",
2936 "Only keyframes of selected F-Curves are visible and editable");
2937 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2939 prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
2940 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY);
2941 RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles",
2942 "Only show and edit handles of selected keyframes");
2943 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2945 prop = RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE);
2946 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF);
2947 RNA_def_property_ui_text(prop, "Use High Quality Drawing",
2948 "Draw F-Curves using Anti-Aliasing and other fancy effects "
2949 "(disable for better performance)");
2950 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2952 prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
2953 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWGCOLORS);
2954 RNA_def_property_ui_text(prop, "Show Group Colors",
2955 "Draw groups and channels with colors matching their corresponding groups");
2956 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2959 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
2960 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
2961 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
2962 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2964 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
2965 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
2966 RNA_def_property_ui_text(prop, "Realtime Updates",
2967 "When transforming keyframes, changes to the animation data are flushed to other views");
2968 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2971 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
2972 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR);
2973 RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
2974 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2976 prop = RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
2977 RNA_def_property_float_sdna(prop, NULL, "cursorVal");
2978 RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
2979 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2981 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
2982 RNA_def_property_enum_sdna(prop, NULL, "around");
2983 RNA_def_property_enum_items(prop, gpivot_items);
2984 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
2985 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2988 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
2989 RNA_def_property_struct_type(prop, "DopeSheet");
2990 RNA_def_property_pointer_sdna(prop, NULL, "ads");
2991 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
2994 prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
2995 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
2996 RNA_def_property_enum_items(prop, autosnap_items);
2997 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
2998 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
3000 /* readonly state info */
3001 prop = RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
3002 RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", NULL);
3003 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
3004 RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
3007 prop = RNA_def_property(srna, "use_auto_view_selected", PROP_BOOLEAN, PROP_NONE);
3008 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_AUTO_VIEW_SELECTED);
3009 RNA_def_property_ui_text(prop, "Auto View Selected", "Automatically adjust view based on selection");
3010 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
3012 /* nromalize curves */
3013 prop = RNA_def_property(srna, "use_normalization", PROP_BOOLEAN, PROP_NONE);
3014 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NORMALIZE);
3015 RNA_def_property_ui_text(prop, "Use Normalization", "Display curves in normalized to -1..1 range, "
3016 "for easier editing of multiple curves with different ranges");
3017 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
3019 prop = RNA_def_property(srna, "use_auto_normalization", PROP_BOOLEAN, PROP_NONE);
3020 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NORMALIZE_FREEZE);
3021 RNA_def_property_ui_text(prop, "Auto Normalization",
3022 "Automatically recalculate curve normalization on every curve edit");
3023 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
3026 static void rna_def_space_nla(BlenderRNA *brna)
3031 srna = RNA_def_struct(brna, "SpaceNLA", "Space");
3032 RNA_def_struct_sdna(srna, "SpaceNla");
3033 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
3036 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
3037 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
3038 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
3039 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3041 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
3042 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
3043 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
3044 "Show frame number beside the current frame indicator line");
3045 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3047 prop = RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
3048 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
3049 RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
3050 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3053 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
3054 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
3055 RNA_def_property_ui_text(prop, "Realtime Updates",
3056 "When transforming strips, changes to the animation data are flushed to other views");
3057 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3060 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
3061 RNA_def_property_struct_type(prop, "DopeSheet");
3062 RNA_def_property_pointer_sdna(prop, NULL, "ads");
3063 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
3066 prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
3067 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
3068 RNA_def_property_enum_items(prop, autosnap_items);
3069 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
3070 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3073 static void rna_def_space_time(BlenderRNA *brna)
3078 srna = RNA_def_struct(brna, "SpaceTimeline", "Space");
3079 RNA_def_struct_sdna(srna, "SpaceTime");
3080 RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
3083 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
3084 RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM);
3085 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
3086 "Show frame number beside the current frame indicator line");
3087 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3089 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
3090 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TIME_DRAWFRAMES);
3091 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
3092 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3094 /* displaying cache status */
3095 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
3096 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY);
3097 RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
3098 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3100 prop = RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
3101 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SOFTBODY);
3102 RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
3103 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3105 prop = RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
3106 RNA_def_property_boolean_sdna(prop, NU