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;
271 for (sa = sc->areabase.first; sa; sa = sa->next)
272 if (BLI_findindex(&sa->spacedata, link) != -1)
278 static void area_region_from_regiondata(bScreen *sc, void *regiondata, ScrArea **r_sa, ARegion **r_ar)
286 for (sa = sc->areabase.first; sa; sa = sa->next) {
287 for (ar = sa->regionbase.first; ar; ar = ar->next) {
288 if (ar->regiondata == regiondata) {
297 static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARegion **r_ar)
299 bScreen *sc = (bScreen *)ptr->id.data;
300 void *regiondata = ptr->data;
302 area_region_from_regiondata(sc, regiondata, r_sa, r_ar);
305 static int rna_Space_view2d_sync_get(PointerRNA *ptr)
310 sa = rna_area_from_space(ptr); /* can be NULL */
311 ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
313 View2D *v2d = &ar->v2d;
314 return (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME) != 0;
320 static void rna_Space_view2d_sync_set(PointerRNA *ptr, int value)
325 sa = rna_area_from_space(ptr); /* can be NULL */
326 ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
328 View2D *v2d = &ar->v2d;
330 v2d->flag |= V2D_VIEWSYNC_SCREEN_TIME;
333 v2d->flag &= ~V2D_VIEWSYNC_SCREEN_TIME;
338 static void rna_Space_view2d_sync_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
343 sa = rna_area_from_space(ptr); /* can be NULL */
344 ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
347 bScreen *sc = (bScreen *)ptr->id.data;
348 View2D *v2d = &ar->v2d;
350 UI_view2d_sync(sc, sa, v2d, V2D_LOCK_SET);
354 static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
356 Scene *scene = ((bScreen *)ptr->id.data)->scene;
357 View3D *v3d = (View3D *)ptr->data;
359 if (v3d->twmode < V3D_MANIP_CUSTOM)
360 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
362 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation,
363 BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
366 EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
369 ListBase *transform_spaces;
370 TransformOrientation *ts = NULL;
371 EnumPropertyItem tmp = {0, "", 0, "", ""};
372 EnumPropertyItem *item = NULL;
373 int i = V3D_MANIP_CUSTOM, totitem = 0;
375 RNA_enum_items_add(&item, &totitem, transform_orientation_items);
377 if (ptr->type == &RNA_SpaceView3D)
378 scene = ((bScreen *)ptr->id.data)->scene;
380 scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
383 transform_spaces = &scene->transform_spaces;
384 ts = transform_spaces->first;
388 RNA_enum_item_add_separator(&item, &totitem);
390 for (; ts; ts = ts->next) {
391 tmp.identifier = ts->name;
394 RNA_enum_item_add(&item, &totitem, &tmp);
398 RNA_enum_item_end(&item, &totitem);
405 static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
407 View3D *v3d = (View3D *)(ptr->data);
408 bScreen *sc = (bScreen *)ptr->id.data;
410 v3d->scenelock = value;
414 v3d->lay = sc->scene->lay;
415 /* seek for layact */
418 if (v3d->lay & (1 << bit)) {
419 v3d->layact = 1 << bit;
424 v3d->camera = sc->scene->camera;
428 static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
430 View3D *v3d = (View3D *)(ptr->data);
431 bScreen *sc = (bScreen *)ptr->id.data;
432 Scene *scene = (Scene *)sc->scene;
433 const float *loc = ED_view3d_cursor3d_get(scene, v3d);
435 copy_v3_v3(values, loc);
438 static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
440 View3D *v3d = (View3D *)(ptr->data);
441 bScreen *sc = (bScreen *)ptr->id.data;
442 Scene *scene = (Scene *)sc->scene;
443 float *cursor = ED_view3d_cursor3d_get(scene, v3d);
445 copy_v3_v3(cursor, values);
448 static float rna_View3D_GridScaleUnit_get(PointerRNA *ptr)
450 View3D *v3d = (View3D *)(ptr->data);
451 bScreen *sc = (bScreen *)ptr->id.data;
452 Scene *scene = (Scene *)sc->scene;
454 return ED_view3d_grid_scale(scene, v3d, NULL);
457 static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
459 View3D *v3d = (View3D *)(ptr->data);
461 v3d->lay = ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
464 static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
466 DAG_on_visible_update(bmain, false);
469 static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *scene, PointerRNA *ptr)
471 View3D *v3d = (View3D *)(ptr->data);
472 ScrArea *sa = rna_area_from_space(ptr);
474 ED_view3d_shade_update(bmain, scene, v3d, sa);
477 static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
479 View3D *v3d = (View3D *)(ptr->data);
481 if (v3d->defmaterial) {
482 Material *ma = v3d->defmaterial;
485 BKE_previewimg_free(&ma->preview);
487 if (ma->gpumaterial.first)
488 GPU_material_free(&ma->gpumaterial);
490 WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
494 static void rna_SpaceView3D_matcap_enable(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
496 View3D *v3d = (View3D *)(ptr->data);
498 if (v3d->matcap_icon == 0)
499 v3d->matcap_icon = ICON_MATCAP_01;
502 static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
504 if (U.uiflag & USER_LOCKAROUND) {
505 View3D *v3d_act = (View3D *)(ptr->data);
507 /* TODO, space looper */
509 for (screen = bmain->screen.first; screen; screen = screen->id.next) {
511 for (sa = screen->areabase.first; sa; sa = sa->next) {
513 for (sl = sa->spacedata.first; sl; sl = sl->next) {
514 if (sl->spacetype == SPACE_VIEW3D) {
515 View3D *v3d = (View3D *)sl;
516 if (v3d != v3d_act) {
517 v3d->around = v3d_act->around;
518 v3d->flag = (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN);
519 ED_area_tag_redraw_regiontype(sa, RGN_TYPE_HEADER);
528 static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
530 View3D *v3d = (View3D *)(ptr->data);
531 ScrArea *sa = rna_area_from_space(ptr);
532 void *regiondata = NULL;
534 ListBase *regionbase = (sa->spacedata.first == v3d) ? &sa->regionbase : &v3d->regionbase;
535 ARegion *ar = regionbase->last; /* always last in list, weak .. */
536 regiondata = ar->regiondata;
539 return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
542 static void rna_SpaceView3D_region_quadviews_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
544 View3D *v3d = (View3D *)(ptr->data);
545 ScrArea *sa = rna_area_from_space(ptr);
548 ARegion *ar = ((sa && sa->spacedata.first == v3d) ? &sa->regionbase : &v3d->regionbase)->last;
549 ListBase lb = {NULL, NULL};
551 if (ar && ar->alignment == RGN_ALIGN_QSPLIT) {
561 rna_iterator_listbase_begin(iter, &lb, NULL);
564 static PointerRNA rna_SpaceView3D_region_quadviews_get(CollectionPropertyIterator *iter)
566 void *regiondata = ((ARegion *)rna_iterator_listbase_get(iter))->regiondata;
568 return rna_pointer_inherit_refine(&iter->parent, &RNA_RegionView3D, regiondata);
571 static void rna_RegionView3D_quadview_update(Main *UNUSED(main), Scene *UNUSED(scene), PointerRNA *ptr)
576 rna_area_region_from_regiondata(ptr, &sa, &ar);
577 if (sa && ar && ar->alignment == RGN_ALIGN_QSPLIT)
578 ED_view3d_quadview_update(sa, ar, false);
581 /* same as above but call clip==true */
582 static void rna_RegionView3D_quadview_clip_update(Main *UNUSED(main), Scene *UNUSED(scene), PointerRNA *ptr)
587 rna_area_region_from_regiondata(ptr, &sa, &ar);
588 if (sa && ar && ar->alignment == RGN_ALIGN_QSPLIT)
589 ED_view3d_quadview_update(sa, ar, true);
592 static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
594 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
595 negate_v3_v3(values, rv3d->ofs);
598 static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
600 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
601 negate_v3_v3(rv3d->ofs, values);
604 static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
606 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
607 invert_qt_qt(values, rv3d->viewquat);
610 static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
612 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
613 invert_qt_qt(rv3d->viewquat, values);
616 static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
618 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
620 invert_m4_m4(mat, (float (*)[4])values);
621 ED_view3d_from_m4(mat, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
624 static int rna_SpaceView3D_viewport_shade_get(PointerRNA *ptr)
626 Scene *scene = ((bScreen *)ptr->id.data)->scene;
627 RenderEngineType *type = RE_engines_find(scene->r.engine);
628 View3D *v3d = (View3D *)ptr->data;
629 int drawtype = v3d->drawtype;
631 if (drawtype == OB_RENDER && !(type && type->view_draw))
637 static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C), PointerRNA *ptr,
638 PropertyRNA *UNUSED(prop), bool *r_free)
640 Scene *scene = ((bScreen *)ptr->id.data)->scene;
641 RenderEngineType *type = RE_engines_find(scene->r.engine);
643 EnumPropertyItem *item = NULL;
646 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_BOUNDBOX);
647 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_WIRE);
648 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_SOLID);
649 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_TEXTURE);
650 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_MATERIAL);
652 if (type && type->view_draw)
653 RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_RENDER);
655 RNA_enum_item_end(&item, &totitem);
661 /* Space Image Editor */
663 static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
665 return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
668 static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
670 ED_space_image_paint_update(bmain->wm.first, scene->toolsettings);
673 static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
675 SpaceImage *sima = (SpaceImage *)(ptr->data);
676 return ED_space_image_show_render(sima);
679 static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
681 SpaceImage *sima = (SpaceImage *)(ptr->data);
682 return ED_space_image_show_paint(sima);
685 static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
687 SpaceImage *sima = (SpaceImage *)(ptr->data);
688 bScreen *sc = (bScreen *)ptr->id.data;
689 return ED_space_image_show_uvedit(sima, sc->scene->obedit);
692 static int rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
694 SpaceImage *sima = (SpaceImage *)(ptr->data);
695 bScreen *sc = (bScreen *)ptr->id.data;
696 return ED_space_image_check_show_maskedit(sc->scene, sima);
699 static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
701 SpaceImage *sima = (SpaceImage *)(ptr->data);
702 bScreen *sc = (bScreen *)ptr->id.data;
704 ED_space_image_set(sima, sc->scene, sc->scene->obedit, (Image *)value.data);
707 static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr, PointerRNA value)
709 SpaceImage *sima = (SpaceImage *)(ptr->data);
711 ED_space_image_set_mask(NULL, sima, (Mask *)value.data);
714 static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr,
715 PropertyRNA *UNUSED(prop), bool *r_free)
717 SpaceImage *sima = (SpaceImage *)ptr->data;
718 EnumPropertyItem *item = NULL;
721 int zbuf, alpha, totitem = 0;
723 ibuf = ED_space_image_acquire_buffer(sima, &lock);
725 alpha = ibuf && (ibuf->channels == 4);
726 zbuf = ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels == 1));
728 ED_space_image_release_buffer(sima, ibuf, lock);
731 return draw_channels_items;
734 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
735 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
736 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
739 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
740 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
743 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
746 RNA_enum_item_end(&item, &totitem);
752 static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
754 SpaceImage *sima = (SpaceImage *)ptr->data;
758 values[0] = values[1] = 1;
761 sa = rna_area_from_space(ptr); /* can be NULL */
762 ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
764 ED_space_image_get_zoom(sima, ar, &values[0], &values[1]);
768 static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
770 SpaceImage *sima = (SpaceImage *)ptr->data;
772 if (sima->flag & SI_COORDFLOATS) {
773 copy_v2_v2(values, sima->cursor);
777 ED_space_image_get_size(sima, &w, &h);
779 values[0] = sima->cursor[0] * w;
780 values[1] = sima->cursor[1] * h;
784 static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
786 SpaceImage *sima = (SpaceImage *)ptr->data;
788 if (sima->flag & SI_COORDFLOATS) {
789 copy_v2_v2(sima->cursor, values);
793 ED_space_image_get_size(sima, &w, &h);
795 sima->cursor[0] = values[0] / w;
796 sima->cursor[1] = values[1] / h;
800 static void rna_SpaceImageEditor_scopes_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
802 SpaceImage *sima = (SpaceImage *)ptr->data;
806 ibuf = ED_space_image_acquire_buffer(sima, &lock);
808 scopes_update(&sima->scopes, ibuf, &scene->view_settings, &scene->display_settings);
809 WM_main_add_notifier(NC_IMAGE, sima->image);
811 ED_space_image_release_buffer(sima, ibuf, lock);
814 static EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext *UNUSED(C), PointerRNA *ptr,
815 PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
817 static EnumPropertyItem pivot_items[] = {
818 {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
819 {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
820 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
821 {0, NULL, 0, NULL, NULL}
824 SpaceImage *sima = (SpaceImage *)ptr->data;
826 if (sima->mode == SI_MODE_PAINT)
827 return pivot_items_full;
832 /* Space Text Editor */
834 static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
836 SpaceText *st = (SpaceText *)(ptr->data);
838 st->wordwrap = value;
842 static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
844 SpaceText *st = (SpaceText *)(ptr->data);
846 st->text = value.data;
848 WM_main_add_notifier(NC_TEXT | NA_SELECTED, st->text);
851 static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
853 SpaceText *st = (SpaceText *)ptr->data;
856 WM_main_add_notifier(NC_TEXT | NA_EDITED, st->text);
860 /* Space Properties */
862 /* note: this function exists only to avoid id refcounting */
863 static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value)
865 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
866 sbuts->pinid = value.data;
869 static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
871 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
874 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
879 static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
881 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
882 ID *id = sbuts->pinid;
885 sbuts->flag &= ~SB_PIN_CONTEXT;
889 switch (GS(id->name)) {
891 WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL);
894 WM_main_add_notifier(NC_TEXTURE, NULL);
897 WM_main_add_notifier(NC_WORLD, NULL);
900 WM_main_add_notifier(NC_LAMP, NULL);
906 static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
908 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
910 sbuts->mainb = value;
911 sbuts->mainbuser = value;
914 static EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext *UNUSED(C), PointerRNA *ptr,
915 PropertyRNA *UNUSED(prop), bool *r_free)
917 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
918 EnumPropertyItem *item = NULL;
921 if (sbuts->pathflag & (1 << BCONTEXT_RENDER)) {
922 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER);
925 if (sbuts->pathflag & (1 << BCONTEXT_RENDER_LAYER)) {
926 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER_LAYER);
929 if (sbuts->pathflag & (1 << BCONTEXT_SCENE)) {
930 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_SCENE);
933 if (sbuts->pathflag & (1 << BCONTEXT_WORLD)) {
934 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORLD);
937 if (sbuts->pathflag & (1 << BCONTEXT_OBJECT)) {
938 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_OBJECT);
941 if (sbuts->pathflag & (1 << BCONTEXT_CONSTRAINT)) {
942 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_CONSTRAINT);
945 if (sbuts->pathflag & (1 << BCONTEXT_MODIFIER)) {
946 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_MODIFIER);
949 if (sbuts->pathflag & (1 << BCONTEXT_DATA)) {
950 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_DATA);
951 (item + totitem - 1)->icon = sbuts->dataicon;
954 if (sbuts->pathflag & (1 << BCONTEXT_BONE)) {
955 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_BONE);
958 if (sbuts->pathflag & (1 << BCONTEXT_BONE_CONSTRAINT)) {
959 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_BONE_CONSTRAINT);
962 if (sbuts->pathflag & (1 << BCONTEXT_MATERIAL)) {
963 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_MATERIAL);
966 if (sbuts->pathflag & (1 << BCONTEXT_TEXTURE)) {
967 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_TEXTURE);
970 if (sbuts->pathflag & (1 << BCONTEXT_PARTICLE)) {
971 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_PARTICLE);
974 if (sbuts->pathflag & (1 << BCONTEXT_PHYSICS)) {
975 RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_PHYSICS);
978 RNA_enum_item_end(&item, &totitem);
984 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
986 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
988 sbuts->align = value;
992 static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *UNUSED(ptr),
993 PropertyRNA *UNUSED(prop), bool *r_free)
995 EnumPropertyItem *item = NULL;
998 if (ED_texture_context_check_world(C)) {
999 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_WORLD);
1002 if (ED_texture_context_check_lamp(C)) {
1003 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_LAMP);
1005 else if (ED_texture_context_check_material(C)) {
1006 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_MATERIAL);
1009 if (ED_texture_context_check_particles(C)) {
1010 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_PARTICLES);
1013 if (ED_texture_context_check_linestyle(C)) {
1014 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_LINESTYLE);
1017 if (ED_texture_context_check_others(C)) {
1018 RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_OTHER);
1021 RNA_enum_item_end(&item, &totitem);
1027 static void rna_SpaceProperties_texture_context_set(PointerRNA *ptr, int value)
1029 SpaceButs *sbuts = (SpaceButs *)(ptr->data);
1031 /* User action, no need to keep "better" value in prev here! */
1032 sbuts->texture_context = sbuts->texture_context_prev = value;
1036 static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
1038 ConsoleLine *ci = (ConsoleLine *)ptr->data;
1039 memcpy(value, ci->line, ci->len + 1);
1042 static int rna_ConsoleLine_body_length(PointerRNA *ptr)
1044 ConsoleLine *ci = (ConsoleLine *)ptr->data;
1048 static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
1050 ConsoleLine *ci = (ConsoleLine *)ptr->data;
1051 int len = strlen(value);
1053 if ((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */
1054 MEM_freeN(ci->line);
1055 ci->line = MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
1056 ci->len_alloc = len + 1;
1058 memcpy(ci->line, value, len + 1);
1061 if (ci->cursor > len) /* clamp the cursor */
1065 static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max,
1066 int *UNUSED(softmin), int *UNUSED(softmax))
1068 ConsoleLine *ci = (ConsoleLine *)ptr->data;
1071 *max = ci->len; /* intentionally _not_ -1 */
1074 /* Space Dopesheet */
1076 static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
1078 SpaceAction *saction = (SpaceAction *)(ptr->data);
1079 bAction *act = (bAction *)value.data;
1081 if ((act == NULL) || (act->idroot == 0)) {
1082 /* just set if we're clearing the action or if the action is "amorphous" still */
1083 saction->action = act;
1086 /* action to set must strictly meet the mode criteria... */
1087 if (saction->mode == SACTCONT_ACTION) {
1088 /* currently, this is "object-level" only, until we have some way of specifying this */
1089 if (act->idroot == ID_OB)
1090 saction->action = act;
1092 printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n",
1095 else if (saction->mode == SACTCONT_SHAPEKEY) {
1096 /* as the name says, "shapekey-level" only... */
1097 if (act->idroot == ID_KE)
1098 saction->action = act;
1100 printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n",
1104 printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n");
1109 static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
1111 SpaceAction *saction = (SpaceAction *)(ptr->data);
1112 Object *obact = (scene->basact) ? scene->basact->object : NULL;
1114 /* we must set this action to be the one used by active object (if not pinned) */
1115 if (obact /* && saction->pin == 0*/) {
1116 AnimData *adt = NULL;
1118 if (saction->mode == SACTCONT_ACTION) {
1119 /* TODO: context selector could help decide this with more control? */
1120 adt = BKE_id_add_animdata(&obact->id); /* this only adds if non-existent */
1122 else if (saction->mode == SACTCONT_SHAPEKEY) {
1123 Key *key = BKE_key_from_object(obact);
1125 adt = BKE_id_add_animdata(&key->id); /* this only adds if non-existent */
1130 /* fix id-count of action we're replacing */
1131 id_us_min(&adt->action->id);
1133 /* show new id-count of action we're replacing */
1134 adt->action = saction->action;
1135 id_us_plus(&adt->action->id);
1137 /* force update of animdata */
1138 adt->recalc |= ADT_RECALC_ANIM;
1141 /* force depsgraph flush too */
1142 DAG_id_tag_update(&obact->id, OB_RECALC_OB | OB_RECALC_DATA);
1146 static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
1148 SpaceAction *saction = (SpaceAction *)(ptr->data);
1149 Object *obact = (scene->basact) ? scene->basact->object : NULL;
1151 /* special exceptions for ShapeKey Editor mode */
1152 if (saction->mode == SACTCONT_SHAPEKEY) {
1153 Key *key = BKE_key_from_object(obact);
1155 /* 1) update the action stored for the editor */
1157 saction->action = (key->adt) ? key->adt->action : NULL;
1159 saction->action = NULL;
1161 /* 2) enable 'show sliders' by default, since one of the main
1162 * points of the ShapeKey Editor is to provide a one-stop shop
1163 * for controlling the shapekeys, whose main control is the value
1165 saction->flag |= SACTION_SLIDERS;
1167 /* make sure action stored is valid */
1168 else if (saction->mode == SACTCONT_ACTION) {
1169 /* 1) update the action stored for the editor */
1170 /* TODO: context selector could help decide this with more control? */
1172 saction->action = (obact->adt) ? obact->adt->action : NULL;
1174 saction->action = NULL;
1177 /* recalculate extents of channel list */
1178 saction->flag |= SACTION_TEMP_NEEDCHANSYNC;
1181 /* Space Graph Editor */
1183 static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1185 ScrArea *sa = rna_area_from_space(ptr);
1187 /* after changing view mode, must force recalculation of F-Curve colors
1188 * which can only be achieved using refresh as opposed to redraw
1190 ED_area_tag_refresh(sa);
1193 static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
1195 SpaceIpo *sipo = (SpaceIpo *)(ptr->data);
1196 return (BLI_listbase_is_empty(&sipo->ghostCurves) == false);
1199 static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1201 ScrArea *sa = rna_area_from_space(ptr);
1202 ED_area_tag_refresh(sa);
1205 static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
1207 BGpic *bgpic = (BGpic *)ptr->data;
1208 return 1.0f - bgpic->blend;
1211 static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
1213 BGpic *bgpic = (BGpic *)ptr->data;
1214 bgpic->blend = 1.0f - value;
1217 static BGpic *rna_BackgroundImage_new(View3D *v3d)
1219 BGpic *bgpic = ED_view3D_background_image_new(v3d);
1221 WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
1226 static void rna_BackgroundImage_remove(View3D *v3d, ReportList *reports, PointerRNA *bgpic_ptr)
1228 BGpic *bgpic = bgpic_ptr->data;
1229 if (BLI_findindex(&v3d->bgpicbase, bgpic) == -1) {
1230 BKE_report(reports, RPT_ERROR, "Background image cannot be removed");
1233 ED_view3D_background_image_remove(v3d, bgpic);
1234 RNA_POINTER_INVALIDATE(bgpic_ptr);
1236 WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
1239 static void rna_BackgroundImage_clear(View3D *v3d)
1241 ED_view3D_background_image_clear(v3d);
1242 WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
1245 /* Space Node Editor */
1247 static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr, const PointerRNA value)
1249 SpaceNode *snode = (SpaceNode *)ptr->data;
1250 ED_node_tree_start(snode, (bNodeTree *)value.data, NULL, NULL);
1253 static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, const PointerRNA value)
1255 SpaceNode *snode = (SpaceNode *)ptr->data;
1256 bNodeTree *ntree = (bNodeTree *)value.data;
1258 /* node tree type must match the selected type in node editor */
1259 return (strcmp(snode->tree_idname, ntree->idname) == 0);
1262 static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA *UNUSED(ptr))
1264 ED_node_tree_update(C);
1267 static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr)
1269 SpaceNode *snode = (SpaceNode *)ptr->data;
1270 return rna_node_tree_idname_to_enum(snode->tree_idname);
1272 static void rna_SpaceNodeEditor_tree_type_set(PointerRNA *ptr, int value)
1274 SpaceNode *snode = (SpaceNode *)ptr->data;
1275 ED_node_set_tree_type(snode, rna_node_tree_type_from_enum(value));
1277 static int rna_SpaceNodeEditor_tree_type_poll(void *Cv, bNodeTreeType *type)
1279 bContext *C = (bContext *)Cv;
1281 return type->poll(C, type);
1285 static EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C, PointerRNA *UNUSED(ptr),
1286 PropertyRNA *UNUSED(prop), bool *r_free)
1288 return rna_node_tree_type_itemf(C, rna_SpaceNodeEditor_tree_type_poll, r_free);
1291 static void rna_SpaceNodeEditor_path_get(PointerRNA *ptr, char *value)
1293 SpaceNode *snode = ptr->data;
1294 ED_node_tree_path_get(snode, value);
1297 static int rna_SpaceNodeEditor_path_length(PointerRNA *ptr)
1299 SpaceNode *snode = ptr->data;
1300 return ED_node_tree_path_length(snode);
1303 static void rna_SpaceNodeEditor_path_clear(SpaceNode *snode, bContext *C)
1305 ED_node_tree_start(snode, NULL, NULL, NULL);
1306 ED_node_tree_update(C);
1309 static void rna_SpaceNodeEditor_path_start(SpaceNode *snode, bContext *C, PointerRNA *node_tree)
1311 ED_node_tree_start(snode, (bNodeTree *)node_tree->data, NULL, NULL);
1312 ED_node_tree_update(C);
1315 static void rna_SpaceNodeEditor_path_append(SpaceNode *snode, bContext *C, PointerRNA *node_tree, PointerRNA *node)
1317 ED_node_tree_push(snode, node_tree->data, node->data);
1318 ED_node_tree_update(C);
1321 static void rna_SpaceNodeEditor_path_pop(SpaceNode *snode, bContext *C)
1323 ED_node_tree_pop(snode);
1324 ED_node_tree_update(C);
1327 static void rna_SpaceNodeEditor_show_backdrop_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
1329 WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
1330 WM_main_add_notifier(NC_SCENE | ND_NODES, NULL);
1333 static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode, bContext *C, int x, int y)
1335 ARegion *ar = CTX_wm_region(C);
1337 UI_view2d_region_to_view(&ar->v2d, x, y, &snode->cursor[0], &snode->cursor[1]);
1338 snode->cursor[0] /= UI_DPI_FAC;
1339 snode->cursor[1] /= UI_DPI_FAC;
1342 static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
1344 SpaceClip *sc = (SpaceClip *)(ptr->data);
1345 bScreen *screen = (bScreen *)ptr->id.data;
1347 ED_space_clip_set_clip(NULL, screen, sc, (MovieClip *)value.data);
1350 static void rna_SpaceClipEditor_mask_set(PointerRNA *ptr, PointerRNA value)
1352 SpaceClip *sc = (SpaceClip *)(ptr->data);
1354 ED_space_clip_set_mask(NULL, sc, (Mask *)value.data);
1357 static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1359 SpaceClip *sc = (SpaceClip *)(ptr->data);
1364 static void rna_SpaceClipEditor_lock_selection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1366 SpaceClip *sc = (SpaceClip *)(ptr->data);
1372 static void rna_SpaceClipEditor_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1374 ScrArea *sa = rna_area_from_space(ptr);
1375 ED_area_tag_refresh(sa);
1380 static EnumPropertyItem dt_uv_items[] = {
1381 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"},
1382 {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"},
1383 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"},
1384 {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"},
1385 {0, NULL, 0, NULL, NULL}
1388 static void rna_def_space(BlenderRNA *brna)
1393 srna = RNA_def_struct(brna, "Space", NULL);
1394 RNA_def_struct_sdna(srna, "SpaceLink");
1395 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
1396 RNA_def_struct_refine_func(srna, "rna_Space_refine");
1398 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1399 RNA_def_property_enum_sdna(prop, NULL, "spacetype");
1400 RNA_def_property_enum_items(prop, space_type_items);
1401 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1402 RNA_def_property_ui_text(prop, "Type", "Space data type");
1404 /* access to V2D_VIEWSYNC_SCREEN_TIME */
1405 prop = RNA_def_property(srna, "show_locked_time", PROP_BOOLEAN, PROP_NONE);
1406 RNA_def_property_boolean_funcs(prop, "rna_Space_view2d_sync_get", "rna_Space_view2d_sync_set");
1407 RNA_def_property_ui_text(prop, "Lock Time to Other Windows", "");
1408 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Space_view2d_sync_update");
1411 /* for all spaces that use a mask */
1412 static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *mask_set_func)
1416 static EnumPropertyItem overlay_mode_items[] = {
1417 {MASK_OVERLAY_ALPHACHANNEL, "ALPHACHANNEL", ICON_NONE, "Alpha Channel", "Show alpha channel of the mask"},
1418 {MASK_OVERLAY_COMBINED, "COMBINED", ICON_NONE, "Combined", "Combine space background image with the mask"},
1419 {0, NULL, 0, NULL, NULL}
1422 prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
1423 RNA_def_property_pointer_sdna(prop, NULL, "mask_info.mask");
1424 RNA_def_property_flag(prop, PROP_EDITABLE);
1425 RNA_def_property_ui_text(prop, "Mask", "Mask displayed and edited in this space");
1426 RNA_def_property_pointer_funcs(prop, NULL, mask_set_func, NULL, NULL);
1427 RNA_def_property_update(prop, noteflag, NULL);
1430 prop = RNA_def_property(srna, "mask_draw_type", PROP_ENUM, PROP_NONE);
1431 RNA_def_property_enum_sdna(prop, NULL, "mask_info.draw_type");
1432 RNA_def_property_enum_items(prop, dt_uv_items);
1433 RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for mask splines");
1434 RNA_def_property_update(prop, noteflag, NULL);
1436 prop = RNA_def_property(srna, "show_mask_smooth", PROP_BOOLEAN, PROP_NONE);
1437 RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_SMOOTH);
1438 RNA_def_property_ui_text(prop, "Draw Smooth Splines", "");
1439 RNA_def_property_update(prop, noteflag, NULL);
1441 prop = RNA_def_property(srna, "show_mask_overlay", PROP_BOOLEAN, PROP_NONE);
1442 RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_OVERLAY);
1443 RNA_def_property_ui_text(prop, "Show Mask Overlay", "");
1444 RNA_def_property_update(prop, noteflag, NULL);
1446 prop = RNA_def_property(srna, "mask_overlay_mode", PROP_ENUM, PROP_NONE);
1447 RNA_def_property_enum_sdna(prop, NULL, "mask_info.overlay_mode");
1448 RNA_def_property_enum_items(prop, overlay_mode_items);
1449 RNA_def_property_ui_text(prop, "Overlay Mode", "Overlay mode of rasterized mask");
1450 RNA_def_property_update(prop, noteflag, NULL);
1453 static void rna_def_space_image_uv(BlenderRNA *brna)
1458 static EnumPropertyItem sticky_mode_items[] = {
1459 {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled"},
1460 {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location",
1461 "Select UVs that are at the same location and share a mesh vertex"},
1462 {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex",
1463 "Select UVs that share mesh vertex, irrespective if they are in the same location"},
1464 {0, NULL, 0, NULL, NULL}
1467 static EnumPropertyItem dt_uvstretch_items[] = {
1468 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
1469 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
1470 {0, NULL, 0, NULL, NULL}
1473 srna = RNA_def_struct(brna, "SpaceUVEditor", NULL);
1474 RNA_def_struct_sdna(srna, "SpaceImage");
1475 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
1476 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
1479 prop = RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
1480 RNA_def_property_enum_sdna(prop, NULL, "sticky");
1481 RNA_def_property_enum_items(prop, sticky_mode_items);
1482 RNA_def_property_ui_text(prop, "Sticky Selection Mode",
1483 "Automatically select also UVs sharing the same vertex as the ones being selected");
1484 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1487 prop = RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
1488 RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
1489 RNA_def_property_enum_items(prop, dt_uv_items);
1490 RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges");
1491 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1493 prop = RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
1494 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
1495 RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased");
1496 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1498 prop = RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
1499 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
1500 RNA_def_property_ui_text(prop, "Draw Stretch",
1501 "Draw faces colored according to the difference in shape between UVs and "
1502 "their 3D coordinates (blue for low distortion, red for high distortion)");
1503 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1505 prop = RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
1506 RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
1507 RNA_def_property_enum_items(prop, dt_uvstretch_items);
1508 RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw");
1509 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1511 prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
1512 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
1513 RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied");
1514 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1516 prop = RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
1517 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
1518 RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
1519 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1521 prop = RNA_def_property(srna, "show_texpaint", PROP_BOOLEAN, PROP_NONE);
1522 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAW_TEXPAINT);
1523 RNA_def_property_ui_text(prop, "Draw Texture Paint UVs", "Draw overlay of texture paint uv layer");
1524 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1526 prop = RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
1527 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
1528 RNA_def_property_ui_text(prop, "Normalized Coordinates",
1529 "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
1530 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1532 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
1533 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES);
1534 RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image");
1535 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1537 /* todo: move edge and face drawing options here from G.f */
1539 prop = RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
1540 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
1541 RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing");
1542 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1544 prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
1545 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
1546 RNA_def_property_ui_text(prop, "Constrain to Image Bounds",
1547 "Constraint to stay within the image bounds while editing");
1548 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1550 prop = RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
1551 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
1552 RNA_def_property_ui_text(prop, "Live Unwrap",
1553 "Continuously unwrap the selected UV island while transforming pinned vertices");
1554 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
1557 static void rna_def_space_outliner(BlenderRNA *brna)
1562 static EnumPropertyItem display_mode_items[] = {
1563 {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display datablocks in all scenes"},
1564 {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display datablocks in current scene"},
1565 {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display datablocks in visible layers"},
1566 {SO_SELECTED, "SELECTED", 0, "Selected", "Display datablocks of selected objects"},
1567 {SO_ACTIVE, "ACTIVE", 0, "Active", "Display datablocks of active object"},
1568 {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types",
1569 "Display datablocks of all objects of same type as selected object"},
1570 {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their datablocks"},
1571 {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence datablocks"},
1572 {SO_LIBRARIES, "LIBRARIES", 0, "Blender File", "Display data of current file and linked libraries"},
1573 {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", "Display all raw datablocks"},
1574 {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display the user preference datablocks"},
1575 {0, NULL, 0, NULL, NULL}
1578 srna = RNA_def_struct(brna, "SpaceOutliner", "Space");
1579 RNA_def_struct_sdna(srna, "SpaceOops");
1580 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
1582 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
1583 RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
1584 RNA_def_property_enum_items(prop, display_mode_items);
1585 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
1586 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1588 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
1589 RNA_def_property_string_sdna(prop, NULL, "search_string");
1590 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
1591 RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE);
1592 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1594 prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
1595 RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE);
1596 RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
1597 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1599 prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
1600 RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE);
1601 RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
1602 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1604 prop = RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
1605 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
1606 RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
1607 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
1610 static void rna_def_background_image(BlenderRNA *brna)
1615 /* note: combinations work but don't flip so arnt that useful */
1616 static EnumPropertyItem bgpic_axis_items[] = {
1617 {0, "", 0, N_("X Axis"), ""},
1618 {(1 << RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"},
1619 {(1 << RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", "Show background image while looking to the right"},
1620 /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/
1621 {0, "", 0, N_("Y Axis"), ""},
1622 {(1 << RV3D_VIEW_BACK), "BACK", 0, "Back", "Show background image in back view"},
1623 {(1 << RV3D_VIEW_FRONT), "FRONT", 0, "Front", "Show background image in front view"},
1624 /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/
1625 {0, "", 0, N_("Z Axis"), ""},
1626 {(1 << RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", "Show background image in bottom view"},
1627 {(1 << RV3D_VIEW_TOP), "TOP", 0, "Top", "Show background image in top view"},
1628 /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/
1629 {0, "", 0, N_("Other"), ""},
1630 {0, "ALL", 0, "All Views", "Show background image in all views"},
1631 {(1 << RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"},
1632 {0, NULL, 0, NULL, NULL}
1635 static EnumPropertyItem bgpic_source_items[] = {
1636 {V3D_BGPIC_IMAGE, "IMAGE", 0, "Image", ""},
1637 {V3D_BGPIC_MOVIE, "MOVIE_CLIP", 0, "Movie Clip", ""},
1638 {0, NULL, 0, NULL, NULL}
1641 static const EnumPropertyItem bgpic_camera_frame_items[] = {
1642 {0, "STRETCH", 0, "Stretch", ""},
1643 {V3D_BGPIC_CAMERA_ASPECT, "FIT", 0, "Fit", ""},
1644 {V3D_BGPIC_CAMERA_ASPECT | V3D_BGPIC_CAMERA_CROP, "CROP", 0, "Crop", ""},
1645 {0, NULL, 0, NULL, NULL}
1648 static const EnumPropertyItem bgpic_draw_depth_items[] = {
1649 {0, "BACK", 0, "Back", ""},
1650 {V3D_BGPIC_FOREGROUND, "FRONT", 0, "Front", ""},
1651 {0, NULL, 0, NULL, NULL}
1654 srna = RNA_def_struct(brna, "BackgroundImage", NULL);
1655 RNA_def_struct_sdna(srna, "BGpic");
1656 RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3D View background");
1658 prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
1659 RNA_def_property_enum_sdna(prop, NULL, "source");
1660 RNA_def_property_enum_items(prop, bgpic_source_items);
1661 RNA_def_property_ui_text(prop, "Background Source", "Data source used for background");
1662 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1664 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
1665 RNA_def_property_pointer_sdna(prop, NULL, "ima");
1666 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
1667 RNA_def_property_flag(prop, PROP_EDITABLE);
1668 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1670 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
1671 RNA_def_property_pointer_sdna(prop, NULL, "clip");
1672 RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space");
1673 RNA_def_property_flag(prop, PROP_EDITABLE);
1674 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1676 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
1677 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1678 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
1679 RNA_def_property_ui_text(prop, "Image User",
1680 "Parameters defining which layer, pass and frame of the image is displayed");
1681 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1683 prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
1684 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1685 RNA_def_property_struct_type(prop, "MovieClipUser");
1686 RNA_def_property_pointer_sdna(prop, NULL, "cuser");
1687 RNA_def_property_ui_text(prop, "Clip User", "Parameters defining which frame of the movie clip is displayed");
1688 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1690 prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
1691 RNA_def_property_float_sdna(prop, NULL, "xof");
1692 RNA_def_property_ui_text(prop, "X Offset", "Offset image horizontally from the world origin");
1693 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1695 prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
1696 RNA_def_property_float_sdna(prop, NULL, "yof");
1697 RNA_def_property_ui_text(prop, "Y Offset", "Offset image vertically from the world origin");
1698 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1700 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
1701 RNA_def_property_float_sdna(prop, NULL, "size");
1702 RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image");
1703 RNA_def_property_range(prop, 0.0, FLT_MAX);
1704 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1706 prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
1707 RNA_def_property_float_sdna(prop, NULL, "blend");
1708 RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);
1709 RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color");
1710 RNA_def_property_range(prop, 0.0, 1.0);
1711 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1713 prop = RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
1714 RNA_def_property_enum_sdna(prop, NULL, "view");
1715 RNA_def_property_enum_items(prop, bgpic_axis_items);
1716 RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the image on");
1717 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1719 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
1720 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED);
1721 RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
1722 RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
1724 prop = RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE);
1725 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_CAMERACLIP);
1726 RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera");
1727 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1729 prop = RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE);
1730 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_BGPIC_DISABLED);
1731 RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background");
1732 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1734 prop = RNA_def_property(srna, "show_on_foreground", PROP_BOOLEAN, PROP_NONE);
1735 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_FOREGROUND);
1736 RNA_def_property_ui_text(prop, "Show On Foreground", "Show this image in front of objects in viewport");
1737 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1739 /* expose 1 flag as a enum of 2 items */
1740 prop = RNA_def_property(srna, "draw_depth", PROP_ENUM, PROP_NONE);
1741 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1742 RNA_def_property_enum_items(prop, bgpic_draw_depth_items);
1743 RNA_def_property_ui_text(prop, "Depth", "Draw under or over everything");
1744 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1746 /* expose 2 flags as a enum of 3 items */
1747 prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE);
1748 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1749 RNA_def_property_enum_items(prop, bgpic_camera_frame_items);
1750 RNA_def_property_ui_text(prop, "Frame Method", "How the image fits in the camera frame");
1751 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1754 static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop)
1760 RNA_def_property_srna(cprop, "BackgroundImages");
1761 srna = RNA_def_struct(brna, "BackgroundImages", NULL);
1762 RNA_def_struct_sdna(srna, "View3D");
1763 RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images");
1765 func = RNA_def_function(srna, "new", "rna_BackgroundImage_new");
1766 RNA_def_function_ui_description(func, "Add new background image");
1767 parm = RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
1768 RNA_def_function_return(func, parm);
1770 func = RNA_def_function(srna, "remove", "rna_BackgroundImage_remove");
1771 RNA_def_function_ui_description(func, "Remove background image");
1772 RNA_def_function_flag(func, FUNC_USE_REPORTS);
1773 parm = RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
1774 RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
1775 RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
1777 func = RNA_def_function(srna, "clear", "rna_BackgroundImage_clear");
1778 RNA_def_function_ui_description(func, "Remove all background images");
1782 static void rna_def_space_view3d(BlenderRNA *brna)
1787 static EnumPropertyItem manipulators_items[] = {
1788 {V3D_MANIP_TRANSLATE, "TRANSLATE", ICON_MAN_TRANS, "Translate",
1789 "Use the manipulator for movement transformations"},
1790 {V3D_MANIP_ROTATE, "ROTATE", ICON_MAN_ROT, "Rotate",
1791 "Use the manipulator for rotation transformations"},
1792 {V3D_MANIP_SCALE, "SCALE", ICON_MAN_SCALE, "Scale",
1793 "Use the manipulator for scale transformations"},
1794 {0, NULL, 0, NULL, NULL}
1797 static EnumPropertyItem rv3d_persp_items[] = {
1798 {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
1799 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
1800 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
1801 {0, NULL, 0, NULL, NULL}
1804 static EnumPropertyItem bundle_drawtype_items[] = {
1805 {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
1806 {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
1807 {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
1808 {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
1809 {OB_CUBE, "CUBE", 0, "Cube", ""},
1810 {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
1811 {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
1812 {0, NULL, 0, NULL, NULL}
1815 static EnumPropertyItem view3d_matcap_items[] = {
1816 {ICON_MATCAP_01, "01", ICON_MATCAP_01, "", ""},
1817 {ICON_MATCAP_02, "02", ICON_MATCAP_02, "", ""},
1818 {ICON_MATCAP_03, "03", ICON_MATCAP_03, "", ""},
1819 {ICON_MATCAP_04, "04", ICON_MATCAP_04, "", ""},
1820 {ICON_MATCAP_05, "05", ICON_MATCAP_05, "", ""},
1821 {ICON_MATCAP_06, "06", ICON_MATCAP_06, "", ""},
1822 {ICON_MATCAP_07, "07", ICON_MATCAP_07, "", ""},
1823 {ICON_MATCAP_08, "08", ICON_MATCAP_08, "", ""},
1824 {ICON_MATCAP_09, "09", ICON_MATCAP_09, "", ""},
1825 {ICON_MATCAP_10, "10", ICON_MATCAP_10, "", ""},
1826 {ICON_MATCAP_11, "11", ICON_MATCAP_11, "", ""},
1827 {ICON_MATCAP_12, "12", ICON_MATCAP_12, "", ""},
1828 {ICON_MATCAP_13, "13", ICON_MATCAP_13, "", ""},
1829 {ICON_MATCAP_14, "14", ICON_MATCAP_14, "", ""},
1830 {ICON_MATCAP_15, "15", ICON_MATCAP_15, "", ""},
1831 {ICON_MATCAP_16, "16", ICON_MATCAP_16, "", ""},
1832 {ICON_MATCAP_17, "17", ICON_MATCAP_17, "", ""},
1833 {ICON_MATCAP_18, "18", ICON_MATCAP_18, "", ""},
1834 {ICON_MATCAP_19, "19", ICON_MATCAP_19, "", ""},
1835 {ICON_MATCAP_20, "20", ICON_MATCAP_20, "", ""},
1836 {ICON_MATCAP_21, "21", ICON_MATCAP_21, "", ""},
1837 {ICON_MATCAP_22, "22", ICON_MATCAP_22, "", ""},
1838 {ICON_MATCAP_23, "23", ICON_MATCAP_23, "", ""},
1839 {ICON_MATCAP_24, "24", ICON_MATCAP_24, "", ""},
1840 {0, NULL, 0, NULL, NULL}
1844 srna = RNA_def_struct(brna, "SpaceView3D", "Space");
1845 RNA_def_struct_sdna(srna, "View3D");
1846 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
1848 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
1849 RNA_def_property_flag(prop, PROP_EDITABLE);
1850 RNA_def_property_pointer_sdna(prop, NULL, "camera");
1851 RNA_def_property_ui_text(prop, "Camera",
1852 "Active camera used in this view (when unlocked from the scene's active camera)");
1853 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1856 prop = RNA_def_property(srna, "use_render_border", PROP_BOOLEAN, PROP_NONE);
1857 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_BORDER);
1858 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1859 RNA_def_property_ui_text(prop, "Render Border", "Use a region within the frame size for rendered viewport "
1860 "(when not viewing through the camera)");
1861 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1863 prop = RNA_def_property(srna, "render_border_min_x", PROP_FLOAT, PROP_NONE);
1864 RNA_def_property_float_sdna(prop, NULL, "render_border.xmin");
1865 RNA_def_property_range(prop, 0.0f, 1.0f);
1866 RNA_def_property_ui_text(prop, "Border Minimum X", "Minimum X value to for the render border");
1867 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1869 prop = RNA_def_property(srna, "render_border_min_y", PROP_FLOAT, PROP_NONE);
1870 RNA_def_property_float_sdna(prop, NULL, "render_border.ymin");
1871 RNA_def_property_range(prop, 0.0f, 1.0f);
1872 RNA_def_property_ui_text(prop, "Border Minimum Y", "Minimum Y value for the render border");
1873 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1875 prop = RNA_def_property(srna, "render_border_max_x", PROP_FLOAT, PROP_NONE);
1876 RNA_def_property_float_sdna(prop, NULL, "render_border.xmax");
1877 RNA_def_property_range(prop, 0.0f, 1.0f);
1878 RNA_def_property_ui_text(prop, "Border Maximum X", "Maximum X value for the render border");
1879 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1881 prop = RNA_def_property(srna, "render_border_max_y", PROP_FLOAT, PROP_NONE);
1882 RNA_def_property_float_sdna(prop, NULL, "render_border.ymax");
1883 RNA_def_property_range(prop, 0.0f, 1.0f);
1884 RNA_def_property_ui_text(prop, "Border Maximum Y", "Maximum Y value for the render border");
1885 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1887 prop = RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
1888 RNA_def_property_flag(prop, PROP_EDITABLE);
1889 RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
1890 RNA_def_property_ui_text(prop, "Lock to Object", "3D View center is locked to this object's position");
1891 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1893 prop = RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
1894 RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone");
1895 RNA_def_property_ui_text(prop, "Lock to Bone", "3D View center is locked to this bone's position");
1896 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1898 prop = RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
1899 RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1);
1900 RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
1901 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1903 prop = RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
1904 RNA_def_property_enum_sdna(prop, NULL, "drawtype");
1905 RNA_def_property_enum_items(prop, viewport_shade_items);
1906 RNA_def_property_enum_funcs(prop, "rna_SpaceView3D_viewport_shade_get", NULL,
1907 "rna_SpaceView3D_viewport_shade_itemf");
1908 RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
1909 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_viewport_shade_update");
1911 prop = RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
1912 RNA_def_property_pointer_sdna(prop, NULL, "localvd");
1913 RNA_def_property_ui_text(prop, "Local View",
1914 "Display an isolated sub-set of objects, apart from the scene visibility");
1916 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
1917 RNA_def_property_array(prop, 3);
1918 RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", NULL);
1919 RNA_def_property_ui_text(prop, "3D Cursor Location",
1920 "3D cursor location for this view (dependent on local view setting)");
1921 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
1922 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1924 prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_UNIT_CAMERA);
1925 RNA_def_property_float_sdna(prop, NULL, "lens");
1926 RNA_def_property_ui_text(prop, "Lens", "Viewport lens angle");
1927 RNA_def_property_range(prop, 1.0f, 250.0f);
1928 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1930 prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
1931 RNA_def_property_float_sdna(prop, NULL, "near");
1932 RNA_def_property_range(prop, 0.001f, FLT_MAX);
1933 RNA_def_property_float_default(prop, 0.1f);
1934 RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance (perspective view only)");
1935 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1937 prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
1938 RNA_def_property_float_sdna(prop, NULL, "far");
1939 RNA_def_property_range(prop, 1.0f, FLT_MAX);
1940 RNA_def_property_float_default(prop, 1000.0f);
1941 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
1942 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1944 prop = RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
1945 RNA_def_property_float_sdna(prop, NULL, "grid");
1946 RNA_def_property_ui_text(prop, "Grid Scale", "Distance between 3D View grid lines");
1947 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1948 RNA_def_property_ui_range(prop, 0.001f, 1000.0f, 0.1f, 3);
1949 RNA_def_property_float_default(prop, 1.0f);
1950 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1952 prop = RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
1953 RNA_def_property_int_sdna(prop, NULL, "gridlines");
1954 RNA_def_property_ui_text(prop, "Grid Lines", "Number of grid lines to display in perspective view");
1955 RNA_def_property_range(prop, 0, 1024);
1956 RNA_def_property_int_default(prop, 16);
1957 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1959 prop = RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
1960 RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
1961 RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
1962 RNA_def_property_range(prop, 1, 1024);
1963 RNA_def_property_int_default(prop, 10);
1964 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1966 prop = RNA_def_property(srna, "grid_scale_unit", PROP_FLOAT, PROP_NONE);
1967 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1968 RNA_def_property_float_funcs(prop, "rna_View3D_GridScaleUnit_get", NULL, NULL);
1969 RNA_def_property_ui_text(prop, "Grid Scale Unit", "Grid cell size scaled by scene unit system settings");
1971 prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
1972 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
1973 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
1974 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1976 prop = RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
1977 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
1978 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
1979 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1981 prop = RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
1982 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
1983 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view");
1984 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1986 prop = RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
1987 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
1988 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view");
1989 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1991 prop = RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
1992 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
1993 RNA_def_property_ui_text(prop, "Outline Selected",
1994 "Show an outline highlight around selected objects in non-wireframe views");
1995 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
1997 prop = RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
1998 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
1999 RNA_def_property_ui_text(prop, "All Object Origins",
2000 "Show the object origin center dot for all (selected and unselected) objects");
2001 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2003 prop = RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
2004 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
2005 RNA_def_property_ui_text(prop, "Relationship Lines",
2006 "Show dashed lines indicating parent or constraint relationships");
2007 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2009 prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
2010 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_GPENCIL);
2011 RNA_def_property_ui_text(prop, "Show Grease Pencil",
2012 "Show grease pencil for this view");
2013 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2015 prop = RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
2016 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
2017 RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
2018 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2020 prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE);
2021 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_BACKFACE_CULLING);
2022 RNA_def_property_ui_text(prop, "Backface Culling", "Use back face culling to hide the back side of faces");
2023 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2025 prop = RNA_def_property(srna, "show_textured_shadeless", PROP_BOOLEAN, PROP_NONE);
2026 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHADELESS_TEX);
2027 RNA_def_property_ui_text(prop, "Shadeless", "Show shadeless texture without lighting in textured draw mode");
2028 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2030 prop = RNA_def_property(srna, "show_occlude_wire", PROP_BOOLEAN, PROP_NONE);
2031 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_OCCLUDE_WIRE);
2032 RNA_def_property_ui_text(prop, "Hidden Wire", "Use hidden wireframe display");
2033 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2035 prop = RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
2036 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA);
2037 RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view");
2038 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2040 prop = RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
2041 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE);
2042 RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
2043 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2045 prop = RNA_def_property(srna, "show_world", PROP_BOOLEAN, PROP_NONE);
2046 RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_SHOW_WORLD);
2047 RNA_def_property_ui_text(prop, "World Background", "Display world colors in the background");
2048 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2050 prop = RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
2051 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT);
2052 RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");
2053 RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
2054 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2056 prop = RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
2057 RNA_def_property_collection_sdna(prop, NULL, "bgpicbase", NULL);
2058 RNA_def_property_struct_type(prop, "BackgroundImage");
2059 RNA_def_property_ui_text(prop, "Background Images", "List of background images");
2060 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2061 rna_def_backgroundImages(brna, prop);
2063 prop = RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
2064 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS);
2065 RNA_def_property_ui_text(prop, "Display Background Images",
2066 "Display reference images behind objects in the 3D View");
2067 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2069 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
2070 RNA_def_property_enum_sdna(prop, NULL, "around");
2071 RNA_def_property_enum_items(prop, pivot_items_full);
2072 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
2073 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
2075 prop = RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
2076 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
2077 RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object and pose mode only)");
2078 RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
2079 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
2081 prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
2082 RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
2083 RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
2084 RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
2085 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2087 prop = RNA_def_property(srna, "transform_manipulators", PROP_ENUM, PROP_NONE);
2088 RNA_def_property_enum_sdna(prop, NULL, "twtype");
2089 RNA_def_property_enum_items(prop, manipulators_items);
2090 RNA_def_property_flag(prop, PROP_ENUM_FLAG);
2091 RNA_def_property_ui_text(prop, "Transform Manipulators", "Transformation manipulators");
2092 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2094 prop = RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
2095 RNA_def_property_enum_sdna(prop, NULL, "twmode");
2096 RNA_def_property_enum_items(prop, transform_orientation_items);
2097 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_itemf");
2098 RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation");
2099 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2101 prop = RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
2102 RNA_def_property_struct_type(prop, "TransformOrientation");
2103 RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
2104 RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current transformation orientation");
2106 prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
2107 RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
2108 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
2109 RNA_def_property_ui_text(prop, "Lock Camera and Layers",
2110 "Use the scene's active camera and layers in this view, rather than local layers");
2111 RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
2112 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2114 prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2115 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
2116 RNA_def_property_array(prop, 20);
2117 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set");
2118 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
2119 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_layer_update");
2121 prop = RNA_def_property(srna, "layers_local_view", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2122 RNA_def_property_boolean_sdna(prop, NULL, "lay", 0x01000000);
2123 RNA_def_property_array(prop, 8);
2124 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2125 RNA_def_property_ui_text(prop, "Local View Layers", "Local view layers visible in this 3D View");
2127 prop = RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2128 RNA_def_property_boolean_sdna(prop, NULL, "lay_used", 1);
2129 RNA_def_property_array(prop, 20);
2130 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2131 RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something");
2133 prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
2134 RNA_def_property_struct_type(prop, "RegionView3D");
2135 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
2136 RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region");
2138 prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE);
2139 RNA_def_property_struct_type(prop, "RegionView3D");
2140 RNA_def_property_collection_funcs(prop, "rna_SpaceView3D_region_quadviews_begin", "rna_iterator_listbase_next",
2141 "rna_iterator_listbase_end", "rna_SpaceView3D_region_quadviews_get",
2142 NULL, NULL, NULL, NULL);
2143 RNA_def_property_ui_text(prop, "Quad View Regions", "3D regions (the third one defines quad view settings, "
2144 "the forth one is same as 'region_3d')");
2146 prop = RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
2147 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_RECONSTRUCTION);
2148 RNA_def_property_ui_text(prop, "Show Reconstruction", "Display reconstruction data from active movie clip");
2149 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2151 prop = RNA_def_property(srna, "tracks_draw_size", PROP_FLOAT, PROP_NONE);
2152 RNA_def_property_range(prop, 0.0, FLT_MAX);
2153 RNA_def_property_ui_range(prop, 0, 5, 1, 3);
2154 RNA_def_property_float_sdna(prop, NULL, "bundle_size");
2155 RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data");
2156 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2158 prop = RNA_def_property(srna, "tracks_draw_type", PROP_ENUM, PROP_NONE);
2159 RNA_def_property_enum_sdna(prop, NULL, "bundle_drawtype");
2160 RNA_def_property_enum_items(prop, bundle_drawtype_items);
2161 RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks");
2162 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2164 prop = RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
2165 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_CAMERAPATH);
2166 RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path");
2167 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2169 prop = RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
2170 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_BUNDLENAME);
2171 RNA_def_property_ui_text(prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
2172 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2174 prop = RNA_def_property(srna, "use_matcap", PROP_BOOLEAN, PROP_NONE);
2175 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_MATCAP);
2176 RNA_def_property_ui_text(prop, "Matcap", "Active Objects draw images mapped on normals, enhancing Solid Draw Mode");
2177 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_matcap_enable");
2179 prop = RNA_def_property(srna, "matcap_icon", PROP_ENUM, PROP_NONE);
2180 RNA_def_property_enum_sdna(prop, NULL, "matcap_icon");
2181 RNA_def_property_enum_items(prop, view3d_matcap_items);
2182 RNA_def_property_ui_text(prop, "Matcap", "Image to use for Material Capture, active objects only");
2183 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_matcap_update");
2187 srna = RNA_def_struct(brna, "RegionView3D", NULL);
2188 RNA_def_struct_sdna(srna, "RegionView3D");
2189 RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
2191 prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
2192 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED);
2193 RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views");
2194 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
2196 prop = RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
2197 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW);
2198 RNA_def_property_ui_text(prop, "Box", "Sync view position between side views");
2199 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
2201 prop = RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
2202 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
2203 RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
2204 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
2206 prop = RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
2207 RNA_def_property_float_sdna(prop, NULL, "persmat");
2208 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* XXX: for now, it's too risky for users to do this */
2209 RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
2210 RNA_def_property_ui_text(prop, "Perspective Matrix", "Current perspective matrix of the 3D region");
2212 prop = RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
2213 RNA_def_property_float_sdna(prop, NULL, "viewmat");
2214 RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
2215 RNA_def_property_float_funcs(prop, NULL, "rna_RegionView3D_view_matrix_set", NULL);
2216 RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region");
2217 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2219 prop = RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
2220 RNA_def_property_enum_sdna(prop, NULL, "persp");
2221 RNA_def_property_enum_items(prop, rv3d_persp_items);
2222 RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
2223 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2225 prop = RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
2226 RNA_def_property_boolean_sdna(prop, NULL, "is_persp", 1);
2227 RNA_def_property_ui_text(prop, "Is Perspective", "");
2228 RNA_def_property_flag(prop, PROP_EDITABLE);
2230 prop = RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
2232 RNA_def_property_float_sdna(prop, NULL, "ofs"); /* cant use because its negated */
2234 RNA_def_property_array(prop, 3);
2235 RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get",
2236 "rna_RegionView3D_view_location_set", NULL);
2238 RNA_def_property_ui_text(prop, "View Location", "View pivot location");
2239 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
2240 RNA_def_property_update(prop, NC_WINDOW, NULL);
2242 prop = RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); /* cant use because its inverted */
2244 RNA_def_property_float_sdna(prop, NULL, "viewquat");
2246 RNA_def_property_array(prop, 4);
2247 RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_rotation_get",
2248 "rna_RegionView3D_view_rotation_set", NULL);
2250 RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
2251 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2253 /* not sure we need rna access to these but adding anyway */
2254 prop = RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
2255 RNA_def_property_float_sdna(prop, NULL, "dist");
2256 RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
2257 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2259 prop = RNA_def_property(srna, "view_camera_zoom", PROP_FLOAT, PROP_UNSIGNED);
2260 RNA_def_property_float_sdna(prop, NULL, "camzoom");
2261 RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view");
2262 RNA_def_property_range(prop, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
2263 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2265 prop = RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
2266 RNA_def_property_float_sdna(prop, NULL, "camdx");
2267 RNA_def_property_array(prop, 2);
2268 RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view");
2269 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
2271 RNA_api_region_view3d(srna);
2274 static void rna_def_space_buttons(BlenderRNA *brna)
2279 static EnumPropertyItem align_items[] = {
2280 {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
2281 {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
2282 {0, NULL, 0, NULL, NULL}
2285 srna = RNA_def_struct(brna, "SpaceProperties", "Space");
2286 RNA_def_struct_sdna(srna, "SpaceButs");
2287 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
2289 prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
2290 RNA_def_property_enum_sdna(prop, NULL, "mainb");
2291 RNA_def_property_enum_items(prop, buttons_context_items);
2292 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf");
2293 RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
2294 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
2296 prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
2297 RNA_def_property_enum_sdna(prop, NULL, "align");
2298 RNA_def_property_enum_items(prop, align_items);
2299 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
2300 RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
2301 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
2303 prop = RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE);
2304 RNA_def_property_enum_items(prop, buttons_texture_context_items);
2305 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_texture_context_set",
2306 "rna_SpaceProperties_texture_context_itemf");
2307 RNA_def_property_ui_text(prop, "Texture Context", "Type of texture data to display and edit");
2308 RNA_def_property_update(prop, NC_TEXTURE, NULL);
2310 prop = RNA_def_property(srna, "use_limited_texture_context", PROP_BOOLEAN, PROP_NONE);
2311 RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_TEX_USER_LIMITED);
2312 RNA_def_property_ui_text(prop, "Limited Texture Context",
2313 "Use the limited version of texture user (for 'old shading' mode)");
2316 prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
2317 RNA_def_property_pointer_sdna(prop, NULL, "pinid");
2318 RNA_def_property_struct_type(prop, "ID");
2319 /* note: custom set function is ONLY to avoid rna setting a user for this. */
2320 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set",
2321 "rna_SpaceProperties_pin_id_typef", NULL);
2322 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
2323 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
2325 prop = RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
2326 RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
2327 RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
2330 static void rna_def_space_image(BlenderRNA *brna)
2332 static EnumPropertyItem image_space_mode_items[] = {
2333 {SI_MODE_VIEW, "VIEW", ICON_FILE_IMAGE, "View", "View the image and UV edit in mesh editmode"},
2334 {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode"},
2335 {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing"},
2336 {0, NULL, 0, NULL, NULL}
2342 srna = RNA_def_struct(brna, "SpaceImageEditor", "Space");
2343 RNA_def_struct_sdna(srna, "SpaceImage");
2344 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
2347 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
2348 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL);
2349 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
2350 RNA_def_property_flag(prop, PROP_EDITABLE);
2351 RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL); /* is handled in image editor too */
2353 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
2354 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2355 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
2356 RNA_def_property_ui_text(prop, "Image User",
2357 "Parameters defining which layer, pass and frame of the image is displayed");
2358 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2360 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
2361 RNA_def_property_pointer_sdna(prop, NULL, "scopes");
2362 RNA_def_property_struct_type(prop, "Scopes");
2363 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
2364 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
2366 prop = RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
2367 RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
2368 RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
2369 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
2370 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2372 prop = RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
2373 RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist");
2374 RNA_def_property_struct_type(prop, "Histogram");
2375 RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
2377 prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
2378 RNA_def_property_array(prop, 2);
2379 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2380 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", NULL, NULL);
2381 RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
2384 prop = RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
2385 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
2386 RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
2387 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2389 prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
2390 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SHOW_GPENCIL);
2391 RNA_def_property_ui_text(prop, "Show Grease Pencil",
2392 "Show grease pencil for this view");
2393 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2395 prop = RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
2396 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2397 RNA_def_property_enum_items(prop, draw_channels_items);
2398 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
2399 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
2400 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2403 prop = RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
2404 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2405 RNA_def_property_struct_type(prop, "SpaceUVEditor");
2406 RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
2407 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
2410 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
2411 RNA_def_property_enum_sdna(prop, NULL, "mode");
2412 RNA_def_property_enum_items(prop, image_space_mode_items);
2413 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
2414 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
2417 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
2418 RNA_def_property_array(prop, 2);
2419 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get",
2420 "rna_SpaceImageEditor_cursor_location_set", NULL);
2421 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
2422 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2424 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
2425 RNA_def_property_enum_sdna(prop, NULL, "around");
2426 RNA_def_property_enum_items(prop, pivot_items_full);
2427 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_pivot_itemf");
2428 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
2429 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2432 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
2433 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
2434 RNA_def_property_struct_type(prop, "GreasePencil");
2435 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
2436 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
2437 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
2440 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
2441 RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
2442 RNA_def_property_ui_text(prop, "Update Automatically",
2443 "Update other affected window spaces automatically to reflect changes "
2444 "during interactive operations such as transform");
2447 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
2448 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
2449 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2450 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
2452 prop = RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
2453 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
2454 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2455 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
2457 prop = RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
2458 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
2459 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2460 RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
2462 prop = RNA_def_property(srna, "show_maskedit", PROP_BOOLEAN, PROP_NONE);
2463 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_maskedit_get", NULL);
2464 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2465 RNA_def_property_ui_text(prop, "Show Mask Editor", "Show Mask editing related properties");
2467 rna_def_space_image_uv(brna);
2470 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mask_set");
2473 static void rna_def_space_sequencer(BlenderRNA *brna)
2478 static EnumPropertyItem view_type_items[] = {
2479 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
2480 {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
2481 {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SPLITVIEW, "Sequencer and Image Preview", ""},
2482 {0, NULL, 0, NULL, NULL}
2485 static EnumPropertyItem display_mode_items[] = {
2486 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
2487 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
2488 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
2489 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
2490 {0, NULL, 0, NULL, NULL}
2493 static EnumPropertyItem proxy_render_size_items[] = {
2494 {SEQ_PROXY_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
2495 {SEQ_PROXY_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""},
2496 {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""},
2497 {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""},
2498 {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""},
2499 {SEQ_PROXY_RENDER_SIZE_100, "PROXY_100", 0, "Proxy size 100%", ""},
2500 {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
2501 {0, NULL, 0, NULL, NULL}
2504 static EnumPropertyItem overlay_type_items[] = {
2505 {SEQ_DRAW_OVERLAY_RECT, "RECTANGLE", 0, "Rectangle", "Show rectangle area overlay"},
2506 {SEQ_DRAW_OVERLAY_REFERENCE, "REFERENCE", 0, "Reference", "Show reference frame only"},
2507 {SEQ_DRAW_OVERLAY_CURRENT, "CURRENT", 0, "Current", "Show current frame only"},
2508 {0, NULL, 0, NULL, NULL}
2511 static EnumPropertyItem preview_channels_items[] = {
2512 {SEQ_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
2513 "Draw image with RGB colors and alpha transparency"},
2514 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
2515 {0, NULL, 0, NULL, NULL}
2518 static EnumPropertyItem waveform_type_draw_items[] = {
2519 {SEQ_NO_WAVEFORMS, "NO_WAVEFORMS", 0, "Waveforms Off",
2520 "No waveforms drawn for any sound strips"},
2521 {SEQ_ALL_WAVEFORMS, "ALL_WAVEFORMS", 0, "Waveforms On",
2522 "Waveforms drawn for all sound strips"},
2523 {0, "DEFAULT_WAVEFORMS", 0, "Use Strip Option",
2524 "Waveforms drawn according to strip setting"},
2525 {0, NULL, 0, NULL, NULL}
2528 srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
2529 RNA_def_struct_sdna(srna, "SpaceSeq");
2530 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
2532 /* view type, fairly important */
2533 prop = RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
2534 RNA_def_property_enum_sdna(prop, NULL, "view");
2535 RNA_def_property_enum_items(prop, view_type_items);
2536 RNA_def_property_ui_text(prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
2537 RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
2539 /* display type, fairly important */
2540 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
2541 RNA_def_property_enum_sdna(prop, NULL, "mainb");
2542 RNA_def_property_enum_items(prop, display_mode_items);
2543 RNA_def_property_ui_text(prop, "Display Mode", "View mode to use for displaying sequencer output");
2544 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2547 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
2548 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM);
2549 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
2550 "Show frame number beside the current frame indicator line");
2551 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2553 prop = RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
2554 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
2555 RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than seconds");
2556 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2558 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
2559 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
2560 RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
2561 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2563 prop = RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
2564 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPARATED);
2565 RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview");
2566 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2568 prop = RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE);
2569 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
2570 RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview");
2571 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2573 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
2574 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
2575 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
2576 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2578 prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
2579 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_GPENCIL);
2580 RNA_def_property_ui_text(prop, "Show Grease Pencil",
2581 "Show grease pencil for this view");
2582 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2584 prop = RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
2585 RNA_def_property_int_sdna(prop, NULL, "chanshown");
2586 RNA_def_property_ui_text(prop, "Display Channel",
2587 "The channel number shown in the image preview. 0 is the result of all strips combined");
2588 RNA_def_property_range(prop, -5, MAXSEQ);
2589 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2591 prop = RNA_def_property(srna, "preview_channels", PROP_ENUM, PROP_NONE);
2592 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2593 RNA_def_property_enum_items(prop, preview_channels_items);
2594 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the preview to draw");
2595 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2597 prop = RNA_def_property(srna, "waveform_draw_type", PROP_ENUM, PROP_NONE);
2598 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2599 RNA_def_property_enum_items(prop, waveform_type_draw_items);
2600 RNA_def_property_ui_text(prop, "Waveform Drawing", "How Waveforms are drawn");
2601 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2603 prop = RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
2604 RNA_def_property_int_sdna(prop, NULL, "zebra");
2605 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
2606 RNA_def_property_range(prop, 0, 110);
2607 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2609 prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
2610 RNA_def_property_enum_sdna(prop, NULL, "render_size");
2611 RNA_def_property_enum_items(prop, proxy_render_size_items);
2612 RNA_def_property_ui_text(prop, "Proxy render size",
2613 "Draw preview using full resolution or different proxy resolutions");
2614 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2617 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
2618 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
2619 RNA_def_property_struct_type(prop, "GreasePencil");
2620 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
2621 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
2622 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2624 prop = RNA_def_property(srna, "overlay_type", PROP_ENUM, PROP_NONE);
2625 RNA_def_property_enum_sdna(prop, NULL, "overlay_type");
2626 RNA_def_property_enum_items(prop, overlay_type_items);
2627 RNA_def_property_ui_text(prop, "Overlay Type", "Overlay draw type");
2628 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2630 prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
2631 RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_BACKDROP);
2632 RNA_def_property_ui_text(prop, "Use Backdrop", "Display result under strips");
2633 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2635 prop = RNA_def_property(srna, "show_strip_offset", PROP_BOOLEAN, PROP_NONE);
2636 RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_OFFSET_EXT);
2637 RNA_def_property_ui_text(prop, "Show Offsets", "Display strip in/out offsets");
2638 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
2641 static void rna_def_space_text(BlenderRNA *brna)
2646 srna = RNA_def_struct(brna, "SpaceTextEditor", "Space");
2647 RNA_def_struct_sdna(srna, "SpaceText");
2648 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
2651 prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
2652 RNA_def_property_flag(prop, PROP_EDITABLE);
2653 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
2654 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL);
2655 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2658 prop = RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
2659 RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
2660 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
2661 RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
2662 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
2663 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2665 prop = RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
2666 RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
2667 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
2668 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
2669 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2671 prop = RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
2672 RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
2673 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
2674 RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
2675 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2677 prop = RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
2678 RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0);
2679 RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
2680 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2682 prop = RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
2683 RNA_def_property_int_sdna(prop, NULL, "tabnumber");
2684 RNA_def_property_range(prop, 2, 8);
2685 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
2686 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
2688 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
2689 RNA_def_property_int_sdna(prop, NULL, "lheight");
2690 RNA_def_property_range(prop, 8, 32);
2691 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
2692 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2694 prop = RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
2695 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_SHOW_MARGIN);
2696 RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
2697 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2699 prop = RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
2700 RNA_def_property_int_sdna(prop, NULL, "margin_column");
2701 RNA_def_property_range(prop, 0, 1024);
2702 RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
2703 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2705 prop = RNA_def_property(srna, "top", PROP_INT, PROP_NONE);
2706 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2707 RNA_def_property_int_sdna(prop, NULL, "top");
2708 RNA_def_property_ui_text(prop, "Top Line", "Top line visible");
2710 prop = RNA_def_property(srna, "visible_lines", PROP_INT, PROP_NONE);
2711 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2712 RNA_def_property_int_sdna(prop, NULL, "viewlines");
2713 RNA_def_property_ui_text(prop, "Top Line", "Amount of lines that can be visible in current editor");
2715 /* functionality options */
2716 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
2717 RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1);
2718 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
2719 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2721 prop = RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
2722 RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1);
2723 RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
2724 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2727 prop = RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
2728 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
2729 RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one");
2730 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2732 prop = RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
2733 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
2734 RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end");
2735 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2737 prop = RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
2738 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_MATCH_CASE);
2739 RNA_def_property_ui_text(prop, "Match case", "Search string is sensitive to uppercase and lowercase letters");
2740 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2742 prop = RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
2743 RNA_def_property_string_sdna(prop, NULL, "findstr");
2744 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
2745 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2747 prop = RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
2748 RNA_def_property_string_sdna(prop, NULL, "replacestr");
2749 RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool");
2750 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL);
2753 static void rna_def_space_dopesheet(BlenderRNA *brna)
2758 /* XXX: action-editor is currently for object-level only actions, so show that using object-icon hint */
2759 static EnumPropertyItem mode_items[] = {
2760 {SACTCONT_DOPESHEET, "DOPESHEET", ICON_OOPS, "Dope Sheet", "Edit all keyframes in scene"},
2761 {SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", "Edit keyframes in active object's Object-level action"},
2762 {SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, "Shape Key Editor", "Edit keyframes in active object's Shape Keys action"},
2763 {SACTCONT_GPENCIL, "GPENCIL", ICON_GREASEPENCIL, "Grease Pencil", "Edit timings for all Grease Pencil sketches in file"},
2764 {SACTCONT_MASK, "MASK", ICON_MOD_MASK, "Mask", "Edit timings for Mask Editor splines"},
2765 {0, NULL, 0, NULL, NULL}
2769 srna = RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
2770 RNA_def_struct_sdna(srna, "SpaceAction");
2771 RNA_def_struct_ui_text(srna, "Space Dope Sheet Editor", "Dope Sheet space data");
2774 prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
2775 RNA_def_property_flag(prop, PROP_EDITABLE);
2776 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL,
2777 "rna_Action_actedit_assign_poll");
2778 RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
2779 RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
2782 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
2783 RNA_def_property_enum_sdna(prop, NULL, "mode");
2784 RNA_def_property_enum_items(prop, mode_items);
2785 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
2786 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
2789 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
2790 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
2791 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
2792 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2794 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
2795 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
2796 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
2797 "Show frame number beside the current frame indicator line");
2798 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2800 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
2801 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
2802 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
2803 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2805 prop = RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
2806 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_POSEMARKERS_SHOW);
2807 RNA_def_property_ui_text(prop, "Show Pose Markers",
2808 "Show markers belonging to the active action instead of Scene markers "
2809 "(Action and Shape Key Editors only)");
2810 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2812 prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
2813 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWGCOLORS);
2814 RNA_def_property_ui_text(prop, "Show Group Colors",
2815 "Draw groups and channels with colors matching their corresponding groups");
2816 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2819 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
2820 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
2821 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
2822 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2824 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
2825 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
2826 RNA_def_property_ui_text(prop, "Realtime Updates",
2827 "When transforming keyframes, changes to the animation data are flushed to other views");
2828 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2830 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
2831 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_MARKERS_MOVE);
2832 RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
2835 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
2836 RNA_def_property_struct_type(prop, "DopeSheet");
2837 RNA_def_property_pointer_sdna(prop, NULL, "ads");
2838 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
2841 prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
2842 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
2843 RNA_def_property_enum_items(prop, autosnap_items);
2844 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
2845 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
2848 static void rna_def_space_graph(BlenderRNA *brna)
2853 static EnumPropertyItem mode_items[] = {
2854 {SIPO_MODE_ANIMATION, "FCURVES", ICON_IPO, "F-Curve",
2855 "Edit animation/keyframes displayed as 2D curves"},
2856 {SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, "Drivers", "Edit drivers"},
2857 {0, NULL, 0, NULL, NULL}
2860 /* this is basically the same as the one for the 3D-View, but with some entries omitted */
2861 static EnumPropertyItem gpivot_items[] = {
2862 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
2863 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
2864 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
2865 /*{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""}, */
2866 /*{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""}, */
2867 {0, NULL, 0, NULL, NULL}
2871 srna = RNA_def_struct(brna, "SpaceGraphEditor", "Space");
2872 RNA_def_struct_sdna(srna, "SpaceIpo");
2873 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
2876 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
2877 RNA_def_property_enum_sdna(prop, NULL, "mode");
2878 RNA_def_property_enum_items(prop, mode_items);
2879 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
2880 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
2883 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
2884 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
2885 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
2886 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2888 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
2889 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
2890 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
2891 "Show frame number beside the current frame indicator line");
2892 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2894 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
2895 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
2896 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
2897 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2899 prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
2900 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
2901 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points");
2902 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2904 prop = RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
2905 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
2906 RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes",
2907 "Only keyframes of selected F-Curves are visible and editable");
2908 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2910 prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
2911 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY);
2912 RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles",
2913 "Only show and edit handles of selected keyframes");
2914 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2916 prop = RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE);
2917 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF);
2918 RNA_def_property_ui_text(prop, "Use High Quality Drawing",
2919 "Draw F-Curves using Anti-Aliasing and other fancy effects "
2920 "(disable for better performance)");
2921 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2923 prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
2924 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWGCOLORS);
2925 RNA_def_property_ui_text(prop, "Show Group Colors",
2926 "Draw groups and channels with colors matching their corresponding groups");
2927 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2930 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
2931 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
2932 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
2933 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2935 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
2936 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
2937 RNA_def_property_ui_text(prop, "Realtime Updates",
2938 "When transforming keyframes, changes to the animation data are flushed to other views");
2939 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2942 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
2943 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR);
2944 RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
2945 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2947 prop = RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
2948 RNA_def_property_float_sdna(prop, NULL, "cursorVal");
2949 RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
2950 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2952 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
2953 RNA_def_property_enum_sdna(prop, NULL, "around");
2954 RNA_def_property_enum_items(prop, gpivot_items);
2955 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
2956 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2959 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
2960 RNA_def_property_struct_type(prop, "DopeSheet");
2961 RNA_def_property_pointer_sdna(prop, NULL, "ads");
2962 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
2965 prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
2966 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
2967 RNA_def_property_enum_items(prop, autosnap_items);
2968 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
2969 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2971 /* readonly state info */
2972 prop = RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
2973 RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", NULL);
2974 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2975 RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
2977 /* nromalize curves */
2978 prop = RNA_def_property(srna, "use_normalization", PROP_BOOLEAN, PROP_NONE);
2979 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NORMALIZE);
2980 RNA_def_property_ui_text(prop, "Use Normalization", "Display curves in normalized to -1..1 range, "
2981 "for easier editing of multiple curves with different ranges");
2982 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2984 prop = RNA_def_property(srna, "use_auto_normalization", PROP_BOOLEAN, PROP_NONE);
2985 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NORMALIZE_FREEZE);
2986 RNA_def_property_ui_text(prop, "Auto Normalization",
2987 "Automatically recalculate curve normalization on every curve edit");
2988 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2991 static void rna_def_space_nla(BlenderRNA *brna)
2996 srna = RNA_def_struct(brna, "SpaceNLA", "Space");
2997 RNA_def_struct_sdna(srna, "SpaceNla");
2998 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
3001 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
3002 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
3003 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
3004 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3006 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
3007 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
3008 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
3009 "Show frame number beside the current frame indicator line");
3010 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3012 prop = RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
3013 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
3014 RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
3015 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3018 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
3019 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
3020 RNA_def_property_ui_text(prop, "Realtime Updates",
3021 "When transforming strips, changes to the animation data are flushed to other views");
3022 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3025 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
3026 RNA_def_property_struct_type(prop, "DopeSheet");
3027 RNA_def_property_pointer_sdna(prop, NULL, "ads");
3028 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
3031 prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
3032 RNA_def_property_enum_sdna(prop, NULL, "autosnap");
3033 RNA_def_property_enum_items(prop, autosnap_items);
3034 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
3035 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NLA, NULL);
3038 static void rna_def_space_time(BlenderRNA *brna)
3043 srna = RNA_def_struct(brna, "SpaceTimeline", "Space");
3044 RNA_def_struct_sdna(srna, "SpaceTime");
3045 RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
3048 prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
3049 RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM);
3050 RNA_def_property_ui_text(prop, "Show Frame Number Indicator",
3051 "Show frame number beside the current frame indicator line");
3052 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3054 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
3055 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TIME_DRAWFRAMES);
3056 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
3057 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3059 /* displaying cache status */
3060 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
3061 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY);
3062 RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
3063 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3065 prop = RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
3066 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SOFTBODY);
3067 RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
3068 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3070 prop = RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
3071 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_PARTICLES);
3072 RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
3073 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3075 prop = RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
3076 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_CLOTH);
3077 RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
3078 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3080 prop = RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
3081 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SMOKE);
3082 RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");
3083 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3085 prop = RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
3086 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DYNAMICPAINT);
3087 RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");
3088 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3090 prop = RNA_def_property(srna, "cache_rigidbody", PROP_BOOLEAN, PROP_NONE);
3091 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_RIGIDBODY);
3092 RNA_def_property_ui_text(prop, "Rigid Body", "Show the active object's Rigid Body cache");
3093 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
3096 static void rna_def_console_line(BlenderRNA *brna)
3098 static EnumPropertyItem console_line_type_items[] = {
3099 {CONSOLE_LINE_OUTPUT, "OUTPUT", 0, "Output", ""},
3100 {CONSOLE_LINE_INPUT, "INPUT", 0, "Input", ""},
3101 {CONSOLE_LINE_INFO, "INFO", 0, "Info", ""},
3102 {CONSOLE_LINE_ERROR, "ERROR", 0, "Error", ""},
3103 {0, NULL, 0, NULL, NULL}