4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2008)
22 * ***** END GPL LICENSE BLOCK *****
27 #include "MEM_guardedalloc.h"
29 #include "RNA_access.h"
30 #include "RNA_define.h"
31 #include "RNA_types.h"
33 #include "rna_internal.h"
35 #include "DNA_action_types.h"
36 #include "DNA_node_types.h"
37 #include "DNA_object_types.h"
38 #include "DNA_space_types.h"
39 #include "DNA_view3d_types.h"
41 #include "BKE_paint.h"
45 EnumPropertyItem space_type_items[] = {
46 {SPACE_EMPTY, "EMPTY", 0, "Empty", ""},
47 {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""},
48 {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""},
49 {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""},
50 {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""},
51 {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""},
52 {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""},
53 {SPACE_INFO, "INFO", 0, "Info", ""},
54 {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""},
55 {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""},
56 //{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""},
57 {SPACE_SOUND, "AUDIO_WINDOW", 0, "Audio Window", ""},
58 {SPACE_ACTION, "DOPESHEET_EDITOR", 0, "DopeSheet Editor", ""},
59 {SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""},
60 {SPACE_SCRIPT, "SCRIPTS_WINDOW", 0, "Scripts Window", ""},
61 {SPACE_TIME, "TIMELINE", 0, "Timeline", ""},
62 {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""},
63 {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""},
64 {SPACE_CONSOLE, "CONSOLE", 0, "Console", ""},
65 {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
66 {0, NULL, 0, NULL, NULL}};
68 #define DC_RGB {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors."}
69 #define DC_RGBA {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency."}
70 #define DC_ALPHA {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel."}
71 #define DC_Z {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)."}
73 #define DC_LCMS {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image."}
75 #define DC_LCMS {0, NULL, 0, NULL, NULL}
77 #define DC_ZERO {0, NULL, 0, NULL, NULL}
79 static EnumPropertyItem dc_all_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_Z, DC_LCMS, DC_ZERO};
83 #include "DNA_scene_types.h"
84 #include "DNA_screen_types.h"
86 #include "BKE_brush.h"
87 #include "BKE_context.h"
90 #include "ED_screen.h"
92 #include "IMB_imbuf_types.h"
94 static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
96 SpaceLink *space= (SpaceLink*)ptr->data;
98 switch(space->spacetype) {
100 return &RNA_Space3DView;
102 return &RNA_SpaceGraphEditor;
104 return &RNA_SpaceOutliner;
106 return &RNA_SpaceProperties;
108 return &RNA_SpaceFileBrowser;
110 return &RNA_SpaceImageEditor;
112 return &RNA_SpaceInfo;
114 return &RNA_SpaceSequenceEditor;
116 return &RNA_SpaceTextEditor;
118 // return &RNA_SpaceImageBrowser;
120 return &RNA_SpaceAudioWindow;*/
122 return &RNA_SpaceDopeSheetEditor;
124 return &RNA_SpaceNLA;
126 return &RNA_SpaceScriptsWindow;*/
128 return &RNA_SpaceTimeline;
130 return &RNA_SpaceNodeEditor;
132 return &RNA_SpaceLogicEditor;
134 return &RNA_SpaceConsole;
136 return &RNA_SpaceUserPreferences;
142 /* Space Image Editor */
144 static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
146 return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
149 static void rna_SpaceImageEditor_paint_update(bContext *C, PointerRNA *ptr)
151 Scene *scene= CTX_data_scene(C);
154 paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
157 static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
159 SpaceImage *sima= (SpaceImage*)(ptr->data);
160 return ED_space_image_show_render(sima);
163 static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
165 SpaceImage *sima= (SpaceImage*)(ptr->data);
166 return ED_space_image_show_paint(sima);
169 static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
171 SpaceImage *sima= (SpaceImage*)(ptr->data);
172 bScreen *sc= (bScreen*)ptr->id.data;
173 return ED_space_image_show_uvedit(sima, sc->scene->obedit);
176 static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
178 SpaceImage *sima= (SpaceImage*)(ptr->data);
179 bScreen *sc= (bScreen*)ptr->id.data;
181 ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data);
184 static EnumPropertyItem dc_rgb_items[] = {DC_RGB, DC_LCMS, DC_ZERO};
185 static EnumPropertyItem dc_alpha_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_LCMS, DC_ZERO};
186 static EnumPropertyItem dc_z_items[] = {DC_RGB, DC_Z, DC_LCMS, DC_ZERO};
188 static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, PointerRNA *ptr, int *free)
190 SpaceImage *sima= (SpaceImage*)ptr->data;
191 ImBuf *ibuf= ED_space_image_buffer(sima);
195 /* needed for doc generation */
199 alpha= ibuf && (ibuf->channels == 4);
200 zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
205 return dc_alpha_items;
212 /* Space Text Editor */
214 void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
216 SpaceText *st= (SpaceText*)(ptr->data);
222 void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
224 SpaceText *st= (SpaceText*)(ptr->data);
226 st->text= value.data;
230 void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value)
232 SpaceFile *sfile= (SpaceFile*)(ptr->data);
234 sfile->params= value.data;
237 /* Space Properties */
239 StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
241 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
244 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
249 void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
251 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
258 static void rna_ConsoleLine_line_get(PointerRNA *ptr, char *value)
260 ConsoleLine *ci= (ConsoleLine*)ptr->data;
261 strcpy(value, ci->line);
264 static int rna_ConsoleLine_line_length(PointerRNA *ptr)
266 ConsoleLine *ci= (ConsoleLine*)ptr->data;
270 static void rna_ConsoleLine_line_set(PointerRNA *ptr, const char *value)
272 ConsoleLine *ci= (ConsoleLine*)ptr->data;
273 int len= strlen(value);
275 if(len < ci->len_alloc) { /* allocated size is enough? */
276 strcpy(ci->line, value);
278 else { /* allocate a new strnig */
280 ci->line= BLI_strdup(value);
285 if(ci->cursor > len) /* clamp the cursor */
289 static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max)
291 ConsoleLine *ci= (ConsoleLine*)ptr->data;
297 static void rna_View3D_display_background_image_set(PointerRNA *ptr, int value)
299 View3D *vd= (View3D*)ptr->data;
301 if(value) vd->flag |= V3D_DISPBGPIC;
302 else vd->flag &= ~V3D_DISPBGPIC;
304 if((vd->flag & V3D_DISPBGPIC) && vd->bgpic == NULL) {
305 vd->bgpic= MEM_callocN(sizeof(BGpic), "bgpic");
306 vd->bgpic->size= 5.0;
307 vd->bgpic->blend= 0.5;
308 vd->bgpic->iuser.fie_ima= 2;
309 vd->bgpic->iuser.ok= 1;
314 static void rna_SpaceTime_redraw_update(bContext *C, PointerRNA *ptr)
316 SpaceTime *st= (SpaceTime*)ptr->data;
317 ED_screen_animation_timer_update(C, st->redraws);
322 static void rna_def_space(BlenderRNA *brna)
327 srna= RNA_def_struct(brna, "Space", NULL);
328 RNA_def_struct_sdna(srna, "SpaceLink");
329 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area.");
330 RNA_def_struct_refine_func(srna, "rna_Space_refine");
332 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
333 RNA_def_property_enum_sdna(prop, NULL, "spacetype");
334 RNA_def_property_enum_items(prop, space_type_items);
335 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
336 RNA_def_property_ui_text(prop, "Type", "Space data type.");
339 static void rna_def_space_image_uv(BlenderRNA *brna)
344 static EnumPropertyItem sticky_mode_items[] = {
345 {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled."},
346 {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location", "Select UVs that are at the same location and share a mesh vertex."},
347 {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex", "Select UVs that share mesh vertex, irrespective if they are in the same location."},
348 {0, NULL, 0, NULL, NULL}};
350 static EnumPropertyItem dt_uv_items[] = {
351 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline."},
352 {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges."},
353 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges."},
354 {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges."},
355 {0, NULL, 0, NULL, NULL}};
357 static EnumPropertyItem dt_uvstretch_items[] = {
358 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles."},
359 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces."},
360 {0, NULL, 0, NULL, NULL}};
362 static EnumPropertyItem pivot_items[] = {
363 {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
364 {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
365 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
366 {0, NULL, 0, NULL, NULL}};
368 srna= RNA_def_struct(brna, "SpaceUVEditor", NULL);
369 RNA_def_struct_sdna(srna, "SpaceImage");
370 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
371 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space.");
374 prop= RNA_def_property(srna, "sticky_selection_mode", PROP_ENUM, PROP_NONE);
375 RNA_def_property_enum_sdna(prop, NULL, "sticky");
376 RNA_def_property_enum_items(prop, sticky_mode_items);
377 RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected.");
378 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
381 prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
382 RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
383 RNA_def_property_enum_items(prop, dt_uv_items);
384 RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges.");
385 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
387 prop= RNA_def_property(srna, "draw_smooth_edges", PROP_BOOLEAN, PROP_NONE);
388 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
389 RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased.");
390 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
392 prop= RNA_def_property(srna, "draw_stretch", PROP_BOOLEAN, PROP_NONE);
393 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
394 RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion).");
395 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
397 prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
398 RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
399 RNA_def_property_enum_items(prop, dt_uvstretch_items);
400 RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw.");
401 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
403 prop= RNA_def_property(srna, "draw_modified_edges", PROP_BOOLEAN, PROP_NONE);
404 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
405 RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied.");
406 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
408 prop= RNA_def_property(srna, "draw_other_objects", PROP_BOOLEAN, PROP_NONE);
409 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
410 RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image.");
411 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
413 prop= RNA_def_property(srna, "normalized_coordinates", PROP_BOOLEAN, PROP_NONE);
414 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
415 RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels.");
416 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
418 /* todo: move edge and face drawing options here from G.f */
420 prop= RNA_def_property(srna, "snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
421 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
422 RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing.");
424 prop= RNA_def_property(srna, "constrain_to_image_bounds", PROP_BOOLEAN, PROP_NONE);
425 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
426 RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing.");
428 prop= RNA_def_property(srna, "live_unwrap", PROP_BOOLEAN, PROP_NONE);
429 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
430 RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices.");
432 prop= RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE);
433 RNA_def_property_enum_sdna(prop, NULL, "around");
434 RNA_def_property_enum_items(prop, pivot_items);
435 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot.");
436 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
439 static void rna_def_space_outliner(BlenderRNA *brna)
444 static EnumPropertyItem display_mode_items[] = {
445 {0, "ALL_SCENES", 0, "All Scenes", ""},
446 {1, "CURRENT_SCENE", 0, "Current Scene", ""},
447 {2, "VISIBLE_LAYERS", 0, "Visible Layers", ""},
448 {3, "SELECTED", 0, "Selected", ""},
449 {4, "ACTIVE", 0, "Active", ""},
450 {5, "SAME_TYPES", 0, "Same Types", ""},
451 {6, "GROUPS", 0, "Groups", ""},
452 {7, "LIBRARIES", 0, "Libraries", ""},
453 {10, "SEQUENCE", 0, "Sequence", ""},
454 {11, "DATABLOCKS", 0, "Datablocks", ""},
455 {12, "USER_PREFERENCES", 0, "User Preferences", ""},
456 {13, "KEYMAPS", 0, "Key Maps", ""},
457 {0, NULL, 0, NULL, NULL}};
459 srna= RNA_def_struct(brna, "SpaceOutliner", "Space");
460 RNA_def_struct_sdna(srna, "SpaceOops");
461 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data.");
463 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
464 RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
465 RNA_def_property_enum_items(prop, display_mode_items);
466 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
467 RNA_def_property_update(prop, NC_WINDOW, NULL);
469 prop= RNA_def_property(srna, "show_restriction_columns", PROP_BOOLEAN, PROP_NONE);
470 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
471 RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show colum");
472 RNA_def_property_update(prop, NC_WINDOW, NULL);
476 static void rna_def_background_image(BlenderRNA *brna)
481 srna= RNA_def_struct(brna, "BackgroundImage", NULL);
482 RNA_def_struct_sdna(srna, "BGpic");
483 RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background.");
485 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
486 RNA_def_property_pointer_sdna(prop, NULL, "ima");
487 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space.");
488 RNA_def_property_flag(prop, PROP_EDITABLE);
489 RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, NULL);
491 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
492 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
493 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
494 RNA_def_property_update(prop, NC_WINDOW, NULL);
496 prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE);
497 RNA_def_property_float_sdna(prop, NULL, "xof");
498 RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
499 RNA_def_property_update(prop, NC_WINDOW, NULL);
501 prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE);
502 RNA_def_property_float_sdna(prop, NULL, "yof");
503 RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the view center");
504 RNA_def_property_update(prop, NC_WINDOW, NULL);
506 prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
507 RNA_def_property_float_sdna(prop, NULL, "size");
508 RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image.");
509 RNA_def_property_range(prop, 0.0, FLT_MAX);
510 RNA_def_property_update(prop, NC_WINDOW, NULL);
512 prop= RNA_def_property(srna, "transparency", PROP_FLOAT, PROP_NONE);
513 RNA_def_property_float_sdna(prop, NULL, "blend");
514 RNA_def_property_ui_text(prop, "Transparency", "Amount to blend the image against the background color.");
515 RNA_def_property_range(prop, 0.0, 1.0);
516 RNA_def_property_update(prop, NC_WINDOW, NULL);
520 static void rna_def_space_3dview(BlenderRNA *brna)
525 static EnumPropertyItem viewport_shading_items[] = {
526 {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
527 {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
528 {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
529 {OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
530 {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"},
531 {0, NULL, 0, NULL, NULL}};
533 static EnumPropertyItem pivot_items[] = {
534 {V3D_CENTER, "BOUNDING_BOX_CENTER", 0, "Bounding Box Center", ""},
535 {V3D_CURSOR, "CURSOR", 0, "3D Cursor", ""},
536 {V3D_LOCAL, "INDIVIDUAL_CENTERS", 0, "Individual Centers", ""},
537 {V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
538 {V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
539 {0, NULL, 0, NULL, NULL}};
541 static EnumPropertyItem transform_orientation_items[] = {
542 {V3D_MANIP_GLOBAL, "ORIENT_GLOBAL", 0, "Global", "Align the transformation axes to world space"},
543 {V3D_MANIP_LOCAL, "ORIENT_LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
544 {V3D_MANIP_NORMAL, "ORIENT_NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
545 {V3D_MANIP_VIEW, "ORIENT_VIEW", 0, "View", "Align the transformation axes to the window"},
546 {V3D_MANIP_CUSTOM, "ORIENT_CUSTOM", 0, "Custom", "Use a custom transform orientation"},
547 {0, NULL, 0, NULL, NULL}};
549 srna= RNA_def_struct(brna, "Space3DView", "Space");
550 RNA_def_struct_sdna(srna, "View3D");
551 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
553 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
554 RNA_def_property_pointer_sdna(prop, NULL, "camera");
555 RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera).");
557 prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
558 RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
559 RNA_def_property_ui_text(prop, "Lock Object", "3D View center is locked to this object's position");
561 prop= RNA_def_property(srna, "background_image", PROP_POINTER, PROP_NONE);
562 RNA_def_property_pointer_sdna(prop, NULL, "bgpic");
563 RNA_def_property_ui_text(prop, "Background Image", "Image and settings to display in the 3D View background");
565 prop= RNA_def_property(srna, "viewport_shading", PROP_ENUM, PROP_NONE);
566 RNA_def_property_enum_sdna(prop, NULL, "drawtype");
567 RNA_def_property_enum_items(prop, viewport_shading_items);
568 RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View.");
570 prop= RNA_def_property(srna, "localview", PROP_BOOLEAN, PROP_NONE);
571 RNA_def_property_boolean_sdna(prop, NULL, "localview", 0);
572 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
573 RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility.");
575 prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
576 RNA_def_property_float_sdna(prop, NULL, "lens");
577 RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view.");
578 RNA_def_property_range(prop, 1.0f, 250.0f);
579 RNA_def_property_update(prop, NC_WINDOW, NULL);
581 prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
582 RNA_def_property_float_sdna(prop, NULL, "near");
583 RNA_def_property_range(prop, 0.0f, FLT_MAX);
584 RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance.");
585 RNA_def_property_update(prop, NC_WINDOW, NULL);
587 prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
588 RNA_def_property_float_sdna(prop, NULL, "far");
589 RNA_def_property_range(prop, 1.0f, FLT_MAX);
590 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance.");
591 RNA_def_property_update(prop, NC_WINDOW, NULL);
593 prop= RNA_def_property(srna, "grid_spacing", PROP_FLOAT, PROP_DISTANCE);
594 RNA_def_property_float_sdna(prop, NULL, "grid");
595 RNA_def_property_ui_text(prop, "Grid Spacing", "The distance between 3D View grid lines.");
596 RNA_def_property_range(prop, 0.0f, FLT_MAX);
597 RNA_def_property_update(prop, NC_WINDOW, NULL);
599 prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
600 RNA_def_property_int_sdna(prop, NULL, "gridlines");
601 RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view.");
602 RNA_def_property_range(prop, 0, 1024);
603 RNA_def_property_update(prop, NC_WINDOW, NULL);
605 prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
606 RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
607 RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines.");
608 RNA_def_property_range(prop, 1, 1024);
609 RNA_def_property_update(prop, NC_WINDOW, NULL);
611 prop= RNA_def_property(srna, "display_floor", PROP_BOOLEAN, PROP_NONE);
612 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
613 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view.");
614 RNA_def_property_update(prop, NC_WINDOW, NULL);
616 prop= RNA_def_property(srna, "display_x_axis", PROP_BOOLEAN, PROP_NONE);
617 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
618 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view.");
619 RNA_def_property_update(prop, NC_WINDOW, NULL);
621 prop= RNA_def_property(srna, "display_y_axis", PROP_BOOLEAN, PROP_NONE);
622 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
623 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view.");
624 RNA_def_property_update(prop, NC_WINDOW, NULL);
626 prop= RNA_def_property(srna, "display_z_axis", PROP_BOOLEAN, PROP_NONE);
627 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
628 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view.");
629 RNA_def_property_update(prop, NC_WINDOW, NULL);
631 prop= RNA_def_property(srna, "outline_selected", PROP_BOOLEAN, PROP_NONE);
632 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
633 RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views.");
634 RNA_def_property_update(prop, NC_WINDOW, NULL);
636 prop= RNA_def_property(srna, "all_object_centers", PROP_BOOLEAN, PROP_NONE);
637 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
638 RNA_def_property_ui_text(prop, "All Object Centers", "Show the object center dot for all (selected and unselected) objects.");
639 RNA_def_property_update(prop, NC_WINDOW, NULL);
641 prop= RNA_def_property(srna, "relationship_lines", PROP_BOOLEAN, PROP_NONE);
642 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
643 RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships.");
644 RNA_def_property_update(prop, NC_WINDOW, NULL);
646 prop= RNA_def_property(srna, "textured_solid", PROP_BOOLEAN, PROP_NONE);
647 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
648 RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
649 RNA_def_property_update(prop, NC_WINDOW, NULL);
651 prop= RNA_def_property(srna, "display_background_image", PROP_BOOLEAN, PROP_NONE);
652 RNA_def_property_boolean_funcs(prop, NULL, "rna_View3D_display_background_image_set");
653 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPIC);
654 RNA_def_property_ui_text(prop, "Display Background Image", "Display a reference image behind objects in the 3D View");
655 RNA_def_property_update(prop, NC_WINDOW, NULL);
657 prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
658 RNA_def_property_enum_sdna(prop, NULL, "around");
659 RNA_def_property_enum_items(prop, pivot_items);
660 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling.");
662 prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE);
663 RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
664 RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms.");
665 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL);
667 prop= RNA_def_property(srna, "manipulator_translate", PROP_BOOLEAN, PROP_NONE);
668 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE);
669 RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations.");
670 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL);
672 prop= RNA_def_property(srna, "manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
673 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE);
674 RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations.");
675 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL);
677 prop= RNA_def_property(srna, "manipulator_scale", PROP_BOOLEAN, PROP_NONE);
678 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE);
679 RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations.");
680 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL);
682 prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
683 RNA_def_property_enum_sdna(prop, NULL, "twmode");
684 RNA_def_property_enum_items(prop, transform_orientation_items);
685 RNA_def_property_ui_text(prop, "Transform Orientation", "The alignment of manipulator handles.");
686 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL);
688 prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
689 RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_LOCKED);
690 RNA_def_property_ui_text(prop, "Lock", "Lock View Rotation");
692 prop= RNA_def_property(srna, "box_preview", PROP_BOOLEAN, PROP_NONE);
693 RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXVIEW);
694 RNA_def_property_ui_text(prop, "Box", "");
696 prop= RNA_def_property(srna, "box_clip", PROP_BOOLEAN, PROP_NONE);
697 RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXCLIP);
698 RNA_def_property_ui_text(prop, "Clip", "");
701 static void rna_def_space_buttons(BlenderRNA *brna)
706 static EnumPropertyItem buttons_context_items[] = {
707 {BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"},
708 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
709 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
710 {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraint", "Constraint"},
711 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifier", "Modifier"},
712 {BCONTEXT_DATA, "DATA", 0, "Data", "Data"},
713 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
714 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
715 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
716 {BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Particle"},
717 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
718 {0, NULL, 0, NULL, NULL}};
720 static EnumPropertyItem align_items[] = {
721 {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
722 {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
723 {0, NULL, 0, NULL, NULL}};
725 srna= RNA_def_struct(brna, "SpaceProperties", "Space");
726 RNA_def_struct_sdna(srna, "SpaceButs");
727 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
729 prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
730 RNA_def_property_enum_sdna(prop, NULL, "mainb");
731 RNA_def_property_enum_items(prop, buttons_context_items);
732 RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit.");
733 RNA_def_property_update(prop, NC_WINDOW, NULL);
735 prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
736 RNA_def_property_enum_sdna(prop, NULL, "align");
737 RNA_def_property_enum_items(prop, align_items);
738 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
739 RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels.");
740 RNA_def_property_update(prop, NC_WINDOW, NULL);
742 prop= RNA_def_property(srna, "brush_texture", PROP_BOOLEAN, PROP_NONE);
743 RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_BRUSH_TEX);
744 RNA_def_property_ui_text(prop, "Brush Texture", "Show brush textures.");
745 RNA_def_property_update(prop, NC_WINDOW, NULL);
748 prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
749 RNA_def_property_pointer_sdna(prop, NULL, "pinid");
750 RNA_def_property_struct_type(prop, "ID");
751 RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef");
752 RNA_def_property_flag(prop, PROP_EDITABLE);
755 static void rna_def_space_image(BlenderRNA *brna)
760 srna= RNA_def_struct(brna, "SpaceImageEditor", "Space");
761 RNA_def_struct_sdna(srna, "SpaceImage");
762 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data.");
765 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
766 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL);
767 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space.");
768 RNA_def_property_flag(prop, PROP_EDITABLE);
769 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
771 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
772 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
773 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
774 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
776 prop= RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE);
777 RNA_def_property_pointer_sdna(prop, NULL, "cumap");
778 RNA_def_property_ui_text(prop, "Curves", "Color curve mapping to use for displaying the image.");
779 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
781 prop= RNA_def_property(srna, "image_pin", PROP_BOOLEAN, PROP_NONE);
782 RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
783 RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection.");
784 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
787 prop= RNA_def_property(srna, "draw_repeated", PROP_BOOLEAN, PROP_NONE);
788 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
789 RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view.");
790 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
792 prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
793 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
794 RNA_def_property_enum_items(prop, dc_all_items);
795 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
796 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw.");
797 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
800 prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NEVER_NULL);
801 RNA_def_property_struct_type(prop, "SpaceUVEditor");
802 RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL);
803 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings.");
806 prop= RNA_def_property(srna, "image_painting", PROP_BOOLEAN, PROP_NONE);
807 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL);
808 RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode.");
809 RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
810 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_SpaceImageEditor_paint_update");
813 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
814 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
815 RNA_def_property_struct_type(prop, "UnknownType");
816 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space.");
818 prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
819 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DISPGP);
820 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay.");
823 prop= RNA_def_property(srna, "update_automatically", PROP_BOOLEAN, PROP_NONE);
824 RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
825 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
826 RNA_def_property_ui_text(prop, "Update Automatically", "Update other affected window spaces automatically to reflect changes during interactive operations such as transform.");
829 prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
830 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
831 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
832 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties.");
834 prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
835 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
836 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
837 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties.");
839 prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
840 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
841 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
842 RNA_def_property_ui_text(prop, "Show UV Editor", "Show uv editing related properties.");
844 rna_def_space_image_uv(brna);
847 static void rna_def_space_sequencer(BlenderRNA *brna)
852 static EnumPropertyItem display_mode_items[] = {
853 {SEQ_DRAW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
854 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
855 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
856 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
857 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
858 {0, NULL, 0, NULL, NULL}};
860 srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
861 RNA_def_struct_sdna(srna, "SpaceSeq");
862 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data.");
864 /* display type, fairly important */
865 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
866 RNA_def_property_enum_sdna(prop, NULL, "mainb");
867 RNA_def_property_enum_items(prop, display_mode_items);
868 RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output.");
869 RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL);
872 prop= RNA_def_property(srna, "draw_frames", PROP_BOOLEAN, PROP_NONE);
873 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
874 RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds.");
875 RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL);
877 prop= RNA_def_property(srna, "transform_markers", PROP_BOOLEAN, PROP_NONE);
878 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
879 RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips.");
881 prop= RNA_def_property(srna, "seperate_color_preview", PROP_BOOLEAN, PROP_NONE);
882 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
883 RNA_def_property_ui_text(prop, "Seperate Colors", "Seperate color channels in preview.");
884 RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL);
886 prop= RNA_def_property(srna, "draw_safe_margin", PROP_BOOLEAN, PROP_NONE);
887 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
888 RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview.");
889 RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL);
891 prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
892 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
893 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay.");
894 RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL);
897 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
898 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
899 RNA_def_property_struct_type(prop, "UnknownType");
900 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space.");
902 prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
903 RNA_def_property_int_sdna(prop, NULL, "chanshown");
904 RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined.");
905 RNA_def_property_range(prop, 0, 32); // MAXSEQ --- todo, move from BKE_sequence.h
906 RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL);
908 prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
909 RNA_def_property_int_sdna(prop, NULL, "zebra");
910 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes.");
911 RNA_def_property_range(prop, 0, 110);
912 RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL);
915 /* not sure we need rna access to these but adding anyway */
916 prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE);
917 RNA_def_property_float_sdna(prop, NULL, "xof");
918 RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
920 prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE);
921 RNA_def_property_float_sdna(prop, NULL, "yof");
922 RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center");
924 prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
925 RNA_def_property_float_sdna(prop, NULL, "zoom");
926 RNA_def_property_ui_text(prop, "Zoom", "Display zoom level");
929 static void rna_def_space_text(BlenderRNA *brna)
934 srna= RNA_def_struct(brna, "SpaceTextEditor", "Space");
935 RNA_def_struct_sdna(srna, "SpaceText");
936 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data.");
939 prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
940 RNA_def_property_flag(prop, PROP_EDITABLE);
941 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space.");
942 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL);
943 RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL);
946 prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE);
947 RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
948 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting.");
949 RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
950 RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL);
952 prop= RNA_def_property(srna, "word_wrap", PROP_BOOLEAN, PROP_NONE);
953 RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
954 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
955 RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space.");
956 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
957 RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL);
959 prop= RNA_def_property(srna, "line_numbers", PROP_BOOLEAN, PROP_NONE);
960 RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
961 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text.");
962 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
963 RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL);
965 prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE);
966 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them.");
967 RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL);
969 prop= RNA_def_property(srna, "live_edit", PROP_BOOLEAN, PROP_NONE);
970 RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing.");
972 prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
973 RNA_def_property_int_sdna(prop, NULL, "tabnumber");
974 RNA_def_property_range(prop, 2, 8);
975 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with.");
976 RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL);
978 prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
979 RNA_def_property_int_sdna(prop, NULL, "lheight");
980 RNA_def_property_range(prop, 8, 32);
981 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text.");
982 RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL);
985 prop= RNA_def_property(srna, "find_all", PROP_BOOLEAN, PROP_NONE);
986 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
987 RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one.");
989 prop= RNA_def_property(srna, "find_wrap", PROP_BOOLEAN, PROP_NONE);
990 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
991 RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end.");
993 prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
994 RNA_def_property_string_sdna(prop, NULL, "findstr");
995 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool.");
997 prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
998 RNA_def_property_string_sdna(prop, NULL, "replacestr");
999 RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool.");
1002 static void rna_def_space_dopesheet(BlenderRNA *brna)
1007 static EnumPropertyItem mode_items[] = {
1008 {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""},
1009 {SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""},
1010 {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""}, // XXX to be depreceated?
1011 {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""},
1012 {0, NULL, 0, NULL, NULL}};
1015 srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
1016 RNA_def_struct_sdna(srna, "SpaceAction");
1017 RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data.");
1020 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1021 RNA_def_property_enum_sdna(prop, NULL, "mode");
1022 RNA_def_property_enum_items(prop, mode_items);
1023 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed.");
1026 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
1027 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
1028 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
1029 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
1031 prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
1032 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
1033 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
1035 prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
1036 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
1037 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels.");
1040 prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE);
1041 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
1042 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
1044 // TODO... autosnap, dopesheet?
1047 static void rna_def_space_graph(BlenderRNA *brna)
1052 static EnumPropertyItem mode_items[] = {
1053 {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curves", ""},
1054 {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", ""},
1055 {0, NULL, 0, NULL, NULL}};
1058 srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
1059 RNA_def_struct_sdna(srna, "SpaceIpo");
1060 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data.");
1063 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1064 RNA_def_property_enum_sdna(prop, NULL, "mode");
1065 RNA_def_property_enum_items(prop, mode_items);
1066 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed.");
1069 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
1070 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
1071 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
1072 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
1074 prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
1075 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
1076 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
1078 prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
1079 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
1080 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points.");
1082 prop= RNA_def_property(srna, "only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
1083 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
1084 RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable.");
1087 prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE);
1088 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
1089 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
1091 // TODO... autosnap, dopesheet?
1094 static void rna_def_space_nla(BlenderRNA *brna)
1099 srna= RNA_def_struct(brna, "SpaceNLA", "Space");
1100 RNA_def_struct_sdna(srna, "SpaceNla");
1101 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data.");
1104 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
1105 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
1106 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
1107 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
1109 prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
1110 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
1111 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
1113 prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
1114 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
1115 RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips.");
1118 // TODO... autosnap, dopesheet?
1121 static void rna_def_space_time(BlenderRNA *brna)
1126 srna= RNA_def_struct(brna, "SpaceTimeline", "Space");
1127 RNA_def_struct_sdna(srna, "SpaceTime");
1128 RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data.");
1130 /* Define Anim Playback Areas */
1132 prop= RNA_def_property(srna, "play_top_left", PROP_BOOLEAN, PROP_NONE);
1133 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_REGION);
1134 RNA_def_property_ui_text(prop, "Top-Left 3D Window", "");
1135 RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
1137 prop= RNA_def_property(srna, "play_all_3d", PROP_BOOLEAN, PROP_NONE);
1138 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_3D_WIN);
1139 RNA_def_property_ui_text(prop, "All 3D Windows", "");
1140 RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
1142 prop= RNA_def_property(srna, "play_anim", PROP_BOOLEAN, PROP_NONE);
1143 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_ANIM_WIN);
1144 RNA_def_property_ui_text(prop, "Animation Windows", "");
1145 RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
1147 prop= RNA_def_property(srna, "play_buttons", PROP_BOOLEAN, PROP_NONE);
1148 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_BUTS_WIN);
1149 RNA_def_property_ui_text(prop, "Properties Windows", "");
1150 RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
1152 prop= RNA_def_property(srna, "play_image", PROP_BOOLEAN, PROP_NONE);
1153 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_IMAGE_WIN);
1154 RNA_def_property_ui_text(prop, "Image Windows", "");
1155 RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
1157 prop= RNA_def_property(srna, "play_sequencer", PROP_BOOLEAN, PROP_NONE);
1158 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_SEQ);
1159 RNA_def_property_ui_text(prop, "Sequencer Windows", "");
1160 RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
1164 prop= RNA_def_property(srna, "continue_physics", PROP_BOOLEAN, PROP_NONE);
1165 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_CONTINUE_PHYSICS);
1166 RNA_def_property_ui_text(prop, "Continue Physics", "During playblack, continue physics simulations regardless of the frame number");
1168 prop= RNA_def_property(srna, "only_selected", PROP_BOOLEAN, PROP_NONE);
1169 RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
1170 RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes only from active/selected channels.");
1171 RNA_def_property_update(prop, NC_WINDOW, NULL);
1174 static void rna_def_console_line(BlenderRNA *brna)
1179 srna = RNA_def_struct(brna, "ConsoleLine", NULL);
1180 RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console.");
1182 prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE);
1183 RNA_def_property_string_funcs(prop, "rna_ConsoleLine_line_get", "rna_ConsoleLine_line_length", "rna_ConsoleLine_line_set");
1184 RNA_def_property_ui_text(prop, "Line", "Text in the line.");
1186 prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
1187 RNA_def_property_int_sdna(prop, NULL, "cursor");
1188 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range");
1192 static EnumPropertyItem console_type_items[] = {
1193 {CONSOLE_TYPE_PYTHON, "PYTHON", 0, "Python", ""},
1194 {CONSOLE_TYPE_REPORT, "REPORT", 0, "Report", ""},
1195 {0, NULL, 0, NULL, NULL}};
1197 static void rna_def_space_console(BlenderRNA *brna)
1202 srna= RNA_def_struct(brna, "SpaceConsole", "Space");
1203 RNA_def_struct_sdna(srna, "SpaceConsole");
1204 RNA_def_struct_ui_text(srna, "Space Console", "Interactive python console.");
1207 prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
1208 RNA_def_property_int_sdna(prop, NULL, "lheight");
1209 RNA_def_property_range(prop, 8, 32);
1210 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text.");
1211 RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE, NULL);
1213 prop= RNA_def_property(srna, "console_type", PROP_ENUM, PROP_NONE);
1214 RNA_def_property_enum_sdna(prop, NULL, "type");
1215 RNA_def_property_enum_items(prop, console_type_items);
1216 RNA_def_property_ui_text(prop, "Type", "Console type.");
1217 RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE, NULL);
1219 /* reporting display */
1220 prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
1221 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_DEBUG);
1222 RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info.");
1223 RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL);
1225 prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
1226 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_INFO);
1227 RNA_def_property_ui_text(prop, "Show Info", "Display general information.");
1228 RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL);
1230 prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
1231 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_OP);
1232 RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log.");
1233 RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL);
1235 prop= RNA_def_property(srna, "show_report_warn", PROP_BOOLEAN, PROP_NONE);
1236 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_WARN);
1237 RNA_def_property_ui_text(prop, "Show Warn", "Display warnings.");
1238 RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL);
1240 prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
1241 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_ERR);
1242 RNA_def_property_ui_text(prop, "Show Error", "Display error text.");
1243 RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL);
1247 prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
1248 RNA_def_property_ui_text(prop, "Prompt", "Command line prompt.");
1249 RNA_def_struct_name_property(srna, prop);
1251 prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
1252 RNA_def_property_collection_sdna(prop, NULL, "history", NULL);
1253 RNA_def_property_struct_type(prop, "ConsoleLine");
1254 RNA_def_property_ui_text(prop, "History", "Command history.");
1256 prop= RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
1257 RNA_def_property_collection_sdna(prop, NULL, "scrollback", NULL);
1258 RNA_def_property_struct_type(prop, "ConsoleLine");
1259 RNA_def_property_ui_text(prop, "Output", "Command output.");
1262 static void rna_def_fileselect_params(BlenderRNA *brna)
1267 static EnumPropertyItem file_display_items[] = {
1268 {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
1269 {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
1270 {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
1271 {0, NULL, 0, NULL, NULL}};
1273 static EnumPropertyItem file_sort_items[] = {
1274 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically."},
1275 {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension."},
1276 {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time."},
1277 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size."},
1278 {0, NULL, 0, NULL, NULL}};
1280 srna= RNA_def_struct(brna, "FileSelectParams", NULL);
1281 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters.");
1283 prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
1284 RNA_def_property_string_sdna(prop, NULL, "title");
1285 RNA_def_property_ui_text(prop, "Title", "Title for the file browser.");
1286 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1288 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_NONE);
1289 RNA_def_property_string_sdna(prop, NULL, "dir");
1290 RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser.");
1291 RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL);
1293 prop= RNA_def_property(srna, "file", PROP_STRING, PROP_NONE);
1294 RNA_def_property_string_sdna(prop, NULL, "file");
1295 RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser.");
1296 RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL);
1298 prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE);
1299 RNA_def_property_enum_sdna(prop, NULL, "display");
1300 RNA_def_property_enum_items(prop, file_display_items);
1301 RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
1302 RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL);
1304 prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE);
1305 RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER);
1306 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files.");
1307 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1309 prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE);
1310 RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
1311 RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files.");
1312 RNA_def_property_update(prop, NC_FILE | ND_FILELIST , NULL);
1314 prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE);
1315 RNA_def_property_enum_sdna(prop, NULL, "sort");
1316 RNA_def_property_enum_items(prop, file_sort_items);
1317 RNA_def_property_ui_text(prop, "Sort", "");
1318 RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL);
1320 prop= RNA_def_property(srna, "filter_image", PROP_BOOLEAN, PROP_NONE);
1321 RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE);
1322 RNA_def_property_ui_text(prop, "Filter Images", "Show image files.");
1323 RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
1324 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1326 prop= RNA_def_property(srna, "filter_blender", PROP_BOOLEAN, PROP_NONE);
1327 RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE);
1328 RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files.");
1329 RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
1330 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1332 prop= RNA_def_property(srna, "filter_movie", PROP_BOOLEAN, PROP_NONE);
1333 RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE);
1334 RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files.");
1335 RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
1336 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1338 prop= RNA_def_property(srna, "filter_script", PROP_BOOLEAN, PROP_NONE);
1339 RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE);
1340 RNA_def_property_ui_text(prop, "Filter Script", "Show script files.");
1341 RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
1342 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1344 prop= RNA_def_property(srna, "filter_font", PROP_BOOLEAN, PROP_NONE);
1345 RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE);
1346 RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files.");
1347 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
1348 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1350 prop= RNA_def_property(srna, "filter_sound", PROP_BOOLEAN, PROP_NONE);
1351 RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE);
1352 RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files.");
1353 RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
1354 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1356 prop= RNA_def_property(srna, "filter_text", PROP_BOOLEAN, PROP_NONE);
1357 RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE);
1358 RNA_def_property_ui_text(prop, "Filter Text", "Show text files.");
1359 RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0);
1360 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1362 prop= RNA_def_property(srna, "filter_folder", PROP_BOOLEAN, PROP_NONE);
1363 RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE);
1364 RNA_def_property_ui_text(prop, "Filter Folder", "Show folders.");
1365 RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
1366 RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL);
1371 static void rna_def_space_filebrowser(BlenderRNA *brna)
1376 srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space");
1377 RNA_def_struct_sdna(srna, "SpaceFile");
1378 RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data.");
1380 prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
1381 RNA_def_property_pointer_sdna(prop, NULL, "params");
1382 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceFileBrowser_params_set", NULL);
1383 RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser.");
1386 static void rna_def_space_info(BlenderRNA *brna)
1390 srna= RNA_def_struct(brna, "SpaceInfo", "Space");
1391 RNA_def_struct_sdna(srna, "SpaceInfo");
1392 RNA_def_struct_ui_text(srna, "Space Info", "Info space data.");
1395 static void rna_def_space_userpref(BlenderRNA *brna)
1399 srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
1400 RNA_def_struct_sdna(srna, "SpaceUserPref");
1401 RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data.");
1404 static void rna_def_space_node(BlenderRNA *brna)
1409 static EnumPropertyItem tree_type_items[] = {
1410 {NTREE_SHADER, "MATERIAL", ICON_MATERIAL, "Material", "Material nodes."},
1411 {NTREE_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture nodes."},
1412 {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDERLAYERS, "Compositing", "Compositing nodes."},
1413 {0, NULL, 0, NULL, NULL}};
1415 static EnumPropertyItem texture_type_items[] = {
1416 {SNODE_TEX_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit texture nodes from Object."},
1417 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World."},
1418 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush."},
1419 {0, NULL, 0, NULL, NULL}};
1421 srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space");
1422 RNA_def_struct_sdna(srna, "SpaceNode");
1423 RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data.");
1425 prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
1426 RNA_def_property_enum_sdna(prop, NULL, "treetype");
1427 RNA_def_property_enum_items(prop, tree_type_items);
1428 RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit.");
1429 RNA_def_property_update(prop, NC_NODE, NULL);
1431 prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
1432 RNA_def_property_enum_sdna(prop, NULL, "texfrom");
1433 RNA_def_property_enum_items(prop, texture_type_items);
1434 RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from.");
1435 RNA_def_property_update(prop, NC_NODE, NULL);
1437 prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
1438 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1439 RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited.");
1441 prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
1442 RNA_def_property_pointer_sdna(prop, NULL, "from");
1443 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1444 RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked.");
1446 prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
1447 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1448 RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited.");
1450 prop= RNA_def_property(srna, "backdrop", PROP_BOOLEAN, PROP_NONE);
1451 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
1452 RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes.");
1453 RNA_def_property_update(prop, NC_NODE, NULL);
1456 static void rna_def_space_logic(BlenderRNA *brna)
1460 srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
1461 RNA_def_struct_sdna(srna, "SpaceLogic");
1462 RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data.");
1465 void RNA_def_space(BlenderRNA *brna)
1467 rna_def_space(brna);
1468 rna_def_space_image(brna);
1469 rna_def_space_sequencer(brna);
1470 rna_def_space_text(brna);
1471 rna_def_fileselect_params(brna);
1472 rna_def_space_filebrowser(brna);
1473 rna_def_space_outliner(brna);
1474 rna_def_background_image(brna);
1475 rna_def_space_3dview(brna);
1476 rna_def_space_buttons(brna);
1477 rna_def_space_dopesheet(brna);
1478 rna_def_space_graph(brna);
1479 rna_def_space_nla(brna);
1480 rna_def_space_time(brna);
1481 rna_def_space_console(brna);
1482 rna_def_console_line(brna);
1483 rna_def_space_info(brna);
1484 rna_def_space_userpref(brna);
1485 rna_def_space_node(brna);
1486 rna_def_space_logic(brna);