2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
27 /** \file DNA_space_types.h
32 * Structs for each of space type in the user interface.
35 #ifndef __DNA_SPACE_TYPES_H__
36 #define __DNA_SPACE_TYPES_H__
39 #include "DNA_listBase.h"
40 #include "DNA_color_types.h" /* for Histogram */
41 #include "DNA_vec_types.h"
42 #include "DNA_outliner_types.h" /* for TreeStoreElem */
43 #include "DNA_image_types.h" /* ImageUser */
44 #include "DNA_movieclip_types.h" /* MovieClipUser */
45 #include "DNA_sequence_types.h" /* SequencerScopes */
46 #include "DNA_node_types.h" /* for bNodeInstanceKey */
47 /* Hum ... Not really nice... but needed for spacebuts. */
48 #include "DNA_view2d_types.h"
61 struct FileSelectParams;
66 struct MovieClipScopes;
71 /* SpaceLink (Base) ==================================== */
74 * The base structure all the other spaces
75 * are derived (implicitly) from. Would be
76 * good to make this explicit.
78 typedef struct SpaceLink {
79 struct SpaceLink *next, *prev;
80 ListBase regionbase; /* storage of regions for inactive spaces */
82 float blockscale DNA_DEPRECATED; /* XXX make deprecated */
83 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
87 /* Space Info ========================================== */
90 typedef struct SpaceInfo {
91 SpaceLink *next, *prev;
92 ListBase regionbase; /* storage of regions for inactive spaces */
94 float blockscale DNA_DEPRECATED;
95 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
101 /* SpaceInfo.rpt_mask */
102 typedef enum eSpaceInfo_RptMask {
103 INFO_RPT_DEBUG = (1 << 0),
104 INFO_RPT_INFO = (1 << 1),
105 INFO_RPT_OP = (1 << 2),
106 INFO_RPT_WARN = (1 << 3),
107 INFO_RPT_ERR = (1 << 4),
108 } eSpaceInfo_RptMask;
111 /* Properties Editor ==================================== */
113 /* Properties Editor */
114 typedef struct SpaceButs {
115 SpaceLink *next, *prev;
116 ListBase regionbase; /* storage of regions for inactive spaces */
118 float blockscale DNA_DEPRECATED;
120 short blockhandler[8] DNA_DEPRECATED;
122 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
124 short mainb, mainbo, mainbuser; /* context tabs */
125 short re_align, align; /* align for panels */
126 short preview; /* preview is signal to refresh */
127 /* texture context selector (material, lamp, particles, world, other) */
128 short texture_context, texture_context_prev;
131 void *path; /* runtime */
132 int pathflag, dataicon; /* runtime */
138 /* button defines (deprecated) */
139 /* warning: the values of these defines are used in sbuts->tabs[8] */
140 /* sbuts->mainb new */
141 #define CONTEXT_SCENE 0
142 #define CONTEXT_OBJECT 1
143 #define CONTEXT_TYPES 2
144 #define CONTEXT_SHADING 3
145 #define CONTEXT_EDITING 4
146 #define CONTEXT_SCRIPT 5
147 #define CONTEXT_LOGIC 6
149 /* sbuts->mainb old (deprecated) */
150 #ifdef DNA_DEPRECATED_ALLOW
151 // #define BUTS_VIEW 0
157 #define BUTS_RENDER 6
160 #define BUTS_FPAINT 9
161 #define BUTS_RADIO 10
162 #define BUTS_SCRIPT 11
163 // #define BUTS_SOUND 12
164 #define BUTS_CONSTRAINT 13
165 // #define BUTS_EFFECTS 14
168 /* buts->mainb new */
169 typedef enum eSpaceButtons_Context {
175 BCONTEXT_MATERIAL = 5,
176 BCONTEXT_TEXTURE = 6,
177 BCONTEXT_PARTICLE = 7,
178 BCONTEXT_PHYSICS = 8,
180 BCONTEXT_MODIFIER = 10,
181 BCONTEXT_CONSTRAINT = 11,
182 BCONTEXT_BONE_CONSTRAINT = 12,
183 BCONTEXT_RENDER_LAYER = 13,
184 BCONTEXT_COLLECTION = 14,
186 /* always as last... */
188 } eSpaceButtons_Context;
191 typedef enum eSpaceButtons_Flag {
192 SB_PRV_OSA = (1 << 0),
193 SB_PIN_CONTEXT = (1 << 1),
194 /* SB_WORLD_TEX = (1 << 2), */ /* not used anymore */
195 /* SB_BRUSH_TEX = (1 << 3), */ /* not used anymore */
196 SB_TEX_USER_LIMITED = (1 << 3), /* Do not add materials, particles, etc. in TemplateTextureUser list. */
197 SB_SHADING_CONTEXT = (1 << 4),
198 } eSpaceButtons_Flag;
200 /* sbuts->texture_context */
201 typedef enum eSpaceButtons_Texture_Context {
202 SB_TEXC_MATERIAL = 0,
205 SB_TEXC_PARTICLES = 3,
207 SB_TEXC_LINESTYLE = 5,
208 } eSpaceButtons_Texture_Context;
211 typedef enum eSpaceButtons_Align {
216 } eSpaceButtons_Align;
219 #define BUTS_SENS_SEL 1
220 #define BUTS_SENS_ACT 2
221 #define BUTS_SENS_LINK 4
222 #define BUTS_CONT_SEL 8
223 #define BUTS_CONT_ACT 16
224 #define BUTS_CONT_LINK 32
225 #define BUTS_ACT_SEL 64
226 #define BUTS_ACT_ACT 128
227 #define BUTS_ACT_LINK 256
228 #define BUTS_SENS_STATE 512
229 #define BUTS_ACT_STATE 1024
230 #define BUTS_CONT_INIT_STATE 2048
233 /* Outliner =============================================== */
236 typedef struct SpaceOops {
237 SpaceLink *next, *prev;
238 ListBase regionbase; /* storage of regions for inactive spaces */
240 float blockscale DNA_DEPRECATED;
241 short blockhandler[8] DNA_DEPRECATED;
243 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
247 /* treestore is an ordered list of TreeStoreElem's from outliner tree;
248 * Note that treestore may contain duplicate elements if element
249 * is used multiple times in outliner tree (e. g. linked objects)
250 * Also note that BLI_mempool can not be read/written in DNA directly,
251 * therefore readfile.c/writefile.c linearize treestore into TreeStore structure
253 struct BLI_mempool *treestore;
256 char search_string[64];
257 struct TreeStoreElem search_tse;
259 short flag, outlinevis, storeflag, search_flags;
261 /* pointers to treestore elements, grouped by (id, type, nr) in hashtable for faster searching */
266 /* SpaceOops->flag */
267 typedef enum eSpaceOutliner_Flag {
268 SO_TESTBLOCKS = (1 << 0),
269 SO_NEWSELECTED = (1 << 1),
270 SO_HIDE_RESTRICTCOLS = (1 << 2),
271 SO_HIDE_KEYINGSETINFO = (1 << 3),
272 SO_SKIP_SORT_ALPHA = (1 << 4),
273 } eSpaceOutliner_Flag;
275 /* SpaceOops->outlinevis */
276 typedef enum eSpaceOutliner_Mode {
285 /* SO_VERSE_SESSION = 8, */ /* deprecated! */
286 /* SO_VERSE_MS = 9, */ /* deprecated! */
290 /* SO_KEYMAP = 13, */ /* deprecated! */
294 } eSpaceOutliner_Mode;
296 /* SpaceOops->storeflag */
297 typedef enum eSpaceOutliner_StoreFlag {
299 SO_TREESTORE_CLEANUP = (1 << 0),
300 /* if set, it allows redraws. gets set for some allqueue events */
301 SO_TREESTORE_REDRAW = (1 << 1),
302 /* rebuild the tree, similar to cleanup,
303 * but defer a call to BKE_outliner_treehash_rebuild_from_treestore instead */
304 SO_TREESTORE_REBUILD = (1 << 2),
305 } eSpaceOutliner_StoreFlag;
307 /* outliner search flags (SpaceOops->search_flags) */
308 typedef enum eSpaceOutliner_Search_Flags {
309 SO_FIND_CASE_SENSITIVE = (1 << 0),
310 SO_FIND_COMPLETE = (1 << 1),
311 SO_SEARCH_RECURSIVE = (1 << 2),
312 } eSpaceOutliner_Search_Flags;
315 /* Graph Editor ========================================= */
317 /* 'Graph' Editor (formerly known as the IPO Editor) */
318 typedef struct SpaceIpo {
319 SpaceLink *next, *prev;
320 ListBase regionbase; /* storage of regions for inactive spaces */
322 float blockscale DNA_DEPRECATED;
323 short blockhandler[8] DNA_DEPRECATED;
325 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
327 struct bDopeSheet *ads; /* settings for filtering animation data (NOTE: we use a pointer due to code-linking issues) */
329 ListBase ghostCurves; /* sampled snapshots of F-Curves used as in-session guides */
331 short mode; /* mode for the Graph editor (eGraphEdit_Mode) */
332 short autosnap; /* time-transform autosnapping settings for Graph editor (eAnimEdit_AutoSnap in DNA_action_types.h) */
333 int flag; /* settings for Graph editor (eGraphEdit_Flag) */
335 float cursorTime; /* time value for cursor (when in drivers mode; animation uses current frame) */
336 float cursorVal; /* cursor value (y-value, x-value is current frame) */
337 int around; /* pivot point for transforms */
342 /* SpaceIpo->flag (Graph Editor Settings) */
343 typedef enum eGraphEdit_Flag {
344 /* OLD DEPRECEATED SETTING */
345 /* SIPO_LOCK_VIEW = (1 << 0), */
347 /* don't merge keyframes on the same frame after a transform */
348 SIPO_NOTRANSKEYCULL = (1 << 1),
349 /* don't show any keyframe handles at all */
350 SIPO_NOHANDLES = (1 << 2),
351 /* don't show current frame number beside indicator line */
352 SIPO_NODRAWCFRANUM = (1 << 3),
353 /* show timing in seconds instead of frames */
354 SIPO_DRAWTIME = (1 << 4),
355 /* only show keyframes for selected F-Curves */
356 SIPO_SELCUVERTSONLY = (1 << 5),
357 /* draw names of F-Curves beside the respective curves */
358 /* NOTE: currently not used */
359 SIPO_DRAWNAMES = (1 << 6),
360 /* show sliders in channels list */
361 SIPO_SLIDERS = (1 << 7),
362 /* don't show the horizontal component of the cursor */
363 SIPO_NODRAWCURSOR = (1 << 8),
364 /* only show handles of selected keyframes */
365 SIPO_SELVHANDLESONLY = (1 << 9),
366 /* temporary flag to force channel selections to be synced with main */
367 SIPO_TEMP_NEEDCHANSYNC = (1 << 10),
368 /* don't perform realtime updates */
369 SIPO_NOREALTIMEUPDATES = (1 << 11),
370 /* don't draw curves with AA ("beauty-draw") for performance */
371 SIPO_BEAUTYDRAW_OFF = (1 << 12),
372 /* draw grouped channels with colors set in group */
373 SIPO_NODRAWGCOLORS = (1 << 13),
374 /* normalize curves on display */
375 SIPO_NORMALIZE = (1 << 14),
376 SIPO_NORMALIZE_FREEZE = (1 << 15),
379 /* SpaceIpo->mode (Graph Editor Mode) */
380 typedef enum eGraphEdit_Mode {
381 /* all animation curves (from all over Blender) */
382 SIPO_MODE_ANIMATION = 0,
384 SIPO_MODE_DRIVERS = 1,
388 /* NLA Editor ============================================= */
391 typedef struct SpaceNla {
392 struct SpaceLink *next, *prev;
393 ListBase regionbase; /* storage of regions for inactive spaces */
395 float blockscale DNA_DEPRECATED;
396 short blockhandler[8] DNA_DEPRECATED;
398 short autosnap; /* this uses the same settings as autosnap for Action Editor */
402 struct bDopeSheet *ads;
403 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
407 typedef enum eSpaceNla_Flag {
408 /* flags (1<<0), (1<<1), and (1<<3) are deprecated flags from old verisons */
410 /* draw timing in seconds instead of frames */
411 SNLA_DRAWTIME = (1 << 2),
412 /* don't draw frame number beside frame indicator */
413 SNLA_NODRAWCFRANUM = (1 << 4),
414 /* don't draw influence curves on strips */
415 SNLA_NOSTRIPCURVES = (1 << 5),
416 /* don't perform realtime updates */
417 SNLA_NOREALTIMEUPDATES = (1 << 6),
418 /* don't show local strip marker indications */
419 SNLA_NOLOCALMARKERS = (1 << 7),
423 /* Timeline =============================================== */
425 /* Pointcache drawing data */
426 # /* Only store the data array in the cache to avoid constant reallocation. */
427 # /* No need to store when saved. */
428 typedef struct SpaceTimeCache {
429 struct SpaceTimeCache *next, *prev;
434 typedef struct SpaceTime {
435 SpaceLink *next, *prev;
436 ListBase regionbase; /* storage of regions for inactive spaces */
438 float blockscale DNA_DEPRECATED;
440 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
450 typedef enum eTimeline_Flag {
451 /* show timing in frames instead of in seconds */
452 TIME_DRAWFRAMES = (1 << 0),
453 /* show time indicator box beside the frame number */
454 TIME_CFRA_NUM = (1 << 1),
455 /* only keyframes from active/selected channels get shown */
456 TIME_ONLYACTSEL = (1 << 2),
459 /* time->redraws (now screen->redraws_flag) */
460 typedef enum eScreen_Redraws_Flag {
461 TIME_REGION = (1 << 0),
462 TIME_ALL_3D_WIN = (1 << 1),
463 TIME_ALL_ANIM_WIN = (1 << 2),
464 TIME_ALL_BUTS_WIN = (1 << 3),
465 // TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
467 TIME_ALL_IMAGE_WIN = (1 << 6),
468 // TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
469 TIME_NODES = (1 << 8),
470 TIME_CLIPS = (1 << 9),
472 TIME_FOLLOW = (1 << 15),
473 } eScreen_Redraws_Flag;
476 typedef enum eTimeline_Cache_Flag {
477 TIME_CACHE_DISPLAY = (1 << 0),
478 TIME_CACHE_SOFTBODY = (1 << 1),
479 TIME_CACHE_PARTICLES = (1 << 2),
480 TIME_CACHE_CLOTH = (1 << 3),
481 TIME_CACHE_SMOKE = (1 << 4),
482 TIME_CACHE_DYNAMICPAINT = (1 << 5),
483 TIME_CACHE_RIGIDBODY = (1 << 6),
484 } eTimeline_Cache_Flag;
487 /* Sequence Editor ======================================= */
490 typedef struct SpaceSeq {
491 SpaceLink *next, *prev;
492 ListBase regionbase; /* storage of regions for inactive spaces */
494 float blockscale DNA_DEPRECATED;
496 short blockhandler[8] DNA_DEPRECATED;
498 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
500 float xof DNA_DEPRECATED, yof DNA_DEPRECATED; /* deprecated: offset for drawing the image preview */
501 short mainb; /* weird name for the sequencer subtype (seq, image, luma... etc) */
502 short render_size; /* eSpaceSeq_Proxy_RenderSize */
506 float zoom DNA_DEPRECATED; /* deprecated, handled by View2D now */
507 int view; /* see SEQ_VIEW_* below */
509 int draw_flag; /* overlay an image of the editing on below the strips */
512 struct bGPdata *gpd; /* grease-pencil data */
514 struct SequencerScopes scopes; /* different scoped displayed in space */
516 char multiview_eye; /* multiview current eye - for internal use */
522 typedef enum eSpaceSeq_RegionType {
523 SEQ_DRAW_SEQUENCE = 0,
524 SEQ_DRAW_IMG_IMBUF = 1,
525 SEQ_DRAW_IMG_WAVEFORM = 2,
526 SEQ_DRAW_IMG_VECTORSCOPE = 3,
527 SEQ_DRAW_IMG_HISTOGRAM = 4,
528 } eSpaceSeq_RegionType;
530 /* sseq->draw_flag */
531 typedef enum eSpaceSeq_DrawFlag {
532 SEQ_DRAW_BACKDROP = (1 << 0),
533 SEQ_DRAW_OFFSET_EXT = (1 << 1),
534 } eSpaceSeq_DrawFlag;
538 typedef enum eSpaceSeq_Flag {
539 SEQ_DRAWFRAMES = (1 << 0),
540 SEQ_MARKER_TRANS = (1 << 1),
541 SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
542 SEQ_SHOW_SAFE_MARGINS = (1 << 3),
543 SEQ_SHOW_GPENCIL = (1 << 4),
544 SEQ_NO_DRAW_CFRANUM = (1 << 5),
545 SEQ_USE_ALPHA = (1 << 6), /* use RGBA display mode for preview */
546 SEQ_ALL_WAVEFORMS = (1 << 7), /* draw all waveforms */
547 SEQ_NO_WAVEFORMS = (1 << 8), /* draw no waveforms */
548 SEQ_SHOW_SAFE_CENTER = (1 << 9),
549 SEQ_SHOW_METADATA = (1 << 10),
553 typedef enum eSpaceSeq_Displays {
554 SEQ_VIEW_SEQUENCE = 1,
555 SEQ_VIEW_PREVIEW = 2,
556 SEQ_VIEW_SEQUENCE_PREVIEW = 3,
559 /* sseq->render_size */
560 typedef enum eSpaceSeq_Proxy_RenderSize {
561 SEQ_PROXY_RENDER_SIZE_NONE = -1,
562 SEQ_PROXY_RENDER_SIZE_SCENE = 0,
563 SEQ_PROXY_RENDER_SIZE_25 = 25,
564 SEQ_PROXY_RENDER_SIZE_50 = 50,
565 SEQ_PROXY_RENDER_SIZE_75 = 75,
566 SEQ_PROXY_RENDER_SIZE_100 = 99,
567 SEQ_PROXY_RENDER_SIZE_FULL = 100
568 } eSpaceSeq_Proxy_RenderSize;
570 typedef struct MaskSpaceInfo {
571 /* **** mask editing **** */
581 typedef enum eSpaceSeq_OverlayType {
582 SEQ_DRAW_OVERLAY_RECT = 0,
583 SEQ_DRAW_OVERLAY_REFERENCE = 1,
584 SEQ_DRAW_OVERLAY_CURRENT = 2
585 } eSpaceSeq_OverlayType;
587 /* File Selector ========================================== */
589 /* Config and Input for File Selector */
590 typedef struct FileSelectParams {
591 char title[96]; /* title, also used for the text of the execute button */
592 char dir[1090]; /* directory, FILE_MAX_LIBEXTRA, 1024 + 66, this is for extreme case when 1023 length path
593 * needs to be linked in, where foo.blend/Armature need adding */
595 char file[256]; /* file */
596 char renamefile[256];
597 char renameedit[256]; /* annoying but the first is only used for initialization */
599 char filter_glob[256]; /* list of filetypes to filter */
601 char filter_search[64]; /* text items' name must match to be shown. */
602 int filter_id; /* same as filter, but for ID types (aka library groups). */
604 int active_file; /* active file used for keyboard navigation */
605 int highlight_file; /* file under cursor */
608 unsigned short thumbnail_size;
612 short type; /* XXXXX for now store type here, should be moved to the operator */
613 short flag; /* settings for filter, hiding dots files,... */
614 short sort; /* sort order */
615 short display; /* display mode flag */
616 int filter; /* filter when (flags & FILE_FILTER) is true */
618 short recursion_level; /* max number of levels in dirtree to show at once, 0 to disable recursion. */
620 /* XXX --- still unused -- */
621 short f_fp; /* show font preview */
622 char fp_str[8]; /* string to use for font preview */
624 /* XXX --- end unused -- */
628 typedef struct SpaceFile {
629 SpaceLink *next, *prev;
630 ListBase regionbase; /* storage of regions for inactive spaces */
635 struct FileSelectParams *params; /* config and input for file select */
637 struct FileList *files; /* holds the list of files to show */
639 ListBase *folders_prev; /* holds the list of previous directories to show */
640 ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
642 /* operator that is invoking fileselect
643 * op->exec() will be called on the 'Load' button.
644 * if operator provides op->cancel(), then this will be invoked
645 * on the cancel button.
647 struct wmOperator *op;
649 struct wmTimer *smoothscroll_timer;
650 struct wmTimer *previews_timer;
652 struct FileLayout *layout;
654 short recentnr, bookmarknr;
655 short systemnr, system_bookmarknr;
658 /* FSMenuEntry's without paths indicate separators */
659 typedef struct FSMenuEntry {
660 struct FSMenuEntry *next;
663 char name[256]; /* FILE_MAXFILE */
669 /* FileSelectParams.display */
670 enum FileDisplayTypeE {
671 FILE_DEFAULTDISPLAY = 0,
672 FILE_SHORTDISPLAY = 1,
673 FILE_LONGDISPLAY = 2,
677 /* FileSelectParams.sort */
681 FILE_SORT_EXTENSION = 2,
686 /* these values need to be hardcoded in structs, dna does not recognize defines */
687 /* also defined in BKE */
688 #define FILE_MAXDIR 768
689 #define FILE_MAXFILE 256
690 #define FILE_MAX 1024
692 #define FILE_MAX_LIBEXTRA (FILE_MAX + MAX_ID_NAME)
696 #define FILE_BLENDER 8 /* don't display relative paths */
697 #define FILE_SPECIAL 9
699 #define FILE_LOADLIB 1
701 #define FILE_LOADFONT 3
703 /* filesel op property -> action */
704 typedef enum eFileSel_Action {
709 /* sfile->params->flag and simasel->flag */
710 typedef enum eFileSel_Params_Flag {
711 FILE_SHOWSHORT = (1 << 0),
712 FILE_RELPATH = (1 << 1), /* was FILE_STRINGCODE */
713 FILE_LINK = (1 << 2),
714 FILE_HIDE_DOT = (1 << 3),
715 FILE_AUTOSELECT = (1 << 4),
716 FILE_ACTIVE_COLLECTION = (1 << 5),
717 /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */
718 FILE_DIRSEL_ONLY = (1 << 7),
719 FILE_FILTER = (1 << 8),
720 FILE_BOOKMARKS = (1 << 9),
721 FILE_GROUP_INSTANCE = (1 << 10),
722 } eFileSel_Params_Flag;
725 /* files in filesel list: file types
726 * Note we could use mere values (instead of bitflags) for file types themselves,
727 * but since we do not lack of bytes currently...
729 typedef enum eFileSel_File_Types {
730 FILE_TYPE_BLENDER = (1 << 2),
731 FILE_TYPE_BLENDER_BACKUP = (1 << 3),
732 FILE_TYPE_IMAGE = (1 << 4),
733 FILE_TYPE_MOVIE = (1 << 5),
734 FILE_TYPE_PYSCRIPT = (1 << 6),
735 FILE_TYPE_FTFONT = (1 << 7),
736 FILE_TYPE_SOUND = (1 << 8),
737 FILE_TYPE_TEXT = (1 << 9),
738 /* 1 << 10 was FILE_TYPE_MOVIE_ICON, got rid of this so free slot for future type... */
739 FILE_TYPE_FOLDER = (1 << 11), /* represents folders for filtering */
740 FILE_TYPE_BTX = (1 << 12),
741 FILE_TYPE_COLLADA = (1 << 13),
742 FILE_TYPE_OPERATOR = (1 << 14), /* from filter_glob operator property */
743 FILE_TYPE_APPLICATIONBUNDLE = (1 << 15),
744 FILE_TYPE_ALEMBIC = (1 << 16),
746 FILE_TYPE_DIR = (1 << 30), /* An FS directory (i.e. S_ISDIR on its path is true). */
747 FILE_TYPE_BLENDERLIB = (1 << 31),
748 } eFileSel_File_Types;
750 /* Selection Flags in filesel: struct direntry, unsigned char selflag */
751 typedef enum eDirEntry_SelectFlag {
752 /* FILE_SEL_ACTIVE = (1 << 1), */ /* UNUSED */
753 FILE_SEL_HIGHLIGHTED = (1 << 2),
754 FILE_SEL_SELECTED = (1 << 3),
755 FILE_SEL_EDITING = (1 << 4),
756 } eDirEntry_SelectFlag;
758 #define FILE_LIST_MAX_RECURSION 4
760 /* ***** Related to file browser, but never saved in DNA, only here to help with RNA. ***** */
762 /* About Unique identifier.
763 * Stored in a CustomProps once imported.
764 * Each engine is free to use it as it likes - it will be the only thing passed to it by blender to identify
765 * asset/variant/version (concatenating the three into a single 48 bytes one).
766 * Assumed to be 128bits, handled as four integers due to lack of real bytes proptype in RNA :|.
768 #define ASSET_UUID_LENGTH 16
770 /* Used to communicate with asset engines outside of 'import' context. */
771 typedef struct AssetUUID {
774 int uuid_revision[4];
777 typedef struct AssetUUIDList {
782 /* Container for a revision, only relevant in asset context. */
783 typedef struct FileDirEntryRevision {
784 struct FileDirEntryRevision *next, *prev;
793 /* Temp caching of UI-generated strings... */
797 } FileDirEntryRevision;
799 /* Container for a variant, only relevant in asset context.
800 * In case there are no variants, a single one shall exist, with NULL name/description. */
801 typedef struct FileDirEntryVariant {
802 struct FileDirEntryVariant *next, *prev;
811 } FileDirEntryVariant;
813 /* Container for mere direntry, with additional asset-related data. */
814 typedef struct FileDirEntry {
815 struct FileDirEntry *next, *prev;
821 /* Either point to active variant/revision if available, or own entry (in mere filebrowser case). */
822 FileDirEntryRevision *entry;
824 int typeflag; /* eFileSel_File_Types */
825 int blentype; /* ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */
829 void *poin; /* TODO: make this a real ID pointer? */
832 /* Tags are for info only, most of filtering is done in asset engine. */
844 /* Array of direntries. */
845 /* This struct is used in various, different contexts.
846 * In Filebrowser UI, it stores the total number of available entries, the number of visible (filtered) entries,
847 * and a subset of those in 'entries' ListBase, from idx_start (included) to idx_end (excluded).
848 * In AssetEngine context (i.e. outside of 'browsing' context), entries contain all needed data, there is no filtering,
849 * so nbr_entries_filtered, entry_idx_start and entry_idx_end should all be set to -1.
851 typedef struct FileDirEntryArr {
854 int nbr_entries_filtered;
855 int entry_idx_start, entry_idx_end;
857 char root[1024]; /* FILE_MAX */
860 /* FileDirEntry.status */
862 ASSET_STATUS_LOCAL = 1 << 0, /* If active uuid is available locally/immediately. */
863 ASSET_STATUS_LATEST = 1 << 1, /* If active uuid is latest available version. */
866 /* FileDirEntry.flags */
868 FILE_ENTRY_INVALID_PREVIEW = 1 << 0, /* The preview for this entry could not be generated. */
871 /* Image/UV Editor ======================================== */
873 /* Image/UV Editor */
874 typedef struct SpaceImage {
875 SpaceLink *next, *prev;
876 ListBase regionbase; /* storage of regions for inactive spaces */
882 struct ImageUser iuser;
884 struct Scopes scopes; /* histogram waveform and vectorscope */
885 struct Histogram sample_line_hist; /* sample line histogram */
887 struct bGPdata *gpd; /* grease pencil data */
889 float cursor[2]; /* UV editor 2d cursor */
890 float xof, yof; /* user defined offset, image is centered */
891 float zoom; /* user defined zoom level */
892 float centx, centy; /* storage for offset while render drawing */
894 char mode; /* view/paint/mask */
897 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
899 char dt_uv; /* UV draw type */
900 char sticky; /* sticky selection type */
904 /* Filter settings when editor shows other object's UVs. */
908 MaskSpaceInfo mask_info;
912 /* SpaceImage->dt_uv */
913 typedef enum eSpaceImage_UVDT {
920 /* SpaceImage->dt_uvstretch */
921 typedef enum eSpaceImage_UVDT_Stretch {
922 SI_UVDT_STRETCH_ANGLE = 0,
923 SI_UVDT_STRETCH_AREA = 1,
924 } eSpaceImage_UVDT_Stretch;
926 /* SpaceImage->mode */
927 typedef enum eSpaceImage_Mode {
930 SI_MODE_MASK = 2 /* note: mesh edit mode overrides mask */
933 /* SpaceImage->sticky
934 * Note DISABLE should be 0, however would also need to re-arrange icon order,
935 * also, sticky loc is the default mode so this means we don't need to 'do_versions' */
936 typedef enum eSpaceImage_Sticky {
938 SI_STICKY_DISABLE = 1,
939 SI_STICKY_VERTEX = 2,
940 } eSpaceImage_Sticky;
942 /* SpaceImage->flag */
943 typedef enum eSpaceImage_Flag {
944 /* SI_BE_SQUARE = (1 << 0), */ /* deprecated */
945 /* SI_EDITTILE = (1 << 1), */ /* deprecated */
946 SI_CLIP_UV = (1 << 2),
947 /* SI_DRAWTOOL = (1 << 3), */ /* deprecated */
948 SI_NO_DRAWFACES = (1 << 4),
949 SI_DRAWSHADOW = (1 << 5),
950 /* SI_SELACTFACE = (1 << 6), */ /* deprecated */
951 /* SI_DEPRECATED2 = (1 << 7), */ /* deprecated */
952 /* SI_DEPRECATED3 = (1 << 8), */ /* deprecated */
953 SI_COORDFLOATS = (1 << 9),
954 SI_PIXELSNAP = (1 << 10),
955 SI_LIVE_UNWRAP = (1 << 11),
956 SI_USE_ALPHA = (1 << 12),
957 SI_SHOW_ALPHA = (1 << 13),
958 SI_SHOW_ZBUF = (1 << 14),
960 /* next two for render window display */
961 SI_PREVSPACE = (1 << 15),
962 SI_FULLWINDOW = (1 << 16),
964 /* SI_DEPRECATED4 = (1 << 17), */ /* deprecated */
965 /* SI_DEPRECATED5 = (1 << 18), */ /* deprecated */
967 /* this means that the image is drawn until it reaches the view edge,
968 * in the image view, it's unrelated to the 'tile' mode for texface
970 SI_DRAW_TILE = (1 << 19),
971 SI_SMOOTH_UV = (1 << 20),
972 SI_DRAW_STRETCH = (1 << 21),
973 SI_SHOW_GPENCIL = (1 << 22),
974 SI_DRAW_OTHER = (1 << 23),
976 SI_COLOR_CORRECTION = (1 << 24),
978 SI_NO_DRAW_TEXPAINT = (1 << 25),
979 SI_DRAW_METADATA = (1 << 26),
981 SI_SHOW_R = (1 << 27),
982 SI_SHOW_G = (1 << 28),
983 SI_SHOW_B = (1 << 29),
986 /* SpaceImage->other_uv_filter */
987 typedef enum eSpaceImage_OtherUVFilter {
988 SI_FILTER_SAME_IMAGE = 0,
990 } eSpaceImage_OtherUVFilter;
992 /* Text Editor ============================================ */
995 typedef struct SpaceText {
996 SpaceLink *next, *prev;
997 ListBase regionbase; /* storage of regions for inactive spaces */
999 float blockscale DNA_DEPRECATED;
1000 short blockhandler[8] DNA_DEPRECATED;
1005 short flags, menunr;
1007 short lheight; /* user preference, is font_size! */
1008 char cwidth, linenrs_tot; /* runtime computed, character width and the number of chars to use when showing line numbers */
1016 short live_edit; /* run python while editing, evil */
1019 struct rcti txtscroll, txtbar;
1021 int wordwrap, doplugins;
1023 char findstr[256]; /* ST_MAX_FIND_STR */
1024 char replacestr[256]; /* ST_MAX_FIND_STR */
1026 short margin_column; /* column number to show right margin at */
1027 short lheight_dpi; /* actual lineheight, dpi controlled */
1030 void *drawcache; /* cache for faster drawing */
1032 float scroll_accum[2]; /* runtime, for scroll increments smaller than a line */
1036 /* SpaceText flags (moved from DNA_text_types.h) */
1037 typedef enum eSpaceText_Flags {
1039 ST_SCROLL_SELECT = (1 << 0),
1040 /* clear namespace after script execution (BPY_main.c) */
1041 ST_CLEAR_NAMESPACE = (1 << 4),
1043 ST_FIND_WRAP = (1 << 5),
1044 ST_FIND_ALL = (1 << 6),
1045 ST_SHOW_MARGIN = (1 << 7),
1046 ST_MATCH_CASE = (1 << 8),
1048 ST_FIND_ACTIVATE = (1 << 9),
1051 /* stext->findstr/replacestr */
1052 #define ST_MAX_FIND_STR 256
1054 /* Script View (Obsolete) ================================== */
1056 /* Script Runtime Data - Obsolete (pre 2.5) */
1057 typedef struct Script {
1063 void *py_browsercallback;
1064 void *py_globaldict;
1066 int flags, lastspace;
1067 /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
1068 char scriptname[1024]; /* 1024 = FILE_MAX */
1069 char scriptarg[256]; /* 1024 = FILE_MAX */
1071 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
1073 /* Script View - Obsolete (pre 2.5) */
1074 typedef struct SpaceScript {
1075 SpaceLink *next, *prev;
1076 ListBase regionbase; /* storage of regions for inactive spaces */
1078 float blockscale DNA_DEPRECATED;
1079 struct Script *script;
1081 short flags, menunr;
1087 /* Nodes Editor =========================================== */
1091 typedef struct bNodeTreePath {
1092 struct bNodeTreePath *next, *prev;
1094 struct bNodeTree *nodetree;
1095 bNodeInstanceKey parent_key; /* base key for nodes in this tree instance */
1097 float view_center[2]; /* v2d center point, so node trees can have different offsets in editors */
1099 char node_name[64]; /* MAX_NAME */
1102 typedef struct SpaceNode {
1103 SpaceLink *next, *prev;
1104 ListBase regionbase; /* storage of regions for inactive spaces */
1106 float blockscale DNA_DEPRECATED;
1107 short blockhandler[8] DNA_DEPRECATED;
1109 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
1111 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
1112 short flag, pad1; /* menunr: browse id block in header */
1113 float aspect, pad2; /* internal state variables */
1115 float xof, yof; /* offset for drawing the backdrop */
1116 float zoom; /* zoom for backdrop */
1117 float cursor[2]; /* mouse pos for drawing socketless link and adding nodes */
1119 /* XXX nodetree pointer info is all in the path stack now,
1120 * remove later on and use bNodeTreePath instead. For now these variables are set when pushing/popping
1121 * from path stack, to avoid having to update all the functions and operators. Can be done when
1122 * design is accepted and everything is properly tested.
1126 struct bNodeTree *nodetree, *edittree;
1128 /* tree type for the current node tree */
1129 char tree_idname[64];
1130 int treetype DNA_DEPRECATED; /* treetype: as same nodetree->type */
1133 short texfrom; /* texfrom object, world or brush */
1134 short shaderfrom; /* shader from object or world */
1135 short recalc; /* currently on 0/1, for auto compo */
1137 char insert_ofs_dir; /* direction for offsetting nodes on insertion */
1140 ListBase linkdrag; /* temporary data for modal linking operator */
1141 /* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */
1142 struct NodeInsertOfsData *iofsd; /* temporary data for node insert offset (in UI called Auto-offset) */
1144 struct bGPdata *gpd; /* grease-pencil data */
1148 typedef enum eSpaceNode_Flag {
1149 SNODE_BACKDRAW = (1 << 1),
1150 SNODE_SHOW_GPENCIL = (1 << 2),
1151 SNODE_USE_ALPHA = (1 << 3),
1152 SNODE_SHOW_ALPHA = (1 << 4),
1153 SNODE_SHOW_R = (1 << 7),
1154 SNODE_SHOW_G = (1 << 8),
1155 SNODE_SHOW_B = (1 << 9),
1156 SNODE_AUTO_RENDER = (1 << 5),
1157 // SNODE_SHOW_HIGHLIGHT = (1 << 6), DNA_DEPRECATED
1158 // SNODE_USE_HIDDEN_PREVIEW = (1 << 10), DNA_DEPRECATED December2013
1159 SNODE_NEW_SHADERS = (1 << 11),
1160 SNODE_PIN = (1 << 12),
1161 SNODE_SKIP_INSOFFSET = (1 << 13), /* automatically offset following nodes in a chain on insertion */
1164 /* snode->texfrom */
1165 typedef enum eSpaceNode_TexFrom {
1166 SNODE_TEX_OBJECT = 0,
1167 SNODE_TEX_WORLD = 1,
1168 SNODE_TEX_BRUSH = 2,
1169 SNODE_TEX_LINESTYLE = 3,
1170 } eSpaceNode_TexFrom;
1172 /* snode->shaderfrom */
1173 typedef enum eSpaceNode_ShaderFrom {
1174 SNODE_SHADER_OBJECT = 0,
1175 SNODE_SHADER_WORLD = 1,
1176 SNODE_SHADER_LINESTYLE = 2,
1177 } eSpaceNode_ShaderFrom;
1179 /* snode->insert_ofs_dir */
1181 SNODE_INSERTOFS_DIR_RIGHT = 0,
1182 SNODE_INSERTOFS_DIR_LEFT = 1,
1185 /* Game Logic Editor ===================================== */
1188 typedef struct SpaceLogic {
1189 SpaceLink *next, *prev;
1190 ListBase regionbase; /* storage of regions for inactive spaces */
1192 float blockscale DNA_DEPRECATED;
1194 short blockhandler[8] DNA_DEPRECATED;
1196 short flag, scaflag;
1199 struct bGPdata *gpd; /* grease-pencil data */
1202 /* Console ================================================ */
1204 /* Console content */
1205 typedef struct ConsoleLine {
1206 struct ConsoleLine *next, *prev;
1208 /* keep these 3 vars so as to share free, realloc funcs */
1209 int len_alloc; /* allocated length */
1210 int len; /* real len - strlen() */
1214 int type; /* only for use when in the 'scrollback' listbase */
1217 /* ConsoleLine.type */
1218 typedef enum eConsoleLine_Type {
1219 CONSOLE_LINE_OUTPUT = 0,
1220 CONSOLE_LINE_INPUT = 1,
1221 CONSOLE_LINE_INFO = 2, /* autocomp feedback */
1222 CONSOLE_LINE_ERROR = 3
1223 } eConsoleLine_Type;
1227 typedef struct SpaceConsole {
1228 SpaceLink *next, *prev;
1229 ListBase regionbase; /* storage of regions for inactive spaces */
1231 float blockscale DNA_DEPRECATED; // XXX are these needed?
1232 short blockhandler[8] DNA_DEPRECATED; // XXX are these needed?
1237 ListBase scrollback; /* ConsoleLine; output */
1238 ListBase history; /* ConsoleLine; command history, current edited line is the first */
1240 char language[32]; /* multiple consoles are possible, not just python */
1247 /* User Preferences ======================================= */
1249 /* User Preferences View */
1250 typedef struct SpaceUserPref {
1251 SpaceLink *next, *prev;
1252 ListBase regionbase; /* storage of regions for inactive spaces */
1257 char filter[64]; /* search term for filtering in the UI */
1260 /* Motion Tracking ======================================== */
1263 typedef struct SpaceClip {
1264 SpaceLink *next, *prev;
1265 ListBase regionbase; /* storage of regions for inactive spaces */
1268 float xof, yof; /* user defined offset, image is centered */
1269 float xlockof, ylockof; /* user defined offset from locked position */
1270 float zoom; /* user defined zoom level */
1272 struct MovieClipUser user; /* user of clip */
1273 struct MovieClip *clip; /* clip data */
1274 struct MovieClipScopes scopes; /* different scoped displayed in space panels */
1276 int flag; /* flags */
1277 short mode; /* editor mode (editing context being displayed) */
1278 short view; /* type of the clip editor view */
1280 int path_length; /* length of displaying path, in frames */
1282 /* current stabilization data */
1283 float loc[2], scale, angle; /* pre-composed stabilization data */
1285 float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
1286 * defined when drawing and used for mouse position calculation */
1288 /* movie postprocessing */
1292 short gpencil_src, pad2;
1294 int around, pad4; /* pivot point for transforms */
1296 float cursor[2]; /* Mask editor 2d cursor */
1298 MaskSpaceInfo mask_info;
1301 /* SpaceClip->flag */
1302 typedef enum eSpaceClip_Flag {
1303 SC_SHOW_MARKER_PATTERN = (1 << 0),
1304 SC_SHOW_MARKER_SEARCH = (1 << 1),
1305 SC_LOCK_SELECTION = (1 << 2),
1306 SC_SHOW_TINY_MARKER = (1 << 3),
1307 SC_SHOW_TRACK_PATH = (1 << 4),
1308 SC_SHOW_BUNDLES = (1 << 5),
1309 SC_MUTE_FOOTAGE = (1 << 6),
1310 SC_HIDE_DISABLED = (1 << 7),
1311 SC_SHOW_NAMES = (1 << 8),
1312 SC_SHOW_GRID = (1 << 9),
1313 SC_SHOW_STABLE = (1 << 10),
1314 SC_MANUAL_CALIBRATION = (1 << 11),
1315 SC_SHOW_GPENCIL = (1 << 12),
1316 SC_SHOW_FILTERS = (1 << 13),
1317 SC_SHOW_GRAPH_FRAMES = (1 << 14),
1318 SC_SHOW_GRAPH_TRACKS_MOTION = (1 << 15),
1319 /* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
1320 SC_LOCK_TIMECURSOR = (1 << 17),
1321 SC_SHOW_SECONDS = (1 << 18),
1322 SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
1323 SC_SHOW_GRAPH_HIDDEN = (1 << 20),
1324 SC_SHOW_GRAPH_TRACKS_ERROR = (1 << 21),
1325 SC_SHOW_METADATA = (1 << 22),
1328 /* SpaceClip->mode */
1329 typedef enum eSpaceClip_Mode {
1330 SC_MODE_TRACKING = 0,
1331 /*SC_MODE_RECONSTRUCTION = 1,*/ /* DEPRECATED */
1332 /*SC_MODE_DISTORTION = 2,*/ /* DEPRECATED */
1333 SC_MODE_MASKEDIT = 3,
1336 /* SpaceClip->view */
1337 typedef enum eSpaceClip_View {
1340 SC_VIEW_DOPESHEET = 2,
1343 /* SpaceClip->gpencil_src */
1344 typedef enum eSpaceClip_GPencil_Source {
1345 SC_GPENCIL_SRC_CLIP = 0,
1346 SC_GPENCIL_SRC_TRACK = 1,
1347 } eSpaceClip_GPencil_Source;
1349 /* **************** SPACE DEFINES ********************* */
1351 /* space types, moved from DNA_screen_types.h */
1352 /* Do NOT change order, append on end. types are hardcoded needed */
1353 typedef enum eSpace_Type {
1364 #ifdef DNA_DEPRECATED
1365 SPACE_IMASEL = 10, /* deprecated */
1366 SPACE_SOUND = 11, /* Deprecated */
1370 /* TODO: fully deprecate */
1371 SPACE_SCRIPT = 14, /* Deprecated */
1376 SPACE_USERPREF = 19,
1379 SPACEICONMAX = SPACE_CLIP
1382 /* use for function args */
1383 #define SPACE_TYPE_ANY -1
1386 #define IMG_SIZE_FALLBACK 256
1388 #endif /* __DNA_SPACE_TYPES_H__ */