Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * $Id$ | |
3 * | |
4 * ***** BEGIN GPL LICENSE BLOCK ***** | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
5 * | 3 * |
6 * This program is free software; you can redistribute it and/or | 4 * This program is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU General Public License | 5 * modify it under the terms of the GNU General Public License |
8 * as published by the Free Software Foundation; either version 2 | 6 * as published by the Free Software Foundation; either version 2 |
9 * of the License, or (at your option) any later version. | 7 * of the License, or (at your option) any later version. |
10 * | 8 * |
11 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
15 * | 13 * |
16 * You should have received a copy of the GNU General Public License | 14 * 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, | 15 * along with this program; if not, write to the Free Software Foundation, |
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
19 * | 17 * |
20 * Contributor(s): Blender Foundation (2008) | 18 * Contributor(s): Blender Foundation (2008) |
21 * | 19 * |
22 * ***** END GPL LICENSE BLOCK ***** | 20 * ***** END GPL LICENSE BLOCK ***** |
23 */ | 21 */ |
24 | 22 |
25 /** \file blender/makesrna/intern/rna_space.c | 23 /** \file blender/makesrna/intern/rna_space.c |
26 * \ingroup RNA | 24 * \ingroup RNA |
27 */ | 25 */ |
28 | 26 |
29 | |
30 #include <stdlib.h> | 27 #include <stdlib.h> |
28 #include <string.h> | |
31 | 29 |
32 #include "MEM_guardedalloc.h" | 30 #include "MEM_guardedalloc.h" |
33 | 31 |
34 #include "RNA_access.h" | 32 #include "BLF_translation.h" |
35 #include "RNA_define.h" | |
36 | |
37 #include "rna_internal.h" | |
38 | 33 |
39 #include "BKE_key.h" | 34 #include "BKE_key.h" |
35 #include "BKE_movieclip.h" | |
36 #include "BKE_node.h" | |
40 | 37 |
41 #include "DNA_action_types.h" | 38 #include "DNA_action_types.h" |
42 #include "DNA_key_types.h" | 39 #include "DNA_key_types.h" |
40 #include "DNA_material_types.h" | |
43 #include "DNA_node_types.h" | 41 #include "DNA_node_types.h" |
44 #include "DNA_object_types.h" | 42 #include "DNA_object_types.h" |
45 #include "DNA_space_types.h" | 43 #include "DNA_space_types.h" |
44 #include "DNA_sequence_types.h" | |
45 #include "DNA_mask_types.h" | |
46 #include "DNA_view3d_types.h" | 46 #include "DNA_view3d_types.h" |
47 | |
48 #include "RNA_access.h" | |
49 #include "RNA_define.h" | |
50 | |
51 #include "rna_internal.h" | |
47 | 52 |
48 #include "WM_api.h" | 53 #include "WM_api.h" |
49 #include "WM_types.h" | 54 #include "WM_types.h" |
50 | 55 |
56 #include "RE_engine.h" | |
57 #include "RE_pipeline.h" | |
58 | |
59 #include "RNA_enum_types.h" | |
60 | |
61 | |
51 EnumPropertyItem space_type_items[] = { | 62 EnumPropertyItem space_type_items[] = { |
52 » {SPACE_EMPTY, "EMPTY", 0, "Empty", ""}, | 63 » /* empty must be here for python, is skipped for UI */ |
53 » {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""}, | 64 » {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""}, |
54 » {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""}, | 65 » {SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, "3D View", ""}, |
55 » {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""}, | 66 » {0, "", ICON_NONE, NULL, NULL}, |
56 » {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""}, | 67 » {SPACE_TIME, "TIMELINE", ICON_TIME, "Timeline", ""}, |
57 » {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""}, | 68 » {SPACE_IPO, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""}, |
58 » {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""}, | 69 » {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", ""}, |
59 » {SPACE_INFO, "INFO", 0, "Info", ""}, | 70 » {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""}, |
60 » {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""}, | 71 » {0, "", ICON_NONE, NULL, NULL}, |
61 » {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""}, | 72 » {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""}, |
62 » //{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""}, | 73 » {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", " "}, |
63 » {SPACE_SOUND, "AUDIO_WINDOW", 0, "Audio Window", ""}, | 74 » {SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""}, |
64 » {SPACE_ACTION, "DOPESHEET_EDITOR", 0, "DopeSheet Editor", ""}, | 75 » {SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""}, |
65 » {SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""}, | 76 » {SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""}, |
66 » {SPACE_SCRIPT, "SCRIPTS_WINDOW", 0, "Scripts Window", ""}, | 77 » {SPACE_LOGIC, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""}, |
67 » {SPACE_TIME, "TIMELINE", 0, "Timeline", ""}, | 78 » {0, "", ICON_NONE, NULL, NULL}, |
68 » {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""}, | 79 » {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", ""}, |
69 » {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""}, | 80 » {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", ""}, |
70 » {SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""}, | 81 » {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences ", ""}, |
71 » {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""}, | 82 » {SPACE_INFO, "INFO", ICON_INFO, "Info", ""}, |
72 » {0, NULL, 0, NULL, NULL}}; | 83 » {0, "", ICON_NONE, NULL, NULL}, |
84 » {SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""}, | |
85 » {0, "", ICON_NONE, NULL, NULL}, | |
86 » {SPACE_CONSOLE, "CONSOLE", ICON_CONSOLE, "Python Console", ""}, | |
87 » {0, NULL, 0, NULL, NULL} | |
88 }; | |
73 | 89 |
74 static EnumPropertyItem draw_channels_items[] = { | 90 static EnumPropertyItem draw_channels_items[] = { |
91 {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", | |
92 "Draw image with RGB colors and alpha transparency"}, | |
75 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"}, | 93 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"}, |
76 {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", " Draw image with RGB colors and alpha transparency"}, | |
77 {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transpar ency channel"}, | 94 {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transpar ency channel"}, |
78 » {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"}, | 95 » {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", |
79 #ifdef WITH_LCMS | 96 » "Draw Z-buffer associated with image (mapped from camera clip start to end)"}, |
80 » {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Correc ted", "Display color corrected image"}, | 97 » {0, NULL, 0, NULL, NULL} |
81 #endif | 98 }; |
82 » {0, NULL, 0, NULL, NULL}}; | |
83 | 99 |
84 static EnumPropertyItem transform_orientation_items[] = { | 100 static EnumPropertyItem transform_orientation_items[] = { |
85 {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"}, | 101 {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"}, |
86 {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"}, | 102 {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"}, |
87 » {V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the euler rotation axis as used for input"}, | 103 » {V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the Euler rotation axis as used for input"}, |
88 » {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"}, | 104 » {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", |
105 » "Align the transformation axes to average normal of s elected elements " | |
106 » "(bone Y axis for pose mode)"}, | |
89 {V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to th e window"}, | 107 {V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to th e window"}, |
90 {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orient ation"}, | 108 {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orient ation"}, |
91 » {0, NULL, 0, NULL, NULL}}; | 109 » {0, NULL, 0, NULL, NULL} |
92 | 110 }; |
93 EnumPropertyItem autosnap_items[] = { | 111 |
112 #ifndef RNA_RUNTIME | |
113 static EnumPropertyItem autosnap_items[] = { | |
94 {SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""}, | 114 {SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""}, |
95 {SACTSNAP_STEP, "STEP", 0, "Time Step", "Snap to 1.0 frame/second interv als"}, | 115 {SACTSNAP_STEP, "STEP", 0, "Time Step", "Snap to 1.0 frame/second interv als"}, |
96 {SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames/sec onds (nla-action time)"}, | 116 {SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames/sec onds (nla-action time)"}, |
97 {SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker "}, | 117 {SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker "}, |
98 » {0, NULL, 0, NULL, NULL}}; | 118 » {0, NULL, 0, NULL, NULL} |
119 }; | |
120 #endif | |
99 | 121 |
100 EnumPropertyItem viewport_shade_items[] = { | 122 EnumPropertyItem viewport_shade_items[] = { |
101 {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object 's local bounding boxes only"}, | 123 {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object 's local bounding boxes only"}, |
102 {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wi re edges"}, | 124 {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wi re edges"}, |
103 {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"}, | 125 {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"}, |
104 » //{OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid , with preview shading interpolated at vertices"}, | 126 » {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Texture", "Display the object sol id, with a texture"}, |
105 » {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object so lid, with face-assigned textures"}, | 127 » {OB_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Display objec ts solid, with GLSL material"}, |
106 » {0, NULL, 0, NULL, NULL}}; | 128 » {OB_RENDER, "RENDERED", ICON_SMOOTH, "Rendered", "Display render preview "}, |
129 » {0, NULL, 0, NULL, NULL} | |
130 }; | |
131 | |
132 | |
133 EnumPropertyItem clip_editor_mode_items[] = { | |
134 » {SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show trackin g and solving tools"}, | |
135 » {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstructi on", | |
136 » "Show tracking/reconstruction tools"}, | |
137 » {SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distor tion tools"}, | |
138 » {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing too ls"}, | |
139 » {0, NULL, 0, NULL, NULL} | |
140 }; | |
141 | |
142 /* Actually populated dynamically trough a function, but helps for context-less access (e.g. doc, i18n...). */ | |
143 static EnumPropertyItem buttons_context_items[] = { | |
144 » {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene"}, | |
145 » {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render"}, | |
146 » {BCONTEXT_RENDER_LAYER, "RENDER_LAYER", ICON_RENDERLAYERS, "Render Layer s", "Render layers"}, | |
147 » {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"}, | |
148 » {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"}, | |
149 » {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Obj ect constraints"}, | |
150 » {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Object modi fiers"}, | |
151 » {BCONTEXT_DATA, "DATA", ICON_NONE, "Data", "Object data"}, | |
152 » {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"}, | |
153 » {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT_BONE, "Bon e Constraints", "Bone constraints"}, | |
154 » {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"}, | |
155 » {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"}, | |
156 » {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle" }, | |
157 » {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"}, | |
158 » {0, NULL, 0, NULL, NULL} | |
159 }; | |
160 | |
161 /* Actually populated dynamically trough a function, but helps for context-less access (e.g. doc, i18n...). */ | |
162 static EnumPropertyItem buttons_texture_context_items[] = { | |
163 » {SB_TEXC_MATERIAL, "MATERIAL", ICON_MATERIAL, "", "Show material texture s"}, | |
164 » {SB_TEXC_WORLD, "WORLD", ICON_WORLD, "", "Show world textures"}, | |
165 » {SB_TEXC_LAMP, "LAMP", ICON_LAMP, "", "Show lamp textures"}, | |
166 » {SB_TEXC_PARTICLES, "PARTICLES", ICON_PARTICLES, "", "Show particles tex tures"}, | |
167 » {SB_TEXC_OTHER, "OTHER", ICON_TEXTURE, "", "Show other data textures"}, | |
168 » {0, NULL, 0, NULL, NULL} | |
169 }; | |
107 | 170 |
108 #ifdef RNA_RUNTIME | 171 #ifdef RNA_RUNTIME |
109 | 172 |
110 #include "DNA_anim_types.h" | 173 #include "DNA_anim_types.h" |
174 #include "DNA_mask_types.h" | |
111 #include "DNA_scene_types.h" | 175 #include "DNA_scene_types.h" |
112 #include "DNA_screen_types.h" | 176 #include "DNA_screen_types.h" |
177 #include "DNA_userdef_types.h" | |
113 | 178 |
114 #include "BLI_math.h" | 179 #include "BLI_math.h" |
115 | 180 |
116 #include "BKE_animsys.h" | 181 #include "BKE_animsys.h" |
117 #include "BKE_brush.h" | 182 #include "BKE_brush.h" |
118 #include "BKE_colortools.h" | 183 #include "BKE_colortools.h" |
119 #include "BKE_context.h" | 184 #include "BKE_context.h" |
120 #include "BKE_depsgraph.h" | 185 #include "BKE_depsgraph.h" |
121 #include "BKE_paint.h" | 186 #include "BKE_paint.h" |
122 | 187 #include "BKE_scene.h" |
188 #include "BKE_screen.h" | |
189 #include "BKE_icons.h" | |
190 | |
191 #include "ED_buttons.h" | |
123 #include "ED_image.h" | 192 #include "ED_image.h" |
193 #include "ED_node.h" | |
124 #include "ED_screen.h" | 194 #include "ED_screen.h" |
125 #include "ED_view3d.h" | 195 #include "ED_view3d.h" |
126 #include "ED_sequencer.h" | 196 #include "ED_sequencer.h" |
197 #include "ED_clip.h" | |
198 | |
199 #include "GPU_material.h" | |
127 | 200 |
128 #include "IMB_imbuf_types.h" | 201 #include "IMB_imbuf_types.h" |
129 | 202 |
130 static StructRNA* rna_Space_refine(struct PointerRNA *ptr) | 203 #include "UI_interface.h" |
131 { | 204 #include "UI_view2d.h" |
132 » SpaceLink *space= (SpaceLink*)ptr->data; | 205 |
133 | 206 static StructRNA *rna_Space_refine(struct PointerRNA *ptr) |
134 » switch(space->spacetype) { | 207 { |
208 » SpaceLink *space = (SpaceLink *)ptr->data; | |
209 | |
210 » switch (space->spacetype) { | |
135 case SPACE_VIEW3D: | 211 case SPACE_VIEW3D: |
136 return &RNA_SpaceView3D; | 212 return &RNA_SpaceView3D; |
137 case SPACE_IPO: | 213 case SPACE_IPO: |
138 return &RNA_SpaceGraphEditor; | 214 return &RNA_SpaceGraphEditor; |
139 case SPACE_OUTLINER: | 215 case SPACE_OUTLINER: |
140 return &RNA_SpaceOutliner; | 216 return &RNA_SpaceOutliner; |
141 case SPACE_BUTS: | 217 case SPACE_BUTS: |
142 return &RNA_SpaceProperties; | 218 return &RNA_SpaceProperties; |
143 case SPACE_FILE: | 219 case SPACE_FILE: |
144 return &RNA_SpaceFileBrowser; | 220 return &RNA_SpaceFileBrowser; |
145 case SPACE_IMAGE: | 221 case SPACE_IMAGE: |
146 return &RNA_SpaceImageEditor; | 222 return &RNA_SpaceImageEditor; |
147 case SPACE_INFO: | 223 case SPACE_INFO: |
148 return &RNA_SpaceInfo; | 224 return &RNA_SpaceInfo; |
149 case SPACE_SEQ: | 225 case SPACE_SEQ: |
150 return &RNA_SpaceSequenceEditor; | 226 return &RNA_SpaceSequenceEditor; |
151 case SPACE_TEXT: | 227 case SPACE_TEXT: |
152 return &RNA_SpaceTextEditor; | 228 return &RNA_SpaceTextEditor; |
153 //case SPACE_IMASEL: | |
154 // return &RNA_SpaceImageBrowser; | |
155 /*case SPACE_SOUND: | |
156 return &RNA_SpaceAudioWindow;*/ | |
157 case SPACE_ACTION: | 229 case SPACE_ACTION: |
158 return &RNA_SpaceDopeSheetEditor; | 230 return &RNA_SpaceDopeSheetEditor; |
159 case SPACE_NLA: | 231 case SPACE_NLA: |
160 return &RNA_SpaceNLA; | 232 return &RNA_SpaceNLA; |
161 /*case SPACE_SCRIPT: | |
162 return &RNA_SpaceScriptsWindow;*/ | |
163 case SPACE_TIME: | 233 case SPACE_TIME: |
164 return &RNA_SpaceTimeline; | 234 return &RNA_SpaceTimeline; |
165 case SPACE_NODE: | 235 case SPACE_NODE: |
166 return &RNA_SpaceNodeEditor; | 236 return &RNA_SpaceNodeEditor; |
167 case SPACE_LOGIC: | 237 case SPACE_LOGIC: |
168 return &RNA_SpaceLogicEditor; | 238 return &RNA_SpaceLogicEditor; |
169 case SPACE_CONSOLE: | 239 case SPACE_CONSOLE: |
170 return &RNA_SpaceConsole; | 240 return &RNA_SpaceConsole; |
171 case SPACE_USERPREF: | 241 case SPACE_USERPREF: |
172 return &RNA_SpaceUserPreferences; | 242 return &RNA_SpaceUserPreferences; |
243 case SPACE_CLIP: | |
244 return &RNA_SpaceClipEditor; | |
173 default: | 245 default: |
174 return &RNA_Space; | 246 return &RNA_Space; |
175 } | 247 } |
176 } | 248 } |
177 | 249 |
178 static ScrArea *rna_area_from_space(PointerRNA *ptr) | 250 static ScrArea *rna_area_from_space(PointerRNA *ptr) |
179 { | 251 { |
180 » bScreen *sc = (bScreen*)ptr->id.data; | 252 » bScreen *sc = (bScreen *)ptr->id.data; |
181 » SpaceLink *link= (SpaceLink*)ptr->data; | 253 » SpaceLink *link = (SpaceLink *)ptr->data; |
182 ScrArea *sa; | 254 ScrArea *sa; |
183 | 255 |
184 » for(sa=sc->areabase.first; sa; sa=sa->next) | 256 » for (sa = sc->areabase.first; sa; sa = sa->next) |
185 » » if(BLI_findindex(&sa->spacedata, link) != -1) | 257 » » if (BLI_findindex(&sa->spacedata, link) != -1) |
186 return sa; | 258 return sa; |
187 | 259 |
188 return NULL; | 260 return NULL; |
189 } | 261 } |
190 | 262 |
191 static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **sa_r, ARe gion **ar_r) | 263 static void area_region_from_regiondata(bScreen *sc, void *regiondata, ScrArea * *r_sa, ARegion **r_ar) |
192 { | 264 { |
193 » bScreen *sc = (bScreen*)ptr->id.data; | |
194 ScrArea *sa; | 265 ScrArea *sa; |
195 ARegion *ar; | 266 ARegion *ar; |
196 » void *regiondata= ptr->data; | 267 |
197 | 268 » *r_sa = NULL; |
198 » *sa_r= NULL; | 269 » *r_ar = NULL; |
199 » *ar_r= NULL; | 270 |
200 | 271 » for (sa = sc->areabase.first; sa; sa = sa->next) { |
201 » for(sa=sc->areabase.first; sa; sa=sa->next) { | 272 » » for (ar = sa->regionbase.first; ar; ar = ar->next) { |
202 » » for(ar=sa->regionbase.first; ar; ar=ar->next) { | 273 » » » if (ar->regiondata == regiondata) { |
203 » » » if(ar->regiondata == regiondata) { | 274 » » » » *r_sa = sa; |
204 » » » » *sa_r= sa; | 275 » » » » *r_ar = ar; |
205 » » » » *ar_r= ar; | |
206 return; | 276 return; |
207 } | 277 } |
208 } | 278 } |
209 } | 279 } |
210 } | 280 } |
211 | 281 |
282 static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARe gion **r_ar) | |
283 { | |
284 bScreen *sc = (bScreen *)ptr->id.data; | |
285 void *regiondata = ptr->data; | |
286 | |
287 area_region_from_regiondata(sc, regiondata, r_sa, r_ar); | |
288 } | |
289 | |
212 static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr) | 290 static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr) |
213 { | 291 { |
214 » Scene *scene = ((bScreen*)ptr->id.data)->scene; | 292 » Scene *scene = ((bScreen *)ptr->id.data)->scene; |
215 » View3D *v3d= (View3D*)ptr->data; | 293 » View3D *v3d = (View3D *)ptr->data; |
216 ········ | 294 ········ |
217 if (v3d->twmode < V3D_MANIP_CUSTOM) | 295 if (v3d->twmode < V3D_MANIP_CUSTOM) |
218 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation , NULL); | 296 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation , NULL); |
219 else | 297 else |
220 » » return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation , BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM)); | 298 » » return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation , |
221 } | 299 » » BLI_findlink(&scene->transform _spaces, v3d->twmode - V3D_MANIP_CUSTOM)); |
222 | 300 } |
223 EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, i nt *free) | 301 |
302 EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P ropertyRNA *UNUSED(prop), int *free) | |
224 { | 303 { |
225 Scene *scene = NULL; | 304 Scene *scene = NULL; |
226 ListBase *transform_spaces; | 305 ListBase *transform_spaces; |
227 » TransformOrientation *ts= NULL; | 306 » TransformOrientation *ts = NULL; |
228 EnumPropertyItem tmp = {0, "", 0, "", ""}; | 307 EnumPropertyItem tmp = {0, "", 0, "", ""}; |
229 » EnumPropertyItem *item= NULL; | 308 » EnumPropertyItem *item = NULL; |
230 » int i = V3D_MANIP_CUSTOM, totitem= 0; | 309 » int i = V3D_MANIP_CUSTOM, totitem = 0; |
231 | 310 |
232 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_GLOBAL); | 311 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_GLOBAL); |
312 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_LOCAL); | |
233 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_NORMAL); | 313 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_NORMAL); |
234 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_GIMBAL); | 314 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_GIMBAL); |
235 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_LOCAL); | |
236 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_VIEW); | 315 RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V 3D_MANIP_VIEW); |
237 | 316 |
238 if (ptr->type == &RNA_SpaceView3D) | 317 if (ptr->type == &RNA_SpaceView3D) |
239 » » scene = ((bScreen*)ptr->id.data)->scene; | 318 » » scene = ((bScreen *)ptr->id.data)->scene; |
240 else | 319 else |
241 » » scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */ | 320 » » scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */ |
242 | 321 |
243 » if(scene) { | 322 » if (scene) { |
244 transform_spaces = &scene->transform_spaces; | 323 transform_spaces = &scene->transform_spaces; |
245 ts = transform_spaces->first; | 324 ts = transform_spaces->first; |
246 } | 325 } |
247 | 326 |
248 » if(ts) | 327 » if (ts) { |
249 » { | |
250 RNA_enum_item_add_separator(&item, &totitem); | 328 RNA_enum_item_add_separator(&item, &totitem); |
251 | 329 |
252 » » for(; ts; ts = ts->next) { | 330 » » for (; ts; ts = ts->next) { |
253 tmp.identifier = ts->name; | 331 tmp.identifier = ts->name; |
254 » » » tmp.name= ts->name; | 332 » » » tmp.name = ts->name; |
255 tmp.value = i++; | 333 tmp.value = i++; |
256 RNA_enum_item_add(&item, &totitem, &tmp); | 334 RNA_enum_item_add(&item, &totitem, &tmp); |
257 } | 335 } |
258 } | 336 } |
259 | 337 |
260 RNA_enum_item_end(&item, &totitem); | 338 RNA_enum_item_end(&item, &totitem); |
261 » *free= 1; | 339 » *free = 1; |
262 | 340 |
263 return item; | 341 return item; |
264 } | 342 } |
265 | 343 |
266 /* Space 3D View */ | 344 /* Space 3D View */ |
267 static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int valu e) | 345 static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int valu e) |
268 { | 346 { |
269 » View3D *v3d= (View3D*)(ptr->data); | 347 » View3D *v3d = (View3D *)(ptr->data); |
270 » bScreen *sc= (bScreen*)ptr->id.data; | 348 » bScreen *sc = (bScreen *)ptr->id.data; |
271 | 349 |
272 v3d->scenelock = value; | 350 v3d->scenelock = value; |
273 | 351 |
274 » if(value) { | 352 » if (value) { |
275 int bit; | 353 int bit; |
276 » » v3d->lay= sc->scene->lay; | 354 » » v3d->lay = sc->scene->lay; |
277 /* seek for layact */ | 355 /* seek for layact */ |
278 » » bit= 0; | 356 » » bit = 0; |
279 » » while(bit<32) { | 357 » » while (bit < 32) { |
280 » » » if(v3d->lay & (1<<bit)) { | 358 » » » if (v3d->lay & (1 << bit)) { |
281 » » » » v3d->layact= 1<<bit; | 359 » » » » v3d->layact = 1 << bit; |
282 break; | 360 break; |
283 } | 361 } |
284 bit++; | 362 bit++; |
285 } | 363 } |
286 » » v3d->camera= sc->scene->camera; | 364 » » v3d->camera = sc->scene->camera; |
287 } | 365 } |
288 } | 366 } |
289 | 367 |
290 static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values) | 368 static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values) |
291 { | 369 { |
292 » View3D *v3d= (View3D*)(ptr->data); | 370 » View3D *v3d = (View3D *)(ptr->data); |
293 » bScreen *sc= (bScreen*)ptr->id.data; | 371 » bScreen *sc = (bScreen *)ptr->id.data; |
294 » Scene *scene= (Scene *)sc->scene; | 372 » Scene *scene = (Scene *)sc->scene; |
295 » float *loc = give_cursor(scene, v3d); | 373 » const float *loc = ED_view3d_cursor3d_get(scene, v3d); |
296 ········ | 374 ········ |
297 copy_v3_v3(values, loc); | 375 copy_v3_v3(values, loc); |
298 } | 376 } |
299 | 377 |
300 static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values) | 378 static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values) |
301 { | 379 { |
302 » View3D *v3d= (View3D*)(ptr->data); | 380 » View3D *v3d = (View3D *)(ptr->data); |
303 » bScreen *sc= (bScreen*)ptr->id.data; | 381 » bScreen *sc = (bScreen *)ptr->id.data; |
304 » Scene *scene= (Scene *)sc->scene; | 382 » Scene *scene = (Scene *)sc->scene; |
305 » float *cursor = give_cursor(scene, v3d); | 383 » float *cursor = ED_view3d_cursor3d_get(scene, v3d); |
306 ········ | 384 ········ |
307 copy_v3_v3(cursor, values); | 385 copy_v3_v3(cursor, values); |
308 } | 386 } |
309 | 387 |
388 static float rna_View3D_GridScaleUnit_get(PointerRNA *ptr) | |
389 { | |
390 View3D *v3d = (View3D *)(ptr->data); | |
391 bScreen *sc = (bScreen *)ptr->id.data; | |
392 Scene *scene = (Scene *)sc->scene; | |
393 | |
394 return ED_view3d_grid_scale(scene, v3d, NULL); | |
395 } | |
396 | |
310 static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values) | 397 static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values) |
311 { | 398 { |
312 » View3D *v3d= (View3D*)(ptr->data); | 399 » View3D *v3d = (View3D *)(ptr->data); |
313 »······· | 400 »······· |
314 » v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact); | 401 » v3d->lay = ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact); |
315 } | 402 } |
316 | 403 |
317 static void rna_SpaceView3D_layer_update(Main *bmain, Scene *scene, PointerRNA * ptr) | 404 static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), Poin terRNA *UNUSED(ptr)) |
318 { | 405 { |
319 DAG_on_visible_update(bmain, FALSE); | 406 DAG_on_visible_update(bmain, FALSE); |
320 } | 407 } |
321 | 408 |
322 static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr) | 409 static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *UNUSED(sce ne), PointerRNA *ptr) |
323 { | 410 { |
324 » View3D *v3d= (View3D*)(ptr->data); | 411 » View3D *v3d = (View3D *)(ptr->data); |
325 » ScrArea *sa= rna_area_from_space(ptr); | 412 » ScrArea *sa = rna_area_from_space(ptr); |
326 » void *regiondata= NULL; | 413 |
327 » if(sa) { | 414 » ED_view3d_shade_update(bmain, v3d, sa); |
328 » » ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionb ase: &v3d->regionbase; | 415 } |
329 » » ARegion *ar= regionbase->last; /* always last in list, weak .. * / | 416 |
330 » » regiondata= ar->regiondata; | 417 static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(sce ne), PointerRNA *ptr) |
331 » } | 418 { |
332 | 419 » View3D *v3d = (View3D *)(ptr->data); |
333 » return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata); | 420 »······· |
334 } | 421 » if (v3d->defmaterial) { |
335 | 422 » » Material *ma = v3d->defmaterial; |
336 static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr) | 423 » »······· |
337 { | 424 » » if (ma->preview) |
338 » View3D *v3d= (View3D*)(ptr->data); | 425 » » » BKE_previewimg_free(&ma->preview); |
339 » ScrArea *sa= rna_area_from_space(ptr); | 426 » »······· |
340 » void *regiondata= NULL; | 427 » » if (ma->gpumaterial.first) |
341 » if(sa) { | 428 » » » GPU_material_free(ma); |
342 » » ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionb ase: &v3d->regionbase; | 429 » »······· |
343 » » ARegion *ar= regionbase->last; /* always before last in list, we ak .. */ | 430 » » WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma); |
344 | 431 » } |
345 » » ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL; | 432 } |
346 » » if(ar) { | 433 |
347 » » » regiondata= ar->regiondata; | 434 static void rna_SpaceView3D_matcap_enable(Main *UNUSED(bmain), Scene *UNUSED(sce ne), PointerRNA *ptr) |
348 » » } | 435 { |
349 » } | 436 » View3D *v3d = (View3D *)(ptr->data); |
350 | 437 »······· |
351 » return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata); | 438 » if (v3d->matcap_icon == 0) |
352 } | 439 » » v3d->matcap_icon = ICON_MATCAP_01; |
353 | 440 } |
354 static void rna_RegionView3D_quadview_update(Main *main, Scene *scene, PointerRN A *ptr) | 441 |
355 { | 442 static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), Poin terRNA *ptr) |
356 » ScrArea *sa; | 443 { |
357 » ARegion *ar; | 444 » if (U.uiflag & USER_LOCKAROUND) { |
358 | 445 » » View3D *v3d_act = (View3D *)(ptr->data); |
359 » rna_area_region_from_regiondata(ptr, &sa, &ar); | 446 |
360 » if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT) | 447 » » /* TODO, space looper */ |
361 » » ED_view3d_quadview_update(sa, ar, FALSE); | 448 » » bScreen *screen; |
362 } | 449 » » for (screen = bmain->screen.first; screen; screen = screen->id.n ext) { |
363 | 450 » » » ScrArea *sa; |
364 /* same as above but call clip==TRUE */ | 451 » » » for (sa = screen->areabase.first; sa; sa = sa->next) { |
365 static void rna_RegionView3D_quadview_clip_update(Main *main, Scene *scene, Poin terRNA *ptr) | 452 » » » » SpaceLink *sl; |
366 { | 453 » » » » for (sl = sa->spacedata.first; sl; sl = sl->next ) { |
367 » ScrArea *sa; | 454 » » » » » if (sl->spacetype == SPACE_VIEW3D) { |
368 » ARegion *ar; | 455 » » » » » » View3D *v3d = (View3D *)sl; |
369 | 456 » » » » » » if (v3d != v3d_act) { |
370 » rna_area_region_from_regiondata(ptr, &sa, &ar); | 457 » » » » » » » v3d->around = v3d_act->a round; |
371 » if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT) | 458 » » » » » » » v3d->flag = (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN); |
372 » » ED_view3d_quadview_update(sa, ar, TRUE); | 459 » » » » » » » ED_area_tag_redraw_regio ntype(sa, RGN_TYPE_HEADER); |
373 } | 460 » » » » » » } |
374 | 461 » » » » » } |
375 static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values) | 462 » » » » } |
376 { | 463 » return item; |
377 » RegionView3D *rv3d= (RegionView3D *)(ptr->data); | 464 } |
378 » negate_v3_v3(values, rv3d->ofs); | 465 |
379 } | 466 static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *val ues) |
380 | |
381 static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *val ues) | |
382 { | |
383 » RegionView3D *rv3d= (RegionView3D *)(ptr->data); | |
384 » negate_v3_v3(rv3d->ofs, values); | |
385 } | |
386 | |
387 /* Space Image Editor */ | |
388 | |
389 static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr) | |
390 { | |
391 » return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data); | |
392 } | |
393 | |
394 static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, Pointer RNA *ptr) | |
395 { | |
396 » paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PA INT); | |
397 | |
398 » ED_space_image_paint_update(bmain->wm.first, scene->toolsettings); | |
399 } | |
400 | |
401 static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr) | |
402 { | |
403 » SpaceImage *sima= (SpaceImage*)(ptr->data); | |
404 » return ED_space_image_show_render(sima); | |
405 } | |
406 | |
407 static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr) | |
408 { | |
409 » SpaceImage *sima= (SpaceImage*)(ptr->data); | |
410 » return ED_space_image_show_paint(sima); | |
411 } | |
412 | |
413 static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr) | |
414 { | |
415 » SpaceImage *sima= (SpaceImage*)(ptr->data); | |
416 » bScreen *sc= (bScreen*)ptr->id.data; | |
417 » return ED_space_image_show_uvedit(sima, sc->scene->obedit); | |
418 } | |
419 | |
420 static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value) | |
421 { | |
422 » SpaceImage *sima= (SpaceImage*)(ptr->data); | |
423 » bScreen *sc= (bScreen*)ptr->id.data; | |
424 | |
425 » ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)val ue.data); | |
426 } | |
427 | |
428 static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P ointerRNA *ptr, int *free) | |
429 { | 467 { |
430 SpaceImage *sima= (SpaceImage*)ptr->data; | 468 SpaceImage *sima= (SpaceImage*)ptr->data; |
431 EnumPropertyItem *item= NULL; | |
432 ImBuf *ibuf; | |
433 void *lock; | |
434 int zbuf, alpha, totitem= 0; | |
435 | |
436 ibuf= ED_space_image_acquire_buffer(sima, &lock); | |
437 ········ | |
438 alpha= ibuf && (ibuf->channels == 4); | |
439 zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1)); | |
440 | |
441 ED_space_image_release_buffer(sima, lock); | |
442 | |
443 if(alpha && zbuf) | |
444 return draw_channels_items; | |
445 | |
446 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0); | |
447 | |
448 if(alpha) { | |
449 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, S I_USE_ALPHA); | |
450 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, S I_SHOW_ALPHA); | |
451 } | |
452 else if(zbuf) { | |
453 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, S I_SHOW_ZBUF); | |
454 } | |
455 | |
456 #ifdef WITH_LCMS | |
457 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_COLOR_ CORRECTION); | |
458 #endif | |
459 | |
460 RNA_enum_item_end(&item, &totitem); | |
461 *free= 1; | |
462 | |
463 return item; | |
464 } | |
465 | |
466 static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values) | |
467 { | |
468 SpaceImage *sima= (SpaceImage*)ptr->data; | |
469 ScrArea *sa; | |
470 ARegion *ar; | |
471 | |
472 values[0] = values[1] = 1; | |
473 | |
474 sa = rna_area_from_space(ptr); | |
475 if(!sa) return; | |
476 ········ | |
477 /* find aregion */ | |
478 for(ar=sa->regionbase.first; ar; ar=ar->next) { | |
479 if(ar->regiontype == RGN_TYPE_WINDOW) | |
480 break; | |
481 } | |
482 if(!ar) return; | |
483 | |
484 ED_space_image_zoom(sima, ar, &values[0], &values[1]); | |
brechtvl
2011/04/01 09:02:50
This should get a stub in source/blenderplayer/bad
| |
485 } | |
486 | |
487 static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *val ues) | |
488 { | |
489 SpaceImage *sima= (SpaceImage*)ptr->data; | |
490 ········ | |
491 if (sima->flag & SI_COORDFLOATS) { | |
492 copy_v2_v2(values, sima->cursor); | |
493 } else { | |
494 int w, h; | |
495 ED_space_image_size(sima, &w, &h); | |
496 ················ | |
497 values[0] = sima->cursor[0] * w; | |
498 values[1] = sima->cursor[1] * h; | |
499 } | |
500 } | |
501 | |
502 static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const floa t *values) | |
503 { | |
504 SpaceImage *sima= (SpaceImage*)ptr->data; | |
505 ········ | |
506 if (sima->flag & SI_COORDFLOATS) { | |
507 copy_v2_v2(sima->cursor, values); | |
508 } else { | |
509 int w, h; | |
510 ED_space_image_size(sima, &w, &h); | |
511 ················ | |
512 sima->cursor[0] = values[0] / w; | |
513 sima->cursor[1] = values[1] / h; | |
514 } | |
515 } | |
516 | |
517 static void rna_SpaceImageEditor_curves_update(Main *bmain, Scene *scene, Pointe rRNA *ptr) | |
518 { | |
519 SpaceImage *sima= (SpaceImage*)ptr->data; | |
520 ImBuf *ibuf; | |
521 void *lock; | |
522 | |
523 ibuf= ED_space_image_acquire_buffer(sima, &lock); | |
524 if(ibuf->rect_float) | |
525 curvemapping_do_ibuf(sima->cumap, ibuf); | |
526 ED_space_image_release_buffer(sima, lock); | |
527 | |
528 WM_main_add_notifier(NC_IMAGE, sima->image); | |
529 } | |
530 | |
531 static void rna_SpaceImageEditor_scopes_update(Main *bmain, Scene *scene, Pointe rRNA *ptr) | |
532 { | |
533 SpaceImage *sima= (SpaceImage*)ptr->data; | |
534 ImBuf *ibuf; | |
535 void *lock; | |
536 ········ | |
537 ibuf= ED_space_image_acquire_buffer(sima, &lock); | |
538 if(ibuf) { | |
539 scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_C OLOR_MANAGEMENT); | |
540 WM_main_add_notifier(NC_IMAGE, sima->image); | |
541 } | |
542 ED_space_image_release_buffer(sima, lock); | |
543 } | |
544 | |
545 /* Space Text Editor */ | |
546 | |
547 static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value) | |
548 { | |
549 SpaceText *st= (SpaceText*)(ptr->data); | |
550 | |
551 st->wordwrap= value; | |
552 st->left= 0; | |
553 } | |
554 | |
555 static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) | |
556 { | |
557 SpaceText *st= (SpaceText*)(ptr->data); | |
558 | |
559 st->text= value.data; | |
560 st->top= 0; | |
561 } | |
562 | |
563 /* Space Properties */ | |
564 | |
565 /* note: this function exists only to avoid id refcounting */ | |
566 static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value) | |
567 { | |
568 SpaceButs *sbuts= (SpaceButs*)(ptr->data); | |
569 sbuts->pinid= value.data; | |
570 } | |
571 | |
572 static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) | |
573 { | |
574 SpaceButs *sbuts= (SpaceButs*)(ptr->data); | |
575 | |
576 if(sbuts->pinid) | |
577 return ID_code_to_RNA_type(GS(sbuts->pinid->name)); | |
578 | |
579 return &RNA_ID; | |
580 } | |
581 | |
582 static void rna_SpaceProperties_pin_id_update(Main *bmain, Scene *scene, Pointer RNA *ptr) | |
583 { | |
584 SpaceButs *sbuts= (SpaceButs*)(ptr->data); | |
585 ID *id = sbuts->pinid; | |
586 ········ | |
587 if (id == NULL) { | |
588 sbuts->flag &= ~SB_PIN_CONTEXT; | |
589 return; | |
590 } | |
591 ········ | |
592 switch (GS(id->name)) { | |
593 case ID_MA: | |
594 WM_main_add_notifier(NC_MATERIAL|ND_SHADING, NULL); | |
595 break; | |
596 case ID_TE: | |
597 WM_main_add_notifier(NC_TEXTURE, NULL); | |
598 break; | |
599 case ID_WO: | |
600 WM_main_add_notifier(NC_WORLD, NULL); | |
601 break; | |
602 case ID_LA: | |
603 WM_main_add_notifier(NC_LAMP, NULL); | |
604 break; | |
605 } | |
606 } | |
607 | |
608 | |
609 static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value) | |
610 { | |
611 SpaceButs *sbuts= (SpaceButs*)(ptr->data); | |
612 ········ | |
613 sbuts->mainb= value; | |
614 sbuts->mainbuser = value; | |
615 } | |
616 | |
617 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) | |
618 { | |
619 SpaceButs *sbuts= (SpaceButs*)(ptr->data); | |
620 | |
621 sbuts->align= value; | |
622 sbuts->re_align= 1; | |
623 } | |
624 | |
625 /* Space Console */ | |
626 static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value) | |
627 { | |
628 ConsoleLine *ci= (ConsoleLine*)ptr->data; | |
629 strcpy(value, ci->line); | |
630 } | |
631 | |
632 static int rna_ConsoleLine_body_length(PointerRNA *ptr) | |
633 { | |
634 ConsoleLine *ci= (ConsoleLine*)ptr->data; | |
635 return ci->len; | |
636 } | |
637 | |
638 static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value) | |
639 { | |
640 ConsoleLine *ci= (ConsoleLine*)ptr->data; | |
641 int len= strlen(value); | |
642 ········ | |
643 if((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */ | |
644 MEM_freeN(ci->line); | |
645 ci->line= MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline "); | |
646 ci->len_alloc= len + 1; | |
647 } | |
648 memcpy(ci->line, value, len + 1); | |
649 ci->len= len; | |
650 | |
651 if(ci->cursor > len) /* clamp the cursor */ | |
652 ci->cursor= len; | |
653 } | |
654 | |
655 static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *m ax) | |
656 { | |
657 ConsoleLine *ci= (ConsoleLine*)ptr->data; | |
658 | |
659 *min= 0; | |
660 *max= ci->len; | |
661 } | |
662 | |
663 /* Space Dopesheet */ | |
664 | |
665 static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu e) | |
666 { | |
667 SpaceAction *saction= (SpaceAction*)(ptr->data); | |
668 saction->action= value.data; | |
669 } | |
670 | |
671 static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, Po interRNA *ptr) | |
672 { | |
673 SpaceAction *saction= (SpaceAction*)(ptr->data); | |
674 Object *obact= (scene->basact)? scene->basact->object: NULL; | |
675 | |
676 /* we must set this action to be the one used by active object (if not p inned) */ | |
677 if (obact/* && saction->pin == 0*/) { | |
678 AnimData *adt = NULL; | |
679 ················ | |
680 if (saction->mode == SACTCONT_ACTION) { | |
681 // TODO: context selector could help decide this with mo re control? | |
682 adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */ | |
683 } | |
684 else if (saction->mode == SACTCONT_SHAPEKEY) { | |
685 Key *key = ob_get_key(obact); | |
686 if (key) | |
687 adt= BKE_id_add_animdata(&key->id); /* this only adds if non-existant */ | |
688 } | |
689 ················ | |
690 /* set action */ | |
691 if (adt) { | |
692 /* fix id-count of action we're replacing */ | |
693 id_us_min(&adt->action->id); | |
694 ························ | |
695 /* show new id-count of action we're replacing */ | |
696 adt->action= saction->action; | |
697 id_us_plus(&adt->action->id); | |
698 } | |
699 ················ | |
700 /* force depsgraph flush too */ | |
701 DAG_id_tag_update(&obact->id, OB_RECALC_OB|OB_RECALC_DATA); | |
702 } | |
703 } | |
704 | |
705 static void rna_SpaceDopeSheetEditor_mode_update(Main *bmain, Scene *scene, Poin terRNA *ptr) | |
706 { | |
707 SpaceAction *saction= (SpaceAction*)(ptr->data); | |
708 Object *obact= (scene->basact)? scene->basact->object: NULL; | |
709 ········ | |
710 /* special exceptions for ShapeKey Editor mode */ | |
711 if (saction->mode == SACTCONT_SHAPEKEY) { | |
712 Key *key = ob_get_key(obact); | |
713 ················ | |
714 /* 1) update the action stored for the editor */ | |
715 if (key) | |
716 saction->action = (key->adt)? key->adt->action : NULL; | |
717 else | |
718 saction->action = NULL; | |
719 ················ | |
720 /* 2) enable 'show sliders' by default, since one of the main | |
721 * points of the ShapeKey Editor is to provide a on e-stop shop | |
722 * for controlling the shapekeys, whose main contro l is the value | |
723 */ | |
724 saction->flag |= SACTION_SLIDERS; | |
725 } | |
726 /* make sure action stored is valid */ | |
727 else if (saction->mode == SACTCONT_ACTION) { | |
728 /* 1) update the action stored for the editor */ | |
729 // TODO: context selector could help decide this with more contr ol? | |
730 if (obact) | |
731 saction->action = (obact->adt)? obact->adt->action : NUL L; | |
732 else | |
733 saction->action = NULL; | |
734 } | |
735 } | |
736 | |
737 /* Space Graph Editor */ | |
738 | |
739 static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *pt r) | |
740 { | |
741 //SpaceIpo *sipo= (SpaceIpo*)(ptr->data); | |
742 ScrArea *sa= CTX_wm_area(C); | |
743 ········ | |
744 /* after changing view mode, must force recalculation of F-Curve colors· | |
745 * which can only be achieved using refresh as opposed to redraw | |
746 */ | |
747 ED_area_tag_refresh(sa); | |
748 } | |
749 | |
750 static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr) | |
751 { | |
752 SpaceIpo *sipo= (SpaceIpo*)(ptr->data); | |
753 return (sipo->ghostCurves.first != NULL); | |
754 } | |
755 | |
756 static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr) | |
757 { | |
758 int view = RNA_int_get(ptr, "view_type"); | |
759 | |
760 ED_sequencer_update_view(C, view); | |
761 } | |
762 | |
763 static float rna_BackgroundImage_opacity_get(PointerRNA *ptr) | |
764 { | |
765 BGpic *bgpic= (BGpic *)ptr->data; | |
766 return 1.0f-bgpic->blend; | |
767 } | |
768 | |
769 static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value) | |
770 { | |
771 BGpic *bgpic= (BGpic *)ptr->data; | |
772 bgpic->blend = 1.0f - value; | |
773 } | |
774 | |
775 static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *ptr, int *free) | |
776 { | |
777 Scene *scene = CTX_data_scene(C); | |
778 Object *ob = CTX_data_active_object(C); | |
779 EnumPropertyItem *item= NULL; | |
780 EnumPropertyItem tmp= {0, "", 0, "", ""}; | |
781 int totitem= 0; | |
782 | |
783 if(ob) { | |
784 if(ob->type == OB_LAMP) { | |
785 tmp.value = SB_TEXC_MAT_OR_LAMP; | |
786 tmp.description = "Show Lamp Textures"; | |
787 tmp.identifier = "LAMP"; | |
788 tmp.icon = ICON_LAMP_POINT; | |
789 RNA_enum_item_add(&item, &totitem, &tmp); | |
790 } | |
791 else if(ob->totcol) { | |
792 tmp.value = SB_TEXC_MAT_OR_LAMP; | |
793 tmp.description = "Show Material Textures"; | |
794 tmp.identifier = "MATERIAL"; | |
795 tmp.icon = ICON_MATERIAL; | |
796 RNA_enum_item_add(&item, &totitem, &tmp); | |
797 } | |
798 | |
799 if(ob->particlesystem.first) { | |
800 tmp.value = SB_TEXC_PARTICLES; | |
801 tmp.description = "Show Particle Textures"; | |
802 tmp.identifier = "PARTICLE"; | |
803 tmp.icon = ICON_PARTICLES; | |
804 RNA_enum_item_add(&item, &totitem, &tmp); | |
805 } | |
806 } | |
807 | |
808 if(scene && scene->world) { | |
809 tmp.value = SB_TEXC_WORLD; | |
810 tmp.description = "Show World Textures"; | |
811 tmp.identifier = "WORLD"; | |
812 tmp.icon = ICON_WORLD; | |
813 RNA_enum_item_add(&item, &totitem, &tmp); | |
814 } | |
815 | |
816 tmp.value = SB_TEXC_BRUSH; | |
817 tmp.description = "Show Brush Textures"; | |
818 tmp.identifier = "BRUSH"; | |
819 tmp.icon = ICON_BRUSH_DATA; | |
820 RNA_enum_item_add(&item, &totitem, &tmp); | |
821 ········ | |
822 RNA_enum_item_end(&item, &totitem); | |
823 *free = 1; | |
824 | |
825 return item; | |
826 } | |
827 | |
828 #else | |
829 | |
830 static void rna_def_space(BlenderRNA *brna) | |
831 { | |
832 StructRNA *srna; | |
833 PropertyRNA *prop; | |
834 ········ | |
835 srna= RNA_def_struct(brna, "Space", NULL); | |
836 RNA_def_struct_sdna(srna, "SpaceLink"); | |
837 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area"); | |
838 RNA_def_struct_refine_func(srna, "rna_Space_refine"); | |
839 ········ | |
840 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | |
841 RNA_def_property_enum_sdna(prop, NULL, "spacetype"); | |
842 RNA_def_property_enum_items(prop, space_type_items); | |
843 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
844 RNA_def_property_ui_text(prop, "Type", "Space data type"); | |
845 } | |
846 | |
847 static void rna_def_space_image_uv(BlenderRNA *brna) | |
848 { | |
849 StructRNA *srna; | |
850 PropertyRNA *prop; | |
851 | |
852 static EnumPropertyItem sticky_mode_items[] = { | |
853 {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabl ed", "Sticky vertex selection disabled"}, | |
854 {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location", "Select UVs that are at the same location and share a mesh vertex"}, | |
855 {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Share d Vertex", "Select UVs that share mesh vertex, irrespective if they are in the s ame location"}, | |
856 {0, NULL, 0, NULL, NULL}}; | |
857 | |
858 static EnumPropertyItem dt_uv_items[] = { | |
859 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges wit h black outline"}, | |
860 {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges "}, | |
861 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"}, | |
862 {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"}, | |
863 {0, NULL, 0, NULL, NULL}}; | |
864 | |
865 static EnumPropertyItem dt_uvstretch_items[] = { | |
866 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"}, | |
867 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion betwe en UV and 3D faces"}, | |
868 {0, NULL, 0, NULL, NULL}}; | |
869 | |
870 static EnumPropertyItem pivot_items[] = { | |
871 {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""}, | |
872 {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""}, | |
873 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""}, | |
874 {0, NULL, 0, NULL, NULL}}; | |
875 | |
876 srna= RNA_def_struct(brna, "SpaceUVEditor", NULL); | |
877 RNA_def_struct_sdna(srna, "SpaceImage"); | |
878 RNA_def_struct_nested(brna, srna, "SpaceImageEditor"); | |
879 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space"); | |
880 | |
881 /* selection */ | |
882 prop= RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE) ; | |
883 RNA_def_property_enum_sdna(prop, NULL, "sticky"); | |
884 RNA_def_property_enum_items(prop, sticky_mode_items); | |
885 RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically s elect also UVs sharing the same vertex as the ones being selected"); | |
886 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
887 | |
888 /* drawing */ | |
889 prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE); | |
890 RNA_def_property_enum_sdna(prop, NULL, "dt_uv"); | |
891 RNA_def_property_enum_items(prop, dt_uv_items); | |
892 RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges"); | |
893 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
894 | |
895 prop= RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NON E); | |
896 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV); | |
897 RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti- aliased"); | |
898 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
899 | |
900 prop= RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE); | |
901 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH); | |
902 RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored accor ding to the difference in shape between UVs and their 3D coordinates (blue for l ow distortion, red for high distortion)"); | |
903 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
904 | |
905 prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE); | |
906 RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch"); | |
907 RNA_def_property_enum_items(prop, dt_uvstretch_items); | |
908 RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw"); | |
909 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
910 | |
911 prop= RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_N ONE); | |
912 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW); | |
913 RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied"); | |
914 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
915 | |
916 prop= RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NO NE); | |
917 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER); | |
918 RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selecte d objects that share the same image"); | |
919 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
920 | |
921 prop= RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PRO P_NONE); | |
922 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); | |
923 RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coo rdinates from 0.0 to 1.0 rather than in pixels"); | |
924 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
925 ········ | |
926 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_NONE); | |
927 RNA_def_property_array(prop, 2); | |
928 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location _get", "rna_SpaceImageEditor_cursor_location_set", NULL); | |
929 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view"); | |
930 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
931 | |
932 /* todo: move edge and face drawing options here from G.f */ | |
933 | |
934 prop= RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NO NE); | |
935 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP); | |
936 RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel loca tions while editing"); | |
937 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
938 | |
939 prop= RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE); | |
940 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV); | |
941 RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing"); | |
942 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
943 | |
944 prop= RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE) ; | |
945 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP); | |
946 RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the s elected UV island while transforming pinned vertices"); | |
947 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
948 | |
949 prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); | |
950 RNA_def_property_enum_sdna(prop, NULL, "around"); | |
951 RNA_def_property_enum_items(prop, pivot_items); | |
952 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot"); | |
953 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
954 } | |
955 | |
956 static void rna_def_space_outliner(BlenderRNA *brna) | |
957 { | |
958 StructRNA *srna; | |
959 PropertyRNA *prop; | |
960 | |
961 static EnumPropertyItem display_mode_items[] = { | |
962 {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", ""}, | |
963 {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", ""}, | |
964 {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", ""}, | |
965 {SO_SELECTED, "SELECTED", 0, "Selected", ""}, | |
966 {SO_ACTIVE, "ACTIVE", 0, "Active", ""}, | |
967 {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", ""}, | |
968 {SO_GROUPS, "GROUPS", 0, "Groups", ""}, | |
969 {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", ""}, | |
970 {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", ""}, | |
971 {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", ""}, | |
972 {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", ""}, | |
973 {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", ""}, | |
974 {0, NULL, 0, NULL, NULL}}; | |
975 ········ | |
976 srna= RNA_def_struct(brna, "SpaceOutliner", "Space"); | |
977 RNA_def_struct_sdna(srna, "SpaceOops"); | |
978 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data"); | |
979 ········ | |
980 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE); | |
981 RNA_def_property_enum_sdna(prop, NULL, "outlinevis"); | |
982 RNA_def_property_enum_items(prop, display_mode_items); | |
983 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to d isplay"); | |
984 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); | |
985 ········ | |
986 prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE); | |
987 RNA_def_property_string_sdna(prop, NULL, "search_string"); | |
988 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string"); | |
989 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); | |
990 ········ | |
991 prop= RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE); | |
992 RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_S ENSITIVE); | |
993 RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string"); | |
994 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); | |
995 ········ | |
996 prop= RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_N ONE); | |
997 RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLE TE); | |
998 RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use comple te matches of search string"); | |
999 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); | |
1000 ········ | |
1001 prop= RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP _NONE); | |
1002 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTR ICTCOLS); | |
1003 RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column" ); | |
1004 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); | |
1005 } | |
1006 | |
1007 static void rna_def_background_image(BlenderRNA *brna) | |
1008 { | |
1009 StructRNA *srna; | |
1010 PropertyRNA *prop; | |
1011 | |
1012 /* note: combinations work but dont flip so arnt that useful */ | |
1013 static EnumPropertyItem bgpic_axis_items[] = { | |
1014 {0, "", 0, "X Axis", ""}, | |
1015 {(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", ""}, | |
1016 {(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", ""}, | |
1017 /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "L eft/Right", ""},*/ | |
1018 {0, "", 0, "Y Axis", ""}, | |
1019 {(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", ""}, | |
1020 {(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", ""}, | |
1021 /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "B ack/Front", ""},*/ | |
1022 {0, "", 0, "Z Axis", ""}, | |
1023 {(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", ""}, | |
1024 {(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", ""}, | |
1025 /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "T op/Bottom", ""},*/ | |
1026 {0, "", 0, "Other", ""}, | |
1027 {0, "ALL", 0, "All Views", ""}, | |
1028 {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", ""}, | |
1029 {0, NULL, 0, NULL, NULL}}; | |
1030 | |
1031 srna= RNA_def_struct(brna, "BackgroundImage", NULL); | |
1032 RNA_def_struct_sdna(srna, "BGpic"); | |
1033 RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background"); | |
1034 | |
1035 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); | |
1036 RNA_def_property_pointer_sdna(prop, NULL, "ima"); | |
1037 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in t his space"); | |
1038 RNA_def_property_flag(prop, PROP_EDITABLE); | |
1039 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1040 | |
1041 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE); | |
1042 RNA_def_property_flag(prop, PROP_NEVER_NULL); | |
1043 RNA_def_property_pointer_sdna(prop, NULL, "iuser"); | |
1044 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed"); | |
1045 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1046 ········ | |
1047 prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); | |
1048 RNA_def_property_float_sdna(prop, NULL, "xof"); | |
1049 RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally f rom the world origin"); | |
1050 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1051 ········ | |
1052 prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); | |
1053 RNA_def_property_float_sdna(prop, NULL, "yof"); | |
1054 RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically fro m the world origin"); | |
1055 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1056 ········ | |
1057 prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); | |
1058 RNA_def_property_float_sdna(prop, NULL, "size"); | |
1059 RNA_def_property_ui_text(prop, "Size", "Scaling factor for the backgroun d image"); | |
1060 RNA_def_property_range(prop, 0.0, FLT_MAX); | |
1061 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1062 ········ | |
1063 prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE); | |
1064 RNA_def_property_float_sdna(prop, NULL, "blend"); | |
1065 RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "r na_BackgroundImage_opacity_set", NULL); | |
1066 RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the im age against the background color"); | |
1067 RNA_def_property_range(prop, 0.0, 1.0); | |
1068 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1069 | |
1070 prop= RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE); | |
1071 RNA_def_property_enum_sdna(prop, NULL, "view"); | |
1072 RNA_def_property_enum_items(prop, bgpic_axis_items); | |
1073 RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the im age on"); | |
1074 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1075 | |
1076 prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); | |
1077 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED); | |
1078 RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in th e user interface"); | |
1079 RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); | |
1080 | |
1081 } | |
1082 | |
1083 static void rna_def_space_view3d(BlenderRNA *brna) | |
1084 { | |
1085 StructRNA *srna; | |
1086 PropertyRNA *prop; | |
1087 const int matrix_dimsize[]= {4, 4}; | |
1088 ················ | |
1089 static EnumPropertyItem pivot_items[] = { | |
1090 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box C enter", ""}, | |
1091 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", ""}, | |
1092 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Indivi dual Origins", ""}, | |
1093 {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point" , ""}, | |
1094 {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", ""}, | |
1095 {0, NULL, 0, NULL, NULL}}; | |
1096 | |
1097 static EnumPropertyItem rv3d_persp_items[] = { | |
1098 {RV3D_PERSP, "PERSP", 0, "Perspective", ""}, | |
1099 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""}, | |
1100 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""}, | |
1101 {0, NULL, 0, NULL, NULL}}; | |
1102 ········ | |
1103 srna= RNA_def_struct(brna, "SpaceView3D", "Space"); | |
1104 RNA_def_struct_sdna(srna, "View3D"); | |
1105 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data"); | |
1106 ········ | |
1107 prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); | |
1108 RNA_def_property_flag(prop, PROP_EDITABLE); | |
1109 RNA_def_property_pointer_sdna(prop, NULL, "camera"); | |
1110 RNA_def_property_ui_text(prop, "Camera", "Active camera used in this vie w (when unlocked from the scene's active camera)"); | |
1111 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1112 ········ | |
1113 prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE); | |
1114 RNA_def_property_flag(prop, PROP_EDITABLE); | |
1115 RNA_def_property_pointer_sdna(prop, NULL, "ob_centre"); | |
1116 RNA_def_property_ui_text(prop, "Lock to Object", "3D View center is lock ed to this object's position"); | |
1117 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1118 ········ | |
1119 prop= RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE); | |
1120 RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone"); | |
1121 RNA_def_property_ui_text(prop, "Lock to Bone", "3D View center is locked to this bone's position"); | |
1122 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1123 | |
1124 prop= RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE); | |
1125 RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1); | |
1126 RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is lock ed to the cursor's position"); | |
1127 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1128 | |
1129 prop= RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE); | |
1130 RNA_def_property_enum_sdna(prop, NULL, "drawtype"); | |
1131 RNA_def_property_enum_items(prop, viewport_shade_items); | |
1132 RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/sh ade objects in the 3D View"); | |
1133 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1134 | |
1135 prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE); | |
1136 RNA_def_property_pointer_sdna(prop, NULL, "localvd"); | |
1137 RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-se t of objects, apart from the scene visibility"); | |
1138 ········ | |
1139 prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LEN GTH); | |
1140 RNA_def_property_array(prop, 3); | |
1141 RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna _View3D_CursorLocation_set", NULL); | |
1142 RNA_def_property_ui_text(prop, "3D Cursor Location", "3D cursor location for this view (dependent on local view setting)"); | |
1143 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4); | |
1144 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1145 ········ | |
1146 prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE); | |
1147 RNA_def_property_float_sdna(prop, NULL, "lens"); | |
1148 RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective v iew"); | |
1149 RNA_def_property_range(prop, 1.0f, 250.0f); | |
1150 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1151 ········ | |
1152 prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); | |
1153 RNA_def_property_float_sdna(prop, NULL, "near"); | |
1154 RNA_def_property_range(prop, 0.0f, FLT_MAX); | |
1155 RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping dist ance"); | |
1156 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1157 | |
1158 prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE); | |
1159 RNA_def_property_float_sdna(prop, NULL, "far"); | |
1160 RNA_def_property_range(prop, 1.0f, FLT_MAX); | |
1161 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distanc e"); | |
1162 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1163 | |
1164 prop= RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE); | |
1165 RNA_def_property_float_sdna(prop, NULL, "grid"); | |
1166 RNA_def_property_ui_text(prop, "Grid Scale", "The distance between 3D Vi ew grid lines"); | |
1167 RNA_def_property_range(prop, 0.0f, FLT_MAX); | |
1168 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1169 | |
1170 prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE); | |
1171 RNA_def_property_int_sdna(prop, NULL, "gridlines"); | |
1172 RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines t o display in perspective view"); | |
1173 RNA_def_property_range(prop, 0, 1024); | |
1174 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1175 ········ | |
1176 prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE); | |
1177 RNA_def_property_int_sdna(prop, NULL, "gridsubdiv"); | |
1178 RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdi visions between grid lines"); | |
1179 RNA_def_property_range(prop, 1, 1024); | |
1180 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1181 ········ | |
1182 prop= RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE); | |
1183 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR); | |
1184 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground pl ane grid in perspective view"); | |
1185 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1186 ········ | |
1187 prop= RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE); | |
1188 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X); | |
1189 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line i n perspective view"); | |
1190 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1191 ········ | |
1192 prop= RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE); | |
1193 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y); | |
1194 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line i n perspective view"); | |
1195 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1196 ········ | |
1197 prop= RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE); | |
1198 RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z); | |
1199 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line i n perspective view"); | |
1200 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1201 ········ | |
1202 prop= RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP _NONE); | |
1203 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE); | |
1204 RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline high light around selected objects in non-wireframe views"); | |
1205 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1206 ········ | |
1207 prop= RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PR OP_NONE); | |
1208 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS); | |
1209 RNA_def_property_ui_text(prop, "All Object Origins", "Show the object or igin center dot for all (selected and unselected) objects"); | |
1210 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1211 | |
1212 prop= RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PR OP_NONE); | |
1213 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELP LINES); | |
1214 RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships"); | |
1215 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1216 ········ | |
1217 prop= RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_N ONE); | |
1218 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX); | |
1219 RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view"); | |
1220 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1221 | |
1222 prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE ); | |
1223 RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE); | |
1224 RNA_def_property_ui_text(prop, "Only Render", "Display only objects whic h will be rendered"); | |
1225 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1226 ········ | |
1227 prop= RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_ NONE); | |
1228 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT); | |
1229 RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to v isible (clipped with depth buffer)"); | |
1230 RNA_def_property_ui_icon(prop, ICON_ORTHO, 0); | |
1231 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1232 | |
1233 prop= RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_ NONE); | |
1234 RNA_def_property_collection_sdna(prop, NULL, "bgpicbase", NULL); | |
1235 RNA_def_property_struct_type(prop, "BackgroundImage"); | |
1236 RNA_def_property_ui_text(prop, "Background Images", "List of background images"); | |
1237 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1238 | |
1239 prop= RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PRO P_NONE); | |
1240 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS); | |
1241 RNA_def_property_ui_text(prop, "Display Background Images", "Display ref erence images behind objects in the 3D View"); | |
1242 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1243 | |
1244 prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); | |
1245 RNA_def_property_enum_sdna(prop, NULL, "around"); | |
1246 RNA_def_property_enum_items(prop, pivot_items); | |
1247 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation /scaling"); | |
1248 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1249 ········ | |
1250 prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP _NONE); | |
1251 RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN); | |
1252 RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only" ); | |
1253 RNA_def_property_ui_icon(prop, ICON_ALIGN, 0); | |
1254 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1255 | |
1256 prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE ); | |
1257 RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR) ; | |
1258 RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widg et for controlling transforms"); | |
1259 RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); | |
1260 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1261 ········ | |
1262 prop= RNA_def_property(srna, "use_manipulator_translate", PROP_BOOLEAN, PROP_NONE); | |
1263 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE) ; | |
1264 RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipul ator for movement transformations"); | |
1265 RNA_def_property_ui_icon(prop, ICON_MAN_TRANS, 0); | |
1266 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1267 ········ | |
1268 prop= RNA_def_property(srna, "use_manipulator_rotate", PROP_BOOLEAN, PRO P_NONE); | |
1269 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE); | |
1270 RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulato r for rotation transformations"); | |
1271 RNA_def_property_ui_icon(prop, ICON_MAN_ROT, 0); | |
1272 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1273 ········ | |
1274 prop= RNA_def_property(srna, "use_manipulator_scale", PROP_BOOLEAN, PROP _NONE); | |
1275 RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE); | |
1276 RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations"); | |
1277 RNA_def_property_ui_icon(prop, ICON_MAN_SCALE, 0); | |
1278 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1279 ········ | |
1280 prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NO NE); | |
1281 RNA_def_property_enum_sdna(prop, NULL, "twmode"); | |
1282 RNA_def_property_enum_items(prop, transform_orientation_items); | |
1283 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_ itemf"); | |
1284 RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation"); | |
1285 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1286 | |
1287 prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_N ONE); | |
1288 RNA_def_property_struct_type(prop, "TransformOrientation"); | |
1289 RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL); | |
1290 RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation"); | |
1291 | |
1292 prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PRO P_NONE); | |
1293 RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1); | |
1294 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_ and_layers_set"); | |
1295 RNA_def_property_ui_text(prop, "Lock Camera and Layers", "Use the scene' s active camera and layers in this view, rather than local layers"); | |
1296 RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1); | |
1297 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1298 | |
1299 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); | |
1300 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); | |
1301 RNA_def_property_array(prop, 20); | |
1302 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set"); | |
1303 RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View"); | |
1304 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D _layer_update"); | |
1305 ········ | |
1306 prop= RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEM BER); | |
1307 RNA_def_property_boolean_sdna(prop, NULL, "lay_used", 1); | |
1308 RNA_def_property_array(prop, 20); | |
1309 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
1310 RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain somet hing"); | |
1311 | |
1312 prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE); | |
1313 RNA_def_property_struct_type(prop, "RegionView3D"); | |
1314 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NU LL, NULL, NULL); | |
1315 RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region"); | |
1316 | |
1317 prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE) ; | |
1318 RNA_def_property_struct_type(prop, "RegionView3D"); | |
1319 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_ge t", NULL, NULL, NULL); | |
1320 RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defin es the quad view settings"); | |
1321 | |
1322 /* region */ | |
1323 | |
1324 srna= RNA_def_struct(brna, "RegionView3D", NULL); | |
1325 RNA_def_struct_sdna(srna, "RegionView3D"); | |
1326 RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data"); | |
1327 | |
1328 prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE); | |
1329 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED); | |
1330 RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views "); | |
1331 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3 D_quadview_update"); | |
1332 ········ | |
1333 prop= RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE); | |
1334 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW); | |
1335 RNA_def_property_ui_text(prop, "Box", "Sync view position between side v iews"); | |
1336 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3 D_quadview_update"); | |
1337 ········ | |
1338 prop= RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE); | |
1339 RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP); | |
1340 RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's vis ible in other side views"); | |
1341 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3 D_quadview_clip_update"); | |
1342 ········ | |
1343 prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATR IX); | |
1344 RNA_def_property_float_sdna(prop, NULL, "persmat"); | |
1345 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this | |
1346 RNA_def_property_multi_array(prop, 2, matrix_dimsize); | |
1347 RNA_def_property_ui_text(prop, "Perspective Matrix", "Current perspectiv e matrix of the 3D region"); | |
1348 ········ | |
1349 prop= RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX); | |
1350 RNA_def_property_float_sdna(prop, NULL, "viewmat"); | |
1351 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this | |
1352 RNA_def_property_multi_array(prop, 2, matrix_dimsize); | |
1353 RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of th e 3D region"); | |
1354 | |
1355 prop= RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE); | |
1356 RNA_def_property_enum_sdna(prop, NULL, "persp"); | |
1357 RNA_def_property_enum_items(prop, rv3d_persp_items); | |
1358 RNA_def_property_ui_text(prop, "Perspective", "View Perspective"); | |
1359 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1360 ········ | |
1361 prop= RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATI ON); | |
1362 #if 0 | |
1363 RNA_def_property_float_sdna(prop, NULL, "ofs"); // cant use because its negated | |
1364 #else | |
1365 RNA_def_property_array(prop, 3); | |
1366 RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", NULL); | |
1367 #endif | |
1368 RNA_def_property_ui_text(prop, "View Location", "View pivot location"); | |
1369 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4); | |
1370 RNA_def_property_update(prop, NC_WINDOW, NULL); | |
1371 ········ | |
1372 prop= RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNIO N); | |
1373 RNA_def_property_float_sdna(prop, NULL, "viewquat"); | |
1374 RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)"); | |
1375 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1376 ········ | |
1377 /* not sure we need rna access to these but adding anyway */ | |
1378 prop= RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED) ; | |
1379 RNA_def_property_float_sdna(prop, NULL, "dist"); | |
1380 RNA_def_property_ui_text(prop, "Distance", "Distance to the view locatio n"); | |
1381 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); | |
1382 } | |
1383 | |
1384 static void rna_def_space_buttons(BlenderRNA *brna) | |
1385 { | |
1386 StructRNA *srna; | |
1387 PropertyRNA *prop; | |
1388 | |
1389 static EnumPropertyItem buttons_context_items[] = { | |
1390 {BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"}, | |
1391 {BCONTEXT_RENDER, "RENDER", ICON_SCENE_DATA, "Render", "Render"} , | |
1392 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"}, | |
1393 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object" }, | |
1394 {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraint s", "Constraints"}, | |
1395 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Mod ifiers"}, | |
1396 {BCONTEXT_DATA, "DATA", 0, "Data", "Data"}, | |
1397 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"}, | |
1398 {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT, " Bone Constraints", "Bone Constraints"}, | |
1399 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Mate rial"}, | |
1400 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture" }, | |
1401 {BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Par ticle"}, | |
1402 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics" }, | |
1403 {0, NULL, 0, NULL, NULL}}; | |
1404 ················ | |
1405 static EnumPropertyItem align_items[] = { | |
1406 {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""}, | |
1407 {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""}, | |
1408 {0, NULL, 0, NULL, NULL}}; | |
1409 | |
1410 static EnumPropertyItem buttons_texture_context_items[] = { | |
1411 {SB_TEXC_MAT_OR_LAMP, "MATERIAL", ICON_MATERIAL, "Material", "Ma terial"}, | |
1412 {0, NULL, 0, NULL, NULL}}; //actually populated dynamically trou gh a function | |
1413 ················ | |
1414 srna= RNA_def_struct(brna, "SpaceProperties", "Space"); | |
1415 RNA_def_struct_sdna(srna, "SpaceButs"); | |
1416 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data" ); | |
1417 ········ | |
1418 prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE); | |
1419 RNA_def_property_enum_sdna(prop, NULL, "mainb"); | |
1420 RNA_def_property_enum_items(prop, buttons_context_items); | |
1421 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set ", NULL); | |
1422 RNA_def_property_ui_text(prop, "Context", "Type of active data to displa y and edit"); | |
1423 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); | |
1424 ········ | |
1425 prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); | |
1426 RNA_def_property_enum_sdna(prop, NULL, "align"); | |
1427 RNA_def_property_enum_items(prop, align_items); | |
1428 RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL); | |
1429 RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels"); | |
1430 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); | |
1431 | |
1432 prop= RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE); | |
1433 RNA_def_property_enum_items(prop, buttons_texture_context_items); | |
1434 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceProperties_textu re_context_itemf"); | |
1435 RNA_def_property_ui_text(prop, "Texture Context", "Type of texture data to display and edit"); | |
1436 RNA_def_property_update(prop, NC_TEXTURE, NULL); | |
1437 | |
1438 /* pinned data */ | |
1439 prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE); | |
1440 RNA_def_property_pointer_sdna(prop, NULL, "pinid"); | |
1441 RNA_def_property_struct_type(prop, "ID"); | |
1442 /* note: custom set function is ONLY to avoid rna setting a user for this. * / | |
1443 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_s et", "rna_SpaceProperties_pin_id_typef", NULL); | |
1444 RNA_def_property_flag(prop, PROP_EDITABLE); | |
1445 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpacePr operties_pin_id_update"); | |
1446 | |
1447 prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE); | |
1448 RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT); | |
1449 RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context"); | |
1450 } | |
1451 | |
1452 static void rna_def_space_image(BlenderRNA *brna) | |
1453 { | |
1454 StructRNA *srna; | |
1455 PropertyRNA *prop; | |
1456 | |
1457 srna= RNA_def_struct(brna, "SpaceImageEditor", "Space"); | |
1458 RNA_def_struct_sdna(srna, "SpaceImage"); | |
1459 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data"); | |
1460 | |
1461 /* image */ | |
1462 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); | |
1463 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_s et", NULL, NULL); | |
1464 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in t his space"); | |
1465 RNA_def_property_flag(prop, PROP_EDITABLE); | |
1466 RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); // is handled in i mage editor too | |
1467 | |
1468 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE); | |
1469 RNA_def_property_flag(prop, PROP_NEVER_NULL); | |
1470 RNA_def_property_pointer_sdna(prop, NULL, "iuser"); | |
1471 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed"); | |
1472 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
1473 | |
1474 prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); | |
1475 RNA_def_property_pointer_sdna(prop, NULL, "cumap"); | |
1476 RNA_def_property_ui_text(prop, "Curve", "Color curve mapping to use for displaying the image"); | |
1477 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEd itor_curves_update"); | |
1478 | |
1479 prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE); | |
1480 RNA_def_property_pointer_sdna(prop, NULL, "scopes"); | |
1481 RNA_def_property_struct_type(prop, "Scopes"); | |
1482 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image stat istics."); | |
1483 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEd itor_scopes_update"); | |
1484 | |
1485 prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE); | |
1486 RNA_def_property_boolean_sdna(prop, NULL, "pin", 0); | |
1487 RNA_def_property_ui_text(prop, "Image Pin", "Display current image regar dless of object selection"); | |
1488 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); | |
1489 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
1490 | |
1491 prop= RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE ); | |
1492 RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist"); | |
1493 RNA_def_property_struct_type(prop, "Histogram"); | |
1494 RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line "); | |
1495 | |
1496 prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); | |
1497 RNA_def_property_array(prop, 2); | |
1498 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", NULL , NULL); | |
1499 RNA_def_property_ui_text(prop, "Zoom", "Zoom factor"); | |
brechtvl
2011/04/01 09:02:50
This property should also its editable flag cleare
| |
1500 ········ | |
1501 /* image draw */ | |
1502 prop= RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE); | |
1503 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE); | |
1504 RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view"); | |
1505 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
1506 | |
1507 prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE); | |
1508 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | |
1509 RNA_def_property_enum_items(prop, draw_channels_items); | |
1510 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw _channels_itemf"); | |
1511 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image t o draw"); | |
1512 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); | |
1513 | |
1514 /* uv */ | |
1515 prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE); | |
1516 RNA_def_property_flag(prop, PROP_NEVER_NULL); | |
1517 RNA_def_property_struct_type(prop, "SpaceUVEditor"); | |
1518 RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL); | |
1519 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings"); | |
1520 ········ | |
1521 /* paint */ | |
1522 prop= RNA_def_property(srna, "use_image_paint", PROP_BOOLEAN, PROP_NONE) ; | |
1523 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL); | |
1524 RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode"); | |
1525 RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0); | |
1526 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEd itor_paint_update"); | |
1527 | |
1528 /* grease pencil */ | |
1529 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); | |
1530 RNA_def_property_pointer_sdna(prop, NULL, "gpd"); | |
1531 RNA_def_property_flag(prop, PROP_EDITABLE); | |
1532 RNA_def_property_struct_type(prop, "GreasePencil"); | |
1533 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space"); | |
1534 | |
1535 prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NON E); | |
1536 RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DISPGP); | |
1537 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit th e grease pencil freehand annotations overlay"); | |
1538 | |
1539 /* update */ | |
1540 prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_N ONE); | |
1541 RNA_def_property_boolean_sdna(prop, NULL, "lock", 0); | |
1542 RNA_def_property_ui_text(prop, "Update Automatically", "Update other aff ected window spaces automatically to reflect changes during interactive operatio ns such as transform"); | |
1543 | |
1544 /* state */ | |
1545 prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE); | |
1546 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_g et", NULL); | |
1547 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
1548 RNA_def_property_ui_text(prop, "Show Render", "Show render related prope rties"); | |
1549 | |
1550 prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE); | |
1551 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_ge t", NULL); | |
1552 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
1553 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related propert ies"); | |
1554 | |
1555 prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE); | |
1556 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_g et", NULL); | |
1557 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
1558 RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing relate d properties"); | |
1559 | |
1560 rna_def_space_image_uv(brna); | |
1561 } | |
1562 | |
1563 static void rna_def_space_sequencer(BlenderRNA *brna) | |
1564 { | |
1565 StructRNA *srna; | |
1566 PropertyRNA *prop; | |
1567 ········ | |
1568 static EnumPropertyItem view_type_items[] = { | |
1569 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer" , ""}, | |
1570 {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview" , ""}, | |
1571 {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SPLIT VIEW, "Sequencer and Image Preview", ""}, | |
1572 {0, NULL, 0, NULL, NULL}}; | |
1573 | |
1574 static EnumPropertyItem display_mode_items[] = { | |
1575 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""}, | |
1576 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Lum a Waveform", ""}, | |
1577 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE , "Chroma Vectorscope", ""}, | |
1578 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histo gram", ""}, | |
1579 {0, NULL, 0, NULL, NULL}}; | |
1580 | |
1581 static EnumPropertyItem proxy_render_size_items[] = { | |
1582 {SEQ_PROXY_RENDER_SIZE_NONE, "NONE", 0, "No display", ""}, | |
1583 {SEQ_PROXY_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", " "}, | |
1584 {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""}, | |
1585 {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""}, | |
1586 {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""}, | |
1587 {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""}, | |
1588 {0, NULL, 0, NULL, NULL}}; | |
1589 ········ | |
1590 srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space"); | |
1591 RNA_def_struct_sdna(srna, "SpaceSeq"); | |
1592 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor s pace data"); | |
1593 ········ | |
1594 /* view type, fairly important */ | |
1595 prop= RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE); | |
1596 RNA_def_property_enum_sdna(prop, NULL, "view"); | |
1597 RNA_def_property_enum_items(prop, view_type_items); | |
1598 RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencer v iew (sequencer, preview or both)"); | |
1599 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | |
1600 RNA_def_property_update(prop, 0, "rna_Sequencer_display_mode_update"); | |
1601 | |
1602 /* display type, fairly important */ | |
1603 prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE); | |
1604 RNA_def_property_enum_sdna(prop, NULL, "mainb"); | |
1605 RNA_def_property_enum_items(prop, display_mode_items); | |
1606 RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output"); | |
1607 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1608 ················ | |
1609 /* flag's */ | |
1610 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_ NONE); | |
1611 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_C FRANUM); | |
1612 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show fram e number beside the current frame indicator line"); | |
1613 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1614 ········ | |
1615 prop= RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE); | |
1616 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES); | |
1617 RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than s econds"); | |
1618 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1619 ········ | |
1620 prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE) ; | |
1621 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS); | |
1622 RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers a s well as strips"); | |
1623 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1624 ········ | |
1625 prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_N ONE); | |
1626 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERAT ED); | |
1627 RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channe ls in preview"); | |
1628 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1629 | |
1630 prop= RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE ); | |
1631 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS) ; | |
1632 RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins i n preview");···· | |
1633 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1634 ········ | |
1635 prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NON E); | |
1636 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL); | |
1637 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit th e grease pencil freehand annotations overlay");· | |
1638 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1639 ········ | |
1640 /* grease pencil */ | |
1641 prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); | |
1642 RNA_def_property_pointer_sdna(prop, NULL, "gpd"); | |
1643 RNA_def_property_struct_type(prop, "UnknownType"); | |
1644 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space"); | |
1645 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1646 ········ | |
1647 prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE); | |
1648 RNA_def_property_int_sdna(prop, NULL, "chanshown"); | |
1649 RNA_def_property_ui_text(prop, "Display Channel", "The channel number sh own in the image preview. 0 is the result of all strips combined"); | |
1650 RNA_def_property_range(prop, -5, 32); // MAXSEQ --- todo, move from BKE_ sequencer.h, allow up to 5 layers up the metastack. Should be dynamic... | |
1651 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1652 ········ | |
1653 prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE); | |
1654 RNA_def_property_int_sdna(prop, NULL, "zebra"); | |
1655 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed are as with zebra stripes"); | |
1656 RNA_def_property_range(prop, 0, 110); | |
1657 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1658 ········ | |
1659 prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE); | |
1660 RNA_def_property_enum_sdna(prop, NULL, "render_size"); | |
1661 RNA_def_property_enum_items(prop, proxy_render_size_items); | |
1662 RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions"); | |
1663 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1664 ········ | |
1665 ········ | |
1666 /* not sure we need rna access to these but adding anyway */ | |
1667 prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); | |
1668 RNA_def_property_float_sdna(prop, NULL, "xof"); | |
1669 RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally f rom the view center"); | |
1670 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1671 | |
1672 prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); | |
1673 RNA_def_property_float_sdna(prop, NULL, "yof"); | |
1674 RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally f rom the view center"); | |
1675 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1676 ········ | |
1677 prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); | |
1678 RNA_def_property_float_sdna(prop, NULL, "zoom"); | |
1679 RNA_def_property_ui_text(prop, "Zoom", "Display zoom level");··· | |
1680 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); | |
1681 } | |
1682 | |
1683 static void rna_def_space_text(BlenderRNA *brna) | |
1684 { | |
1685 StructRNA *srna; | |
1686 PropertyRNA *prop; | |
1687 | |
1688 srna= RNA_def_struct(brna, "SpaceTextEditor", "Space"); | |
1689 RNA_def_struct_sdna(srna, "SpaceText"); | |
1690 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space dat a"); | |
1691 | |
1692 /* text */ | |
1693 prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE); | |
1694 RNA_def_property_flag(prop, PROP_EDITABLE); | |
1695 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in thi s space"); | |
1696 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set ", NULL, NULL); | |
1697 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1698 | |
1699 /* display */ | |
1700 prop= RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE); | |
1701 RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0); | |
1702 RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wra p_set"); | |
1703 RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space"); | |
1704 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1); | |
1705 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1706 | |
1707 prop= RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NON E); | |
1708 RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0); | |
1709 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next t o the text"); | |
1710 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1); | |
1711 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1712 | |
1713 prop= RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP _NONE); | |
1714 RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0); | |
1715 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting"); | |
1716 RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1); | |
1717 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1718 ········ | |
1719 prop= RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_N ONE); | |
1720 RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0); | |
1721 RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line"); | |
1722 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1723 | |
1724 prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE); | |
1725 RNA_def_property_int_sdna(prop, NULL, "tabnumber"); | |
1726 RNA_def_property_range(prop, 2, 8); | |
1727 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with"); | |
1728 RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL); | |
1729 | |
1730 prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); | |
1731 RNA_def_property_int_sdna(prop, NULL, "lheight"); | |
1732 RNA_def_property_range(prop, 8, 32); | |
1733 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displa ying the text"); | |
1734 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1735 | |
1736 prop= RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE); | |
1737 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_SHOW_MARGIN); | |
1738 RNA_def_property_ui_text(prop, "Show Margin", "Show right margin"); | |
1739 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1740 | |
1741 prop= RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE); | |
1742 RNA_def_property_int_sdna(prop, NULL, "margin_column"); | |
1743 RNA_def_property_range(prop, 0, 1024); | |
1744 RNA_def_property_ui_text(prop, "Margin Column", "Column number to show r ight margin at"); | |
1745 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1746 | |
1747 /* functionality options */ | |
1748 prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE); | |
1749 RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1); | |
1750 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when t yping rather than inserting them"); | |
1751 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1752 ········ | |
1753 prop= RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE); | |
1754 RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1); | |
1755 RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing"); | |
1756 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1757 ········ | |
1758 /* find */ | |
1759 prop= RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE); | |
1760 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL); | |
1761 RNA_def_property_ui_text(prop, "Find All", "Search in all text datablock s, instead of only the active one"); | |
1762 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1763 | |
1764 prop= RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE); | |
1765 RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP); | |
1766 RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end"); | |
1767 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1768 | |
1769 prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE); | |
1770 RNA_def_property_string_sdna(prop, NULL, "findstr"); | |
1771 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool"); | |
1772 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1773 | |
1774 prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE); | |
1775 RNA_def_property_string_sdna(prop, NULL, "replacestr"); | |
1776 RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool"); | |
1777 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); | |
1778 } | |
1779 | |
1780 static void rna_def_space_dopesheet(BlenderRNA *brna) | |
1781 { | |
1782 StructRNA *srna; | |
1783 PropertyRNA *prop; | |
1784 ········ | |
1785 static EnumPropertyItem mode_items[] = { | |
1786 {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""}, | |
1787 {SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""}, | |
1788 {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""}, | |
1789 {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""}, | |
1790 {0, NULL, 0, NULL, NULL}}; | |
1791 ················ | |
1792 ········ | |
1793 srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space"); | |
1794 RNA_def_struct_sdna(srna, "SpaceAction"); | |
1795 RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data"); | |
1796 | |
1797 /* data */ | |
1798 prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); | |
1799 RNA_def_property_flag(prop, PROP_EDITABLE); | |
1800 RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_act ion_set", NULL, NULL); | |
1801 RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space"); | |
1802 RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_S paceDopeSheetEditor_action_update"); | |
1803 ········ | |
1804 /* mode */ | |
1805 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); | |
1806 RNA_def_property_enum_sdna(prop, NULL, "mode"); | |
1807 RNA_def_property_enum_items(prop, mode_items); | |
1808 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed" ); | |
1809 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDop eSheetEditor_mode_update"); | |
1810 ········ | |
1811 /* display */ | |
1812 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); | |
1813 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME); | |
1814 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only s et with operator | |
1815 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds n ot frames"); | |
1816 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); | |
1817 ········ | |
1818 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_ NONE); | |
1819 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRA WCFRANUM); | |
1820 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show fram e number beside the current frame indicator line"); | |
1821 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); | |
1822 ········ | |
1823 prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE); | |
1824 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS); | |
1825 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Cu rve channels"); | |
1826 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); | |
1827 ········ | |
1828 prop= RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NON E); | |
1829 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_POSEMARKERS_SH OW); | |
1830 RNA_def_property_ui_text(prop, "Show Pose Markers", "Show markers belong ing to the active action instead of Scene markers (Action and Shape Key Editors only)"); | |
1831 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); | |
1832 ········ | |
1833 /* editing */ | |
1834 prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, P ROP_NONE); | |
1835 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRA NSKEYCULL); | |
1836 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically mer ge nearby keyframes"); | |
1837 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); | |
1838 ········ | |
1839 prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_N ONE); | |
1840 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREA LTIMEUPDATES); | |
1841 RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming ke yframes, changes to the animation data are flushed to other views"); | |
1842 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); | |
1843 | |
1844 prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE) ; | |
1845 RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_MARKERS_MOVE); | |
1846 RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyfra me edits"); | |
1847 | |
1848 /* dopesheet */ | |
1849 prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE); | |
1850 RNA_def_property_struct_type(prop, "DopeSheet"); | |
1851 RNA_def_property_pointer_sdna(prop, NULL, "ads"); | |
1852 RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering anim ation data"); | |
1853 | |
1854 /* autosnap */ | |
1855 prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE); | |
1856 RNA_def_property_enum_sdna(prop, NULL, "autosnap"); | |
1857 RNA_def_property_enum_items(prop, autosnap_items); | |
1858 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping set tings for transformations"); | |
1859 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); | |
1860 } | |
1861 | |
1862 static void rna_def_space_graph(BlenderRNA *brna) | |
1863 { | |
1864 StructRNA *srna; | |
1865 PropertyRNA *prop; | |
1866 ········ | |
1867 static EnumPropertyItem mode_items[] = { | |
1868 {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", ""}, | |
1869 {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", ""}, | |
1870 {0, NULL, 0, NULL, NULL}}; | |
1871 ················ | |
1872 /* this is basically the same as the one for the 3D-View, but wi th some entries ommitted */ | |
1873 static EnumPropertyItem gpivot_items[] = { | |
1874 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box C enter", ""}, | |
1875 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""}, | |
1876 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Indivi dual Centers", ""}, | |
1877 //{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""}, | |
1878 //{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""}, | |
1879 {0, NULL, 0, NULL, NULL}}; | |
1880 | |
1881 ········ | |
1882 srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space"); | |
1883 RNA_def_struct_sdna(srna, "SpaceIpo"); | |
1884 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space d ata"); | |
1885 ········ | |
1886 /* mode */ | |
1887 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); | |
1888 RNA_def_property_enum_sdna(prop, NULL, "mode"); | |
1889 RNA_def_property_enum_items(prop, mode_items); | |
1890 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed" ); | |
1891 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | |
1892 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, "rna_SpaceGraphEd itor_display_mode_update"); | |
1893 ········ | |
1894 /* display */ | |
1895 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); | |
1896 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME); | |
1897 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only s et with operator | |
1898 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds n ot frames"); | |
1899 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1900 ········ | |
1901 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_ NONE); | |
1902 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCF RANUM); | |
1903 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show fram e number beside the current frame indicator line"); | |
1904 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1905 ········ | |
1906 prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE); | |
1907 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS); | |
1908 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Cu rve channels"); | |
1909 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1910 ········ | |
1911 prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE); | |
1912 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOHANDLE S); | |
1913 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier c ontrol points"); | |
1914 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1915 ········ | |
1916 prop= RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BO OLEAN, PROP_NONE); | |
1917 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY); | |
1918 RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only ke yframes of selected F-Curves are visible and editable"); | |
1919 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1920 ········ | |
1921 prop= RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_ BOOLEAN, PROP_NONE); | |
1922 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY); | |
1923 RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes"); | |
1924 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1925 ········ | |
1926 prop= RNA_def_property(srna, "use_fancy_drawing", PROP_BOOLEAN, PROP_NON E); | |
1927 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDR AW_OFF); | |
1928 RNA_def_property_ui_text(prop, "Use Fancy Drawing", "Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance"); | |
1929 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1930 ········ | |
1931 /* editing */ | |
1932 prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, P ROP_NONE); | |
1933 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSK EYCULL); | |
1934 RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically mer ge nearby keyframes"); | |
1935 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1936 ········ | |
1937 prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_N ONE); | |
1938 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTI MEUPDATES); | |
1939 RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming ke yframes, changes to the animation data are flushed to other views"); | |
1940 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1941 ········ | |
1942 /* cursor */ | |
1943 prop= RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE); | |
1944 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCU RSOR); | |
1945 RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor"); | |
1946 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1947 ········ | |
1948 prop= RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE) ; | |
1949 RNA_def_property_float_sdna(prop, NULL, "cursorVal"); | |
1950 RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component"); | |
1951 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1952 ········ | |
1953 prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); | |
1954 RNA_def_property_enum_sdna(prop, NULL, "around"); | |
1955 RNA_def_property_enum_items(prop, gpivot_items); | |
1956 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation /scaling"); | |
1957 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1958 | |
1959 /* dopesheet */ | |
1960 prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE); | |
1961 RNA_def_property_struct_type(prop, "DopeSheet"); | |
1962 RNA_def_property_pointer_sdna(prop, NULL, "ads"); | |
1963 RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering anim ation data"); | |
1964 | |
1965 /* autosnap */ | |
1966 prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE); | |
1967 RNA_def_property_enum_sdna(prop, NULL, "autosnap"); | |
1968 RNA_def_property_enum_items(prop, autosnap_items); | |
1969 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping set tings for transformations"); | |
1970 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1971 ········ | |
1972 /* readonly state info */ | |
1973 prop= RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE ); | |
1974 RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); /* XXX: hack to ma ke this compile, since this property doesn't actually exist*/ | |
1975 RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_cur ves_get", NULL); | |
1976 RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instanc e has some ghost curves stored"); | |
1977 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); | |
1978 } | |
1979 | |
1980 static void rna_def_space_nla(BlenderRNA *brna) | |
1981 { | |
1982 StructRNA *srna; | |
1983 PropertyRNA *prop; | |
1984 ········ | |
1985 srna= RNA_def_struct(brna, "SpaceNLA", "Space"); | |
1986 RNA_def_struct_sdna(srna, "SpaceNla"); | |
1987 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data" ); | |
1988 ········ | |
1989 /* display */ | |
1990 prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); | |
1991 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME); | |
1992 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only s et with operator | |
1993 RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds n ot frames"); | |
1994 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); | |
1995 ········ | |
1996 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_ NONE); | |
1997 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCF RANUM); | |
1998 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show fram e number beside the current frame indicator line"); | |
1999 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); | |
2000 ········ | |
2001 prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NON E); | |
2002 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPC URVES); | |
2003 RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence cu rves on strips"); | |
2004 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); | |
2005 ········ | |
2006 /* editing */ | |
2007 prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_N ONE); | |
2008 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTI MEUPDATES); | |
2009 RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming st rips, changes to the animation data are flushed to other views"); | |
2010 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); | |
2011 | |
2012 /* dopesheet */ | |
2013 prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE); | |
2014 RNA_def_property_struct_type(prop, "DopeSheet"); | |
2015 RNA_def_property_pointer_sdna(prop, NULL, "ads"); | |
2016 RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering anim ation data"); | |
2017 | |
2018 /* autosnap */ | |
2019 prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE); | |
2020 RNA_def_property_enum_sdna(prop, NULL, "autosnap"); | |
2021 RNA_def_property_enum_items(prop, autosnap_items); | |
2022 RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping set tings for transformations"); | |
2023 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); | |
2024 } | |
2025 | |
2026 static void rna_def_space_time(BlenderRNA *brna) | |
2027 { | |
2028 StructRNA *srna; | |
2029 PropertyRNA *prop; | |
2030 ········ | |
2031 srna= RNA_def_struct(brna, "SpaceTimeline", "Space"); | |
2032 RNA_def_struct_sdna(srna, "SpaceTime"); | |
2033 RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor s pace data"); | |
2034 ········ | |
2035 /* view settings */····· | |
2036 prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NO NE); | |
2037 RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL); | |
2038 RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes for active Object and/or its selected channels only");· | |
2039 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); | |
2040 ········ | |
2041 prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_ NONE); | |
2042 RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM); | |
2043 RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show fram e number beside the current frame indicator line"); | |
2044 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); | |
2045 ········ | |
2046 /* displaying cache status */ | |
2047 prop= RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE); | |
2048 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DI SPLAY); | |
2049 RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");······· | |
2050 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); | |
2051 ········ | |
2052 prop= RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE); | |
2053 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SO FTBODY); | |
2054 RNA_def_property_ui_text(prop, "Softbody", "Show the active object's sof tbody point cache");···· | |
2055 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); | |
2056 ········ | |
2057 prop= RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE) ; | |
2058 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_PA RTICLES); | |
2059 RNA_def_property_ui_text(prop, "Particles", "Show the active object's pa rticle point cache");··· | |
2060 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); | |
2061 ········ | |
2062 prop= RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE); | |
2063 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_CL OTH); | |
2064 RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");·· | |
2065 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); | |
2066 ········ | |
2067 prop= RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE); | |
2068 RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SM OKE); | |
2069 RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");········ | |
2070 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); | |
2071 } | |
2072 | |
2073 static void rna_def_console_line(BlenderRNA *brna) | |
2074 { | |
2075 StructRNA *srna; | |
2076 PropertyRNA *prop; | |
2077 ········ | |
2078 srna = RNA_def_struct(brna, "ConsoleLine", NULL); | |
2079 RNA_def_struct_ui_text(srna, "Console Input", "Input line for the intera ctive console"); | |
2080 // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPA CE|ND_SPACE_CONSOLE, NULL); | |
2081 ········ | |
2082 prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE); | |
2083 RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_Con soleLine_body_length", "rna_ConsoleLine_body_set"); | |
2084 RNA_def_property_ui_text(prop, "Line", "Text in the line"); | |
2085 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); | |
2086 ········ | |
2087 prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */ | |
2088 RNA_def_property_int_sdna(prop, NULL, "cursor"); | |
2089 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_ind ex_range"); | |
2090 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); | |
2091 } | |
2092 ········ | |
2093 static void rna_def_space_console(BlenderRNA *brna) | |
2094 { | |
2095 StructRNA *srna; | |
2096 PropertyRNA *prop; | |
2097 ········ | |
2098 srna= RNA_def_struct(brna, "SpaceConsole", "Space"); | |
2099 RNA_def_struct_sdna(srna, "SpaceConsole"); | |
2100 RNA_def_struct_ui_text(srna, "Space Console", "Interactive python consol e"); | |
2101 ········ | |
2102 /* display */ | |
2103 prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copie d from text editor */ | |
2104 RNA_def_property_int_sdna(prop, NULL, "lheight"); | |
2105 RNA_def_property_range(prop, 8, 32); | |
2106 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displa ying the text"); | |
2107 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); | |
2108 | |
2109 | |
2110 prop= RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); / * copied from text editor */ | |
2111 RNA_def_property_int_sdna(prop, NULL, "sel_start"); | |
2112 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); | |
2113 ········ | |
2114 prop= RNA_def_property(srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */ | |
2115 RNA_def_property_int_sdna(prop, NULL, "sel_end"); | |
2116 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); | |
2117 | |
2118 prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE); | |
2119 RNA_def_property_ui_text(prop, "Prompt", "Command line prompt"); | |
2120 ········ | |
2121 prop= RNA_def_property(srna, "language", PROP_STRING, PROP_NONE); | |
2122 RNA_def_property_ui_text(prop, "Language", "Command line prompt language "); | |
2123 | |
2124 prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE); | |
2125 RNA_def_property_collection_sdna(prop, NULL, "history", NULL); | |
2126 RNA_def_property_struct_type(prop, "ConsoleLine"); | |
2127 RNA_def_property_ui_text(prop, "History", "Command history"); | |
2128 ········ | |
2129 prop= RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE); | |
2130 RNA_def_property_collection_sdna(prop, NULL, "scrollback", NULL); | |
2131 RNA_def_property_struct_type(prop, "ConsoleLine"); | |
2132 RNA_def_property_ui_text(prop, "Output", "Command output"); | |
2133 } | |
2134 | |
2135 static void rna_def_fileselect_params(BlenderRNA *brna) | |
2136 { | |
2137 StructRNA *srna; | |
2138 PropertyRNA *prop; | |
2139 ········ | |
2140 static EnumPropertyItem file_display_items[] = { | |
2141 {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Sho rt List", "Display files as short list"}, | |
2142 {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long L ist", "Display files as a detailed list"}, | |
2143 {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnail s", "Display files as thumbnails"}, | |
2144 {0, NULL, 0, NULL, NULL}}; | |
2145 | |
2146 static EnumPropertyItem file_sort_items[] = { | |
2147 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alpha betically", "Sort the file list alphabetically"}, | |
2148 {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "So rt by extension", "Sort the file list by extension"}, | |
2149 {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time" , "Sort files by modification time"}, | |
2150 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size" , "Sort files by size"}, | |
2151 {0, NULL, 0, NULL, NULL}}; | |
2152 | |
2153 srna= RNA_def_struct(brna, "FileSelectParams", NULL); | |
2154 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Para meters"); | |
2155 | |
2156 prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE); | |
2157 RNA_def_property_string_sdna(prop, NULL, "title"); | |
2158 RNA_def_property_ui_text(prop, "Title", "Title for the file browser"); | |
2159 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
2160 | |
2161 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); | |
2162 RNA_def_property_string_sdna(prop, NULL, "dir"); | |
2163 RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser"); | |
2164 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2165 | |
2166 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME); | |
2167 RNA_def_property_string_sdna(prop, NULL, "file"); | |
2168 RNA_def_property_ui_text(prop, "File Name", "Active file in the file bro wser"); | |
2169 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2170 | |
2171 prop= RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE); | |
2172 RNA_def_property_enum_sdna(prop, NULL, "display"); | |
2173 RNA_def_property_enum_items(prop, file_display_items); | |
2174 RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the fil e list"); | |
2175 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2176 | |
2177 prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE); | |
2178 RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); | |
2179 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of file s"); | |
2180 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2181 | |
2182 prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE); | |
2183 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT ); | |
2184 RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files"); | |
2185 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL); | |
2186 | |
2187 prop= RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE); | |
2188 RNA_def_property_enum_sdna(prop, NULL, "sort"); | |
2189 RNA_def_property_enum_items(prop, file_sort_items); | |
2190 RNA_def_property_ui_text(prop, "Sort", ""); | |
2191 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2192 | |
2193 prop= RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE ); | |
2194 RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE); | |
2195 RNA_def_property_ui_text(prop, "Filter Images", "Show image files"); | |
2196 RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0); | |
2197 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2198 | |
2199 prop= RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NO NE); | |
2200 RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE); | |
2201 RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files"); | |
2202 RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0); | |
2203 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2204 | |
2205 prop= RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE ); | |
2206 RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE); | |
2207 RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files"); | |
2208 RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0); | |
2209 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2210 | |
2211 prop= RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NON E); | |
2212 RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE); | |
2213 RNA_def_property_ui_text(prop, "Filter Script", "Show script files"); | |
2214 RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0); | |
2215 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2216 | |
2217 prop= RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE) ; | |
2218 RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE); | |
2219 RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files"); | |
2220 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0); | |
2221 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2222 | |
2223 prop= RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE ); | |
2224 RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE); | |
2225 RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files"); | |
2226 RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0); | |
2227 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2228 | |
2229 prop= RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE) ; | |
2230 RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE); | |
2231 RNA_def_property_ui_text(prop, "Filter Text", "Show text files"); | |
2232 RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0); | |
2233 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2234 | |
2235 prop= RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NON E); | |
2236 RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE); | |
2237 RNA_def_property_ui_text(prop, "Filter Folder", "Show folders"); | |
2238 RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0); | |
2239 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); | |
2240 ········ | |
2241 prop= RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE); | |
2242 RNA_def_property_string_sdna(prop, NULL, "filter_glob"); | |
2243 RNA_def_property_ui_text(prop, "Extension Filter", ""); | |
2244 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); | |
2245 | |
2246 } | |
2247 | |
2248 static void rna_def_space_filebrowser(BlenderRNA *brna) | |
2249 { | |
2250 StructRNA *srna; | |
2251 PropertyRNA *prop; | |
2252 | |
2253 srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space"); | |
2254 RNA_def_struct_sdna(srna, "SpaceFile"); | |
2255 RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space d ata"); | |
2256 | |
2257 prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE); | |
2258 RNA_def_property_pointer_sdna(prop, NULL, "params"); | |
2259 RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser"); | |
2260 ········ | |
2261 prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE); | |
2262 RNA_def_property_pointer_sdna(prop, NULL, "op"); | |
2263 RNA_def_property_ui_text(prop, "Operator", ""); | |
2264 } | |
2265 | |
2266 static void rna_def_space_info(BlenderRNA *brna) | |
2267 { | |
2268 StructRNA *srna; | |
2269 PropertyRNA *prop; | |
2270 | |
2271 srna= RNA_def_struct(brna, "SpaceInfo", "Space"); | |
2272 RNA_def_struct_sdna(srna, "SpaceInfo"); | |
2273 RNA_def_struct_ui_text(srna, "Space Info", "Info space data"); | |
2274 ········ | |
2275 /* reporting display */ | |
2276 prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NON E); | |
2277 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_DEBUG); | |
2278 RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting in fo"); | |
2279 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL); | |
2280 ········ | |
2281 prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE ); | |
2282 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_INFO); | |
2283 RNA_def_property_ui_text(prop, "Show Info", "Display general information "); | |
2284 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL); | |
2285 ········ | |
2286 prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_ NONE); | |
2287 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_OP); | |
2288 RNA_def_property_ui_text(prop, "Show Operator", "Display the operator lo g"); | |
2289 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL); | |
2290 ········ | |
2291 prop= RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_N ONE); | |
2292 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_WARN); | |
2293 RNA_def_property_ui_text(prop, "Show Warn", "Display warnings"); | |
2294 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL); | |
2295 ········ | |
2296 prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NON E); | |
2297 RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_ERR); | |
2298 RNA_def_property_ui_text(prop, "Show Error", "Display error text"); | |
2299 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);····· | |
2300 } | |
2301 | |
2302 static void rna_def_space_userpref(BlenderRNA *brna) | |
2303 { | |
2304 StructRNA *srna; | |
2305 PropertyRNA *prop; | |
2306 ········ | |
2307 srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space"); | |
2308 RNA_def_struct_sdna(srna, "SpaceUserPref"); | |
2309 RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data"); | |
2310 ········ | |
2311 prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE); | |
2312 RNA_def_property_string_sdna(prop, NULL, "filter"); | |
2313 RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in t he UI"); | |
2314 | |
2315 } | |
2316 | |
2317 static void rna_def_space_node(BlenderRNA *brna) | |
2318 { | |
2319 StructRNA *srna; | |
2320 PropertyRNA *prop; | |
2321 | |
2322 static EnumPropertyItem tree_type_items[] = { | |
2323 {NTREE_SHADER, "MATERIAL", ICON_MATERIAL, "Material", "Material nodes"}, | |
2324 {NTREE_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture nod es"}, | |
2325 {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDERLAYERS, "Compositing" , "Compositing nodes"}, | |
2326 {0, NULL, 0, NULL, NULL}}; | |
2327 | |
2328 static EnumPropertyItem texture_type_items[] = { | |
2329 {SNODE_TEX_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit t exture nodes from Object"}, | |
2330 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit textu re nodes from World"}, | |
2331 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit textu re nodes from Brush"}, | |
2332 {0, NULL, 0, NULL, NULL}}; | |
2333 | |
2334 static EnumPropertyItem backdrop_channels_items[] = { | |
2335 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB color s"}, | |
2336 {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color an d Alpha", "Draw image with RGB colors and alpha transparency"}, | |
2337 {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alp ha transparency channel"}, | |
2338 {0, NULL, 0, NULL, NULL}}; | |
2339 | |
2340 srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space"); | |
2341 RNA_def_struct_sdna(srna, "SpaceNode"); | |
2342 RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space dat a"); | |
2343 | |
2344 prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE); | |
2345 RNA_def_property_enum_sdna(prop, NULL, "treetype"); | |
2346 RNA_def_property_enum_items(prop, tree_type_items); | |
2347 RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display a nd edit"); | |
2348 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL); | |
2349 | |
2350 prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE); | |
2351 RNA_def_property_enum_sdna(prop, NULL, "texfrom"); | |
2352 RNA_def_property_enum_items(prop, texture_type_items); | |
2353 RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take tex ture from"); | |
2354 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL); | |
2355 | |
2356 prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); | |
2357 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
2358 RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being ed ited"); | |
2359 | |
2360 prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE); | |
2361 RNA_def_property_pointer_sdna(prop, NULL, "from"); | |
2362 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
2363 RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edit ed datablock is linked"); | |
2364 | |
2365 prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); | |
2366 RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); | |
2367 RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |
2368 RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed a nd edited"); | |
2369 | |
2370 prop= RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE); | |
2371 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW); | |
2372 RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node outpu t as backdrop for compositing nodes"); | |
2373 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); | |
2374 | |
2375 prop= RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE) ; | |
2376 RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_AUTO_RENDER); | |
2377 RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite c hanged layer on 3D edits"); | |
2378 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); | |
2379 ········ | |
2380 prop= RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE); | |
2381 RNA_def_property_float_sdna(prop, NULL, "zoom"); | |
2382 RNA_def_property_float_default(prop, 1.0f); | |
2383 RNA_def_property_range(prop, 0.01f, FLT_MAX); | |
2384 RNA_def_property_ui_range(prop, 0.01, 100, 1, 2); | |
2385 RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor"); | |
2386 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); | |
2387 ········ | |
2388 prop= RNA_def_property(srna, "backdrop_x", PROP_FLOAT, PROP_NONE); | |
2389 RNA_def_property_float_sdna(prop, NULL, "xof"); | |
2390 RNA_def_property_ui_text(prop, "Backdrop X", "Backdrop X offset"); | |
2391 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); | |
2392 | |
2393 prop= RNA_def_property(srna, "backdrop_y", PROP_FLOAT, PROP_NONE); | |
2394 RNA_def_property_float_sdna(prop, NULL, "yof"); | |
2395 RNA_def_property_ui_text(prop, "Backdrop Y", "Backdrop Y offset"); | |
2396 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); | |
2397 | |
2398 prop= RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE); | |
2399 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | |
2400 RNA_def_property_enum_items(prop, backdrop_channels_items); | |
2401 RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image t o draw"); | |
2402 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); | |
2403 } | |
2404 | |
2405 static void rna_def_space_logic(BlenderRNA *brna) | |
2406 { | |
2407 StructRNA *srna; | |
2408 PropertyRNA *prop; | |
2409 | |
2410 srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space"); | |
2411 RNA_def_struct_sdna(srna, "SpaceLogic"); | |
2412 RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space d ata"); | |
2413 | |
2414 /* sensors */ | |
2415 prop= RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLE AN, PROP_NONE); | |
2416 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_SEL); | |
2417 RNA_def_property_ui_text(prop, "Show Selected Object", "Show sensors of all selected objects"); | |
2418 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2419 ········ | |
2420 prop= RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE); | |
2421 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_ACT); | |
2422 RNA_def_property_ui_text(prop, "Show Active Object", "Show sensors of ac tive object"); | |
2423 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2424 ········ | |
2425 prop= RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOL EAN, PROP_NONE); | |
2426 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_LINK); | |
2427 RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to the controller"); | |
2428 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2429 | |
2430 prop= RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE); | |
2431 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE); | |
2432 RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states"); | |
2433 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2434 | |
2435 /* controllers */ | |
2436 prop= RNA_def_property(srna, "show_controllers_selected_objects", PROP_B OOLEAN, PROP_NONE); | |
2437 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_SEL); | |
2438 RNA_def_property_ui_text(prop, "Show Selected Object", "Show controllers of all selected objects"); | |
2439 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2440 ········ | |
2441 prop= RNA_def_property(srna, "show_controllers_active_object", PROP_BOOL EAN, PROP_NONE); | |
2442 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_ACT); | |
2443 RNA_def_property_ui_text(prop, "Show Active Object", "Show controllers o f active object"); | |
2444 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2445 | |
2446 prop= RNA_def_property(srna, "show_controllers_linked_controller", PROP_ BOOLEAN, PROP_NONE); | |
2447 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK); | |
2448 RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator"); | |
2449 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2450 | |
2451 /* actuators */ | |
2452 prop= RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOO LEAN, PROP_NONE); | |
2453 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_SEL); | |
2454 RNA_def_property_ui_text(prop, "Show Selected Object", "Show actuators o f all selected objects"); | |
2455 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2456 ········ | |
2457 prop= RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEA N, PROP_NONE); | |
2458 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_ACT); | |
2459 RNA_def_property_ui_text(prop, "Show Active Object", "Show actuators of active object"); | |
2460 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2461 ········ | |
2462 prop= RNA_def_property(srna, "show_actuators_linked_controller", PROP_BO OLEAN, PROP_NONE); | |
2463 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_LINK); | |
2464 RNA_def_property_ui_text(prop, "Show Linked to Actuator", "Show linked o bjects to the actuator"); | |
2465 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2466 | |
2467 prop= RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEA N, PROP_NONE); | |
2468 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE); | |
2469 RNA_def_property_ui_text(prop, "Show Active States", "Show only actuator s connected to active states"); | |
2470 RNA_def_property_update(prop, NC_LOGIC, NULL); | |
2471 | |
2472 } | |
2473 | |
2474 void RNA_def_space(BlenderRNA *brna) | |
2475 { | |
2476 rna_def_space(brna); | |
2477 rna_def_space_image(brna); | |
2478 rna_def_space_sequencer(brna); | |
2479 rna_def_space_text(brna); | |
2480 rna_def_fileselect_params(brna); | |
2481 rna_def_space_filebrowser(brna); | |
2482 rna_def_space_outliner(brna); | |
2483 rna_def_background_image(brna); | |
2484 rna_def_space_view3d(brna); | |
2485 rna_def_space_buttons(brna); | |
2486 rna_def_space_dopesheet(brna); | |
2487 rna_def_space_graph(brna); | |
2488 rna_def_space_nla(brna); | |
2489 rna_def_space_time(brna); | |
2490 rna_def_space_console(brna); | |
2491 rna_def_console_line(brna); | |
2492 rna_def_space_info(brna); | |
2493 rna_def_space_userpref(brna); | |
2494 rna_def_space_node(brna); | |
2495 rna_def_space_logic(brna); | |
2496 } | |
2497 | |
2498 #endif | |
2499 | |
LEFT | RIGHT |