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"
44 EnumPropertyItem space_type_items[] = {
45 {SPACE_EMPTY, "EMPTY", 0, "Empty", ""},
46 {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""},
47 {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""},
48 {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""},
49 {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""},
50 {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""},
51 {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""},
52 {SPACE_INFO, "INFO", 0, "Info", ""},
53 {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""},
54 {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""},
55 //{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""},
56 {SPACE_SOUND, "AUDIO_WINDOW", 0, "Audio Window", ""},
57 {SPACE_ACTION, "DOPESHEET_EDITOR", 0, "DopeSheet Editor", ""},
58 {SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""},
59 {SPACE_SCRIPT, "SCRIPTS_WINDOW", 0, "Scripts Window", ""},
60 {SPACE_TIME, "TIMELINE", 0, "Timeline", ""},
61 {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""},
62 {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""},
63 {SPACE_CONSOLE, "CONSOLE", 0, "Console", ""},
64 {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
65 {0, NULL, 0, NULL, NULL}};
67 #define DC_RGB {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors."}
68 #define DC_RGBA {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency."}
69 #define DC_ALPHA {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel."}
70 #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)."}
72 #define DC_LCMS {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image."}
74 #define DC_LCMS {0, NULL, 0, NULL, NULL}
76 #define DC_ZERO {0, NULL, 0, NULL, NULL}
78 static EnumPropertyItem dc_all_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_Z, DC_LCMS, DC_ZERO};
83 #include "DNA_anim_types.h"
84 #include "DNA_scene_types.h"
85 #include "DNA_screen_types.h"
87 #include "BKE_animsys.h"
88 #include "BKE_brush.h"
89 #include "BKE_colortools.h"
90 #include "BKE_context.h"
91 #include "BKE_paint.h"
94 #include "ED_screen.h"
96 #include "IMB_imbuf_types.h"
98 static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
100 SpaceLink *space= (SpaceLink*)ptr->data;
102 switch(space->spacetype) {
104 return &RNA_Space3DView;
106 return &RNA_SpaceGraphEditor;
108 return &RNA_SpaceOutliner;
110 return &RNA_SpaceProperties;
112 return &RNA_SpaceFileBrowser;
114 return &RNA_SpaceImageEditor;
116 return &RNA_SpaceInfo;
118 return &RNA_SpaceSequenceEditor;
120 return &RNA_SpaceTextEditor;
122 // return &RNA_SpaceImageBrowser;
124 return &RNA_SpaceAudioWindow;*/
126 return &RNA_SpaceDopeSheetEditor;
128 return &RNA_SpaceNLA;
130 return &RNA_SpaceScriptsWindow;*/
132 return &RNA_SpaceTimeline;
134 return &RNA_SpaceNodeEditor;
136 return &RNA_SpaceLogicEditor;
138 return &RNA_SpaceConsole;
140 return &RNA_SpaceUserPreferences;
146 static int rna_TransformOrientation_getf(PointerRNA *ptr)
148 View3D *v3d= (View3D*)ptr->data;
153 EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, int *free)
156 ListBase *transform_spaces;
157 TransformOrientation *ts= NULL;
159 EnumPropertyItem global = {V3D_MANIP_GLOBAL, "Global", 0, "Global", ""};
160 EnumPropertyItem normal = {V3D_MANIP_NORMAL, "Normal", 0, "Normal", ""};
161 EnumPropertyItem local = {V3D_MANIP_LOCAL, "Local", 0, "Local", ""};
162 EnumPropertyItem view = {V3D_MANIP_VIEW, "View", 0, "View", ""};
163 EnumPropertyItem tmp = {0, "", 0, "", ""};
164 EnumPropertyItem *item= NULL;
165 int i = V3D_MANIP_CUSTOM, totitem= 0;
167 RNA_enum_item_add(&item, &totitem, &global);
168 RNA_enum_item_add(&item, &totitem, &normal);
169 RNA_enum_item_add(&item, &totitem, &local);
170 RNA_enum_item_add(&item, &totitem, &view);
173 scene= CTX_data_scene(C);
176 transform_spaces = &scene->transform_spaces;
177 ts = transform_spaces->first;
181 printf("no scene\n");
186 printf("no context\n");
190 RNA_enum_item_add_separator(&item, &totitem);
192 for(; ts; ts = ts->next) {
193 tmp.identifier = ts->name;
196 RNA_enum_item_add(&item, &totitem, &tmp);
199 RNA_enum_item_end(&item, &totitem);
206 /* Space Image Editor */
208 static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
210 return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
213 static void rna_SpaceImageEditor_paint_update(bContext *C, PointerRNA *ptr)
215 Scene *scene= CTX_data_scene(C);
218 paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
221 static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
223 SpaceImage *sima= (SpaceImage*)(ptr->data);
224 return ED_space_image_show_render(sima);
227 static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
229 SpaceImage *sima= (SpaceImage*)(ptr->data);
230 return ED_space_image_show_paint(sima);
233 static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
235 SpaceImage *sima= (SpaceImage*)(ptr->data);
236 bScreen *sc= (bScreen*)ptr->id.data;
237 return ED_space_image_show_uvedit(sima, sc->scene->obedit);
240 static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
242 SpaceImage *sima= (SpaceImage*)(ptr->data);
243 bScreen *sc= (bScreen*)ptr->id.data;
245 ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data);
248 static EnumPropertyItem dc_rgb_items[] = {DC_RGB, DC_LCMS, DC_ZERO};
249 static EnumPropertyItem dc_alpha_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_LCMS, DC_ZERO};
250 static EnumPropertyItem dc_z_items[] = {DC_RGB, DC_Z, DC_LCMS, DC_ZERO};
252 static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, PointerRNA *ptr, int *free)
254 SpaceImage *sima= (SpaceImage*)ptr->data;
260 /* needed for doc generation */
264 ibuf= ED_space_image_acquire_buffer(sima, &lock);
266 alpha= ibuf && (ibuf->channels == 4);
267 zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
269 ED_space_image_release_buffer(sima, lock);
274 return dc_alpha_items;
281 static void rna_SpaceImageEditor_curves_update(bContext *C, PointerRNA *ptr)
283 SpaceImage *sima= (SpaceImage*)ptr->data;
287 ibuf= ED_space_image_acquire_buffer(sima, &lock);
288 curvemapping_do_ibuf(sima->cumap, ibuf);
289 ED_space_image_release_buffer(sima, lock);
291 WM_event_add_notifier(C, NC_IMAGE, sima->image);
295 /* Space Text Editor */
297 static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
299 SpaceText *st= (SpaceText*)(ptr->data);
305 static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
307 SpaceText *st= (SpaceText*)(ptr->data);
309 st->text= value.data;
313 /* Space Properties */
315 static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
317 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
320 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
325 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
327 SpaceButs *sbuts= (SpaceButs*)(ptr->data);
334 static void rna_ConsoleLine_line_get(PointerRNA *ptr, char *value)
336 ConsoleLine *ci= (ConsoleLine*)ptr->data;
337 strcpy(value, ci->line);
340 static int rna_ConsoleLine_line_length(PointerRNA *ptr)
342 ConsoleLine *ci= (ConsoleLine*)ptr->data;
346 static void rna_ConsoleLine_line_set(PointerRNA *ptr, const char *value)
348 ConsoleLine *ci= (ConsoleLine*)ptr->data;
349 int len= strlen(value);
351 if(len < ci->len_alloc) { /* allocated size is enough? */
352 strcpy(ci->line, value);
354 else { /* allocate a new strnig */
356 ci->line= BLI_strdup(value);
361 if(ci->cursor > len) /* clamp the cursor */
365 static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max)
367 ConsoleLine *ci= (ConsoleLine*)ptr->data;
373 static void rna_View3D_display_background_image_set(PointerRNA *ptr, int value)
375 View3D *vd= (View3D*)ptr->data;
377 if(value) vd->flag |= V3D_DISPBGPIC;
378 else vd->flag &= ~V3D_DISPBGPIC;
380 if((vd->flag & V3D_DISPBGPIC) && vd->bgpic == NULL) {
381 vd->bgpic= MEM_callocN(sizeof(BGpic), "bgpic");
382 vd->bgpic->size= 5.0;
383 vd->bgpic->blend= 0.5;
384 vd->bgpic->iuser.fie_ima= 2;
385 vd->bgpic->iuser.ok= 1;
391 static void rna_SpaceTime_redraw_update(bContext *C, PointerRNA *ptr)
393 SpaceTime *st= (SpaceTime*)ptr->data;
394 ED_screen_animation_timer_update(C, st->redraws);
397 /* Space Dopesheet */
399 static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
401 SpaceAction *saction= (SpaceAction*)(ptr->data);
402 saction->action= value.data;
405 static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
407 SpaceAction *saction= (SpaceAction*)(ptr->data);
408 Object *obact= CTX_data_active_object(C);
410 /* we must set this action to be the one used by active object (if not pinned) */
411 if(obact && saction->pin == 0) {
412 AnimData *adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
415 adt->action= saction->action;
416 id_us_plus(&adt->action->id);
422 static void rna_def_space(BlenderRNA *brna)
427 srna= RNA_def_struct(brna, "Space", NULL);
428 RNA_def_struct_sdna(srna, "SpaceLink");
429 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area.");
430 RNA_def_struct_refine_func(srna, "rna_Space_refine");
432 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
433 RNA_def_property_enum_sdna(prop, NULL, "spacetype");
434 RNA_def_property_enum_items(prop, space_type_items);
435 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
436 RNA_def_property_ui_text(prop, "Type", "Space data type.");
439 static void rna_def_space_image_uv(BlenderRNA *brna)
444 static EnumPropertyItem sticky_mode_items[] = {
445 {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled."},
446 {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location", "Select UVs that are at the same location and share a mesh vertex."},
447 {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."},
448 {0, NULL, 0, NULL, NULL}};
450 static EnumPropertyItem dt_uv_items[] = {
451 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline."},
452 {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges."},
453 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges."},
454 {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges."},
455 {0, NULL, 0, NULL, NULL}};
457 static EnumPropertyItem dt_uvstretch_items[] = {
458 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles."},
459 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces."},
460 {0, NULL, 0, NULL, NULL}};
462 static EnumPropertyItem pivot_items[] = {
463 {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
464 {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
465 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
466 {0, NULL, 0, NULL, NULL}};
468 srna= RNA_def_struct(brna, "SpaceUVEditor", NULL);
469 RNA_def_struct_sdna(srna, "SpaceImage");
470 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
471 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space.");
474 prop= RNA_def_property(srna, "sticky_selection_mode", PROP_ENUM, PROP_NONE);
475 RNA_def_property_enum_sdna(prop, NULL, "sticky");
476 RNA_def_property_enum_items(prop, sticky_mode_items);
477 RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected.");
478 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
481 prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
482 RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
483 RNA_def_property_enum_items(prop, dt_uv_items);
484 RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges.");
485 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
487 prop= RNA_def_property(srna, "draw_smooth_edges", PROP_BOOLEAN, PROP_NONE);
488 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
489 RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased.");
490 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
492 prop= RNA_def_property(srna, "draw_stretch", PROP_BOOLEAN, PROP_NONE);
493 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
494 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).");
495 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
497 prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
498 RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
499 RNA_def_property_enum_items(prop, dt_uvstretch_items);
500 RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw.");
501 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
503 prop= RNA_def_property(srna, "draw_modified_edges", PROP_BOOLEAN, PROP_NONE);
504 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
505 RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied.");
506 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
508 prop= RNA_def_property(srna, "draw_other_objects", PROP_BOOLEAN, PROP_NONE);
509 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
510 RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image.");
511 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
513 prop= RNA_def_property(srna, "normalized_coordinates", PROP_BOOLEAN, PROP_NONE);
514 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
515 RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels.");
516 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
518 /* todo: move edge and face drawing options here from G.f */
520 prop= RNA_def_property(srna, "snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
521 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
522 RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing.");
523 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
525 prop= RNA_def_property(srna, "constrain_to_image_bounds", PROP_BOOLEAN, PROP_NONE);
526 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
527 RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing.");
528 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
530 prop= RNA_def_property(srna, "live_unwrap", PROP_BOOLEAN, PROP_NONE);
531 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
532 RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices.");
533 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
535 prop= RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE);
536 RNA_def_property_enum_sdna(prop, NULL, "around");
537 RNA_def_property_enum_items(prop, pivot_items);
538 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot.");
539 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
542 static void rna_def_space_outliner(BlenderRNA *brna)
547 static EnumPropertyItem display_mode_items[] = {
548 {0, "ALL_SCENES", 0, "All Scenes", ""},
549 {1, "CURRENT_SCENE", 0, "Current Scene", ""},
550 {2, "VISIBLE_LAYERS", 0, "Visible Layers", ""},
551 {3, "SELECTED", 0, "Selected", ""},
552 {4, "ACTIVE", 0, "Active", ""},
553 {5, "SAME_TYPES", 0, "Same Types", ""},
554 {6, "GROUPS", 0, "Groups", ""},
555 {7, "LIBRARIES", 0, "Libraries", ""},
556 {10, "SEQUENCE", 0, "Sequence", ""},
557 {11, "DATABLOCKS", 0, "Datablocks", ""},
558 {12, "USER_PREFERENCES", 0, "User Preferences", ""},
559 {13, "KEYMAPS", 0, "Key Maps", ""},
560 {0, NULL, 0, NULL, NULL}};
562 srna= RNA_def_struct(brna, "SpaceOutliner", "Space");
563 RNA_def_struct_sdna(srna, "SpaceOops");
564 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data.");
566 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
567 RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
568 RNA_def_property_enum_items(prop, display_mode_items);
569 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
570 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
572 prop= RNA_def_property(srna, "show_restriction_columns", PROP_BOOLEAN, PROP_NONE);
573 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
574 RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show colum");
575 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
579 static void rna_def_background_image(BlenderRNA *brna)
584 srna= RNA_def_struct(brna, "BackgroundImage", NULL);
585 RNA_def_struct_sdna(srna, "BGpic");
586 RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background.");
588 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
589 RNA_def_property_pointer_sdna(prop, NULL, "ima");
590 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space.");
591 RNA_def_property_flag(prop, PROP_EDITABLE);
592 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
594 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
595 RNA_def_property_flag(prop, PROP_NEVER_NULL);
596 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
597 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
598 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
600 prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
601 RNA_def_property_float_sdna(prop, NULL, "xof");
602 RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
603 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
605 prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
606 RNA_def_property_float_sdna(prop, NULL, "yof");
607 RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the view center");
608 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
610 prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
611 RNA_def_property_float_sdna(prop, NULL, "size");
612 RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image.");
613 RNA_def_property_range(prop, 0.0, FLT_MAX);
614 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
616 prop= RNA_def_property(srna, "transparency", PROP_FLOAT, PROP_NONE);
617 RNA_def_property_float_sdna(prop, NULL, "blend");
618 RNA_def_property_ui_text(prop, "Transparency", "Amount to blend the image against the background color.");
619 RNA_def_property_range(prop, 0.0, 1.0);
620 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
623 static void rna_def_space_3dview(BlenderRNA *brna)
628 static EnumPropertyItem viewport_shading_items[] = {
629 {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
630 {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
631 {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
632 {OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
633 {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"},
634 {0, NULL, 0, NULL, NULL}};
636 static EnumPropertyItem pivot_items[] = {
637 {V3D_CENTER, "BOUNDING_BOX_CENTER", 0, "Bounding Box Center", ""},
638 {V3D_CURSOR, "CURSOR", 0, "3D Cursor", ""},
639 {V3D_LOCAL, "INDIVIDUAL_CENTERS", 0, "Individual Centers", ""},
640 {V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
641 {V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
642 {0, NULL, 0, NULL, NULL}};
644 static EnumPropertyItem transform_orientation_items[] = {
645 {V3D_MANIP_GLOBAL, "ORIENT_GLOBAL", 0, "Global", "Align the transformation axes to world space"},
646 {V3D_MANIP_LOCAL, "ORIENT_LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
647 {V3D_MANIP_NORMAL, "ORIENT_NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
648 {V3D_MANIP_VIEW, "ORIENT_VIEW", 0, "View", "Align the transformation axes to the window"},
649 {V3D_MANIP_CUSTOM, "ORIENT_CUSTOM", 0, "Custom", "Use a custom transform orientation"},
650 {0, NULL, 0, NULL, NULL}};
652 srna= RNA_def_struct(brna, "Space3DView", "Space");
653 RNA_def_struct_sdna(srna, "View3D");
654 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
656 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
657 RNA_def_property_flag(prop, PROP_EDITABLE);
658 RNA_def_property_pointer_sdna(prop, NULL, "camera");
659 RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera).");
660 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
662 prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
663 RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
664 RNA_def_property_ui_text(prop, "Lock Object", "3D View center is locked to this object's position");
665 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
667 prop= RNA_def_property(srna, "background_image", PROP_POINTER, PROP_NONE);
668 RNA_def_property_pointer_sdna(prop, NULL, "bgpic");
669 RNA_def_property_ui_text(prop, "Background Image", "Image and settings to display in the 3D View background");
671 prop= RNA_def_property(srna, "viewport_shading", PROP_ENUM, PROP_NONE);
672 RNA_def_property_enum_sdna(prop, NULL, "drawtype");
673 RNA_def_property_enum_items(prop, viewport_shading_items);
674 RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View.");
675 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
677 prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
678 RNA_def_property_pointer_sdna(prop, NULL, "localvd");
679 RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility.");
681 prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
682 RNA_def_property_float_sdna(prop, NULL, "lens");
683 RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view.");
684 RNA_def_property_range(prop, 1.0f, 250.0f);
685 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
687 prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
688 RNA_def_property_float_sdna(prop, NULL, "near");
689 RNA_def_property_range(prop, 0.0f, FLT_MAX);
690 RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance.");
691 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
693 prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
694 RNA_def_property_float_sdna(prop, NULL, "far");
695 RNA_def_property_range(prop, 1.0f, FLT_MAX);
696 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance.");
697 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
699 prop= RNA_def_property(srna, "grid_spacing", PROP_FLOAT, PROP_DISTANCE);
700 RNA_def_property_float_sdna(prop, NULL, "grid");
701 RNA_def_property_ui_text(prop, "Grid Spacing", "The distance between 3D View grid lines.");
702 RNA_def_property_range(prop, 0.0f, FLT_MAX);
703 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
705 prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
706 RNA_def_property_int_sdna(prop, NULL, "gridlines");
707 RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view.");
708 RNA_def_property_range(prop, 0, 1024);
709 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
711 prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
712 RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
713 RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines.");
714 RNA_def_property_range(prop, 1, 1024);
715 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
717 prop= RNA_def_property(srna, "display_floor", PROP_BOOLEAN, PROP_NONE);
718 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
719 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view.");
720 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
722 prop= RNA_def_property(srna, "display_x_axis", PROP_BOOLEAN, PROP_NONE);
723 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
724 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view.");
725 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
727 prop= RNA_def_property(srna, "display_y_axis", PROP_BOOLEAN, PROP_NONE);
728 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
729 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view.");
730 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
732 prop= RNA_def_property(srna, "display_z_axis", PROP_BOOLEAN, PROP_NONE);
733 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
734 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view.");
735 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
737 prop= RNA_def_property(srna, "outline_selected", PROP_BOOLEAN, PROP_NONE);
738 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
739 RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views.");
740 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
742 prop= RNA_def_property(srna, "all_object_centers", PROP_BOOLEAN, PROP_NONE);
743 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
744 RNA_def_property_ui_text(prop, "All Object Centers", "Show the object center dot for all (selected and unselected) objects.");
745 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
747 prop= RNA_def_property(srna, "relationship_lines", PROP_BOOLEAN, PROP_NONE);
748 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
749 RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships.");
750 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
752 prop= RNA_def_property(srna, "textured_solid", PROP_BOOLEAN, PROP_NONE);
753 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
754 RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
755 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
757 prop= RNA_def_property(srna, "display_background_image", PROP_BOOLEAN, PROP_NONE);
758 RNA_def_property_boolean_funcs(prop, NULL, "rna_View3D_display_background_image_set");
759 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPIC);
760 RNA_def_property_ui_text(prop, "Display Background Image", "Display a reference image behind objects in the 3D View");
761 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
763 prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
764 RNA_def_property_enum_sdna(prop, NULL, "around");
765 RNA_def_property_enum_items(prop, pivot_items);
766 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling.");
767 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
769 prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE);
770 RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
771 RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms.");
772 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
774 prop= RNA_def_property(srna, "manipulator_translate", PROP_BOOLEAN, PROP_NONE);
775 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE);
776 RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations.");
777 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
779 prop= RNA_def_property(srna, "manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
780 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE);
781 RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations.");
782 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
784 prop= RNA_def_property(srna, "manipulator_scale", PROP_BOOLEAN, PROP_NONE);
785 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE);
786 RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations.");
787 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
789 prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
790 RNA_def_property_enum_sdna(prop, NULL, "twmode");
791 RNA_def_property_enum_items(prop, transform_orientation_items);
792 RNA_def_property_enum_funcs(prop, "rna_TransformOrientation_getf", NULL, "rna_TransformOrientation_itemf");
793 RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation.");
794 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
796 prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
797 RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_LOCKED);
798 RNA_def_property_ui_text(prop, "Lock", "Lock View Rotation");
799 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
801 prop= RNA_def_property(srna, "box_preview", PROP_BOOLEAN, PROP_NONE);
802 RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXVIEW);
803 RNA_def_property_ui_text(prop, "Box", "");
804 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
806 prop= RNA_def_property(srna, "box_clip", PROP_BOOLEAN, PROP_NONE);
807 RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXCLIP);
808 RNA_def_property_ui_text(prop, "Clip", "");
809 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
812 static void rna_def_space_buttons(BlenderRNA *brna)
817 static EnumPropertyItem buttons_context_items[] = {
818 {BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"},
819 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
820 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
821 {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Constraints"},
822 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifiers"},
823 {BCONTEXT_DATA, "DATA", 0, "Data", "Data"},
824 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
825 {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT, "Bone Constraints", "Bone Constraints"},
826 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
827 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
828 {BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Particle"},
829 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
830 {0, NULL, 0, NULL, NULL}};
832 static EnumPropertyItem align_items[] = {
833 {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
834 {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
835 {0, NULL, 0, NULL, NULL}};
837 srna= RNA_def_struct(brna, "SpaceProperties", "Space");
838 RNA_def_struct_sdna(srna, "SpaceButs");
839 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
841 prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
842 RNA_def_property_enum_sdna(prop, NULL, "mainb");
843 RNA_def_property_enum_items(prop, buttons_context_items);
844 RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit.");
845 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
847 prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
848 RNA_def_property_enum_sdna(prop, NULL, "align");
849 RNA_def_property_enum_items(prop, align_items);
850 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
851 RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels.");
852 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
854 prop= RNA_def_property(srna, "brush_texture", PROP_BOOLEAN, PROP_NONE);
855 RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_BRUSH_TEX);
856 RNA_def_property_ui_text(prop, "Brush Texture", "Show brush textures.");
857 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
860 prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
861 RNA_def_property_pointer_sdna(prop, NULL, "pinid");
862 RNA_def_property_struct_type(prop, "ID");
863 RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef");
864 RNA_def_property_flag(prop, PROP_EDITABLE);
865 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
868 static void rna_def_space_image(BlenderRNA *brna)
873 srna= RNA_def_struct(brna, "SpaceImageEditor", "Space");
874 RNA_def_struct_sdna(srna, "SpaceImage");
875 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data.");
878 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
879 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL);
880 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space.");
881 RNA_def_property_flag(prop, PROP_EDITABLE);
882 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
884 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
885 RNA_def_property_flag(prop, PROP_NEVER_NULL);
886 RNA_def_property_pointer_sdna(prop, NULL, "iuser");
887 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
888 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
890 prop= RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE);
891 RNA_def_property_pointer_sdna(prop, NULL, "cumap");
892 RNA_def_property_ui_text(prop, "Curves", "Color curve mapping to use for displaying the image.");
893 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_curves_update");
895 prop= RNA_def_property(srna, "image_pin", PROP_BOOLEAN, PROP_NONE);
896 RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
897 RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection.");
898 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
901 prop= RNA_def_property(srna, "draw_repeated", PROP_BOOLEAN, PROP_NONE);
902 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
903 RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view.");
904 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
906 prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
907 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
908 RNA_def_property_enum_items(prop, dc_all_items);
909 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
910 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw.");
911 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
914 prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
915 RNA_def_property_flag(prop, PROP_NEVER_NULL);
916 RNA_def_property_struct_type(prop, "SpaceUVEditor");
917 RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL);
918 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings.");
921 prop= RNA_def_property(srna, "image_painting", PROP_BOOLEAN, PROP_NONE);
922 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL);
923 RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode.");
924 RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
925 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_paint_update");
928 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
929 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
930 RNA_def_property_struct_type(prop, "UnknownType");
931 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space.");
933 prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
934 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DISPGP);
935 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay.");
938 prop= RNA_def_property(srna, "update_automatically", PROP_BOOLEAN, PROP_NONE);
939 RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
940 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
941 RNA_def_property_ui_text(prop, "Update Automatically", "Update other affected window spaces automatically to reflect changes during interactive operations such as transform.");
944 prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
945 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
946 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
947 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties.");
949 prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
950 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
951 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
952 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties.");
954 prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
955 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
956 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
957 RNA_def_property_ui_text(prop, "Show UV Editor", "Show uv editing related properties.");
959 rna_def_space_image_uv(brna);
962 static void rna_def_space_sequencer(BlenderRNA *brna)
967 static EnumPropertyItem display_mode_items[] = {
968 {SEQ_DRAW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
969 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
970 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
971 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
972 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
973 {0, NULL, 0, NULL, NULL}};
975 srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
976 RNA_def_struct_sdna(srna, "SpaceSeq");
977 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data.");
979 /* display type, fairly important */
980 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
981 RNA_def_property_enum_sdna(prop, NULL, "mainb");
982 RNA_def_property_enum_items(prop, display_mode_items);
983 RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output.");
984 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
987 prop= RNA_def_property(srna, "draw_frames", PROP_BOOLEAN, PROP_NONE);
988 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
989 RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds.");
990 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
992 prop= RNA_def_property(srna, "transform_markers", PROP_BOOLEAN, PROP_NONE);
993 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
994 RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips.");
995 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
997 prop= RNA_def_property(srna, "seperate_color_preview", PROP_BOOLEAN, PROP_NONE);
998 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
999 RNA_def_property_ui_text(prop, "Seperate Colors", "Seperate color channels in preview.");
1000 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1002 prop= RNA_def_property(srna, "draw_safe_margin", PROP_BOOLEAN, PROP_NONE);
1003 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
1004 RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview.");
1005 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1007 prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
1008 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
1009 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay.");
1010 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1013 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
1014 RNA_def_property_pointer_sdna(prop, NULL, "gpd");
1015 RNA_def_property_struct_type(prop, "UnknownType");
1016 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space.");
1017 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1019 prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
1020 RNA_def_property_int_sdna(prop, NULL, "chanshown");
1021 RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined.");
1022 RNA_def_property_range(prop, 0, 32); // MAXSEQ --- todo, move from BKE_sequence.h
1023 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1025 prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
1026 RNA_def_property_int_sdna(prop, NULL, "zebra");
1027 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes.");
1028 RNA_def_property_range(prop, 0, 110);
1029 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1032 /* not sure we need rna access to these but adding anyway */
1033 prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
1034 RNA_def_property_float_sdna(prop, NULL, "xof");
1035 RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
1036 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1038 prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
1039 RNA_def_property_float_sdna(prop, NULL, "yof");
1040 RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center");
1041 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1043 prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
1044 RNA_def_property_float_sdna(prop, NULL, "zoom");
1045 RNA_def_property_ui_text(prop, "Zoom", "Display zoom level");
1046 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
1049 static void rna_def_space_text(BlenderRNA *brna)
1054 srna= RNA_def_struct(brna, "SpaceTextEditor", "Space");
1055 RNA_def_struct_sdna(srna, "SpaceText");
1056 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data.");
1059 prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
1060 RNA_def_property_flag(prop, PROP_EDITABLE);
1061 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space.");
1062 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL);
1063 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1066 prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE);
1067 RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
1068 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting.");
1069 RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
1070 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1072 prop= RNA_def_property(srna, "word_wrap", PROP_BOOLEAN, PROP_NONE);
1073 RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
1074 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
1075 RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space.");
1076 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
1077 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1079 prop= RNA_def_property(srna, "line_numbers", PROP_BOOLEAN, PROP_NONE);
1080 RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
1081 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text.");
1082 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
1083 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1085 prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE);
1086 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them.");
1087 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1089 prop= RNA_def_property(srna, "live_edit", PROP_BOOLEAN, PROP_NONE);
1090 RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing.");
1091 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1093 prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
1094 RNA_def_property_int_sdna(prop, NULL, "tabnumber");
1095 RNA_def_property_range(prop, 2, 8);
1096 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with.");
1097 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1099 prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
1100 RNA_def_property_int_sdna(prop, NULL, "lheight");
1101 RNA_def_property_range(prop, 8, 32);
1102 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text.");
1103 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1106 prop= RNA_def_property(srna, "find_all", PROP_BOOLEAN, PROP_NONE);
1107 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
1108 RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one.");
1109 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1111 prop= RNA_def_property(srna, "find_wrap", PROP_BOOLEAN, PROP_NONE);
1112 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
1113 RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end.");
1114 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1116 prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
1117 RNA_def_property_string_sdna(prop, NULL, "findstr");
1118 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool.");
1119 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1121 prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
1122 RNA_def_property_string_sdna(prop, NULL, "replacestr");
1123 RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool.");
1124 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
1127 static void rna_def_space_dopesheet(BlenderRNA *brna)
1132 static EnumPropertyItem mode_items[] = {
1133 {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""},
1134 {SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""},
1135 {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""}, // XXX to be depreceated?
1136 {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""},
1137 {0, NULL, 0, NULL, NULL}};
1140 srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
1141 RNA_def_struct_sdna(srna, "SpaceAction");
1142 RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data.");
1145 prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
1146 RNA_def_property_flag(prop, PROP_EDITABLE);
1147 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL);
1148 RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space.");
1149 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_action_update");
1152 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1153 RNA_def_property_enum_sdna(prop, NULL, "mode");
1154 RNA_def_property_enum_items(prop, mode_items);
1155 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed.");
1156 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1159 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
1160 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
1161 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
1162 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
1163 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1165 prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
1166 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
1167 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
1168 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1170 prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
1171 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
1172 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels.");
1173 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1176 prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE);
1177 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
1178 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
1179 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
1181 // TODO... autosnap, dopesheet?
1184 static void rna_def_space_graph(BlenderRNA *brna)
1189 static EnumPropertyItem mode_items[] = {
1190 {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curves", ""},
1191 {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", ""},
1192 {0, NULL, 0, NULL, NULL}};
1195 srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
1196 RNA_def_struct_sdna(srna, "SpaceIpo");
1197 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data.");
1200 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1201 RNA_def_property_enum_sdna(prop, NULL, "mode");
1202 RNA_def_property_enum_items(prop, mode_items);
1203 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed.");
1204 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1207 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
1208 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
1209 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
1210 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
1211 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1213 prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
1214 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
1215 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
1216 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1218 prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
1219 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
1220 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels.");
1221 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1223 prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
1224 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
1225 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points.");
1226 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1228 prop= RNA_def_property(srna, "only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
1229 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
1230 RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable.");
1231 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1234 prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE);
1235 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
1236 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
1237 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
1239 // TODO... autosnap, dopesheet?
1242 static void rna_def_space_nla(BlenderRNA *brna)
1247 srna= RNA_def_struct(brna, "SpaceNLA", "Space");
1248 RNA_def_struct_sdna(srna, "SpaceNla");
1249 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data.");
1252 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
1253 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
1254 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
1255 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
1256 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
1258 prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
1259 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
1260 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
1261 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
1263 prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
1264 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
1265 RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips.");
1266 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
1269 // TODO... autosnap, dopesheet?
1272 static void rna_def_space_time(BlenderRNA *brna)
1277 srna= RNA_def_struct(brna, "SpaceTimeline", "Space");
1278 RNA_def_struct_sdna(srna, "SpaceTime");
1279 RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data.");
1281 /* Define Anim Playback Areas */
1283 prop= RNA_def_property(srna, "play_top_left", PROP_BOOLEAN, PROP_NONE);
1284 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_REGION);
1285 RNA_def_property_ui_text(prop, "Top-Left 3D Window", "");
1286 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
1288 prop= RNA_def_property(srna, "play_all_3d", PROP_BOOLEAN, PROP_NONE);
1289 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_3D_WIN);
1290 RNA_def_property_ui_text(prop, "All 3D Windows", "");
1291 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
1293 prop= RNA_def_property(srna, "play_anim", PROP_BOOLEAN, PROP_NONE);
1294 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_ANIM_WIN);
1295 RNA_def_property_ui_text(prop, "Animation Windows", "");
1296 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
1298 prop= RNA_def_property(srna, "play_buttons", PROP_BOOLEAN, PROP_NONE);
1299 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_BUTS_WIN);
1300 RNA_def_property_ui_text(prop, "Properties Windows", "");
1301 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
1303 prop= RNA_def_property(srna, "play_image", PROP_BOOLEAN, PROP_NONE);
1304 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_IMAGE_WIN);
1305 RNA_def_property_ui_text(prop, "Image Windows", "");
1306 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
1308 prop= RNA_def_property(srna, "play_sequencer", PROP_BOOLEAN, PROP_NONE);
1309 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_SEQ);
1310 RNA_def_property_ui_text(prop, "Sequencer Windows", "");
1311 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
1313 prop= RNA_def_property(srna, "play_nodes", PROP_BOOLEAN, PROP_NONE);
1314 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_NODES);
1315 RNA_def_property_ui_text(prop, "Node Windows", "");
1316 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
1320 prop= RNA_def_property(srna, "continue_physics", PROP_BOOLEAN, PROP_NONE);
1321 RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_CONTINUE_PHYSICS);
1322 RNA_def_property_ui_text(prop, "Continue Physics", "During playblack, continue physics simulations regardless of the frame number");
1323 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
1325 prop= RNA_def_property(srna, "only_selected", PROP_BOOLEAN, PROP_NONE);
1326 RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
1327 RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes only from active/selected channels.");
1328 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
1331 static void rna_def_console_line(BlenderRNA *brna)
1336 srna = RNA_def_struct(brna, "ConsoleLine", NULL);
1337 RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console.");
1338 // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
1340 prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE);
1341 RNA_def_property_string_funcs(prop, "rna_ConsoleLine_line_get", "rna_ConsoleLine_line_length", "rna_ConsoleLine_line_set");
1342 RNA_def_property_ui_text(prop, "Line", "Text in the line.");
1343 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
1345 prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
1346 RNA_def_property_int_sdna(prop, NULL, "cursor");
1347 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range");
1348 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
1351 static EnumPropertyItem console_type_items[] = {
1352 {CONSOLE_TYPE_PYTHON, "PYTHON", 0, "Python", ""},
1353 {CONSOLE_TYPE_REPORT, "REPORT", 0, "Report", ""},
1354 {0, NULL, 0, NULL, NULL}};
1356 static void rna_def_space_console(BlenderRNA *brna)
1361 srna= RNA_def_struct(brna, "SpaceConsole", "Space");
1362 RNA_def_struct_sdna(srna, "SpaceConsole");
1363 RNA_def_struct_ui_text(srna, "Space Console", "Interactive python console.");
1366 prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
1367 RNA_def_property_int_sdna(prop, NULL, "lheight");
1368 RNA_def_property_range(prop, 8, 32);
1369 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text.");
1370 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
1372 prop= RNA_def_property(srna, "console_type", PROP_ENUM, PROP_NONE);
1373 RNA_def_property_enum_sdna(prop, NULL, "type");
1374 RNA_def_property_enum_items(prop, console_type_items);
1375 RNA_def_property_ui_text(prop, "Type", "Console type.");
1376 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
1378 /* reporting display */
1379 prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
1380 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_DEBUG);
1381 RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info.");
1382 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
1384 prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
1385 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_INFO);
1386 RNA_def_property_ui_text(prop, "Show Info", "Display general information.");
1387 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
1389 prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
1390 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_OP);
1391 RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log.");
1392 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
1394 prop= RNA_def_property(srna, "show_report_warn", PROP_BOOLEAN, PROP_NONE);
1395 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_WARN);
1396 RNA_def_property_ui_text(prop, "Show Warn", "Display warnings.");
1397 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
1399 prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
1400 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_ERR);
1401 RNA_def_property_ui_text(prop, "Show Error", "Display error text.");
1402 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
1406 prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
1407 RNA_def_property_ui_text(prop, "Prompt", "Command line prompt.");
1408 RNA_def_struct_name_property(srna, prop);
1410 prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
1411 RNA_def_property_collection_sdna(prop, NULL, "history", NULL);
1412 RNA_def_property_struct_type(prop, "ConsoleLine");
1413 RNA_def_property_ui_text(prop, "History", "Command history.");
1415 prop= RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
1416 RNA_def_property_collection_sdna(prop, NULL, "scrollback", NULL);
1417 RNA_def_property_struct_type(prop, "ConsoleLine");
1418 RNA_def_property_ui_text(prop, "Output", "Command output.");
1421 static void rna_def_fileselect_params(BlenderRNA *brna)
1426 static EnumPropertyItem file_display_items[] = {
1427 {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
1428 {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
1429 {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
1430 {0, NULL, 0, NULL, NULL}};
1432 static EnumPropertyItem file_sort_items[] = {
1433 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically."},
1434 {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension."},
1435 {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time."},
1436 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size."},
1437 {0, NULL, 0, NULL, NULL}};
1439 srna= RNA_def_struct(brna, "FileSelectParams", NULL);
1440 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters.");
1442 prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
1443 RNA_def_property_string_sdna(prop, NULL, "title");
1444 RNA_def_property_ui_text(prop, "Title", "Title for the file browser.");
1445 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1447 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_NONE);
1448 RNA_def_property_string_sdna(prop, NULL, "dir");
1449 RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser.");
1450 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
1452 prop= RNA_def_property(srna, "file", PROP_STRING, PROP_NONE);
1453 RNA_def_property_string_sdna(prop, NULL, "file");
1454 RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser.");
1455 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
1457 prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE);
1458 RNA_def_property_enum_sdna(prop, NULL, "display");
1459 RNA_def_property_enum_items(prop, file_display_items);
1460 RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
1461 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
1463 prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE);
1464 RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER);
1465 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files.");
1466 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1468 prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE);
1469 RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
1470 RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files.");
1471 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST , NULL);
1473 prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE);
1474 RNA_def_property_enum_sdna(prop, NULL, "sort");
1475 RNA_def_property_enum_items(prop, file_sort_items);
1476 RNA_def_property_ui_text(prop, "Sort", "");
1477 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
1479 prop= RNA_def_property(srna, "filter_image", PROP_BOOLEAN, PROP_NONE);
1480 RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE);
1481 RNA_def_property_ui_text(prop, "Filter Images", "Show image files.");
1482 RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
1483 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1485 prop= RNA_def_property(srna, "filter_blender", PROP_BOOLEAN, PROP_NONE);
1486 RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE);
1487 RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files.");
1488 RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
1489 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1491 prop= RNA_def_property(srna, "filter_movie", PROP_BOOLEAN, PROP_NONE);
1492 RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE);
1493 RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files.");
1494 RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
1495 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1497 prop= RNA_def_property(srna, "filter_script", PROP_BOOLEAN, PROP_NONE);
1498 RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE);
1499 RNA_def_property_ui_text(prop, "Filter Script", "Show script files.");
1500 RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
1501 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1503 prop= RNA_def_property(srna, "filter_font", PROP_BOOLEAN, PROP_NONE);
1504 RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE);
1505 RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files.");
1506 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
1507 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1509 prop= RNA_def_property(srna, "filter_sound", PROP_BOOLEAN, PROP_NONE);
1510 RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE);
1511 RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files.");
1512 RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
1513 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1515 prop= RNA_def_property(srna, "filter_text", PROP_BOOLEAN, PROP_NONE);
1516 RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE);
1517 RNA_def_property_ui_text(prop, "Filter Text", "Show text files.");
1518 RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0);
1519 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1521 prop= RNA_def_property(srna, "filter_folder", PROP_BOOLEAN, PROP_NONE);
1522 RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE);
1523 RNA_def_property_ui_text(prop, "Filter Folder", "Show folders.");
1524 RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
1525 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
1530 static void rna_def_space_filebrowser(BlenderRNA *brna)
1535 srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space");
1536 RNA_def_struct_sdna(srna, "SpaceFile");
1537 RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data.");
1539 prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
1540 RNA_def_property_pointer_sdna(prop, NULL, "params");
1541 RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser.");
1544 static void rna_def_space_info(BlenderRNA *brna)
1548 srna= RNA_def_struct(brna, "SpaceInfo", "Space");
1549 RNA_def_struct_sdna(srna, "SpaceInfo");
1550 RNA_def_struct_ui_text(srna, "Space Info", "Info space data.");
1553 static void rna_def_space_userpref(BlenderRNA *brna)
1557 srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
1558 RNA_def_struct_sdna(srna, "SpaceUserPref");
1559 RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data.");
1562 static void rna_def_space_node(BlenderRNA *brna)
1567 static EnumPropertyItem tree_type_items[] = {
1568 {NTREE_SHADER, "MATERIAL", ICON_MATERIAL, "Material", "Material nodes."},
1569 {NTREE_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture nodes."},
1570 {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDERLAYERS, "Compositing", "Compositing nodes."},
1571 {0, NULL, 0, NULL, NULL}};
1573 static EnumPropertyItem texture_type_items[] = {
1574 {SNODE_TEX_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit texture nodes from Object."},
1575 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World."},
1576 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush."},
1577 {0, NULL, 0, NULL, NULL}};
1579 srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space");
1580 RNA_def_struct_sdna(srna, "SpaceNode");
1581 RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data.");
1583 prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
1584 RNA_def_property_enum_sdna(prop, NULL, "treetype");
1585 RNA_def_property_enum_items(prop, tree_type_items);
1586 RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit.");
1587 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
1589 prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
1590 RNA_def_property_enum_sdna(prop, NULL, "texfrom");
1591 RNA_def_property_enum_items(prop, texture_type_items);
1592 RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from.");
1593 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
1595 prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
1596 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1597 RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited.");
1599 prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
1600 RNA_def_property_pointer_sdna(prop, NULL, "from");
1601 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1602 RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked.");
1604 prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
1605 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1606 RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited.");
1608 prop= RNA_def_property(srna, "backdrop", PROP_BOOLEAN, PROP_NONE);
1609 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
1610 RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes.");
1611 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
1614 static void rna_def_space_logic(BlenderRNA *brna)
1618 srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
1619 RNA_def_struct_sdna(srna, "SpaceLogic");
1620 RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data.");
1623 void RNA_def_space(BlenderRNA *brna)
1625 rna_def_space(brna);
1626 rna_def_space_image(brna);
1627 rna_def_space_sequencer(brna);
1628 rna_def_space_text(brna);
1629 rna_def_fileselect_params(brna);
1630 rna_def_space_filebrowser(brna);
1631 rna_def_space_outliner(brna);
1632 rna_def_background_image(brna);
1633 rna_def_space_3dview(brna);
1634 rna_def_space_buttons(brna);
1635 rna_def_space_dopesheet(brna);
1636 rna_def_space_graph(brna);
1637 rna_def_space_nla(brna);
1638 rna_def_space_time(brna);
1639 rna_def_space_console(brna);
1640 rna_def_console_line(brna);
1641 rna_def_space_info(brna);
1642 rna_def_space_userpref(brna);
1643 rna_def_space_node(brna);
1644 rna_def_space_logic(brna);