svn merge -r 20133:20486 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
authorAndre Susano Pinto <andresusanopinto@gmail.com>
Fri, 29 May 2009 00:54:52 +0000 (00:54 +0000)
committerAndre Susano Pinto <andresusanopinto@gmail.com>
Fri, 29 May 2009 00:54:52 +0000 (00:54 +0000)
2.5 trunk has a nice bug fix for rendering

213 files changed:
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
projectfiles_vc9/blender/editors/ED_editors.vcproj
release/datafiles/blenderbuttons
release/ui/buttons_data_armature.py [new file with mode: 0644]
release/ui/buttons_data_bone.py [new file with mode: 0644]
release/ui/buttons_data_camera.py
release/ui/buttons_data_curve.py [new file with mode: 0644]
release/ui/buttons_data_empty.py [new file with mode: 0644]
release/ui/buttons_data_lamp.py
release/ui/buttons_data_lattice.py
release/ui/buttons_data_mesh.py [new file with mode: 0644]
release/ui/buttons_data_modifier.py
release/ui/buttons_data_text.py [new file with mode: 0644]
release/ui/buttons_material.py
release/ui/buttons_object_constraint.py [new file with mode: 0644]
release/ui/buttons_objects.py
release/ui/buttons_physic_cloth.py [new file with mode: 0644]
release/ui/buttons_scene.py
release/ui/buttons_texture.py [new file with mode: 0644]
release/ui/buttons_world.py
release/ui/space_outliner.py [new file with mode: 0644]
release/ui/space_text.py
source/blender/blenfont/intern/blf.c
source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/object.c
source/blender/blenlib/BLI_arithb.h
source/blender/blenlib/intern/arithb.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/rct.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poselib.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/datafiles/blenderbuttons.c
source/blender/editors/include/BIF_glutil.h
source/blender/editors/include/ED_fileselect.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_screen.h
source/blender/editors/include/ED_screen_types.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_interface.h
source/blender/editors/include/UI_resources.h
source/blender/editors/include/UI_view2d.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_api.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_templates.c [new file with mode: 0644]
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/editconstraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/physics/editparticle.c
source/blender/editors/preview/previewrender.c
source/blender/editors/screen/area.c
source/blender/editors/screen/glutil.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/buttons_intern.h
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_file/Makefile
source/blender/editors/space_file/SConscript
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_header.c
source/blender/editors/space_file/file_intern.h
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filelist.h
source/blender/editors/space_file/filesel.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_graph/graph_intern.h
source/blender/editors/space_graph/graph_select.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/SConscript
source/blender/editors/space_image/image_buttons.c [moved from source/blender/editors/space_image/image_panels.c with 95% similarity]
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_header.c
source/blender/editors/space_image/image_intern.h
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_header.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_sequencer/sequencer_header.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_header.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_time/time_header.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/intern/allocimbuf.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_anim_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_define.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_camera.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_context.c
source/blender/makesrna/intern/rna_controller.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_lamp.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_sensor.c
source/blender/makesrna/intern/rna_sound.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_world.c
source/blender/python/epy_doc_gen.py
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_ui.c
source/blender/python/intern/bpy_util.c
source/blender/python/intern/bpy_util.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/rendercore.c
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_event_types.h
source/darwin/blender.app/Contents/Resources/blender file icon.icns
source/darwin/blender.app/Contents/Resources/blender icon.icns
source/darwin/blendercreator.app/Contents/Resources/blender creator icon.icns
source/darwin/blendercreator.app/Contents/Resources/blender file icon.icns
source/darwin/blenderplayer.app/Contents/Resources/blender file icon.icns
source/darwin/blenderplayer.app/Contents/Resources/blender player icon.icns
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
tools/Blender.py
tools/btools.py

index e79a075ff2c9b8880c6bc08d03963c4ed57fea26..8513d056795bed2cbc96eb70a2c88f5e4d0fc942 100644 (file)
@@ -39,6 +39,7 @@
 #endif
 
 #include "GHOST_SystemWin32.h"
+//#include <stdio.h> //for printf()
 
 // win64 doesn't define GWL_USERDATA
 #ifdef WIN32
@@ -536,7 +537,7 @@ GHOST_Event* GHOST_SystemWin32::processWindowEvent(GHOST_TEventType type, GHOST_
 LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
        GHOST_Event* event = 0;
-       LRESULT lResult;
+       LRESULT lResult = 0;
        GHOST_SystemWin32* system = ((GHOST_SystemWin32*)getSystem());
        GHOST_ASSERT(system, "GHOST_SystemWin32::s_wndProc(): system not initialized")
 
@@ -746,6 +747,9 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                         * the message is sent asynchronously, so the window is activated immediately. 
                                         */
                                        event = processWindowEvent(LOWORD(wParam) ? GHOST_kEventWindowActivate : GHOST_kEventWindowDeactivate, window);
+                                       /* WARNING: Let DefWindowProc handle WM_ACTIVATE, otherwise WM_MOUSEWHEEL
+                                       will not be dispatched to OUR active window if we minimize one of OUR windows. */
+                                       lResult = ::DefWindowProc(hwnd, msg, wParam, lParam);
                                        break;
                                case WM_PAINT:
                                        /* An application sends the WM_PAINT message when the system or another application 
@@ -905,7 +909,6 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
 
        if (event) {
                system->pushEvent(event);
-               lResult = 0;
        }
        else {
                lResult = ::DefWindowProc(hwnd, msg, wParam, lParam);
index c6ce7b628e96b4af046de8fd6f66f5de481f5353..a975322e9cef1b5a286f17e7368bccf8d67c2655 100644 (file)
@@ -117,7 +117,15 @@ GHOST_SystemX11(
        m_net_fullscreen= XInternAtom(m_display,
                                        "_NET_WM_STATE_FULLSCREEN", False);
        m_motif= XInternAtom(m_display, "_MOTIF_WM_HINTS", False);
-
+       m_targets= XInternAtom(m_display, "TARGETS", False);
+       m_string= XInternAtom(m_display, "STRING", False);
+       m_compound_text= XInternAtom(m_display, "COMPOUND_TEXT", False);
+       m_text= XInternAtom(m_display, "TEXT", False);
+       m_clipboard= XInternAtom(m_display, "CLIPBOARD", False);
+       m_primary= XInternAtom(m_display, "PRIMARY", False);
+       m_xclip_out= XInternAtom(m_display, "XCLIP_OUT", False);
+       m_incr= XInternAtom(m_display, "INCR", False);
+       m_utf8_string= XInternAtom(m_display, "UTF8_STRING", False);
 
        // compute the initial time
        timeval tv;
@@ -1004,144 +1012,298 @@ convertXKey(
 
 #undef GXMAP
 
-       GHOST_TUns8*
-GHOST_SystemX11::
-getClipboard(bool selection
-) const {
-       //Flag 
-       //0 = Regular clipboard 1 = selection
-       static Atom Primary_atom, clip_String, compound_text, a_text, a_string;
-       Atom rtype;
-       Window m_window, owner;
-       unsigned char *data, *tmp_data;
-       int bits, count;
-       unsigned long len, bytes;
-       XEvent xevent;
-       
+/* from xclip.c xcout() v0.11 */
+
+#define XCLIB_XCOUT_NONE               0 /* no context */
+#define XCLIB_XCOUT_SENTCONVSEL                1 /* sent a request */
+#define XCLIB_XCOUT_INCR               2 /* in an incr loop */
+#define XCLIB_XCOUT_FALLBACK           3 /* STRING failed, need fallback to UTF8 */
+#define XCLIB_XCOUT_FALLBACK_UTF8      4 /* UTF8 failed, move to compouned */
+#define XCLIB_XCOUT_FALLBACK_COMP      5 /* compouned failed, move to text. */
+#define XCLIB_XCOUT_FALLBACK_TEXT      6
+
+// Retrieves the contents of a selections.
+void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
+       Atom sel, Atom target, unsigned char **txt,
+       unsigned long *len, unsigned int *context) const
+{
+       Atom pty_type;
+       int pty_format;
+       unsigned char *buffer;
+       unsigned long pty_size, pty_items;
+       unsigned char *ltxt= *txt;
+
        vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();
        vector<GHOST_IWindow *>::iterator win_it = win_vec.begin();
        GHOST_WindowX11 * window = static_cast<GHOST_WindowX11 *>(*win_it);
-       m_window = window->getXWindow();
+       Window win = window->getXWindow();
+
+       switch (*context) {
+               // There is no context, do an XConvertSelection()
+               case XCLIB_XCOUT_NONE:
+                       // Initialise return length to 0
+                       if (*len > 0) {
+                               free(*txt);
+                               *len = 0;
+                       }
 
-       clip_String = XInternAtom(m_display, "_BLENDER_STRING", False);
-       compound_text = XInternAtom(m_display, "COMPOUND_TEXT", False);
-       a_text= XInternAtom(m_display, "TEXT", False);
-       a_string= XInternAtom(m_display, "STRING", False);
-
-       //lets check the owner and if it is us then return the static buffer
-       if(!selection) {
-               Primary_atom = XInternAtom(m_display, "CLIPBOARD", False);
-               owner = XGetSelectionOwner(m_display, Primary_atom);
-               if (owner == m_window) {
-                       data = (unsigned char*) malloc(strlen(txt_cut_buffer)+1);
-                       strcpy((char*)data, txt_cut_buffer);
-                       return (GHOST_TUns8*)data;
-               } else if (owner == None) {
-                       return NULL;
-               }
-       } else {
-               Primary_atom = XInternAtom(m_display, "PRIMARY", False);
-               owner = XGetSelectionOwner(m_display, Primary_atom);
-               if (owner == m_window) {
-                       data = (unsigned char*) malloc(strlen(txt_select_buffer)+1);
-                       strcpy((char*)data, txt_select_buffer);
-                       return (GHOST_TUns8*)data;
-               } else if (owner == None) {
-                       return NULL;
-               }
-       }
+                       // Send a selection request
+                       XConvertSelection(m_display, sel, target, m_xclip_out, win, CurrentTime);
+                       *context = XCLIB_XCOUT_SENTCONVSEL;
+                       return;
 
-       if(!Primary_atom) {
-               return NULL;
-       }
-       
-       XDeleteProperty(m_display, m_window, Primary_atom);
-       XConvertSelection(m_display, Primary_atom, compound_text, clip_String, m_window, CurrentTime); //XA_STRING
-       XFlush(m_display);
+               case XCLIB_XCOUT_SENTCONVSEL:
+                       if (evt.type != SelectionNotify)
+                               return;
 
-       //This needs to change so we do not wait for ever or check owner first
-       count= 1;
-       while(1) {
-               XNextEvent(m_display, &xevent);
-               if(xevent.type == SelectionNotify) {
-                       if (xevent.xselection.property == None) {
-                               /* Ok, the client can't convert the property
-                                * to some that we can handle, try other types..
-                                */
-                               if (count == 1) {
-                                       XConvertSelection(m_display, Primary_atom, a_text, clip_String, m_window, CurrentTime);
-                                       count++;
-                               }
-                               else if (count == 2) {
-                                       XConvertSelection(m_display, Primary_atom, a_string, clip_String, m_window, CurrentTime);
-                                       count++;
-                               }
-                               else {
-                                       /* Ok, the owner of the selection can't 
-                                        * convert the data to something that we can
-                                        * handle.
-                                        */
-                                       return(NULL);
-                               }
+                       if (target == m_utf8_string && evt.xselection.property == None) {
+                               *context= XCLIB_XCOUT_FALLBACK_UTF8;
+                               return;
+                       }
+                       else if (target == m_compound_text && evt.xselection.property == None) {
+                               *context= XCLIB_XCOUT_FALLBACK_COMP;
+                               return;
+                       }
+                       else if (target == m_text && evt.xselection.property == None) {
+                               *context= XCLIB_XCOUT_FALLBACK_TEXT;
+                               return;
+                       }
+
+                       // find the size and format of the data in property
+                       XGetWindowProperty(m_display, win, m_xclip_out, 0, 0, False,
+                               AnyPropertyType, &pty_type, &pty_format,
+                               &pty_items, &pty_size, &buffer);
+                       XFree(buffer);
+
+                       if (pty_type == m_incr) {
+                               // start INCR mechanism by deleting property
+                               XDeleteProperty(m_display, win, m_xclip_out);
+                               XFlush(m_display);
+                               *context = XCLIB_XCOUT_INCR;
+                               return;
+                       }
+
+                       // if it's not incr, and not format == 8, then there's
+                       // nothing in the selection (that xclip understands, anyway)
+
+                       if (pty_format != 8) {
+                               *context = XCLIB_XCOUT_NONE;
+                               return;
+                       }
+
+                       // not using INCR mechanism, just read the property
+                       XGetWindowProperty(m_display, win, m_xclip_out, 0, (long) pty_size,
+                                       False, AnyPropertyType, &pty_type,
+                                       &pty_format, &pty_items, &pty_size, &buffer);
+
+                       // finished with property, delete it
+                       XDeleteProperty(m_display, win, m_xclip_out);
+
+                       // copy the buffer to the pointer for returned data
+                       ltxt = (unsigned char *) malloc(pty_items);
+                       memcpy(ltxt, buffer, pty_items);
+
+                       // set the length of the returned data
+                       *len = pty_items;
+                       *txt = ltxt;
+
+                       // free the buffer
+                       XFree(buffer);
+
+                       *context = XCLIB_XCOUT_NONE;
+
+                       // complete contents of selection fetched, return 1
+                       return;
+
+               case XCLIB_XCOUT_INCR:
+                       // To use the INCR method, we basically delete the
+                       // property with the selection in it, wait for an
+                       // event indicating that the property has been created,
+                       // then read it, delete it, etc.
+
+                       // make sure that the event is relevant
+                       if (evt.type != PropertyNotify)
+                               return;
+
+                       // skip unless the property has a new value
+                       if (evt.xproperty.state != PropertyNewValue)
+                               return;
+
+                       // check size and format of the property
+                       XGetWindowProperty(m_display, win, m_xclip_out, 0, 0, False,
+                               AnyPropertyType, &pty_type, &pty_format,
+                               &pty_items, &pty_size, (unsigned char **) &buffer);
+
+                       if (pty_format != 8) {
+                               // property does not contain text, delete it
+                               // to tell the other X client that we have read 
+                               // it and to send the next property
+                               XFree(buffer);
+                               XDeleteProperty(m_display, win, m_xclip_out);
+                               return;
+                       }
+
+                       if (pty_size == 0) {
+                               // no more data, exit from loop
+                               XFree(buffer);
+                               XDeleteProperty(m_display, win, m_xclip_out);
+                               *context = XCLIB_XCOUT_NONE;
+
+                               // this means that an INCR transfer is now
+                               // complete, return 1
+                               return;
+                       }
+
+                       XFree(buffer);
+
+                       // if we have come this far, the propery contains
+                       // text, we know the size.
+                       XGetWindowProperty(m_display, win, m_xclip_out, 0, (long) pty_size,
+                               False, AnyPropertyType, &pty_type, &pty_format,
+                               &pty_items, &pty_size, (unsigned char **) &buffer);
+
+                       // allocate memory to accommodate data in *txt
+                       if (*len == 0) {
+                               *len = pty_items;
+                               ltxt = (unsigned char *) malloc(*len);
                        }
                        else {
-                               if(XGetWindowProperty(m_display, m_window, xevent.xselection.property , 0L, 4096L, False, AnyPropertyType, &rtype, &bits, &len, &bytes, &data) == Success) {
-                                       if (data) {
-                                               if (bits == 8 && (rtype == compound_text || rtype == a_text || rtype == a_string)) {
-                                                       tmp_data = (unsigned char*) malloc(strlen((char*)data)+1);
-                                                       strcpy((char*)tmp_data, (char*)data);
-                                               }
-                                               else
-                                                       tmp_data= NULL;
-
-                                               XFree(data);
-                                               return (GHOST_TUns8*)tmp_data;
-                                       }
-                               }
-                               return(NULL);
+                               *len += pty_items;
+                               ltxt = (unsigned char *) realloc(ltxt, *len);
                        }
-               }
+
+                       // add data to ltxt
+                       memcpy(&ltxt[*len - pty_items], buffer, pty_items);
+
+                       *txt = ltxt;
+                       XFree(buffer);
+
+                       // delete property to get the next item
+                       XDeleteProperty(m_display, win, m_xclip_out);
+                       XFlush(m_display);
+                       return;
        }
+       return;
 }
 
-       void
-GHOST_SystemX11::
-putClipboard(
-GHOST_TInt8 *buffer, bool selection) const
+GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
 {
-       static Atom Primary_atom;
-       Window m_window, owner;
-       
-       if(!buffer) {return;}
-       
-       if(!selection) {
-               Primary_atom = XInternAtom(m_display, "CLIPBOARD", False);
-               if(txt_cut_buffer) { free((void*)txt_cut_buffer); }
+       Atom sseln;
+       Atom target= m_string;
+       Window owner;
+
+       // from xclip.c doOut() v0.11
+       unsigned char *sel_buf;
+       unsigned long sel_len= 0;
+       XEvent evt;
+       unsigned int context= XCLIB_XCOUT_NONE;
+
+       if (selection == True)
+               sseln= m_primary;
+       else
+               sseln= m_clipboard;
+
+       vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();
+       vector<GHOST_IWindow *>::iterator win_it = win_vec.begin();
+       GHOST_WindowX11 * window = static_cast<GHOST_WindowX11 *>(*win_it);
+       Window win = window->getXWindow();
+
+       /* check if we are the owner. */
+       owner= XGetSelectionOwner(m_display, sseln);
+       if (owner == win) {
+               if (sseln == m_clipboard) {
+                       sel_buf= (unsigned char *)malloc(strlen(txt_cut_buffer)+1);
+                       strcpy((char *)sel_buf, txt_cut_buffer);
+                       return((GHOST_TUns8*)sel_buf);
+               }
+               else {
+                       sel_buf= (unsigned char *)malloc(strlen(txt_select_buffer)+1);
+                       strcpy((char *)sel_buf, txt_select_buffer);
+                       return((GHOST_TUns8*)sel_buf);
+               }
+       }
+       else if (owner == None)
+               return(NULL);
+
+       while (1) {
+               /* only get an event if xcout() is doing something */
+               if (context != XCLIB_XCOUT_NONE)
+                       XNextEvent(m_display, &evt);
+
+               /* fetch the selection, or part of it */
+               getClipboard_xcout(evt, sseln, target, &sel_buf, &sel_len, &context);
+
+               /* fallback is needed. set XA_STRING to target and restart the loop. */
+               if (context == XCLIB_XCOUT_FALLBACK) {
+                       context= XCLIB_XCOUT_NONE;
+                       target= m_string;
+                       continue;
+               }
+               else if (context == XCLIB_XCOUT_FALLBACK_UTF8) {
+                       /* utf8 fail, move to compouned text. */
+                       context= XCLIB_XCOUT_NONE;
+                       target= m_compound_text;
+                       continue;
+               }
+               else if (context == XCLIB_XCOUT_FALLBACK_COMP) {
+                       /* compouned text faile, move to text. */
+                       context= XCLIB_XCOUT_NONE;
+                       target= m_text;
+                       continue;
+               }
+
+               /* only continue if xcout() is doing something */
+               if (context == XCLIB_XCOUT_NONE)
+                       break;
+       }
+
+       if (sel_len) {
+               /* only print the buffer out, and free it, if it's not
+                * empty
+                */
+               unsigned char *tmp_data = (unsigned char*) malloc(sel_len+1);
+               memcpy((char*)tmp_data, (char*)sel_buf, sel_len);
+               tmp_data[sel_len] = '\0';
                
-               txt_cut_buffer = (char*) malloc(strlen(buffer)+1);
-               strcpy(txt_cut_buffer, buffer);
-       } else {
-               Primary_atom = XInternAtom(m_display, "PRIMARY", False);
-               if(txt_select_buffer) { free((void*)txt_select_buffer); }
+               if (sseln == m_string)
+                       XFree(sel_buf);
+               else
+                       free(sel_buf);
                
-               txt_select_buffer = (char*) malloc(strlen(buffer)+1);
-               strcpy(txt_select_buffer, buffer);
+               return (GHOST_TUns8*)tmp_data;
        }
-       
-       vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();
+       return(NULL);
+}
+
+void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
+{
+       Window m_window, owner;
+
+       vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();      
        vector<GHOST_IWindow *>::iterator win_it = win_vec.begin();
        GHOST_WindowX11 * window = static_cast<GHOST_WindowX11 *>(*win_it);
        m_window = window->getXWindow();
 
-       if(!Primary_atom) {
-               return;
-       }
-       
-       XSetSelectionOwner(m_display, Primary_atom, m_window, CurrentTime);
-       owner = XGetSelectionOwner(m_display, Primary_atom);
-       if (owner != m_window)
-               fprintf(stderr, "failed to own primary\n");
+       if (buffer) {
+               if (selection == False) {
+                       XSetSelectionOwner(m_display, m_clipboard, m_window, CurrentTime);
+                       owner= XGetSelectionOwner(m_display, m_clipboard);
+                       if (txt_cut_buffer)
+                               free((void*)txt_cut_buffer);
+
+                       txt_cut_buffer = (char*) malloc(strlen(buffer)+1);
+                       strcpy(txt_cut_buffer, buffer);
+               } else {
+                       XSetSelectionOwner(m_display, m_primary, m_window, CurrentTime);
+                       owner= XGetSelectionOwner(m_display, m_primary);
+                       if (txt_select_buffer)
+                               free((void*)txt_select_buffer);
+
+                       txt_select_buffer = (char*) malloc(strlen(buffer)+1);
+                       strcpy(txt_select_buffer, buffer);
+               }
        
-       return;
+               if (owner != m_window)
+                       fprintf(stderr, "failed to own primary\n");
+       }
 }
-
index 6eacd88b8c202a26f5691580ab9e8b00d1f4b4c7..711a188ffe94e8f665837d75602317ba0df62096 100644 (file)
@@ -199,20 +199,25 @@ public:
        prepareNdofInfo(
                volatile GHOST_TEventNDOFData *current_values
        );
-               
+
+       /* Helped function for get data from the clipboard. */
+       void getClipboard_xcout(XEvent evt, Atom sel, Atom target,
+                        unsigned char **txt, unsigned long *len,
+                        unsigned int *context) const;
+
        /**
         * Returns unsinged char from CUT_BUFFER0
         * @param selection             Get selection, X11 only feature
         * @return                              Returns the Clipboard indicated by Flag
         */
-       GHOST_TUns8getClipboard(bool selection) const;
+       GHOST_TUns8 *getClipboard(bool selection) const;
        
        /**
         * Puts buffer to system clipboard
         * @param buffer        The buffer to copy to the clipboard     
         * @param selection     Set the selection into the clipboard, X11 only feature
         */
-       virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
+       void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
 
        /**
         * Atom used for ICCCM, WM-spec and Motif.
@@ -231,6 +236,17 @@ public:
        Atom m_wm_protocols;
        Atom m_delete_window_atom;
 
+       /* Atoms for Selection, copy & paste. */
+       Atom m_targets;
+       Atom m_string;
+       Atom m_compound_text;
+       Atom m_text;
+       Atom m_clipboard;
+       Atom m_primary;
+       Atom m_xclip_out;
+       Atom m_incr;
+       Atom m_utf8_string;
+
 private :
 
        Display * m_display;
index a7deb22555ef4823ed862c0b805af20ca6450103..3ed0e772d2ff2224aa5a56cbbcc4e33e21e58b6b 100644 (file)
@@ -44,7 +44,7 @@
                                Name="VCCLCompilerTool"\r
                                InlineFunctionExpansion="1"\r
                                AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"\r
-                               PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"\r
+                               PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_FREETYPE2;WITH_INTERNATIONAL;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"\r
                                StringPooling="true"\r
                                RuntimeLibrary="0"\r
                                EnableFunctionLevelLinking="true"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
                                AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"\r
-                               PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER;WITH_QUICKTIME;INTERNATIONAL;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"\r
+                               PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER;WITH_QUICKTIME;INTERNATIONAL;WITH_BF_INTERNATIONAL;WITH_FREETYPE2;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="1"\r
                                DefaultCharIsUnsigned="true"\r
                                RelativePath="..\..\..\source\blender\editors\interface\interface_style.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\interface\interface_templates.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\interface\interface_utils.c"\r
                                >\r
                <Filter\r
                        Name="space_image"\r
                        >\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\space_image\image_buttons.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\space_image\image_draw.c"\r
                                >\r
                                RelativePath="..\..\..\source\blender\editors\space_image\image_ops.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\source\blender\editors\space_image\image_panels.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\space_image\image_render.c"\r
                                >\r
index 219dacd887064ffe61413ae716dd03c061f20a97..467e79f024a53f18223567e2fc60ae044e617463 100644 (file)
Binary files a/release/datafiles/blenderbuttons and b/release/datafiles/blenderbuttons differ
diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py
new file mode 100644 (file)
index 0000000..1d0043a
--- /dev/null
@@ -0,0 +1,114 @@
+
+import bpy
+class DataButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "data"
+       
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.type == 'ARMATURE')
+
+class DATA_PT_skeleton(DataButtonsPanel):
+       __idname__ = "DATA_PT_skeleton"
+       __label__ = "Skeleton"
+
+       def draw(self, context):
+               arm = context.active_object.data
+               layout = self.layout
+               
+               layout.itemR(arm, "rest_position")
+
+               split = layout.split()
+
+               sub = split.column()
+               sub.itemL(text="Deform:")
+               sub.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
+               sub.itemR(arm, "deform_envelope", text="Envelopes")
+               sub.itemR(arm, "deform_quaternion", text="Quaternion")
+               sub.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
+               #sub.itemR(arm, "x_axis_mirror")
+               #sub.itemR(arm, "auto_ik")
+               
+               sub = split.column()
+               sub.itemL(text="Layers:")
+               sub.itemL(text="LAYERS")
+               #sub.itemR(arm, "layer")
+               #sub.itemR(arm, "layer_protection")
+
+class DATA_PT_display(DataButtonsPanel):
+       __idname__ = "DATA_PT_display"
+       __label__ = "Display"
+       
+       def draw(self, context):
+               arm = context.active_object.data
+               layout = self.layout
+
+               split = layout.split()
+
+               sub = split.column()
+               sub.itemR(arm, "drawtype", text="Style")
+               sub.itemR(arm, "delay_deform", text="Delay Refresh")
+
+               sub = split.column()
+               sub.itemR(arm, "draw_names", text="Names")
+               sub.itemR(arm, "draw_axes", text="Axes")
+               sub.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
+               sub.itemR(arm, "draw_group_colors", text="Colors")
+
+class DATA_PT_paths(DataButtonsPanel):
+       __idname__ = "DATA_PT_paths"
+       __label__ = "Paths"
+
+       def draw(self, context):
+               arm = context.active_object.data
+               layout = self.layout
+
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
+               if (arm.paths_show_around_current_frame):
+                       sub.itemR(arm, "path_before_current", text="Before")
+                       sub.itemR(arm, "path_after_current", text="After")
+               else:
+                       sub.itemR(arm, "path_start_frame", text="Start")
+                       sub.itemR(arm, "path_end_frame", text="End")
+
+               sub.itemR(arm, "path_size", text="Step")        
+               sub.itemR(arm, "paths_calculate_head_positions", text="Head")
+               
+               sub = split.column()
+               sub.itemL(text="Show:")
+               sub.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
+               sub.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
+               sub.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
+
+class DATA_PT_ghost(DataButtonsPanel):
+       __idname__ = "DATA_PT_ghost"
+       __label__ = "Ghost"
+
+       def draw(self, context):
+               arm = context.active_object.data
+               layout = self.layout
+
+               split = layout.split()
+
+               sub = split.column()
+               sub.itemR(arm, "ghost_type", text="Scope")
+               if arm.ghost_type == 'RANGE':
+                       sub.itemR(arm, "ghost_start_frame", text="Start")
+                       sub.itemR(arm, "ghost_end_frame", text="End")
+                       sub.itemR(arm, "ghost_size", text="Step")
+               elif arm.ghost_type == 'CURRENT_FRAME':
+                       sub.itemR(arm, "ghost_step", text="Range")
+                       sub.itemR(arm, "ghost_size", text="Step")
+
+               sub = split.column()
+               sub.itemR(arm, "ghost_only_selected", text="Selected Only")
+
+bpy.types.register(DATA_PT_skeleton)
+bpy.types.register(DATA_PT_display)
+bpy.types.register(DATA_PT_paths)
+bpy.types.register(DATA_PT_ghost)
\ No newline at end of file
diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py
new file mode 100644 (file)
index 0000000..a4e0fe4
--- /dev/null
@@ -0,0 +1,53 @@
+
+import bpy
+class BoneButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "bone"
+       
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.type == 'ARMATURE')
+
+class BONE_PT_bone(BoneButtonsPanel):
+       __idname__ = "BONE_PT_bone"
+       __label__ = "Bone"
+
+       def draw(self, context):
+               bone = context.active_object.data.bones[0]
+               layout = self.layout
+
+               split = layout.split()
+
+               sub = split.column()
+               sub.itemR(bone, "name")
+               sub.itemR(bone, "parent")
+               sub.itemR(bone, "connected")
+               sub.itemR(bone, "deform")
+
+               sub.itemL(text="Inherit:")
+               sub.itemR(bone, "hinge")
+               sub.itemR(bone, "inherit_scale")
+
+               sub.itemL(text="Envelope:")
+               sub.itemR(bone, "envelope_distance", text="Distance")
+               sub.itemR(bone, "envelope_weight", text="Weight")
+               sub.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
+
+               sub = split.column()
+               #sub.itemR(bone, "layer")
+               sub.itemL(text="Display:")
+               sub.itemR(bone, "draw_wire", text="Wireframe")
+               sub.itemR(bone, "editmode_hidden", text="Hide (EditMode)")
+               sub.itemR(bone, "pose_channel_hidden", text="Hide (PoseMode)")
+
+               sub.itemL(text="Curved Bones:")
+               sub.itemR(bone, "bbone_segments", text="Segments")
+               sub.itemR(bone, "bbone_in", text="Ease In")
+               sub.itemR(bone, "bbone_out", text="Ease Out")
+               
+               sub.itemR(bone, "cyclic_offset")
+
+bpy.types.register(BONE_PT_bone)
+
index 0f852216a87690e6331df23b809a4c39a20d4f4d..9770fdaf8ebf0a90bfef48423d66f26754efddd6 100644 (file)
@@ -15,67 +15,59 @@ class DATA_PT_cameralens(DataButtonsPanel):
        __label__ = "Lens"
 
        def draw(self, context):
-               cam = context.main.cameras[0]
+               cam = context.active_object.data
                layout = self.layout
 
-               if not cam:
-                       return
-               
-               layout.row()
                layout.itemR(cam, "type", expand=True)
                
-               layout.row()
-               if (cam.type == 'PERSP'):
-                       layout.itemR(cam, "lens_unit")
-                       if (cam.lens_unit == 'MILLIMETERS'):
-                               layout.itemR(cam, "lens", text="Angle")
-                       if (cam.lens_unit == 'DEGREES'):
-                               layout.itemR(cam, "angle")
-               if (cam.type == 'ORTHO'):
-                       layout.itemR(cam, "ortho_scale")
+               row = layout.row(align=True)
+               if cam.type == 'PERSP':
+                       row.itemR(cam, "lens_unit", text="")
+                       if cam.lens_unit == 'MILLIMETERS':
+                               row.itemR(cam, "lens", text="Angle")
+                       elif cam.lens_unit == 'DEGREES':
+                               row.itemR(cam, "angle")
+
+               elif cam.type == 'ORTHO':
+                       row.itemR(cam, "ortho_scale")
+                       
+               split = layout.split()
                
-               layout.column_flow()
-               layout.itemL(text="Shift:")
-               layout.itemR(cam, "shift_x", text="X")
-               layout.itemR(cam, "shift_y", text="Y")
-               layout.itemL(text="Clipping:")
-               layout.itemR(cam, "clip_start", text="Start")
-               layout.itemR(cam, "clip_end", text="End")
+               sub = split.column(align=True)
+               sub.itemL(text="Shift:")
+               sub.itemR(cam, "shift_x", text="X")
+               sub.itemR(cam, "shift_y", text="Y")
                
-               layout.row()
-               layout.itemR(cam, "dof_object")
-               layout.itemR(cam, "dof_distance")
+               sub = split.column(align=True)
+               sub.itemL(text="Clipping:")
+               sub.itemR(cam, "clip_start", text="Start")
+               sub.itemR(cam, "clip_end", text="End")
+               
+               row = layout.row()
+               row.itemR(cam, "dof_object")
+               row.itemR(cam, "dof_distance")
                
 class DATA_PT_cameradisplay(DataButtonsPanel):
        __idname__ = "DATA_PT_cameradisplay"
        __label__ = "Display"
        
        def draw(self, context):
-               cam = context.main.cameras[0]
+               cam = context.active_object.data
                layout = self.layout
 
-               if not cam:
-                       return
-                       
-               layout.split(number=2)
+               split = layout.split()
                
-               sub = layout.sub(0)
-               sub.column()
+               sub = split.column()
                sub.itemR(cam, "show_limits", text="Limits")
                sub.itemR(cam, "show_mist", text="Mist")
                sub.itemR(cam, "show_title_safe", text="Title Safe")
                sub.itemR(cam, "show_name", text="Name")
-               
-               sub = layout.sub(1)
-               subsub = sub.box()
-               subsub.column()
-               subsub.itemR(cam, "show_passepartout", text="Passepartout")
+                       
+               sub = split.column()
+               sub.itemR(cam, "show_passepartout", text="Passepartout")
                if (cam.show_passepartout):
-                       subsub.itemR(cam, "passepartout_alpha", text="Alpha")
-               sub.row()
+                       sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
                sub.itemR(cam, "draw_size", text="Size")
                
 bpy.types.register(DATA_PT_cameralens)
-bpy.types.register(DATA_PT_cameradisplay)
-
-
+bpy.types.register(DATA_PT_cameradisplay)
\ No newline at end of file
diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py
new file mode 100644 (file)
index 0000000..12a1fef
--- /dev/null
@@ -0,0 +1,127 @@
+
+import bpy
+
+class DataButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "data"
+       
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.type == 'CURVE')
+
+class DATA_PT_shape_curve(DataButtonsPanel):
+               __idname__ = "DATA_PT_shape_curve"
+               __label__ = "Shape"
+
+               def draw(self, context):
+                       curve = context.active_object.data
+                       layout = self.layout
+
+                       layout.itemR(curve, "curve_2d")                 
+                                                       
+                       split = layout.split()
+               
+                       sub = split.column()
+                       sub.itemL(text="Caps:")
+                       sub.itemR(curve, "front")
+                       sub.itemR(curve, "back")
+                       
+                       sub.itemL(text="Textures:")
+                       sub.itemR(curve, "uv_orco")
+                       sub.itemR(curve, "auto_texspace")
+                       
+                       sub = split.column()    
+                       sub.itemL(text="Resolution:")
+                       sub.itemR(curve, "resolution_u", text="Preview U")
+                       sub.itemR(curve, "resolution_v", text="Preview V")
+                       sub.itemR(curve, "render_resolution_u", text="Render U")
+                       sub.itemR(curve, "render_resolution_v", text="Render V")
+
+                       sub.itemL(text="Display:")
+                       sub.itemL(text="HANDLES")
+                       sub.itemL(text="NORMALS")
+                       sub.itemR(curve, "vertex_normal_flip")
+
+class DATA_PT_geometry(DataButtonsPanel):
+               __idname__ = "DATA_PT_geometry"
+               __label__ = "Geometry"
+
+               def draw(self, context):
+                       curve = context.active_object.data
+                       layout = self.layout
+
+                       split = layout.split()
+               
+                       sub = split.column()
+                       sub.itemL(text="Modification:")
+                       sub.itemR(curve, "width")
+                       sub.itemR(curve, "extrude")
+                       sub.itemR(curve, "taper_object")
+                       
+                       sub = split.column()
+                       sub.itemL(text="Bevel:")
+                       sub.itemR(curve, "bevel_depth", text="Depth")
+                       sub.itemR(curve, "bevel_resolution", text="Resolution")
+                       sub.itemR(curve, "bevel_object")
+       
+class DATA_PT_pathanim(DataButtonsPanel):
+               __idname__ = "DATA_PT_pathanim"
+               __label__ = "Path Animation"
+
+               def draw(self, context):
+                       curve = context.active_object.data
+                       layout = self.layout
+
+                       layout.itemR(curve, "path", text="Enable")
+                       
+                       split = layout.split()          
+                       
+                       sub = split.column()
+                       sub.itemR(curve, "path_length", text="Frames")
+                       sub.itemR(curve, "follow")
+
+                       sub = split.column()
+                       sub.itemR(curve, "stretch")
+                       sub.itemR(curve, "offset_path_distance", text="Offset Children")
+       
+class DATA_PT_current_curve(DataButtonsPanel):
+               __idname__ = "DATA_PT_current_curve"
+               __label__ = "Current Curve"
+
+               def draw(self, context):
+                       currentcurve = context.active_object.data.curves[0]
+                       layout = self.layout
+
+                       split = layout.split()
+               
+                       sub = split.column()
+                       sub.itemL(text="Cyclic:")
+                       sub.itemR(currentcurve, "cyclic_u", text="U")
+                       sub.itemR(currentcurve, "cyclic_v", text="V")
+                       sub.itemL(text="Order:")
+                       sub.itemR(currentcurve, "order_u", text="U")
+                       sub.itemR(currentcurve, "order_v", text="V")
+                       sub.itemL(text="Point Count:")                  
+                       sub.itemR(currentcurve, "point_count_u", text="U")
+                       sub.itemR(currentcurve, "point_count_v", text="V")
+                       sub.itemL(text="Endpoints:")
+                       sub.itemR(currentcurve, "endpoint_u", text="U")
+                       sub.itemR(currentcurve, "endpoint_v", text="V")
+                       
+                       sub = split.column()
+                       sub.itemL(text="Bezier:")
+                       sub.itemR(currentcurve, "bezier_u", text="U")
+                       sub.itemR(currentcurve, "bezier_v", text="V")
+                       sub.itemL(text="Resolution:")
+                       sub.itemR(currentcurve, "resolution_u", text="U")
+                       sub.itemR(currentcurve, "resolution_v", text="V")
+                       sub.itemL(text="Interpolation:")
+                       sub.itemR(currentcurve, "tilt_interpolation", text="Tilt")
+                       sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
+                       sub.itemR(currentcurve, "smooth")
+                       
+bpy.types.register(DATA_PT_shape_curve)
+bpy.types.register(DATA_PT_geometry)
+bpy.types.register(DATA_PT_pathanim)
+bpy.types.register(DATA_PT_current_curve)
\ No newline at end of file
diff --git a/release/ui/buttons_data_empty.py b/release/ui/buttons_data_empty.py
new file mode 100644 (file)
index 0000000..94caa4e
--- /dev/null
@@ -0,0 +1,24 @@
+
+import bpy
+
+class DataButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "data"
+       
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.type == 'EMPTY')
+       
+class DATA_PT_empty(DataButtonsPanel):
+       __idname__ = "DATA_PT_empty"
+       __label__ = "Empty"
+
+       def draw(self, context):
+               ob = context.active_object
+               layout = self.layout
+
+               layout.itemR(ob, "empty_draw_type")
+               layout.itemR(ob, "empty_draw_size")
+               
+bpy.types.register(DATA_PT_empty)
\ No newline at end of file
index 6cec1a0d09d8fa73bbd7e7eba4f3fa1ac63e121f..157a89eb2c710246837f7ee2d3e5b5e0e2804b8e 100644 (file)
@@ -15,40 +15,25 @@ class DATA_PT_lamp(DataButtonsPanel):
        __label__ = "Lamp"
 
        def draw(self, context):
-               lamp = context.main.lamps[0]
+               lamp = context.active_object.data
                layout = self.layout
 
-               if not lamp:
-                       return
-               
-               layout.row()
                layout.itemR(lamp, "type", expand=True)
                
-               layout.split(number=2)
+               split = layout.split()
                
-               sub = layout.sub(0)
-               sub.column()
-               sub.itemL(text="LAMP DATABLOCKS")
+               sub = split.column()
+               sub.itemR(lamp, "color")
                sub.itemR(lamp, "energy")
                sub.itemR(lamp, "distance")
-       
-               sub = layout.sub(1)
-               sub.column()
-               sub.itemR(lamp, "color")
-               
-               layout.split(number=2)  
-               
-               sub = layout.sub(0)
-               sub.column()
-               sub.itemL(text="Illumination:")
-               sub.itemR(lamp, "layer")
                sub.itemR(lamp, "negative")
+       
+               sub = split.column()
+               sub.itemR(lamp, "layer", text="This Layer Only")
                sub.itemR(lamp, "specular")
                sub.itemR(lamp, "diffuse")
                
-               sub = layout.sub(1)
-               if (lamp.type in ('LOCAL', 'SPOT')):
-                       sub.column()
+               if lamp.type in ('POINT', 'SPOT'):
                        sub.itemR(lamp, "falloff_type")
                        sub.itemR(lamp, "sphere")
                        
@@ -56,7 +41,7 @@ class DATA_PT_lamp(DataButtonsPanel):
                                sub.itemR(lamp, "linear_attenuation")
                                sub.itemR(lamp, "quadratic_attenuation")
                        
-               if (lamp.type == 'AREA'):
+               if lamp.type == 'AREA':
                        sub.column()
                        sub.itemR(lamp, "gamma")
                        sub.itemR(lamp, "shape")
@@ -72,43 +57,38 @@ class DATA_PT_sunsky(DataButtonsPanel):
        
        def poll(self, context):
                ob = context.active_object
-               lamp = context.main.lamps[0]
-               return (ob.type == 'LAMP' and lamp.type == 'SUN')
+               return (ob.type == 'LAMP' and ob.data.type == 'SUN')
 
        def draw(self, context):
-               lamp = context.main.lamps[0].sky
+               lamp = context.active_object.data.sky
                layout = self.layout
 
-               if not lamp:
-                       return
-               
-               layout.row()
-               layout.itemR(lamp, "sky")
-               layout.itemR(lamp, "atmosphere")
+               row = layout.row()
+               row.itemR(lamp, "sky")
+               row.itemR(lamp, "atmosphere")
                
-               if (lamp.sky or lamp.atmosphere):
-                       layout.row()
+               if lamp.sky or lamp.atmosphere:
                        layout.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
                        
-                       layout.split(number=2)
+                       split = layout.split()
                        
-                       if (lamp.sky):
-                               sub = layout.sub(0)
-                               sub.column()
+                       col = split.column()
+                       if lamp.sky:
+                               sub = col.column()
                                sub.itemR(lamp, "sky_blend_type", text="Blend Type")
                                sub.itemR(lamp, "sky_blend")
                                sub.itemR(lamp, "sky_color_space", text="Color Space")
                                sub.itemR(lamp, "sky_exposure")
-                               sub.column()
+                               
+                               sub = col.column()
                                sub.itemR(lamp, "horizon_brightness", text="Hor Bright")
                                sub.itemR(lamp, "spread", text="Hor Spread")
                                sub.itemR(lamp, "sun_brightness", text="Sun Bright")
                                sub.itemR(lamp, "sun_size")
                                sub.itemR(lamp, "backscattered_light", text="Back Light")
                                
-                       if (lamp.atmosphere):
-                               sub = layout.sub(1)
-                               sub.column()
+                       sub = split.column()
+                       if lamp.atmosphere:
                                sub.itemR(lamp, "sun_intensity", text="Sun Intens")
                                sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering")
                                sub.itemR(lamp, "atmosphere_extinction", text="Extinction")
@@ -120,85 +100,78 @@ class DATA_PT_shadow(DataButtonsPanel):
        
        def poll(self, context):
                ob = context.active_object
-               lamp = context.main.lamps[0]
-               return (ob.type == 'LAMP' and lamp.type in ('LOCAL','SUN', 'SPOT', 'AREA'))
+               return (ob.type == 'LAMP' and ob.data.type in ('POINT','SUN', 'SPOT', 'AREA'))
 
        def draw(self, context):
-               lamp = context.main.lamps[0]
+               lamp = context.active_object.data
                layout = self.layout
 
-               if not lamp:
-                       return
-               
-               layout.row()
                layout.itemR(lamp, "shadow_method", expand=True)
                
-               if (lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW')):
+               if lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW'):
                
-                       layout.split(number=2)
+                       split = layout.split()
                        
-                       sub = layout.sub(0)
-                       sub.column()
-                       sub.itemL(text="Options:")
-                       sub.itemR(lamp, "only_shadow")
-                       sub.itemR(lamp, "shadow_layer")
-                       
-                       sub = layout.sub(1)
-                       sub.column()
+                       sub = split.column()
                        sub.itemR(lamp, "shadow_color")
+                       
+                       sub = split.column()
+                       sub.itemR(lamp, "shadow_layer", text="This Layer Only")
+                       sub.itemR(lamp, "only_shadow")
                
-               if (lamp.shadow_method == 'RAY_SHADOW'):
+               if lamp.shadow_method == 'RAY_SHADOW':
                
-                       layout.column()
-                       layout.itemL(text="Sampling:")
-                       layout.itemR(lamp, "shadow_ray_sampling_method", expand=True)
+                       col = layout.column()
+                       col.itemL(text="Sampling:")
+                       col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
                                
-                       if (lamp.type in ('LOCAL', 'SUN', 'SPOT') and lamp.shadow_ray_sampling_method in ('CONSTANT_QMC', 'ADAPTIVE_QMC')):
-                               layout.column_flow()
-                               layout.itemR(lamp, "shadow_soft_size", text="Soft Size")
-                               layout.itemR(lamp, "shadow_ray_samples", text="Samples")
-                               if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'):
-                                       layout.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+                       if lamp.type in ('POINT', 'SUN', 'SPOT'):
+                               flow = layout.column_flow()
+                               flow.itemR(lamp, "shadow_soft_size", text="Soft Size")
+                               flow.itemR(lamp, "shadow_ray_samples", text="Samples")
+                               if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
+                                       flow.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
                                                
-                       if (lamp.type == 'AREA'):
-                               layout.column_flow()
-                               layout.itemR(lamp, "shadow_ray_samples_x", text="Samples")
-                               if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'):
-                                       layout.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
-                               if (lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED'):
-                                       layout.itemR(lamp, "umbra")
-                                       layout.itemR(lamp, "dither")
-                                       layout.itemR(lamp, "jitter")    
-               
-               if (lamp.shadow_method == 'BUFFER_SHADOW'):
-                       layout.column()
-                       layout.itemL(text="Buffer Type:")
-                       layout.itemR(lamp, "shadow_buffer_type", expand=True)
+                       if lamp.type == 'AREA':
+                               flow = layout.column_flow()
+                               flow.itemR(lamp, "shadow_ray_samples_x", text="Samples")
+                               if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
+                                       flow.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+                               if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
+                                       flow.itemR(lamp, "umbra")
+                                       flow.itemR(lamp, "dither")
+                                       flow.itemR(lamp, "jitter")      
+       
+               if lamp.shadow_method == 'BUFFER_SHADOW':
+                       col = layout.column()
+                       col.itemL(text="Buffer Type:")
+                       col.row().itemR(lamp, "shadow_buffer_type", expand=True)
 
-                       if (lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY')):
-                               layout.column_flow()
-                               layout.itemL(text="Sample Buffers:")
-                               layout.itemR(lamp, "shadow_sample_buffers", expand=True)
-                               layout.itemL(text="Filter Type:")
-                               layout.itemR(lamp, "shadow_filter_type", expand=True)
-                               layout.column_flow()
-                               layout.itemR(lamp, "shadow_buffer_size", text="Size")
-                               layout.itemR(lamp, "shadow_buffer_samples", text="Samples")
-                               layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
-                               layout.itemR(lamp, "shadow_buffer_soft", text="Soft")
+                       if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY'):
+                               flow = layout.column_flow()
+                               flow.itemL(text="Sample Buffers:")
+                               flow.itemR(lamp, "shadow_sample_buffers", text="")
+                               flow.itemL(text="Filter Type:")
+                               flow.itemR(lamp, "shadow_filter_type", text="")
+                               
+                               flow = layout.column_flow()
+                               flow.itemR(lamp, "shadow_buffer_size", text="Size")
+                               flow.itemR(lamp, "shadow_buffer_samples", text="Samples")
+                               flow.itemR(lamp, "shadow_buffer_bias", text="Bias")
+                               flow.itemR(lamp, "shadow_buffer_soft", text="Soft")
                                
                        if (lamp.shadow_buffer_type == 'IRREGULAR'):
-                               layout.row()
-                               layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
+                               row = layout.row()
+                               row.itemR(lamp, "shadow_buffer_bias", text="Bias")
                        
-                       layout.row()
-                       layout.itemR(lamp, "auto_clip_start", text="Autoclip Start")
+                       row = layout.row()
+                       row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
                        if not (lamp.auto_clip_start):
-                               layout.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
-                       layout.row()
-                       layout.itemR(lamp, "auto_clip_end", text="Autoclip End")
+                               row.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
+                       row = layout.row()
+                       row.itemR(lamp, "auto_clip_end", text="Autoclip End")
                        if not (lamp.auto_clip_end):
-                               layout.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
+                               row.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
 
 class DATA_PT_spot(DataButtonsPanel):
        __idname__ = "DATA_PT_spot"
@@ -206,33 +179,27 @@ class DATA_PT_spot(DataButtonsPanel):
        
        def poll(self, context):
                ob = context.active_object
-               lamp = context.main.lamps[0]
-               return (ob.type == 'LAMP' and lamp.type == 'SPOT')
+               return (ob.type == 'LAMP' and ob.data.type == 'SPOT')
 
        def draw(self, context):
-               lamp = context.main.lamps[0]
+               lamp = context.active_object.data
                layout = self.layout
 
-               if not lamp:
-                       return
-               
-               layout.split(number=2)
+               split = layout.split()
                
-               sub = layout.sub(0)
-               sub.column()
+               sub = split.column()
+               sub.itemR(lamp, "spot_size", text="Size")
+               sub.itemR(lamp, "spot_blend", text="Blend")
                sub.itemR(lamp, "square")
-               sub.itemR(lamp, "spot_size")
-               sub.itemR(lamp, "spot_blend")
                
-               sub = layout.sub(1)
-               sub.column()
+               sub = split.column()
                sub.itemR(lamp, "halo")
-               if (lamp.halo):
-                       sub.itemR(lamp, "halo_intensity")
-                       if (lamp.shadow_method == 'BUFFER_SHADOW'):
-                               sub.itemR(lamp, "halo_step")
+               if lamp.halo:
+                       sub.itemR(lamp, "halo_intensity", text="Intensity")
+                       if lamp.shadow_method == 'BUFFER_SHADOW':
+                               sub.itemR(lamp, "halo_step", text="Step")
 
 bpy.types.register(DATA_PT_lamp)
 bpy.types.register(DATA_PT_shadow)
 bpy.types.register(DATA_PT_sunsky)
-bpy.types.register(DATA_PT_spot)
+bpy.types.register(DATA_PT_spot)
\ No newline at end of file
index cf2053ae495af3d6491e040da9d2128a7bb93a10..4bcff9f53892f75f0c4ba1d47dc93ae8b9f66a00 100644 (file)
@@ -15,26 +15,23 @@ class DATA_PT_lattice(DataButtonsPanel):
        __label__ = "Lattice"
 
        def draw(self, context):
-               lat = context.main.lattices[0]
+               lat = context.active_object.data
                layout = self.layout
 
-               if not lat:
-                       return
+               row = layout.row()
+               row.itemR(lat, "points_u")
+               row.itemR(lat, "interpolation_type_u", expand=True)
                
-               layout.row()
-               layout.itemR(lat, "points_u")
-               layout.itemR(lat, "interpolation_type_u", expand=True)
+               row = layout.row()
+               row.itemR(lat, "points_v")
+               row.itemR(lat, "interpolation_type_v", expand=True)
                
-               layout.row()
-               layout.itemR(lat, "points_v")
-               layout.itemR(lat, "interpolation_type_v", expand=True)
+               row = layout.row()
+               row.itemR(lat, "points_w")
+               row.itemR(lat, "interpolation_type_w", expand=True)
                
-               layout.row()
-               layout.itemR(lat, "points_w")
-               layout.itemR(lat, "interpolation_type_w", expand=True)
-               
-               layout.row()
-               layout.itemR(lat, "outside")
-               layout.itemR(lat, "shape_keys")
+               row = layout.row()
+               row.itemR(lat, "outside")
+               row.itemR(lat, "shape_keys")
 
 bpy.types.register(DATA_PT_lattice)
\ No newline at end of file
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py
new file mode 100644 (file)
index 0000000..44a48dc
--- /dev/null
@@ -0,0 +1,32 @@
+               
+import bpy
+
+class DataButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "data"
+       
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.type == 'MESH')
+
+class DATA_PT_surface(DataButtonsPanel):
+               __idname__ = "DATA_PT_surface"
+               __label__ = "Surface"
+
+               def draw(self, context):
+                       mesh = context.active_object.data
+                       layout = self.layout
+
+                       split = layout.split()
+               
+                       sub = split.column()
+                       sub.itemR(mesh, "autosmooth")
+                       sub.itemR(mesh, "autosmooth_angle", text="Angle")
+                       sub = split.column()
+                       sub.itemR(mesh, "vertex_normal_flip")
+                       sub.itemR(mesh, "double_sided")
+                       
+                       layout.itemR(mesh, "texco_mesh")                        
+                                               
+bpy.types.register(DATA_PT_surface)            
\ No newline at end of file
index f07a6cc48822c8829a25fd56f40c0f53e072370a..93fa122caf8ed1f1892d3dc38d563de2adb51f6f 100644 (file)
@@ -4,7 +4,7 @@ import bpy
 class DataButtonsPanel(bpy.types.Panel):
        __space_type__ = "BUTTONS_WINDOW"
        __region_type__ = "WINDOW"
-       __context__ = "data"
+       __context__ = "modifier"
 
        def poll(self, context):
                ob = context.active_object
@@ -18,44 +18,371 @@ class DATA_PT_modifiers(DataButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               if not ob:
-                       return
-
-               layout.row()
-               layout.item_menu_enumO("OBJECT_OT_modifier_add", "type")
+               row = layout.row()
+               row.item_menu_enumO("OBJECT_OT_modifier_add", "type")
+               row.itemL();
 
                for md in ob.modifiers:
-                       sub = layout.box()
-
-                       sub.row()
-                       sub.itemR(md, "expanded", text="")
-                       sub.itemR(md, "name", text="")
-
-                       sub.itemR(md, "render", text="")
-                       sub.itemR(md, "realtime", text="")
-                       sub.itemR(md, "editmode", text="")
-                       sub.itemR(md, "on_cage", text="")
-
-                       if (md.expanded):
-                               sub.row()
-                               sub.itemS()
-
-                               if (md.type == 'ARMATURE'):
-                                       self.armature(sub, md)
+                       box = layout.template_modifier(md)
 
+                       if box:
+                               if md.type == 'ARMATURE':
+                                       self.armature(box, md)
+                               if md.type == 'ARRAY':
+                                       self.array(box, md)
+                               if md.type == 'BEVEL':
+                                       self.bevel(box, md)
+                               if md.type == 'BOOLEAN':
+                                       self.boolean(box, md)
+                               if md.type == 'BUILD':
+                                       self.build(box, md)
+                               if md.type == 'CAST':
+                                       self.cast(box, md)
+                               if md.type == 'CLOTH':
+                                       self.cloth(box, md)
+                               if md.type == 'COLLISION':
+                                       self.collision(box, md)
+                               if md.type == 'CURVE':
+                                       self.curve(box, md)
+                               if md.type == 'DECIMATE':
+                                       self.decimate(box, md)
+                               if md.type == 'DISPLACE':
+                                       self.displace(box, md)
+                               if md.type == 'EDGE_SPLIT':
+                                       self.edgesplit(box, md)
+                               if md.type == 'EXPLODE':
+                                       self.explode(box, md)
+                               if md.type == 'FLUID_SIMULATION':
+                                       self.fluid(box, md)
+                               if md.type == 'HOOK':
+                                       self.hook(box, md)
+                               if md.type == 'LATTICE':
+                                       self.lattice(box, md)
+                               if md.type == 'MASK':
+                                       self.mask(box, md)
+                               if md.type == 'MESH_DEFORM':
+                                       self.meshdeform(box, md)
+                               if md.type == 'MIRROR':
+                                       self.mirror(box, md)
+                               if md.type == 'MULTIRES':
+                                       self.multires(box, md)
+                               if md.type == 'PARTICLE_INSTANCE':
+                                       self.particleinstance(box, md)
+                               if md.type == 'PARTICLE_SYSTEM':
+                                       self.particlesystem(box, md)
+                               if md.type == 'SHRINKWRAP':
+                                       self.shrinkwrap(box, md)
+                               if md.type == 'SIMPLE_DEFORM':
+                                       self.simpledeform(box, md)
+                               if md.type == 'SMOOTH':
+                                       self.smooth(box, md)
+                               if md.type == 'SOFTBODY':
+                                       self.softbody(box, md)
+                               if md.type == 'SUBSURF':
+                                       self.subsurf(box, md)
+                               if md.type == 'UV_PROJECT':
+                                       self.uvproject(box, md)
+                               if md.type == 'WAVE':
+                                       self.wave(box, md)
+                                                       
        def armature(self, layout, md):
-               layout.column()
                layout.itemR(md, "object")
-               layout.row()
+               row = layout.row()
+               row.itemR(md, "vertex_group")
+               row.itemR(md, "invert")
+               flow = layout.column_flow()
+               flow.itemR(md, "use_vertex_groups", text="Vertex Groups")
+               flow.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
+               flow.itemR(md, "quaternion")
+               flow.itemR(md, "multi_modifier")
+               
+       def array(self, layout, md):
+               layout.itemR(md, "fit_type")
+               if md.fit_type == 'FIXED_COUNT':
+                       layout.itemR(md, "count")
+               if md.fit_type == 'FIT_LENGTH':
+                       layout.itemR(md, "length")
+               if md.fit_type == 'FIT_CURVE':
+                       layout.itemR(md, "curve")
+               
+               split = layout.split()
+               
+               col = split.column()
+               sub = col.column()
+               sub.itemR(md, "constant_offset")
+               sub.itemR(md, "constant_offset_displacement", text="Displacement")
+               sub = col.column()
+               sub = col.row().itemR(md, "merge_adjacent_vertices", text="Merge")
+               sub = col.row().itemR(md, "merge_end_vertices", text="First Last")
+               sub = col.itemR(md, "merge_distance", text="Distance")
+               
+               col = split.column()
+               sub = col.column()
+               sub.itemR(md, "relative_offset")
+               sub.itemR(md, "relative_offset_displacement", text="Displacement")
+               sub = col.column()
+               sub.itemR(md, "add_offset_object")
+               sub.itemR(md, "offset_object")
+               
+               col = layout.column()
+               col.itemR(md, "start_cap")
+               col.itemR(md, "end_cap")
+       
+       def bevel(self, layout, md):
+               row = layout.row()
+               row.itemR(md, "width")
+               row.itemR(md, "only_vertices")
+               
+               layout.itemL(text="Limit Method:")
+               row = layout.row()
+               row.itemR(md, "limit_method", expand=True)
+               if md.limit_method == 'ANGLE':
+                       row = layout.row()
+                       row.itemR(md, "angle")
+               if md.limit_method == 'WEIGHT':
+                       row = layout.row()
+                       row.itemR(md, "edge_weight_method", expand=True)
+                       
+       def boolean(self, layout, md):
+               layout.itemR(md, "operation")
+               layout.itemR(md, "object")
+               
+       def build(self, layout, md):
+               layout.itemR(md, "start")
+               layout.itemR(md, "length")
+
+               row = layout.row()
+               row.itemR(md, "randomize")
+               if md.randomize:
+                       row.itemR(md, "seed")
+                       
+       def cast(self, layout, md):
+               layout.itemR(md, "cast_type")
+               col = layout.column_flow()
+               col.itemR(md, "x")
+               col.itemR(md, "y")
+               col.itemR(md, "z")
+               col.itemR(md, "factor")
+               col.itemR(md, "radius")
+               col.itemR(md, "size")
+               layout.itemR(md, "vertex_group")
+               #Missing: "OB" and "From Radius"
+               
+       def cloth(self, layout, md):
+               layout.itemL(text="See Cloth panel.")
+               
+       def collision(self, layout, md):
+               layout.itemL(text="See Collision panel.")
+               
+       def curve(self, layout, md):
+               layout.itemR(md, "object")
+               layout.itemR(md, "vertex_group")
+               layout.itemR(md, "deform_axis")
+               
+       def decimate(self, layout, md):
+               layout.itemR(md, "ratio")
+               layout.itemR(md, "face_count")
+               
+       def displace(self, layout, md):
+               layout.itemR(md, "vertex_group")
+               layout.itemR(md, "texture")
+               layout.itemR(md, "midlevel")
+               layout.itemR(md, "strength")
+               layout.itemR(md, "texture_coordinates")
+               if md.texture_coordinates == 'OBJECT':
+                       layout.itemR(md, "texture_coordinate_object", text="Object")
+               if md.texture_coordinates == 'UV':
+                       layout.itemR(md, "uv_layer")
+       
+       def edgesplit(self, layout, md):
+               layout.itemR(md, "use_edge_angle", text="Edge Angle")
+               if (md.use_edge_angle):
+                       layout.itemR(md, "split_angle")
+               layout.itemR(md, "use_sharp", text="Sharp Edges")
+               
+       def explode(self, layout, md):
+               layout.itemR(md, "vertex_group")
+               layout.itemR(md, "protect")
+               layout.itemR(md, "split_edges")
+               layout.itemR(md, "unborn")
+               layout.itemR(md, "alive")
+               layout.itemR(md, "dead")
+               # Missing: "Refresh" and "Clear Vertex Group" ?
+               
+       def fluid(self, layout, md):
+               layout.itemL(text="See Fluidsim panel.")
+               
+       def hook(self, layout, md):
+               layout.itemR(md, "falloff")
+               layout.itemR(md, "force", slider=True)
+               layout.itemR(md, "object")
+               layout.itemR(md, "vertex_group")
+               # Missing: "Reset" and "Recenter"
+               
+       def lattice(self, layout, md):
+               layout.itemR(md, "object")
+               layout.itemR(md, "vertex_group")
+               
+       def mask(self, layout, md):
+               layout.itemR(md, "mode")
+               if md.mode == 'ARMATURE':
+                       layout.itemR(md, "armature")
+               if md.mode == 'VERTEX_GROUP':
+                       layout.itemR(md, "vertex_group")
+               layout.itemR(md, "inverse")
+               
+       def meshdeform(self, layout, md):
+               layout.itemR(md, "object")
                layout.itemR(md, "vertex_group")
                layout.itemR(md, "invert")
-               layout.column_flow()
-               layout.itemR(md, "use_vertex_groups")
-               layout.itemR(md, "use_bone_envelopes")
-               layout.itemR(md, "quaternion")
-               layout.itemR(md, "b_bone_rest")
-               layout.itemR(md, "multi_modifier")
+               layout.itemR(md, "precision")
+               layout.itemR(md, "dynamic")
+               # Missing: "Bind"
                
-bpy.types.register(DATA_PT_modifiers)
+       def mirror(self, layout, md):
+               layout.itemR(md, "merge_limit")
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemR(md, "x")
+               sub.itemR(md, "y")
+               sub.itemR(md, "z")
+               sub = split.column()
+               sub.itemR(md, "mirror_u")
+               sub.itemR(md, "mirror_v")
+               sub = split.column()
+               sub.itemR(md, "clip", text="Do Clipping")
+               sub.itemR(md, "mirror_vertex_groups", text="Vertex Group")
+               
+               layout.itemR(md, "mirror_object")
+               
+       def multires(self, layout, md):
+               layout.itemR(md, "subdivision_type")
+               layout.itemO("OBJECT_OT_multires_subdivide", text="Subdivide")
+               layout.itemR(md, "level")
+       
+       def particleinstance(self, layout, md):
+               layout.itemR(md, "object")
+               layout.itemR(md, "particle_system_number")
+               
+               col = layout.column_flow()
+               col.itemR(md, "normal")
+               col.itemR(md, "children")
+               col.itemR(md, "path")
+               col.itemR(md, "unborn")
+               col.itemR(md, "alive")
+               col.itemR(md, "dead")
+               
+       def particlesystem(self, layout, md):
+               layout.itemL(text="See Particle panel.")
+               
+       def shrinkwrap(self, layout, md):
+               layout.itemR(md, "target")
+               layout.itemR(md, "vertex_group")
+               layout.itemR(md, "offset")
+               layout.itemR(md, "subsurf_levels")
+               layout.itemR(md, "mode")
+               if md.mode == 'PROJECT':
+                       layout.itemR(md, "subsurf_levels")
+                       layout.itemR(md, "auxiliary_target")
+               
+                       row = layout.row()
+                       row.itemR(md, "x")
+                       row.itemR(md, "y")
+                       row.itemR(md, "z")
+               
+                       col = layout.column_flow()
+                       col.itemR(md, "negative")
+                       col.itemR(md, "positive")
+                       col.itemR(md, "cull_front_faces")
+                       col.itemR(md, "cull_back_faces")
+               if md.mode == 'NEAREST_SURFACEPOINT':
+                       layout.itemR(md, "keep_above_surface")
+               # To-Do: Validate if structs
+               
+       def simpledeform(self, layout, md):
+               layout.itemR(md, "mode")
+               layout.itemR(md, "vertex_group")
+               layout.itemR(md, "origin")
+               layout.itemR(md, "relative")
+               layout.itemR(md, "factor")
+               layout.itemR(md, "limits")
+               if md.mode in ('TAPER', 'STRETCH'):
+                       layout.itemR(md, "lock_x_axis")
+                       layout.itemR(md, "lock_y_axis")
+       
+       def smooth(self, layout, md):
+               split = layout.split()
+               sub = split.column()
+               row = sub.row(align=True)
+               row.itemR(md, "x", toggle=True)
+               row.itemR(md, "y", toggle=True)
+               row.itemR(md, "z", toggle=True)
+               sub = split.column()
+               sub.itemR(md, "factor")
+               sub.itemR(md, "repeat")
+               
+               layout.itemR(md, "vertex_group")
+               
+       def softbody(self, layout, md):
+               layout.itemL(text="See Softbody panel.")
+       
+       def subsurf(self, layout, md):
+               layout.itemR(md, "subdivision_type")
+               col = layout.column_flow()
+               col.itemR(md, "levels")
+               col.itemR(md, "render_levels")
+               col.itemR(md, "optimal_draw")
+               col.itemR(md, "subsurf_uv")
+       
+       def uvproject(self, layout, md):
+               layout.itemR(md, "uv_layer")
+               layout.itemR(md, "projectors")
+               layout.itemR(md, "image")
+               layout.itemR(md, "horizontal_aspect_ratio")
+               layout.itemR(md, "vertical_aspect_ratio")
+               layout.itemR(md, "override_image")
+               #"Projectors" don't work.
+               
+       def wave(self, layout, md):
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemL(text="Motion:")
+               sub.itemR(md, "x")
+               sub.itemR(md, "y")
+               sub.itemR(md, "cyclic")
+               
+               sub = split.column()
+               sub.itemR(md, "normals")
+               if md.normals:
+                       row = sub.row(align=True)
+                       row.itemR(md, "x_normal", text="X", toggle=True)
+                       row.itemR(md, "y_normal", text="Y", toggle=True)
+                       row.itemR(md, "z_normal", text="Z", toggle=True)
+               
+               col = layout.column_flow()
+               col.itemR(md, "time_offset")
+               col.itemR(md, "lifetime")
+               col.itemR(md, "damping_time")
+               col.itemR(md, "falloff_radius")
+               col.itemR(md, "start_position_x")
+               col.itemR(md, "start_position_y")
+               
+               layout.itemR(md, "start_position_object")
+               layout.itemR(md, "vertex_group")
+               layout.itemR(md, "texture")
+               layout.itemR(md, "texture_coordinates")
+               if md.texture_coordinates == 'MAP_UV':
+                       layout.itemR(md, "uv_layer")
+               if md.texture_coordinates == 'OBJECT':
+                       layout.itemR(md, "texture_coordinates_object")
+               
+               col = layout.column_flow()
+               col.itemR(md, "speed", slider=True)
+               col.itemR(md, "height", slider=True)
+               col.itemR(md, "width", slider=True)
+               col.itemR(md, "narrowness", slider=True)
 
+bpy.types.register(DATA_PT_modifiers)
 
diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py
new file mode 100644 (file)
index 0000000..9614727
--- /dev/null
@@ -0,0 +1,111 @@
+
+import bpy
+
+class DataButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "data"
+       
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.type == 'TEXT')
+               
+class DATA_PT_shape_text(DataButtonsPanel):
+               __idname__ = "DATA_PT_shape_text"
+               __label__ = "Shape"
+
+               def draw(self, context):
+                       curve = context.active_object.data
+                       layout = self.layout
+
+                       layout.itemR(curve, "curve_2d")                 
+                                                       
+                       split = layout.split()
+               
+                       sub = split.column()
+                       sub.itemL(text="Caps:")
+                       sub.itemR(curve, "front")
+                       sub.itemR(curve, "back")
+                       
+                       sub.itemL(text="Textures:")
+                       sub.itemR(curve, "uv_orco")
+                       sub.itemR(curve, "auto_texspace")
+                       
+                       sub = split.column()    
+                       sub.itemL(text="Resolution:")
+                       sub.itemR(curve, "resolution_u", text="Preview U")
+                       sub.itemR(curve, "resolution_v", text="Preview V")
+                       sub.itemR(curve, "render_resolution_u", text="Render U")
+                       sub.itemR(curve, "render_resolution_v", text="Render V")
+
+                       sub.itemL(text="Display:")
+                       sub.itemR(curve, "fast")
+                       
+class DATA_PT_font(DataButtonsPanel):
+       __idname__ = "DATA_PT_font"
+       __label__ = "Font"
+
+       def draw(self, context):
+               text = context.active_object.data
+               layout = self.layout
+
+               layout.row()
+               layout.itemR(text, "font")
+               
+               split = layout.split()
+               
+               sub = split.column()    
+       #       sub.itemR(text, "style")
+       #       sub.itemR(text, "bold")
+       #       sub.itemR(text, "italic")
+       #       sub.itemR(text, "underline")
+       #       ToDo: These settings are in a sub struct (Edit Format). 
+               sub.itemR(text, "text_size")            
+               sub.itemR(text, "shear")
+
+               sub = split.column()
+               sub.itemR(text, "text_on_curve")
+               sub.itemR(text, "family")
+               sub.itemL(text="Underline:")
+               sub.itemR(text, "ul_position", text="Position")
+               sub.itemR(text, "ul_height", text="Height")
+
+       #       sub.itemR(text, "edit_format")
+
+class DATA_PT_paragraph(DataButtonsPanel):
+       __idname__ = "DATA_PT_paragraph"
+       __label__ = "Paragraph"
+
+       def draw(self, context):
+               text = context.active_object.data
+               layout = self.layout
+
+               layout.itemL(text="Align:")
+               layout.itemR(text, "spacemode", expand=True)
+
+               split = layout.split()
+               
+               sub = split.column()    
+               sub.itemL(text="Spacing:")
+               sub.itemR(text, "spacing", text="Character")
+               sub.itemR(text, "word_spacing", text="Word")
+               sub.itemR(text, "line_dist", text="Line")
+
+               sub = split.column()
+               sub.itemL(text="Offset:")
+               sub.itemR(text, "x_offset", text="X")
+               sub.itemR(text, "y_offset", text="Y")
+               sub.itemR(text, "wrap")
+                       
+class DATA_PT_textboxes(DataButtonsPanel):
+               __idname__ = "DATA_PT_textboxes"
+               __label__ = "Text Boxes"
+
+               def draw(self, context):
+                       text = context.active_object.data
+                       layout = self.layout
+
+bpy.types.register(DATA_PT_shape_text) 
+bpy.types.register(DATA_PT_font)
+bpy.types.register(DATA_PT_paragraph)
+#bpy.types.register(DATA_PT_textboxes)
\ No newline at end of file
index 55887cb3c4a7d2e38608d8b7aeccd79336aca7e7..7137bccd245e374a4e659d45367987fc956f2521 100644 (file)
@@ -5,126 +5,203 @@ class MaterialButtonsPanel(bpy.types.Panel):
        __space_type__ = "BUTTONS_WINDOW"
        __region_type__ = "WINDOW"
        __context__ = "material"
+
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.active_material)
+
+class MATERIAL_PT_preview(MaterialButtonsPanel):
+       __idname__= "MATERIAL_PT_preview"
+       __label__ = "Preview"
+
+       def draw(self, context):
+               layout = self.layout
+
+               mat = context.active_object.active_material
+               layout.template_preview(mat)
        
 class MATERIAL_PT_material(MaterialButtonsPanel):
        __idname__= "MATERIAL_PT_material"
        __label__ = "Material"
-       
+
        def draw(self, context):
-               mat = context.main.materials[0]
                layout = self.layout
-               
-               if not mat:
-                       return 
+               mat = context.active_object.active_material
        
-               layout.row()
-               layout.itemR(mat, "diffuse_color")
-               layout.itemR(mat, "specular_color")
-               layout.itemR(mat, "mirror_color")
-               
-               layout.row()
-               layout.itemR(mat, "color_model")
-               layout.itemR(mat, "alpha")
+               layout.itemR(mat, "type", expand=True)
+
+               row = layout.row()
+               row.column().itemR(mat, "diffuse_color")
+               row.column().itemR(mat, "specular_color")
+               row.column().itemR(mat, "mirror_color")
                
+               layout.itemR(mat, "alpha", slider=True)
+                       
 class MATERIAL_PT_sss(MaterialButtonsPanel):
        __idname__= "MATERIAL_PT_sss"
        __label__ = "Subsurface Scattering"
+
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.active_material and ob.active_material.type == "SURFACE")
+
+       def draw_header(self, context):
+               sss = context.active_object.active_material.subsurface_scattering
+
+               layout = self.layout
+               layout.itemR(sss, "enabled", text="")
        
        def draw(self, context):
-               sss = context.main.materials[0].subsurface_scattering 
                layout = self.layout
+               sss = context.active_object.active_material.subsurface_scattering
                
-               if not sss:
-                       return 
+               flow = layout.column_flow()
+               flow.itemR(sss, "error_tolerance")
+               flow.itemR(sss, "ior")
+               flow.itemR(sss, "scale")
                
-               layout.row()
-               layout.itemR(sss, "enabled", text="Enable")
+               row = layout.row()
+               row.column().itemR(sss, "color")
+               row.column().itemR(sss, "radius")
                
-               layout.column_flow()
-               layout.itemR(sss, "error_tolerance")
-               layout.itemR(sss, "ior")
-               layout.itemR(sss, "scale")
-               
-               layout.row()
-               layout.itemR(sss, "color")
-               layout.itemR(sss, "radius")
-               
-               layout.column_flow()
-               layout.itemR(sss, "color_factor")
-               layout.itemR(sss, "texture_factor")
-               layout.itemR(sss, "front")
-               layout.itemR(sss, "back")
+               flow = layout.column_flow()
+               flow.itemR(sss, "color_factor", slider=True)
+               flow.itemR(sss, "texture_factor", slider=True)
+               flow.itemR(sss, "front")
+               flow.itemR(sss, "back")
                
 class MATERIAL_PT_raymir(MaterialButtonsPanel):
        __idname__= "MATERIAL_PT_raymir"
        __label__ = "Ray Mirror"
        
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.active_material and ob.active_material.type == "SURFACE")
+       
+       def draw_header(self, context):
+               raym = context.active_object.active_material.raytrace_mirror
+
+               layout = self.layout
+               layout.itemR(raym, "enabled", text="")
+       
        def draw(self, context):
-               raym = context.main.materials[0].raytrace_mirror
                layout = self.layout
-               
-               if not raym:
-                       return 
+               raym = context.active_object.active_material.raytrace_mirror
 
-               layout.row()
-               layout.itemR(raym, "enabled", text="Enable")
+               split = layout.split()
                
-               layout.split(number=2)
-               
-               sub = layout.sub(0)
-               sub.column_flow()
-               sub.itemR(raym, "reflect", text="RayMir")
+               sub = split.column()
+               sub.itemR(raym, "reflect", text="RayMir", slider=True)
                sub.itemR(raym, "fresnel")
-               sub.itemR(raym, "fresnel_fac", text="Fac")
+               sub.itemR(raym, "fresnel_fac", text="Fac", slider=True)
                
-               sub = layout.sub(1)
-               sub.column_flow()
-               sub.itemR(raym, "gloss")
-               sub.itemR(raym, "gloss_threshold")
+               sub = split.column()
+               sub.itemR(raym, "gloss", slider=True)
+               sub.itemR(raym, "gloss_threshold", slider=True)
                sub.itemR(raym, "gloss_samples")
-               sub.itemR(raym, "gloss_anisotropic")
+               sub.itemR(raym, "gloss_anisotropic", slider=True)
+               
+               row = layout.row()
+               row.itemR(raym, "distance", text="Max Dist")
+               row.itemR(raym, "depth")
                
-               layout.column_flow()
-               layout.itemR(raym, "distance", text="Max Dist")
-               layout.itemR(raym, "depth")
                layout.itemR(raym, "fade_to")
                
 class MATERIAL_PT_raytransp(MaterialButtonsPanel):
        __idname__= "MATERIAL_PT_raytransp"
        __label__= "Ray Transparency"
+       
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.active_material and ob.active_material.type == "SURFACE")
 
-       def draw(self, context):
-               rayt = context.main.materials[0].raytrace_transparency
-               layout = self.layout
+       def draw_header(self, context):
+               rayt = context.active_object.active_material.raytrace_transparency
 
-               if not rayt:
-                       return
+               layout = self.layout
+               layout.itemR(rayt, "enabled", text="")
 
-               layout.row()
-               layout.itemR(rayt, "enabled", text="Enable")
+       def draw(self, context):
+               layout = self.layout
+               rayt = context.active_object.active_material.raytrace_transparency
                
-               layout.split(number=2)
+               split = layout.split()
                
-               sub = layout.sub(0)
-               sub.column()
+               sub = split.column()
                sub.itemR(rayt, "ior")
                sub.itemR(rayt, "fresnel")
-               sub.itemR(rayt, "fresnel_fac", text="Fac")
+               sub.itemR(rayt, "fresnel_fac", text="Fac", slider=True)
                
-               sub = layout.sub(1)
-               sub.column()
-               sub.itemR(rayt, "gloss")
-               sub.itemR(rayt, "gloss_threshold")
+               sub = split.column()
+               sub.itemR(rayt, "gloss", slider=True)
+               sub.itemR(rayt, "gloss_threshold", slider=True)
                sub.itemR(rayt, "gloss_samples")
                
-               layout.column_flow()
-               layout.itemR(rayt, "filter")
-               layout.itemR(rayt, "limit")
-               layout.itemR(rayt, "falloff")
-               layout.itemR(rayt, "specular_opacity")
-               layout.itemR(rayt, "depth")
+               flow = layout.column_flow()
+               flow.itemR(rayt, "filter", slider=True)
+               flow.itemR(rayt, "limit")
+               flow.itemR(rayt, "falloff")
+               flow.itemR(rayt, "specular_opacity", slider=True)
+               flow.itemR(rayt, "depth")
+               
+class MATERIAL_PT_halo(MaterialButtonsPanel):
+       __idname__= "MATERIAL_PT_halo"
+       __label__= "Halo"
+       
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.active_material and ob.active_material.type == "HALO")
+       
+       def draw(self, context):
+               layout = self.layout
+               mat = context.active_object.active_material
+               halo = mat.halo
 
+               split = layout.split()
+               
+               col = split.column(align=True)
+               col.itemL(text="General Settings:")
+               col.itemR(halo, "size")
+               col.itemR(halo, "hardness")
+               col.itemR(halo, "add", slider=True)
+               
+               col.itemL(text="Options:")
+               col.itemR(halo, "use_texture", text="Texture")
+               col.itemR(halo, "use_vertex_normal", text="Vertex Normal")
+               col.itemR(halo, "xalpha")
+               col.itemR(halo, "shaded")
+               col.itemR(halo, "soft")
+
+               col = split.column()
+               sub = col.column(align=True)
+               sub.itemL(text="Elements:")
+               sub.itemR(halo, "ring")
+               sub.itemR(halo, "lines")
+               sub.itemR(halo, "star")
+               sub.itemR(halo, "flare_mode")
+               
+               sub = col.column()
+               if (halo.ring):
+                       sub.itemR(halo, "rings")
+               if (halo.lines):
+                       sub.itemR(halo, "line_number")
+               if (halo.ring or halo.lines):
+                       sub.itemR(halo, "seed")
+               if (halo.star):
+                       sub.itemR(halo, "star_tips")
+               if (halo.flare_mode):
+                       sub = col.column(align=True)
+                       sub.itemL(text="Flare:")
+                       sub.itemR(halo, "flare_size", text="Size")
+                       sub.itemR(halo, "flare_subsize", text="Subsize")
+                       sub.itemR(halo, "flare_boost", text="Boost")
+                       sub.itemR(halo, "flare_seed", text="Seed")
+                       sub.itemR(halo, "flares_sub", text="Sub")
+                               
+bpy.types.register(MATERIAL_PT_preview)
 bpy.types.register(MATERIAL_PT_material)
 bpy.types.register(MATERIAL_PT_raymir)
 bpy.types.register(MATERIAL_PT_raytransp)
-bpy.types.register(MATERIAL_PT_sss)
\ No newline at end of file
+bpy.types.register(MATERIAL_PT_sss)
+bpy.types.register(MATERIAL_PT_halo)
+
diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py
new file mode 100644 (file)
index 0000000..d44e6fd
--- /dev/null
@@ -0,0 +1,108 @@
+
+import bpy
+
+class ConstraintButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "object"
+
+       def draw_constraint(self, con):
+               layout = self.layout
+               box = layout.template_constraint(con)
+
+               if box:
+                       if con.type == "COPY_LOCATION":
+                               self.copy_location(box, con)
+
+                       # show/key buttons here are most likely obsolete now, with
+                       # keyframing functionality being part of every button
+                       if con.type not in ("RIGID_BODY_JOINT", "NULL"):
+                               box.itemR(con, "influence")
+       
+       def space_template(self, layout, con, target=True, owner=True):
+               if target or owner:
+                       row = layout.row()
+
+                       row.itemL(text="Convert:")
+
+                       if target:
+                               row.itemR(con, "target_space", text="")
+
+                       if target and owner:
+                               row.itemL(icon=8) # XXX
+
+                       if owner:
+                               row.itemR(con, "owner_space", text="")
+                       
+       def target_template(self, layout, con, subtargets=True):
+               layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
+               
+               if con.target and subtargets:
+                       if con.target.type == "ARMATURE":
+                               layout.itemR(con, "subtarget", text="Bone") # XXX autocomplete
+                               
+                               row = layout.row()
+                               row.itemL(text="Head/Tail:")
+                               row.itemR(con, "head_tail", text="")
+                       elif con.target.type in ("MESH", "LATTICE"):
+                               layout.itemR(con, "subtarget", text="Vertex Group") # XXX autocomplete
+       
+       def copy_location(self, layout, con):
+               self.target_template(layout, con)
+               
+               row = layout.row(align=True)
+               row.itemR(con, "locate_like_x", text="X", toggle=True)
+               row.itemR(con, "invert_x", text="-", toggle=True)
+               row.itemR(con, "locate_like_y", text="Y", toggle=True)
+               row.itemR(con, "invert_y", text="-", toggle=True)
+               row.itemR(con, "locate_like_z", text="Z", toggle=True)
+               row.itemR(con, "invert_z", text="-", toggle=True)
+
+               layout.itemR(con, "offset")
+
+               self.space_template(layout, con)
+
+class OBJECT_PT_constraints(ConstraintButtonsPanel):
+       __idname__ = "OBJECT_PT_constraints"
+       __label__ = "Constraints"
+       __context__ = "object"
+
+       def poll(self, context):
+               ob = context.active_object
+               return (ob != None)
+               
+       def draw(self, context):
+               ob = context.active_object
+               layout = self.layout
+
+               row = layout.row()
+               row.item_menu_enumO("OBJECT_OT_constraint_add", "type")
+               row.itemL();
+
+               for con in ob.constraints:
+                       self.draw_constraint(con)
+
+class BONE_PT_constraints(ConstraintButtonsPanel):
+       __idname__ = "BONE_PT_constraints"
+       __label__ = "Constraints"
+       __context__ = "bone"
+
+       def poll(self, context):
+               ob = context.active_object
+               return (ob and ob.type == "ARMATURE")
+               
+       def draw(self, context):
+               ob = context.active_object
+               pchan = ob.pose.pose_channels[0]
+               layout = self.layout
+
+               #row = layout.row()
+               #row.item_menu_enumO("BONE_OT_constraint_add", "type")
+               #row.itemL();
+
+               for con in pchan.constraints:
+                       self.draw_constraint(con)
+
+bpy.types.register(OBJECT_PT_constraints)
+bpy.types.register(BONE_PT_constraints)
+
index 8e76bf5083732d6631b51601deddf6fe7cbac7e0..a5074614515880906bbba711d7ce492296b6aa14 100644 (file)
@@ -17,10 +17,10 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               layout.row()
-               layout.itemR(ob, "location")
-               layout.itemR(ob, "rotation")
-               layout.itemR(ob, "scale")
+               row = layout.row()
+               row.column().itemR(ob, "location")
+               row.column().itemR(ob, "rotation")
+               row.column().itemR(ob, "scale")
 
 class OBJECT_PT_groups(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_groups"
@@ -30,24 +30,24 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               layout.row()
-               layout.itemR(ob, "pass_index")
-               layout.itemR(ob, "parent")
+               row = layout.row()
+               row.itemR(ob, "pass_index")
+               row.itemR(ob, "parent")
 
                # layout.left_right()
                # layout.itemO("OBJECT_OT_add_group");
 
                for group in bpy.data.groups:
                        if ob in group.objects:
-                               sub = layout.box()
+                               col = layout.column(align=True)
 
-                               sub.split(number=2, lr=True)
-                               sub.sub(0).itemR(group, "name")
-                               # sub.sub(1).itemO("OBJECT_OT_remove_group")
+                               row = col.box().row()
+                               row.itemR(group, "name", text="")
+                               #row.itemO("OBJECT_OT_remove_group")
 
-                               sub.row()
-                               sub.itemR(group, "layer")
-                               sub.itemR(group, "dupli_offset")
+                               split = col.box().split()
+                               split.column().itemR(group, "layer")
+                               split.column().itemR(group, "dupli_offset")
 
 class OBJECT_PT_display(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_display"
@@ -57,17 +57,17 @@ class OBJECT_PT_display(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
                        
-               layout.row()
-               layout.itemR(ob, "max_draw_type", text="Type")
-               layout.itemR(ob, "draw_bounds_type", text="Bounds")
-
-               layout.column_flow()
-               layout.itemR(ob, "draw_name", text="Name")
-               layout.itemR(ob, "draw_axis", text="Axis")
-               layout.itemR(ob, "draw_wire", text="Wire")
-               layout.itemR(ob, "draw_texture_space", text="Texture Space")
-               layout.itemR(ob, "x_ray", text="X-Ray")
-               layout.itemR(ob, "draw_transparent", text="Transparency")
+               row = layout.row()
+               row.itemR(ob, "max_draw_type", text="Type")
+               row.itemR(ob, "draw_bounds_type", text="Bounds")
+
+               flow = layout.column_flow()
+               flow.itemR(ob, "draw_name", text="Name")
+               flow.itemR(ob, "draw_axis", text="Axis")
+               flow.itemR(ob, "draw_wire", text="Wire")
+               flow.itemR(ob, "draw_texture_space", text="Texture Space")
+               flow.itemR(ob, "x_ray", text="X-Ray")
+               flow.itemR(ob, "draw_transparent", text="Transparency")
 
 class OBJECT_PT_duplication(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_duplication"
@@ -77,15 +77,31 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               layout.column()
-               layout.itemR(ob, "dupli_type", text="", expand=True)
+               layout.itemR(ob, "dupli_type", expand=True)
 
-               if ob.dupli_type == "FRAMES":
-                       layout.column_flow()
-                       layout.itemR(ob, "dupli_frames_start", text="Start")
-                       layout.itemR(ob, "dupli_frames_end", text="End")
-                       layout.itemR(ob, "dupli_frames_on", text="On")
-                       layout.itemR(ob, "dupli_frames_off", text="Off")
+               if ob.dupli_type == 'FRAMES':
+                       split = layout.split()
+                       
+                       sub = split.column(align=True)
+                       sub.itemR(ob, "dupli_frames_start", text="Start")
+                       sub.itemR(ob, "dupli_frames_end", text="End")
+                       
+                       sub = split.column(align=True)
+                       sub.itemR(ob, "dupli_frames_on", text="On")
+                       sub.itemR(ob, "dupli_frames_off", text="Off")
+                       
+                       layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
+
+               elif ob.dupli_type == 'VERTS':
+                       layout.itemR(ob, "dupli_verts_rotation", text="Rotation")
+
+               elif ob.dupli_type == 'FACES':
+                       row = layout.row()
+                       row.itemR(ob, "dupli_faces_scale", text="Scale")
+                       row.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
+
+               elif ob.dupli_type == 'GROUP':
+                       layout.itemR(ob, "dupli_group", text="Group")
 
 class OBJECT_PT_animation(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_animation"
@@ -94,11 +110,10 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
        def draw(self, context):
                ob = context.active_object
                layout = self.layout
-
-               layout.split(number=2)
                
-               sub = layout.sub(0)
-               sub.column()
+               split = layout.split()
+               
+               sub = split.column()
                sub.itemL(text="Time Offset:")
                sub.itemR(ob, "time_offset_edit", text="Edit")
                sub.itemR(ob, "time_offset_particle", text="Particle")
@@ -106,8 +121,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
                sub.itemR(ob, "slow_parent")
                sub.itemR(ob, "time_offset", text="Offset")
                
-               sub = layout.sub(1)
-               sub.column()
+               sub = split.column()
                sub.itemL(text="Tracking:")
                sub.itemR(ob, "track_axis", text="Axis")
                sub.itemR(ob, "up_axis", text="Up Axis")
@@ -118,4 +132,3 @@ bpy.types.register(OBJECT_PT_groups)
 bpy.types.register(OBJECT_PT_display)
 bpy.types.register(OBJECT_PT_duplication)
 bpy.types.register(OBJECT_PT_animation)
-
diff --git a/release/ui/buttons_physic_cloth.py b/release/ui/buttons_physic_cloth.py
new file mode 100644 (file)
index 0000000..12d2183
--- /dev/null
@@ -0,0 +1,115 @@
+
+import bpy
+
+class PhysicButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "physics"
+
+       def cloth_modifier(self, context):
+               ob = context.active_object
+               for md in ob.modifiers:
+                       if md.type == 'CLOTH':
+                               return md
+
+               return None
+       
+       def poll(self, context):
+               md = self.cloth_modifier(context)
+               return (md != None)
+               
+class Physic_PT_cloth(PhysicButtonsPanel):
+       __idname__ = "Physic_PT_cloth"
+       __label__ = "Cloth"
+
+       def draw(self, context):
+               layout = self.layout
+               md = self.cloth_modifier(context)
+               cloth = md.settings
+               
+               split = layout.split()
+               
+               col = split.column()
+               col.itemR(cloth, "quality", slider=True)
+               col.itemR(cloth, "gravity")
+               col.itemR(cloth, "mass")
+               col.itemR(cloth, "mass_vertex_group", text="Vertex Group")
+
+               col = split.column()
+               col.itemL(text="Stiffness:")
+               col.itemR(cloth, "structural_stiffness", text="Structural")
+               col.itemR(cloth, "bending_stiffness", text="Bending")
+               col.itemL(text="Damping:")
+               col.itemR(cloth, "spring_damping", text="Spring")
+               col.itemR(cloth, "air_damping", text="Air")
+               
+               # Disabled for now#
+               """
+               if cloth.mass_vertex_group:
+                       layout.itemL(text="Goal:")
+               
+                       col = layout.column_flow()
+                       col.itemR(cloth, "goal_default", text="Default")
+                       col.itemR(cloth, "goal_spring", text="Stiffness")
+                       col.itemR(cloth, "goal_friction", text="Friction")
+               """
+       
+class Physic_PT_cloth_collision(PhysicButtonsPanel):
+       __idname__ = "Physic_PT_clothcollision"
+       __label__ = "Cloth Collision"
+       
+       def draw_header(self, context):
+               layout = self.layout
+               md = self.cloth_modifier(context)                       
+               cloth = md.collision_settings
+       
+               layout.itemR(cloth, "enable_collision", text="")
+
+       def draw(self, context):
+               layout = self.layout
+               md = self.cloth_modifier(context)               
+               cloth = md.collision_settings
+               
+               col = layout.column_flow()
+               col.itemR(cloth, "collision_quality", slider=True)
+               col.itemR(cloth, "friction")
+               col.itemR(cloth, "min_distance", text="MinDistance")
+               
+               
+               layout.itemR(cloth, "enable_self_collision", text="Self Collision")
+               
+               col = layout.column_flow()
+               col.itemR(cloth, "self_collision_quality", slider=True)
+               col.itemR(cloth, "self_min_distance", text="MinDistance")
+
+class Physic_PT_cloth_stiffness(PhysicButtonsPanel):
+       __idname__ = "Physic_PT_stiffness"
+       __label__ = "Cloth Stiffness Scaling"
+       
+       def draw_header(self, context):
+               layout = self.layout
+               md = self.cloth_modifier(context)
+               cloth = md.settings
+       
+               layout.itemR(cloth, "stiffness_scaling", text="")
+
+       def draw(self, context):
+               layout = self.layout
+               md = self.cloth_modifier(context)
+               cloth = md.settings
+               
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemL(text="Structural Stiffness:")
+               sub.column().itemR(cloth, "structural_stiffness_vertex_group", text="VGroup")
+               sub.itemR(cloth, "structural_stiffness_max", text="Max")
+               
+               sub = split.column()
+               sub.itemL(text="Bending Stiffness:")
+               sub.column().itemR(cloth, "bending_vertex_group", text="VGroup")
+               sub.itemR(cloth, "bending_stiffness_max", text="Max")
+               
+bpy.types.register(Physic_PT_cloth)
+bpy.types.register(Physic_PT_cloth_collision)
+bpy.types.register(Physic_PT_cloth_stiffness)
\ No newline at end of file
index 6b3c7dca49dc471d914bca071c87e2583dff3622..1b892a5b2fb3269f520e3ff29335223a6d5e4039 100644 (file)
@@ -15,72 +15,85 @@ class RENDER_PT_shading(RenderButtonsPanel):
 
                rd = scene.render_data
                
-               layout.split(number=2)
+               split = layout.split()
                
-               sub = layout.sub(0)
-               sub.column()
+               sub = split.column()
                sub.itemR(rd, "render_shadows", text="Shadows")
-               sub.itemR(rd, "render_sss", text="SSS")
-               sub.itemR(rd, "render_envmaps", text="EnvMap")
-               sub.itemR(rd, "render_radiosity", text="Radio")
-               
-               sub = layout.sub(1)
-               subsub = sub.box()
-               subsub.column()
-               subsub.itemR(rd, "render_raytracing", text="Ray Tracing")
+               sub.itemR(rd, "render_sss", text="Subsurface Scattering")
+               sub.itemR(rd, "render_envmaps", text="Environment Map")
+               #       sub.itemR(rd, "render_radiosity", text="Radio")
+               
+               sub = split.column()
+               sub.itemR(rd, "render_raytracing", text="Ray Tracing")
                if (rd.render_raytracing):
-                       subsub.itemR(rd, "octree_resolution", text="Octree")
-               sub.row()
-               sub.itemR(rd, "alpha_mode")
+                       sub.itemR(rd, "octree_resolution", text="Octree")
+               sub.itemR(rd, "dither_intensity", text="Dither", slider=True)
                
-class RENDER_PT_image(RenderButtonsPanel):
-       __label__ = "Image"
+class RENDER_PT_output(RenderButtonsPanel):
+       __label__ = "Output"
 
        def draw(self, context):
                scene = context.scene
                layout = self.layout
 
                rd = scene.render_data
-
-               layout.column_flow()
-               layout.itemR(rd, "resolution_x", text="SizeX")
-               layout.itemR(rd, "resolution_y", text="SizeY")
-               layout.itemR(rd, "pixel_aspect_x", text="AspX")
-               layout.itemR(rd, "pixel_aspect_y", text="AspY")
-
-               sub = layout.box()
-               sub.row()
-               sub.itemR(rd, "image_type")
-               sub.row()
-               sub.itemR(rd, "file_extensions")
+               
+               layout.itemR(rd, "output_path")
+               
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemR(rd, "file_format", text="Format")
+               if rd.file_format in ("AVIJPEG", "JPEG"):
+                       sub.itemR(rd, "quality", slider=True)
+               
+               sub = split.column()
                sub.itemR(rd, "color_mode")
-               if rd.image_type in ("AVIJPEG", "JPEG"):
-                       sub.row()
-                       sub.itemR(rd, "quality")
-       
+               sub.itemR(rd, "alpha_mode")
+               
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemL(text="Distributed Rendering:")
+               sub.itemR(rd, "placeholders")
+               sub.itemR(rd, "no_overwrite")
+               
+               sub = split.column()
+               sub.itemL(text="Settings:")
+               sub.itemR(rd, "file_extensions")
+               sub.itemR(rd, "fields", text="Fields")
+               if rd.fields:
+                       sub.itemR(rd, "fields_still", text="Still")
+                       sub.row().itemR(rd, "field_order", expand=True)
+
 class RENDER_PT_antialiasing(RenderButtonsPanel):
        __label__ = "Anti-Aliasing"
 
+       def draw_header(self, context):
+               rd = context.scene.render_data
+
+               layout = self.layout
+               layout.itemR(rd, "antialiasing", text="")
+
        def draw(self, context):
                scene = context.scene
+               rd = scene.render_data
+
                layout = self.layout
+               layout.active = rd.antialiasing
 
-               rd = scene.render_data
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemL(text="Samples:")
+               sub.row().itemR(rd, "antialiasing_samples", expand=True)
 
-               layout.row()
-               layout.itemR(rd, "antialiasing", text="Enable")
-               if (rd.antialiasing):
-                       layout.row()
-                       layout.itemL(text="Samples:")
-                       layout.itemR(rd, "antialiasing_samples", expand=True)
-                       layout.row()
-                       layout.itemR(rd, "pixel_filter")
-                       layout.itemR(rd, "filter_size")
-
-                       layout.row()
-                       layout.itemR(rd, "save_buffers")
-                       if (rd.save_buffers):
-                               layout.itemR(rd, "full_sample")
+               sub = split.column()
+               sub.itemR(rd, "pixel_filter")
+               sub.itemR(rd, "filter_size", text="Size", slider=True)
+               sub.itemR(rd, "save_buffers")
+               if rd.save_buffers:
+                       sub.itemR(rd, "full_sample")
 
 class RENDER_PT_render(RenderButtonsPanel):
        __label__ = "Render"
@@ -91,71 +104,114 @@ class RENDER_PT_render(RenderButtonsPanel):
 
                rd = scene.render_data
 
-               layout.row()
-               layout.itemO("SCREEN_OT_render", text="RENDER", icon=0) # ICON_SCENE
-               #layout.itemO("SCREEN_OT_render", text="ANIM", icon=0) # "anim", 1
+               row = layout.row()
+               row.itemO("SCREEN_OT_render", text="Render Still", icon=109)
+               row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon=111)
+               
+               row = layout.row()
+               row.itemR(rd, "do_composite")
+               row.itemR(rd, "do_sequence")
+               if rd.do_composite:
+                       row = layout.row()
+                       row.itemR(rd, "free_image_textures")
+
+               split = layout.split()
+               
+               sub = split.column(align=True)
+               sub.itemL(text="Threads:")
+               sub.row().itemR(rd, "threads_mode", expand=True)
+               if rd.threads_mode == 'THREADS_FIXED':
+                       sub.itemR(rd, "threads")
+               
+               sub = split.column(align=True)
+               sub.itemL(text="Tiles:")
+               sub.itemR(rd, "parts_x", text="X")
+               sub.itemR(rd, "parts_y", text="Y")
+               
+               split = layout.split()
+               sub = split.column()
+               sub = split.column()
+               sub.itemR(rd, "panorama")
+               
+               #       row.itemR(rd, "backbuf")
+                       
+class RENDER_PT_dimensions(RenderButtonsPanel):
+       __label__ = "Dimensions"
+
+       def draw(self, context):
+               scene = context.scene
+               layout = self.layout
 
-               layout.row()
-               layout.itemR(scene, "start_frame", text="Start")
-               layout.itemR(rd, "fps")
-               layout.itemR(scene, "current_frame", text="Frame")
+               rd = scene.render_data
+               
+               split = layout.split()
+               
+               col = split.column()
+               sub = col.column(align=True)
+               sub.itemL(text="Resolution:")
+               sub.itemR(rd, "resolution_x", text="X")
+               sub.itemR(rd, "resolution_y", text="Y")
+               sub.itemR(rd, "resolution_percentage", text="")
+               
+               sub.itemL(text="Aspect Ratio:")
+               sub.itemR(rd, "pixel_aspect_x", text="X")
+               sub.itemR(rd, "pixel_aspect_y", text="Y")
                
-               layout.row()
-               layout.itemR(scene, "end_frame", text="End")
-               layout.itemR(rd, "fps_base",text="/")
-               layout.itemR(scene, "frame_step", text="Step")
+               sub = col.column(align=False)
+               sub.itemR(rd, "border", text="Border")
+               if rd.border:
+                       sub.itemR(rd, "crop_to_border")
+
+               col = split.column(align=True)
+               col.itemL(text="Frame Range:")
+               col.itemR(scene, "start_frame", text="Start")
+               col.itemR(scene, "end_frame", text="End")
+               col.itemR(scene, "frame_step", text="Step")
+               
+               col.itemL(text="Frame Rate:")
+               col.itemR(rd, "fps")
+               col.itemR(rd, "fps_base",text="/")
+
+class RENDER_PT_stamp(RenderButtonsPanel):
+       __label__ = "Stamp"
 
-               layout.row()
-               layout.itemR(rd, "do_composite")
-               layout.itemR(rd, "do_sequence")
+       def draw_header(self, context):
+               rd = context.scene.render_data
 
-               layout.row()
-               layout.itemL(text="General:")
+               layout = self.layout
+               layout.itemR(rd, "stamp", text="")
 
-               layout.column_flow()
-               layout.itemR(rd, "resolution_percentage", text="Size ")
-               layout.itemR(rd, "dither_intensity")
-               layout.itemR(rd, "parts_x")
-               layout.itemR(rd, "parts_y")
+       def draw(self, context):
+               scene = context.scene
+               rd = scene.render_data
+
+               layout = self.layout
+               layout.active = rd.stamp
+
+               split = layout.split()
                
-               layout.split(number=2)
+               sub = split.column()
+               sub.itemR(rd, "stamp_time", text="Time")
+               sub.itemR(rd, "stamp_date", text="Date")
+               sub.itemR(rd, "stamp_frame", text="Frame")
+               sub.itemR(rd, "stamp_camera", text="Scene")
+               sub.itemR(rd, "stamp_marker", text="Marker")
+               sub.itemR(rd, "stamp_filename", text="Filename")
+               sub.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
+               sub.itemR(rd, "stamp_note", text="Note")
+               if (rd.stamp_note):
+                       sub.itemR(rd, "stamp_note_text", text="")
                
-               sub = layout.sub(0)
-               subsub = sub.box()
-               subsub.column()
-               subsub.itemL(text="Threads Mode:")
-               subsub.itemR(rd, "threads_mode", expand=True)
-               if rd.threads_mode == 'THREADS_FIXED':
-                       subsub.itemR(rd, "threads")
-               
-               subsub = sub.box()
-               subsub.column()
-               subsub.itemL(text="Distributed Rendering:")
-               subsub.itemR(rd, "placeholders")
-               subsub.itemR(rd, "no_overwrite")
-               subsub = sub.box()
-               subsub.column()
-               subsub.itemR(rd, "fields", text="Fields")
-               if (rd.fields):
-                       subsub.itemR(rd, "fields_still", text="Still")
-                       subsub.itemR(rd, "field_order", text="Order")
-               
-               sub = layout.sub(1)
-               subsub = sub.box()
-               subsub.column()
-               subsub.itemL(text="Extra:")
-               subsub.itemR(rd, "panorama")
-               subsub.itemR(rd, "backbuf")
-               subsub.itemR(rd, "free_image_textures")
-               
-               subsub = sub.box()
-               subsub.column()
-               subsub.itemL(text="Border:")
-               subsub.itemR(rd, "border", text="Border Render")
-               if (rd.border):
-                       subsub.itemR(rd, "crop_to_border")
+               sub = split.column()
+               sub.itemR(rd, "render_stamp")
+               sub.itemR(rd, "stamp_foreground")
+               sub.itemR(rd, "stamp_background")
+               sub.itemR(rd, "stamp_font_size", text="Font Size")
 
 bpy.types.register(RENDER_PT_render)
+bpy.types.register(RENDER_PT_dimensions)
 bpy.types.register(RENDER_PT_antialiasing)
 bpy.types.register(RENDER_PT_shading)
-bpy.types.register(RENDER_PT_image)
+bpy.types.register(RENDER_PT_output)
+bpy.types.register(RENDER_PT_stamp)
+
diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py
new file mode 100644 (file)
index 0000000..ccdbda5
--- /dev/null
@@ -0,0 +1,358 @@
+
+import bpy
+
+class TextureButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "texture"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture != None)
+               except:return False
+
+class TEXTURE_PT_preview(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_preview"
+       __label__ = "Preview"
+
+       def draw(self, context):
+               layout = self.layout
+
+               tex = context.active_object.active_material.active_texture.texture
+               layout.template_preview(tex)
+
+class TEXTURE_PT_texture(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_texture"
+       __label__ = "Texture"
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               layout.itemR(tex, "type")
+
+class TEXTURE_PT_clouds(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_clouds"
+       __label__ = "Clouds"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'CLOUDS')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               layout.itemR(tex, "stype", expand=True)
+               layout.itemL(text="Noise:")
+               layout.itemR(tex, "noise_type", text="Type", expand=True)
+               layout.itemR(tex, "noise_basis", text="Basis")
+               
+               col = layout.column_flow()
+               col.itemR(tex, "noise_size", text="Size")
+               col.itemR(tex, "noise_depth", text="Depth")
+               col.itemR(tex, "nabla", text="Nabla")
+
+class TEXTURE_PT_wood(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_wood"
+       __label__ = "Wood"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'WOOD')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               layout.itemR(tex, "stype", expand=True)
+               layout.itemR(tex, "noisebasis2", expand=True)
+               layout.itemL(text="Noise:")
+               layout.itemR(tex, "noise_type", text="Type", expand=True)
+               layout.itemR(tex, "noise_basis", text="Basis")
+               
+               col = layout.column_flow()
+               col.itemR(tex, "noise_size", text="Size")
+               col.itemR(tex, "turbulence")
+               col.itemR(tex, "nabla")
+               
+class TEXTURE_PT_marble(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_marble"
+       __label__ = "Marble"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'MARBLE')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               layout.itemR(tex, "stype", expand=True)
+               layout.itemR(tex, "noisebasis2", expand=True)
+               layout.itemL(text="Noise:")
+               layout.itemR(tex, "noise_type", text="Type", expand=True)
+               layout.itemR(tex, "noise_basis", text="Basis")
+               
+               col = layout.column_flow()      
+               col.itemR(tex, "noise_size", text="Size")
+               col.itemR(tex, "noise_depth", text="Depth")
+               col.itemR(tex, "turbulence")
+               col.itemR(tex, "nabla")
+
+class TEXTURE_PT_magic(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_magic"
+       __label__ = "Magic"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'MAGIC')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+                       
+               row = layout.row()
+               row.itemR(tex, "noise_depth", text="Depth")
+               row.itemR(tex, "turbulence")
+
+class TEXTURE_PT_blend(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_blend"
+       __label__ = "Blend"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'BLEND')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+
+               layout.itemR(tex, "progression")
+               layout.itemR(tex, "flip_axis")
+                       
+class TEXTURE_PT_stucci(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_stucci"
+       __label__ = "Stucci"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'STUCCI')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               layout.itemR(tex, "stype", expand=True)
+               layout.itemL(text="Noise:")
+               layout.itemR(tex, "noise_type", text="Type", expand=True)
+               layout.itemR(tex, "noise_basis", text="Basis")
+               
+               row = layout.row()
+               row.itemR(tex, "noise_size", text="Size")
+               row.itemR(tex, "turbulence")
+               
+class TEXTURE_PT_image(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_image"
+       __label__ = "Image/Movie"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'IMAGE')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               split = layout.split()
+               
+               sub = split.column()            
+               sub.itemR(tex, "flip_axis")
+               sub.itemR(tex, "normal_map")
+               sub.itemL(text="Filter:")
+               sub.itemR(tex, "mipmap")
+               sub.itemR(tex, "mipmap_gauss")
+               sub.itemR(tex, "interpolation")
+               sub = split.column() 
+               sub.itemL(text="Alpha:")
+               sub.itemR(tex, "use_alpha")
+               sub.itemR(tex, "calculate_alpha")
+               sub.itemR(tex, "invert_alpha")
+
+class TEXTURE_PT_mapping(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_mapping"
+       __label__ = "Mapping"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'IMAGE')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+                               
+               split = layout.split()
+               
+               sub = split.column()
+               #sub.itemR(tex, "crop_rectangle")
+               sub.itemL(text="Crop Minimum:")
+               sub.itemR(tex, "crop_min_x", text="X")
+               sub.itemR(tex, "crop_min_y", text="Y")
+               sub = split.column()
+               sub.itemL(text="Crop Maximum:")
+               sub.itemR(tex, "crop_max_x", text="X")
+               sub.itemR(tex, "crop_max_y", text="Y")
+               
+               layout.itemR(tex, "extension")
+               
+               split = layout.split()
+               
+               sub = split.column()
+               if tex.extension == 'REPEAT': 
+                       sub.itemL(text="Repeat:")
+                       sub.itemR(tex, "repeat_x", text="X")
+                       sub.itemR(tex, "repeat_y", text="Y")
+                       sub = split.column()
+                       sub.itemL(text="Mirror:")
+                       sub.itemR(tex, "mirror_x", text="X")
+                       sub.itemR(tex, "mirror_y", text="Y")
+               elif tex.extension == 'CHECKER': 
+                       sub.itemR(tex, "checker_even", text="Even")
+                       sub.itemR(tex, "checker_odd", text="Odd")
+                       sub = split.column()
+                       sub.itemR(tex, "checker_distance", text="Distance")
+       
+class TEXTURE_PT_plugin(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_plugin"
+       __label__ = "Plugin"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'PLUGIN')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               layout.itemL(text="Nothing yet")
+               
+class TEXTURE_PT_envmap(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_envmap"
+       __label__ = "Environment Map"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'ENVIRONMENT_MAP')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               layout.itemL(text="Nothing yet")
+               
+class TEXTURE_PT_musgrave(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_musgrave"
+       __label__ = "Musgrave"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'MUSGRAVE')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+               
+               layout.itemR(tex, "musgrave_type")      
+               
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemR(tex, "highest_dimension", text="Dimension")
+               sub.itemR(tex, "lacunarity")
+               sub.itemR(tex, "octaves")
+               sub = split.column() 
+               if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
+                       sub.itemR(tex, "offset")
+               if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
+                       sub.itemR(tex, "gain")
+                       sub.itemR(tex, "noise_intensity", text="Intensity")
+               
+               layout.itemL(text="Noise:")
+               
+               layout.itemR(tex, "noise_basis", text="Basis")
+               
+               row = layout.row()
+               row.itemR(tex, "noise_size", text="Size")
+               row.itemR(tex, "nabla")
+
+class TEXTURE_PT_voronoi(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_voronoi"
+       __label__ = "Voronoi"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'VORONOI')
+               except:return False
+
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+       
+               layout.itemR(tex, "distance_metric")
+               layout.itemR(tex, "coloring")
+               
+               split = layout.split()
+               
+               sub = split.column()   
+               
+               sub.itemR(tex, "noise_intensity", text="Intensity")
+               if tex.distance_metric == 'MINKOVSKY':
+                       sub.itemR(tex, "minkovsky_exponent", text="Exponent")
+               sub = split.column()
+               sub.itemR(tex, "feature_weights", slider=True)
+               
+               layout.itemL(text="Noise:")
+               
+               row = layout.row()
+               row.itemR(tex, "noise_size", text="Size")
+               row.itemR(tex, "nabla")
+                       
+class TEXTURE_PT_distortednoise(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_distortednoise"
+       __label__ = "Distorted Noise"
+       
+       def poll(self, context):
+               try:    return (context.active_object.active_material.active_texture.texture.type == 'DISTORTED_NOISE')
+               except:return False
+
+       def draw(self, context):
+               layout = self.layout
+               tex = context.active_object.active_material.active_texture.texture
+
+               layout.itemR(tex, "noise_distortion")
+               layout.itemR(tex, "noise_basis", text="Basis")
+               
+               split = layout.split()
+               
+               sub = split.column()
+               sub.itemR(tex, "distortion_amount", text="Amount")
+               sub.itemR(tex, "noise_size", text="Size")
+               
+               sub = split.column()
+               sub.itemR(tex, "nabla") 
+
+bpy.types.register(TEXTURE_PT_preview)
+bpy.types.register(TEXTURE_PT_texture)
+bpy.types.register(TEXTURE_PT_clouds)
+bpy.types.register(TEXTURE_PT_wood)
+bpy.types.register(TEXTURE_PT_marble)
+bpy.types.register(TEXTURE_PT_magic)
+bpy.types.register(TEXTURE_PT_blend)
+bpy.types.register(TEXTURE_PT_stucci)
+bpy.types.register(TEXTURE_PT_image)
+bpy.types.register(TEXTURE_PT_mapping)
+bpy.types.register(TEXTURE_PT_plugin)
+bpy.types.register(TEXTURE_PT_envmap)
+bpy.types.register(TEXTURE_PT_musgrave)
+bpy.types.register(TEXTURE_PT_voronoi)
+bpy.types.register(TEXTURE_PT_distortednoise)
+
index 44ce472bf5d4682e14d3df45dc609a3d7df9da78..c38e791d92adfcde3b2444795027c9c621c25d77 100644 (file)
@@ -8,6 +8,15 @@ class WorldButtonsPanel(bpy.types.Panel):
 
        def poll(self, context):
                return (context.scene.world != None)
+
+class WORLD_PT_preview(WorldButtonsPanel):
+       __label__ = "Preview"
+
+       def draw(self, context):
+               layout = self.layout
+
+               world = context.scene.world
+               layout.template_preview(world)
        
 class WORLD_PT_world(WorldButtonsPanel):
        __label__ = "World"
@@ -16,15 +25,15 @@ class WORLD_PT_world(WorldButtonsPanel):
                world = context.scene.world
                layout = self.layout
                
-               layout.row()
-               layout.itemR(world, "blend_sky")
-               layout.itemR(world, "paper_sky")
-               layout.itemR(world, "real_sky")
+               row = layout.row()
+               row.itemR(world, "blend_sky")
+               row.itemR(world, "paper_sky")
+               row.itemR(world, "real_sky")
                
-               layout.row()
-               layout.itemR(world, "horizon_color")
-               layout.itemR(world, "zenith_color")
-               layout.itemR(world, "ambient_color")
+               row = layout.row()
+               row.column().itemR(world, "horizon_color")
+               row.column().itemR(world, "zenith_color")
+               row.column().itemR(world, "ambient_color")
                
 class WORLD_PT_color_correction(WorldButtonsPanel):
        __label__ = "Color Correction"
@@ -33,103 +42,105 @@ class WORLD_PT_color_correction(WorldButtonsPanel):
                world = context.scene.world
                layout = self.layout
 
-               layout.row()
-               layout.itemR(world, "exposure")
-               layout.itemR(world, "range")
+               row = layout.row()
+               row.itemR(world, "exposure")
+               row.itemR(world, "range")
        
 class WORLD_PT_mist(WorldButtonsPanel):
        __label__ = "Mist"
 
-       def draw(self, context):
+       def draw_header(self, context):
                world = context.scene.world
+
                layout = self.layout
+               layout.itemR(world.mist, "enabled", text="")
 
-               layout.row()
-               layout.itemR(world.mist, "enabled", text="Enable")
-               if (world.mist.enabled):
-       
-                       layout.column_flow()
-                       layout.itemR(world.mist, "start")
-                       layout.itemR(world.mist, "depth")
-                       layout.itemR(world.mist, "height")
-                       layout.itemR(world.mist, "intensity")
-                       layout.column()
-                       layout.itemL(text="Fallof:")
-                       layout.itemR(world.mist, "falloff", expand=True)
+       def draw(self, context):
+               world = context.scene.world
+               layout = self.layout
+               layout.active = world.mist.enabled
+
+               flow = layout.column_flow()
+               flow.itemR(world.mist, "start")
+               flow.itemR(world.mist, "depth")
+               flow.itemR(world.mist, "height")
+               flow.itemR(world.mist, "intensity")
+               col = layout.column()
+               col.itemL(text="Fallof:")
+               col.row().itemR(world.mist, "falloff", expand=True)
                
 class WORLD_PT_stars(WorldButtonsPanel):
        __label__ = "Stars"
 
-       def draw(self, context):
+       def draw_header(self, context):
                world = context.scene.world
+
                layout = self.layout
+               layout.itemR(world.stars, "enabled", text="")
 
-               layout.row()
-               layout.itemR(world.stars, "enabled", text="Enable")
-               if (world.stars.enabled):
+       def draw(self, context):
+               world = context.scene.world
+               layout = self.layout
+               layout.active = world.stars.enabled
 
-                       layout.column_flow()
-                       layout.itemR(world.stars, "size")
-                       layout.itemR(world.stars, "min_distance", text="MinDist")
-                       layout.itemR(world.stars, "average_separation", text="StarDist")
-                       layout.itemR(world.stars, "color_randomization", text="Colnoise")
+               flow = layout.column_flow()
+               flow.itemR(world.stars, "size")
+               flow.itemR(world.stars, "min_distance", text="Min. Dist")
+               flow.itemR(world.stars, "average_separation", text="Separation")
+               flow.itemR(world.stars, "color_randomization", text="Random:")
                
 class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
        __label__ = "Ambient Occlusion"
 
-       def draw(self, context):
+       def draw_header(self, context):
                world = context.scene.world
+
                layout = self.layout
+               layout.itemR(world.ambient_occlusion, "enabled", text="")
 
+       def draw(self, context):
+               world = context.scene.world
                ao = world.ambient_occlusion
+               layout = self.layout
+               layout.active = ao.enabled
                
-               layout.row()
-               layout.itemR(ao, "enabled", text="Enable")
-               if (ao.enabled):
-
-                       layout.row()
-                       layout.itemR(ao, "gather_method", expand=True)
+               layout.itemR(ao, "gather_method", expand=True)
+               
+               if ao.gather_method == 'RAYTRACE':
+                       row = layout.row()
+                       row.itemR(ao, "samples")
+                       row.itemR(ao, "distance")
                        
-                       if ao.gather_method == 'RAYTRACE':
-                               layout.row()
-                               layout.itemR(ao, "samples")
-                               layout.itemR(ao, "distance")
+                       layout.itemR(ao, "sample_method")
+                       if ao.sample_method == 'ADAPTIVE_QMC':
+                               row = layout.row()
+                               row.itemR(ao, "threshold")
+                               row.itemR(ao, "adapt_to_speed")
                                
-                               layout.row()
-                               layout.itemR(ao, "sample_method")
-                               if ao.sample_method == 'ADAPTIVE_QMC':
-                                       layout.row()
-                                       layout.itemR(ao, "threshold")
-                                       layout.itemR(ao, "adapt_to_speed")
-                                       
-                               if ao.sample_method == 'CONSTANT_JITTERED':
-                                       layout.row()
-                                       layout.itemR(ao, "bias")
-                                                       
-                       if ao.gather_method == 'APPROXIMATE':
-                               layout.row()
-                               layout.itemR(ao, "passes")
-                               layout.itemR(ao, "error_tolerance")
-                               
-                               layout.row()
-                               layout.itemR(ao, "correction")
-                               layout.itemR(ao, "pixel_cache")
-
-                       layout.row()
-                       layout.itemS()
-                               
-                       layout.row()
-                       layout.itemR(ao, "falloff")     
-                       layout.itemR(ao, "strength")
-                       
-                       layout.column()
-                       layout.itemR(ao, "blend_mode", expand=True)
-                       layout.itemR(ao, "color", expand=True)
-                       layout.itemR(ao, "energy")
+                       if ao.sample_method == 'CONSTANT_JITTERED':
+                               row = layout.row()
+                               row.itemR(ao, "bias")
+                                               
+               if ao.gather_method == 'APPROXIMATE':
+                       col = layout.column_flow()
+                       col.itemR(ao, "passes")
+                       col.itemR(ao, "error_tolerance", text="Error")
+                       col.itemR(ao, "correction")
+                       col.itemR(ao, "pixel_cache")
+
+               row = layout.row()
+               row.itemR(ao, "falloff")        
+               row.itemR(ao, "strength")
+               
+               col = layout.column()
+               col.row().itemR(ao, "blend_mode", expand=True)
+               col.row().itemR(ao, "color", expand=True)
+               col.itemR(ao, "energy")
        
+bpy.types.register(WORLD_PT_preview)
 bpy.types.register(WORLD_PT_world)
+bpy.types.register(WORLD_PT_ambient_occlusion)
 bpy.types.register(WORLD_PT_mist)
 bpy.types.register(WORLD_PT_stars)
-bpy.types.register(WORLD_PT_ambient_occlusion)
 bpy.types.register(WORLD_PT_color_correction)
 
diff --git a/release/ui/space_outliner.py b/release/ui/space_outliner.py
new file mode 100644 (file)
index 0000000..d73ea38
--- /dev/null
@@ -0,0 +1,35 @@
+
+import bpy
+
+class OUTLINER_HT_header(bpy.types.Header):
+       __space_type__ = "OUTLINER"
+       __idname__ = "OUTLINER_HT_header"
+
+       def draw(self, context):
+               so = context.space_data
+               layout = self.layout
+
+               layout.template_header(context)
+
+               if context.area.show_menus:
+                       row = layout.row(align=True)
+                       row.itemM(context, "OUTLINER_MT_view")
+                       
+               row = layout.row(align=True)
+               row.itemR(so, "display_mode", text="")
+
+class OUTLINER_MT_view(bpy.types.Menu):
+       __space_type__ = "OUTLINER"
+       __label__ = "View"
+
+       def draw(self, context):
+               layout = self.layout
+               so = context.space_data
+
+               layout.column()
+               row.itemR(so, "show_restriction_columns")
+               #layout.itemO("TEXT_OT_new")
+
+bpy.types.register(OUTLINER_HT_header)
+bpy.types.register(OUTLINER_MT_view)
+
index a3d27370ffa5b33f1e55a3b58fdc9dfd6940e367..d4187c10b69beb752ad3938705f2059efcf234f1 100644 (file)
@@ -18,38 +18,40 @@ class TEXT_HT_header(bpy.types.Header):
                text = st.text
                layout = self.layout
 
-               layout.template_header()
-               layout.itemM("TEXT_MT_text")
-               if text:
-                       layout.itemM("TEXT_MT_edit")
-                       layout.itemM("TEXT_MT_format")
+               layout.template_header(context)
+
+               if context.area.show_menus:
+                       row = layout.row(align=True)
+                       row.itemM(context, "TEXT_MT_text")
+                       if text:
+                               row.itemM(context, "TEXT_MT_edit")
+                               row.itemM(context, "TEXT_MT_format")
 
                if text and text.modified:
-                       layout.row()
-                       # layout.color(redalert)
-                       layout.itemO("TEXT_OT_resolve_conflict", text="", icon=ICON_HELP)
+                       row = layout.row()
+                       # row.color(redalert)
+                       row.itemO("TEXT_OT_resolve_conflict", text="", icon=ICON_HELP)
 
-               layout.row()
-               layout.itemR(st, "line_numbers", text="", icon=ICON_LINENUMBERS_OFF)
-               layout.itemR(st, "word_wrap", text="", icon=ICON_WORDWRAP_OFF)
-               layout.itemR(st, "syntax_highlight", text="", icon=ICON_SYNTAX_OFF)
-               # layout.itemR(st, "do_python_plugins", text="", icon=ICON_SCRIPTPLUGINS)
+               row = layout.row(align=True)
+               row.itemR(st, "line_numbers", text="", icon=ICON_LINENUMBERS_OFF)
+               row.itemR(st, "word_wrap", text="", icon=ICON_WORDWRAP_OFF)
+               row.itemR(st, "syntax_highlight", text="", icon=ICON_SYNTAX_OFF)
+               # row.itemR(st, "do_python_plugins", text="", icon=ICON_SCRIPTPLUGINS)
 
-               layout.row()
-               layout.template_header_ID(st, "text", new="TEXT_OT_new", open="TEXT_OT_open", unlink="TEXT_OT_unlink")
+               layout.template_header_ID(context, st, "text", new="TEXT_OT_new", open="TEXT_OT_open", unlink="TEXT_OT_unlink")
 
                if text:
-                       layout.row()
+                       row = layout.row()
                        if text.filename != "":
                                if text.dirty:
-                                       layout.itemL(text="File: *" + text.filename + " (unsaved)")
+                                       row.itemL(text="File: *" + text.filename + " (unsaved)")
                                else:
-                                       layout.itemL(text="File: " + text.filename)
+                                       row.itemL(text="File: " + text.filename)
                        else:
                                if text.library:
-                                       layout.itemL(text="Text: External")
+                                       row.itemL(text="Text: External")
                                else:
-                                       layout.itemL(text="Text: Internal")
+                                       row.itemL(text="Text: Internal")
 
 class TEXT_PT_properties(bpy.types.Panel):
        __space_type__ = "TEXT_EDITOR"
@@ -60,14 +62,14 @@ class TEXT_PT_properties(bpy.types.Panel):
                st = context.space_data
                layout = self.layout
 
-               layout.column_flow()
-               layout.itemR(st, "line_numbers", icon=ICON_LINENUMBERS_OFF)
-               layout.itemR(st, "word_wrap", icon=ICON_WORDWRAP_OFF)
-               layout.itemR(st, "syntax_highlight", icon=ICON_SYNTAX_OFF)
+               flow = layout.column_flow()
+               flow.itemR(st, "line_numbers", icon=ICON_LINENUMBERS_OFF)
+               flow.itemR(st, "word_wrap", icon=ICON_WORDWRAP_OFF)
+               flow.itemR(st, "syntax_highlight", icon=ICON_SYNTAX_OFF)
 
-               layout.column_flow()
-               layout.itemR(st, "font_size")
-               layout.itemR(st, "tab_width")
+               flow = layout.column_flow()
+               flow.itemR(st, "font_size")
+               flow.itemR(st, "tab_width")
 
 class TEXT_PT_find(bpy.types.Panel):
        __space_type__ = "TEXT_EDITOR"
@@ -79,27 +81,26 @@ class TEXT_PT_find(bpy.types.Panel):
                layout = self.layout
 
                # find
-               layout.row()
-               layout.itemR(st, "find_text", text="")
-               layout.itemO("TEXT_OT_find_set_selected", text="", icon=ICON_TEXT)
-               layout.column()
-               layout.itemO("TEXT_OT_find")
+               col = layout.column(align=True)
+               row = col.row()
+               row.itemR(st, "find_text", text="")
+               row.itemO("TEXT_OT_find_set_selected", text="", icon=ICON_TEXT)
+               col.itemO("TEXT_OT_find")
 
                # replace
-               layout.row()
-               layout.itemR(st, "replace_text", text="")
-               layout.itemO("TEXT_OT_replace_set_selected", text="", icon=ICON_TEXT)
-               layout.column()
-               layout.itemO("TEXT_OT_replace")
+               col = layout.column(align=True)
+               row = col.row()
+               row.itemR(st, "replace_text", text="")
+               row.itemO("TEXT_OT_replace_set_selected", text="", icon=ICON_TEXT)
+               col.itemO("TEXT_OT_replace")
 
                # mark
-               layout.column()
                layout.itemO("TEXT_OT_mark_all")
 
                # settings
-               layout.row()
-               layout.itemR(st, "find_wrap", text="Wrap")
-               layout.itemR(st, "find_all", text="All")
+               row = layout.row()
+               row.itemR(st, "find_wrap", text="Wrap")
+               row.itemR(st, "find_all", text="All")
 
 class TEXT_MT_text(bpy.types.Menu):
        __space_type__ = "TEXT_EDITOR"
index 10bbdb4851b21a9cc10e7a597d7ca750998e3338..14bc6a33b72e903de1f24986f6e53364e642feff 100644 (file)
@@ -138,7 +138,7 @@ int BLF_load(char *name)
 
        filename= blf_dir_search(name);
        if (!filename) {
-               printf("Can't found font: %s\n", name);
+               printf("Can't find font: %s\n", name);
                return(-1);
        }
 
index 555b467b1d6ae44a91be12fd381803f117185461..6f6c4a834dfcdde78761485ce4731d816a7bd805 100644 (file)
@@ -58,6 +58,7 @@ void                          curvemapping_premultiply(struct CurveMapping *cumap, int restore);
 int                                    curvemapping_RGBA_does_something(struct CurveMapping *cumap);
 void                           curvemapping_initialize(struct CurveMapping *cumap);
 void                           curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
+void                           colorcorrection_do_ibuf(struct ImBuf *ibuf, const char *profile);
 
 #endif
 
index f08b14c7820cd7482d0a67f02562f3c97206b2da..6a43f4ca25c99b0e91efb8e205bc4e3328aeeee1 100644 (file)
@@ -72,6 +72,20 @@ typedef struct bContextDataResult bContextDataResult;
 typedef int (*bContextDataCallback)(const bContext *C,
        const char *member, bContextDataResult *result);
 
+typedef struct bContextStoreEntry {
+       struct bContextStoreEntry *next, *prev;
+
+       char name[128];
+       PointerRNA ptr;
+} bContextStoreEntry;
+
+typedef struct bContextStore {
+       struct bContextStore *next, *prev;
+
+       ListBase entries;
+       int used;
+} bContextStore;
+
 /* Context */
 
 bContext *CTX_create(void);
@@ -79,6 +93,14 @@ void CTX_free(bContext *C);
 
 bContext *CTX_copy(const bContext *C);
 
+/* Stored Context */
+
+bContextStore *CTX_store_add(ListBase *contexts, char *name, PointerRNA *ptr);
+void CTX_store_set(bContext *C, bContextStore *store);
+bContextStore *CTX_store_copy(bContextStore *store);
+void CTX_store_free(bContextStore *store);
+void CTX_store_free_list(ListBase *contexts);
+
 /* Window Manager Context */
 
 struct wmWindowManager *CTX_wm_manager(const bContext *C);
index e598394cc605c65a6fa979c465f8ce5d90b02c51..ce182267b93146eb22d26ffaaf53f3a4446d93c0 100644 (file)
@@ -45,6 +45,7 @@ void *copy_libblock(void *rt);
 
 void id_lib_extern(struct ID *id);
 void id_us_plus(struct ID *id);
+void id_us_min(struct ID *id);
 
 int check_for_dupid(struct ListBase *lb, struct ID *id, char *name);
 int new_id(struct ListBase *lb, struct ID *id, const char *name);
index 3b0ff2db6f46292bfd328c3f06558db5c972dbd9..29a522d711fce399e7f5de37d3d7f6384ba01ed2 100644 (file)
@@ -60,12 +60,12 @@ void multires_force_update(struct Object *ob);
 struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, struct DerivedMesh*,
                                                    struct Mesh *, int, int);
 
+struct MultiresModifierData *find_multires_modifier(struct Object *ob);
 int multiresModifier_switch_level(struct Object *, const int);
 void multiresModifier_join(struct Object *);
 void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
 void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob, int distance,
                                int updateblock, int simple);
-void multiresModifier_setLevel(void *mmd_v, void *ob_v);
 int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src);
 
 /* Related to the old multires */
index 2af72d987013c3e3aa13a448c6c76e9e7e1c1798..3d71193f37a5ea6bb4384a9ddc0a3ec69f42d736 100644 (file)
@@ -85,6 +85,7 @@ struct Object *add_object(struct Scene *scene, int type);
 struct Object *copy_object(struct Object *ob);
 void expand_local_object(struct Object *ob);
 void make_local_object(struct Object *ob);
+int object_data_is_libdata(struct Object *ob);
 void set_mblur_offs(float blur);
 void set_field_offs(float field);
 void disable_speed_curve(int val);
index 4797616a471f2c8c802c382d0a23d6b1235ce820..9b5d99f6ae6eff043cc965023aedb95f14e94dde 100644 (file)
@@ -159,6 +159,8 @@ typedef struct PanelType {
 
        /* verify if the panel should draw or not */
        int                     (*poll)(const struct bContext *, struct PanelType *);
+       /* draw header (optional) */
+       void            (*draw_header)(const struct bContext *, struct Panel *);        
        /* draw entirely, view changes should be handled here */
        void            (*draw)(const struct bContext *, struct Panel *);       
 
index 19d150b34a84315289c7957c73c5ecb7af5c5655..dbc990d06137ff52d3613dfd678b076876898f2d 100644 (file)
@@ -55,6 +55,9 @@ if env['WITH_BF_BULLET']:
 if env['BF_NO_ELBEEM']:
        defs.append('DISABLE_ELBEEM')
 
+if env['WITH_BF_LCMS']:
+       defs.append('WITH_LCMS')
+       
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
     incs += ' ' + env['BF_PTHREADS_INC']
 
index 1bc34aea9a135896dab31ad276db682ba8a10372..e8716aba296fb3b47f51cfeacb68d57f27678336 100644 (file)
 #include <stdlib.h>
 #include <float.h>
 
+#ifdef WITH_LCMS
+#include <lcms.h>
+#endif
+
 #include "MEM_guardedalloc.h"
 
 #include "DNA_color_types.h"
@@ -650,6 +654,38 @@ void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const
        vecout[2]= curvemap_evaluateF(cumap->cm+2, fac);
 }
 
+void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile)
+{
+       if (ibuf->crect == NULL)
+       {
+#ifdef WITH_LCMS
+               cmsHPROFILE imageProfile, proofingProfile;
+               cmsHTRANSFORM hTransform;
+               
+               ibuf->crect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(int), "imbuf crect");
+
+               imageProfile  = cmsCreate_sRGBProfile();
+               proofingProfile = cmsOpenProfileFromFile(profile, "r");
+               
+               cmsErrorAction(LCMS_ERROR_SHOW);
+       
+               hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8, 
+                                                 proofingProfile,
+                                                 INTENT_ABSOLUTE_COLORIMETRIC,
+                                                 INTENT_ABSOLUTE_COLORIMETRIC,
+                                                 cmsFLAGS_SOFTPROOFING);
+       
+               cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y);
+       
+               cmsDeleteTransform(hTransform);
+               cmsCloseProfile(imageProfile);
+               cmsCloseProfile(proofingProfile);
+#else
+               ibuf->crect = ibuf->rect;
+#endif
+       }
+}
+
 
 void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
 {
index 9d2830983e19aaae6f049e0c4a3a093a33f0caba..ae541365b1ebd5a384e529da08240724a0629a48 100644 (file)
@@ -38,6 +38,7 @@
 #include "RNA_access.h"
 
 #include "BLI_listbase.h"
+#include "BLI_string.h"
 
 #include "BKE_context.h"
 #include "BKE_main.h"
@@ -58,6 +59,7 @@ struct bContext {
                struct ScrArea *area;
                struct ARegion *region;
                struct ARegion *menu;
+               struct bContextStore *store;
        } wm;
        
        /* data context */
@@ -97,6 +99,69 @@ void CTX_free(bContext *C)
        MEM_freeN(C);
 }
 
+/* store */
+
+bContextStore *CTX_store_add(ListBase *contexts, char *name, PointerRNA *ptr)
+{
+       bContextStoreEntry *entry;
+       bContextStore *ctx, *lastctx;
+
+       /* ensure we have a context to put the entry in, if it was already used
+        * we have to copy the context to ensure */
+       ctx= contexts->last;
+
+       if(!ctx || ctx->used) {
+               if(ctx) {
+                       lastctx= ctx;
+                       ctx= MEM_dupallocN(lastctx);
+                       BLI_duplicatelist(&ctx->entries, &lastctx->entries);
+               }
+               else
+                       ctx= MEM_callocN(sizeof(bContextStore), "bContextStore");
+
+               BLI_addtail(contexts, ctx);
+       }
+
+       entry= MEM_callocN(sizeof(bContextStoreEntry), "bContextStoreEntry");
+       BLI_strncpy(entry->name, name, sizeof(entry->name));
+       entry->ptr= *ptr;
+
+       BLI_addtail(&ctx->entries, entry);
+
+       return ctx;
+}
+
+void CTX_store_set(bContext *C, bContextStore *store)
+{
+       C->wm.store= store;
+}
+
+bContextStore *CTX_store_copy(bContextStore *store)
+{
+       bContextStore *ctx;
+
+       ctx= MEM_dupallocN(store);
+       BLI_duplicatelist(&ctx->entries, &store->entries);
+
+       return ctx;
+}
+
+void CTX_store_free(bContextStore *store)
+{
+       BLI_freelistN(&store->entries);
+       MEM_freeN(store);
+}
+
+void CTX_store_free_list(ListBase *contexts)
+{
+       bContextStore *ctx;
+
+       while((ctx= contexts->first)) {
+               BLI_remlink(contexts, ctx);
+               CTX_store_free(ctx);
+       }
+}
+
 /* window manager context */
 
 wmWindowManager *CTX_wm_manager(const bContext *C)
@@ -225,19 +290,31 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
 
        /* we check recursion to ensure that we do not get infinite
         * loops requesting data from ourselfs in a context callback */
-       if(!done && recursion < 1 && C->wm.region) {
+       if(!done && recursion < 1 && C->wm.store) {
+               bContextStoreEntry *entry;
+
                C->data.recursion= 1;
+
+               for(entry=C->wm.store->entries.first; entry; entry=entry->next) {
+                       if(strcmp(entry->name, member) == 0) {
+                               result->ptr= entry->ptr;
+                               done= 1;
+                       }
+               }
+       }
+       if(!done && recursion < 2 && C->wm.region) {
+               C->data.recursion= 2;
                if(C->wm.region->type && C->wm.region->type->context)
                        done= C->wm.region->type->context(C, member, result);
        }
-       if(!done && recursion < 2 && C->wm.area) {
-               C->data.recursion= 2;
+       if(!done && recursion < 3 && C->wm.area) {
+               C->data.recursion= 3;
                if(C->wm.area->type && C->wm.area->type->context)
                        done= C->wm.area->type->context(C, member, result);
        }
-       if(!done && recursion < 3 && C->wm.screen) {
+       if(!done && recursion < 4 && C->wm.screen) {
                bContextDataCallback cb= C->wm.screen->context;
-               C->data.recursion= 3;
+               C->data.recursion= 4;
                if(cb)
                        done= cb(C, member, result);
        }
index cade555a07ab87adae3e0828217414213c39db4f..ad8115ba9aaf487c62b6ce884df2558944bdfaeb 100644 (file)
@@ -164,7 +164,7 @@ FCurve *list_find_fcurve (ListBase *list, const char rna_path[], const int array
        /* check paths of curves, then array indices... */
        for (fcu= list->first; fcu; fcu= fcu->next) {
                /* simple string-compare (this assumes that they have the same root...) */
-               if (strcmp(fcu->rna_path, rna_path) == 0) {
+               if (fcu->rna_path && !strcmp(fcu->rna_path, rna_path)) {
                        /* now check indicies */
                        if (fcu->array_index == array_index)
                                return fcu;
@@ -210,8 +210,10 @@ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
                                BezTriple *bezt;
                                
                                for (bezt=fcu->bezt, i=0; i < fcu->totvert; bezt++, i++) {
-                                       yminv= MIN2(yminv, bezt->vec[1][1]);
-                                       ymaxv= MAX2(ymaxv, bezt->vec[1][1]);
+                                       if (bezt->vec[1][1] < yminv)
+                                               yminv= bezt->vec[1][1];
+                                       if (bezt->vec[1][1] > ymaxv)
+                                               ymaxv= bezt->vec[1][1];
                                }
                        }
                }
@@ -227,8 +229,10 @@ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
                                FPoint *fpt;
                                
                                for (fpt=fcu->fpt, i=0; i < fcu->totvert; fpt++, i++) {
-                                       yminv= MIN2(yminv, fpt->vec[1]);
-                                       ymaxv= MAX2(ymaxv, fpt->vec[1]);
+                                       if (fpt->vec[1] < yminv)
+                                               yminv= fpt->vec[1];
+                                       if (fpt->vec[1] > ymaxv)
+                                               ymaxv= fpt->vec[1];
                                }
                        }
                }
@@ -1044,17 +1048,22 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
        lastbezt= prevbezt + a;
        
        /* evaluation time at or past endpoints? */
-       if (prevbezt->vec[1][0] >= evaltime) {
+       if (prevbezt->vec[1][0] >= evaltime) 
+       {
                /* before or on first keyframe */
-               if ((fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (prevbezt->ipo != BEZT_IPO_CONST)) {
+               if ( (fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (prevbezt->ipo != BEZT_IPO_CONST) &&
+                       !(fcu->flag & FCURVE_DISCRETE_VALUES) ) 
+               {
                        /* linear or bezier interpolation */
-                       if (prevbezt->ipo==BEZT_IPO_LIN) {
+                       if (prevbezt->ipo==BEZT_IPO_LIN) 
+                       {
                                /* Use the next center point instead of our own handle for
                                 * linear interpolated extrapolate 
                                 */
                                if (fcu->totvert == 1) 
                                        cvalue= prevbezt->vec[1][1];
-                               else {
+                               else 
+                               {
                                        bezt = prevbezt+1;
                                        dx= prevbezt->vec[1][0] - evaltime;
                                        fac= bezt->vec[1][0] - prevbezt->vec[1][0];
@@ -1068,7 +1077,8 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
                                                cvalue= prevbezt->vec[1][1];
                                }
                        } 
-                       else {
+                       else 
+                       {
                                /* Use the first handle (earlier) of first BezTriple to calculate the
                                 * gradient and thus the value of the curve at evaltime
                                 */
@@ -1084,24 +1094,30 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
                                        cvalue= prevbezt->vec[1][1];
                        }
                }
-               else {
+               else 
+               {
                        /* constant (BEZT_IPO_HORIZ) extrapolation or constant interpolation, 
                         * so just extend first keyframe's value 
                         */
                        cvalue= prevbezt->vec[1][1];
                }
        }
-       else if (lastbezt->vec[1][0] <= evaltime) {
+       else if (lastbezt->vec[1][0] <= evaltime) 
+       {
                /* after or on last keyframe */
-               if ((fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (lastbezt->ipo != BEZT_IPO_CONST)) {
+               if ( (fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (lastbezt->ipo != BEZT_IPO_CONST) &&
+                       !(fcu->flag & FCURVE_DISCRETE_VALUES) ) 
+               {
                        /* linear or bezier interpolation */
-                       if (lastbezt->ipo==BEZT_IPO_LIN) {
+                       if (lastbezt->ipo==BEZT_IPO_LIN) 
+                       {
                                /* Use the next center point instead of our own handle for
                                 * linear interpolated extrapolate 
                                 */
                                if (fcu->totvert == 1) 
                                        cvalue= lastbezt->vec[1][1];
-                               else {
+                               else 
+                               {
                                        prevbezt = lastbezt - 1;
                                        dx= evaltime - lastbezt->vec[1][0];
                                        fac= lastbezt->vec[1][0] - prevbezt->vec[1][0];
@@ -1115,7 +1131,8 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
                                                cvalue= lastbezt->vec[1][1];
                                }
                        } 
-                       else {
+                       else 
+                       {
                                /* Use the gradient of the second handle (later) of last BezTriple to calculate the
                                 * gradient and thus the value of the curve at evaltime
                                 */
@@ -1131,24 +1148,30 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
                                        cvalue= lastbezt->vec[1][1];
                        }
                }
-               else {
+               else 
+               {
                        /* constant (BEZT_IPO_HORIZ) extrapolation or constant interpolation, 
                         * so just extend last keyframe's value 
                         */
                        cvalue= lastbezt->vec[1][1];
                }
        }
-       else {
+       else 
+       {
                /* evaltime occurs somewhere in the middle of the curve */
-               for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++) {  
+               for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++) 
+               {  
                        /* evaltime occurs within the interval defined by these two keyframes */
-                       if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime)) {
+                       if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime)) 
+                       {
                                /* value depends on interpolation mode */
-                               if (prevbezt->ipo == BEZT_IPO_CONST) {
+                               if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES))
+                               {
                                        /* constant (evaltime not relevant, so no interpolation needed) */
                                        cvalue= prevbezt->vec[1][1];
                                }
-                               else if (prevbezt->ipo == BEZT_IPO_LIN) {
+                               else if (prevbezt->ipo == BEZT_IPO_LIN) 
+                               {
                                        /* linear - interpolate between values of the two keyframes */
                                        fac= bezt->vec[1][0] - prevbezt->vec[1][0];
                                        
@@ -1160,7 +1183,8 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
                                        else
                                                cvalue= prevbezt->vec[1][1];
                                }
-                               else {
+                               else 
+                               {
                                        /* bezier interpolation */
                                                /* v1,v2 are the first keyframe and its 2nd handle */
                                        v1[0]= prevbezt->vec[1][0];
index 43791e32b3805693ed49edbf563d69afd018d04f..9c5560be8f3bf7255bd8bcc514dad26e80c467f0 100644 (file)
@@ -160,7 +160,7 @@ static AdrBit2Path ma_mode_bits[]= {
 //     ...
        {MA_RAYTRANSP, "raytrace_transparency.enabled", 0},
        {MA_RAYMIRROR, "raytrace_mirror.enabled", 0},
-       {MA_HALO, "halo.enabled", 0}
+//     {MA_HALO, "type", MA_TYPE_HALO}
 };
 
 /* ----------------- */
@@ -1169,7 +1169,7 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
                if (G.f & G_DEBUG) printf("\tconvert bitflag ipocurve, totbits = %d \n", totbits);
                
                /* add the 'only int values' flag */
-               fcu->flag |= FCURVE_INT_VALUES;         
+               fcu->flag |= (FCURVE_INT_VALUES|FCURVE_DISCRETE_VALUES);                
                
                /* for each bit we have to remap + check for:
                 * 1) we need to make copy the existing F-Curve data (fcu -> fcurve),
index d0e4c1a15bcbf4b4dea42c2e00ce2c0574a89d15..90ab4e05d440ce2b18d8966e7431dc2a1d1794ed 100644 (file)
@@ -142,6 +142,12 @@ void id_us_plus(ID *id)
        }
 }
 
+void id_us_min(ID *id)
+{
+       if(id)
+               id->us--;
+}
+
 ListBase *wich_libbase(Main *mainlib, short type)
 {
        switch( type ) {
index 6578feeeed17d8c985c7baeaab39473830eb317a..d02b660d99262c2361191838137e7d3aaa3171ee 100644 (file)
@@ -4058,17 +4058,15 @@ static void decimateModifier_copyData(ModifierData *md, ModifierData *target)
        tdmd->percent = dmd->percent;
 }
 
-//XXX
-#if 0 
 static DerivedMesh *decimateModifier_applyModifier(
                ModifierData *md, Object *ob, DerivedMesh *derivedData,
   int useRenderParams, int isFinalCalc)
 {
-       DecimateModifierData *dmd = (DecimateModifierData*) md;
+       // DecimateModifierData *dmd = (DecimateModifierData*) md;
        DerivedMesh *dm = derivedData, *result = NULL;
        MVert *mvert;
        MFace *mface;
-       LOD_Decimation_Info lod;
+       // LOD_Decimation_Info lod;
        int totvert, totface;
        int a, numTris;
 
@@ -4090,6 +4088,8 @@ static DerivedMesh *decimateModifier_applyModifier(
                goto exit;
        }
 
+       // XXX
+#if 0
        lod.vertex_buffer= MEM_mallocN(3*sizeof(float)*totvert, "vertices");
        lod.vertex_normal_buffer= MEM_mallocN(3*sizeof(float)*totvert, "normals");
        lod.triangle_index_buffer= MEM_mallocN(3*sizeof(int)*numTris, "trias");
@@ -4174,11 +4174,14 @@ static DerivedMesh *decimateModifier_applyModifier(
        MEM_freeN(lod.vertex_buffer);
        MEM_freeN(lod.vertex_normal_buffer);
        MEM_freeN(lod.triangle_index_buffer);
+#else
+       modifier_setError(md, "Modifier not working yet in 2.5.");
+       goto exit;
+#endif
 
 exit:
                return result;
 }
-#endif
 
 /* Smooth */
 
@@ -8271,7 +8274,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
                mti->flags = eModifierTypeFlag_AcceptsMesh;
                mti->initData = decimateModifier_initData;
                mti->copyData = decimateModifier_copyData;
-               //XXX mti->applyModifier = decimateModifier_applyModifier;
+               mti->applyModifier = decimateModifier_applyModifier;
 
                mti = INIT_TYPE(Smooth);
                mti->type = eModifierTypeType_OnlyDeform;
index dfd83a7b42ef4e88f4b6670046d6076d1190d0a3..244c2711e63c33d5c26659087450cae5e9cd001f 100644 (file)
@@ -59,16 +59,26 @@ static const int multires_max_levels = 13;
 static const int multires_quad_tot[] = {4, 9, 25, 81, 289, 1089, 4225, 16641, 66049, 263169, 1050625, 4198401, 16785409};
 static const int multires_side_tot[] = {2, 3, 5,  9,  17,  33,   65,   129,   257,   513,    1025,    2049,    4097};
 
-int multiresModifier_switch_level(Object *ob, const int distance)
+MultiresModifierData *find_multires_modifier(Object *ob)
 {
-       ModifierData *md = NULL;
+       ModifierData *md;
        MultiresModifierData *mmd = NULL;
 
        for(md = ob->modifiers.first; md; md = md->next) {
-               if(md->type == eModifierType_Multires)
+               if(md->type == eModifierType_Multires) {
                        mmd = (MultiresModifierData*)md;
+                       break;
+               }
        }
 
+       return mmd;
+
+}
+
+int multiresModifier_switch_level(Object *ob, const int distance)
+{
+       MultiresModifierData *mmd = find_multires_modifier(ob);
+
        if(mmd) {
                mmd->lvl += distance;
                if(mmd->lvl < 1) mmd->lvl = 1;
index b913651d8561e1bd25064d56d139f9b4aa8d8598..d7619010808a4f4f8ecfcd2f3e69860ac57443bb 100644 (file)
@@ -1320,6 +1320,18 @@ void make_local_object(Object *ob)
        expand_local_object(ob);
 }
 
+/* returns true if the Object data is a from an external blend file (libdata) */
+int object_data_is_libdata(Object *ob)
+{
+       if(!ob) return 0;
+       if(ob->proxy) return 0;
+       if(ob->id.lib) return 1;
+       if(!ob->data) return 0;
+       if(((ID *)ob->data)->lib) return 1;
+
+       return 0;
+}
+
 /* *************** PROXY **************** */
 
 /* when you make proxy, ensure the exposed layers are extern */
index 30bb4d11450dfee96584405599375cb4c22a7e8f..787579250ed6ff3c8070d1df0e804c85e325a08e 100644 (file)
@@ -402,7 +402,7 @@ int AabbIntersectAabb(float min1[3], float max1[3], float min2[3], float max2[3]
 void VecfCubicInterpol(float *x1, float *v1, float *x2, float *v2, float t, float *x, float *v);
 void PointInQuad2DUV(float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv);
 void PointInFace2DUV(int isquad, float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv);
-int IsPointInTri2D(float v0[2], float v1[2], float v2[2], float pt[2]);
+int IsPointInTri2D(float v1[2], float v2[2], float v3[2], float pt[2]);
 int IsPointInTri2DInts(int x1, int y1, int x2, int y2, int a, int b);
 int point_in_tri_prism(float p[3], float v1[3], float v2[3], float v3[3]);
 
index 2368f0cd2ba44446dee541cab85c5dd68cac338a..f111e94a141047c4f2f234f1b4f9813224649d24 100644 (file)
@@ -4515,6 +4515,21 @@ void PointInFace2DUV(int isquad, float v0[2], float v1[2], float v2[2], float v3
        }
 }
 
+int IsPointInTri2D(float v1[2], float v2[2], float v3[2], float pt[2])
+{
+       float inp1, inp2, inp3;
+       
+       inp1= (v2[0]-v1[0])*(v1[1]-pt[1]) + (v1[1]-v2[1])*(v1[0]-pt[0]);
+       inp2= (v3[0]-v2[0])*(v2[1]-pt[1]) + (v2[1]-v3[1])*(v2[0]-pt[0]);
+       inp3= (v1[0]-v3[0])*(v3[1]-pt[1]) + (v3[1]-v1[1])*(v3[0]-pt[0]);
+       
+       if(inp1<=0.0f && inp2<=0.0f && inp3<=0.0f) return 1;
+       if(inp1>=0.0f && inp2>=0.0f && inp3>=0.0f) return 1;
+       
+       return 0;
+}
+
+#if 0
 int IsPointInTri2D(float v0[2], float v1[2], float v2[2], float pt[2])
 {
                /* not for quads, use for our abuse of LineIntersectsTriangleUV */
@@ -4542,6 +4557,7 @@ int IsPointInTri2D(float v0[2], float v1[2], float v2[2], float pt[2])
                /* Doing this in 3D is not nice */
                return LineIntersectsTriangle(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, uv);
 }
+#endif
 
 /*
 
index 676a7e32333b7a2325ee5794e33c010babd94db9..ffebd05f2f607f722e509389f4d9eeb4c3dfff2f 100644 (file)
@@ -153,7 +153,7 @@ int BLI_is_writable(char *filename)
 {
        int file;
        
-       file = open(filename, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666);
+       file = open(filename, O_BINARY | O_RDWR, 0666);
        
        if (file < 0)
                return 0;
index 48ba18515deca2745dfa8118cfcb1aaec410c92f..915a93e8e0bf8916fbb59186d35349e4589eddb5 100644 (file)
@@ -88,17 +88,42 @@ void BLI_union_rcti(rcti *rct1, rcti *rct2)
 
 void BLI_init_rctf(rctf *rect, float xmin, float xmax, float ymin, float ymax)
 {
-       rect->xmin= xmin;
-       rect->xmax= xmax;
-       rect->ymin= ymin;
-       rect->ymax= ymax;
+       if(xmin <= xmax) {
+               rect->xmin= xmin;
+               rect->xmax= xmax;
+       }
+       else {
+               rect->xmax= xmin;
+               rect->xmin= xmax;
+       }
+       if(ymin <= ymax) {
+               rect->ymin= ymin;
+               rect->ymax= ymax;
+       }
+       else {
+               rect->ymax= ymin;
+               rect->ymin= ymax;
+       }
 }
+
 void BLI_init_rcti(rcti *rect, int xmin, int xmax, int ymin, int ymax)
 {
-       rect->xmin= xmin;
-       rect->xmax= xmax;
-       rect->ymin= ymin;
-       rect->ymax= ymax;
+       if(xmin <= xmax) {
+               rect->xmin= xmin;
+               rect->xmax= xmax;
+       }
+       else {
+               rect->xmax= xmin;
+               rect->xmin= xmax;
+       }
+       if(ymin <= ymax) {
+               rect->ymin= ymin;
+               rect->ymax= ymax;
+       }
+       else {
+               rect->ymax= ymin;
+               rect->ymin= ymax;
+       }
 }
 
 void BLI_translate_rcti(rcti *rect, int x, int y)
index fd9da2059e1ea55a2cc4c58a40fde9705b586fa6..f8657125014c888a9263ed164d04c3232397bc8a 100644 (file)
@@ -2176,9 +2176,12 @@ static void direct_link_constraints(FileData *fd, ListBase *lb)
                
                if (cons->type == CONSTRAINT_TYPE_PYTHON) {
                        bPythonConstraint *data= cons->data;
+                       
                        link_list(fd, &data->targets);
+                       
                        data->prop = newdataadr(fd, data->prop);
-                       IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
+                       if (data->prop)
+                               IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
                }
        }
 }
@@ -3417,7 +3420,13 @@ static void direct_link_pose(FileData *fd, bPose *pose)
                pchan->bone= NULL;
                pchan->parent= newdataadr(fd, pchan->parent);
                pchan->child= newdataadr(fd, pchan->child);
+               
                direct_link_constraints(fd, &pchan->constraints);
+               
+               pchan->prop = newdataadr(fd, pchan->prop);
+               if (pchan->prop)
+                       IDP_DirectLinkProperty(pchan->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
+               
                pchan->iktree.first= pchan->iktree.last= NULL;
                pchan->path= NULL;
        }
@@ -4646,6 +4655,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
                                        direct_link_gpencil(fd, sima->gpd);
                                if(sima->cumap)
                                        direct_link_curvemapping(fd, sima->cumap);
+                               sima->iuser.scene= NULL;
                                sima->iuser.ok= 1;
                        }
                        else if(sl->spacetype==SPACE_NODE) {
@@ -5641,7 +5651,6 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                        {
                                SpaceButs *sbuts= (SpaceButs *)sl;
                                memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D));
-                               ar->v2d.keepzoom |= V2D_KEEPASPECT;
                                break;
                        }
                        case SPACE_FILE:
@@ -8904,6 +8913,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
           bump the version (or sub-version.) */
        {
                Object *ob;
+               Material *ma;
                int i;
 
                for(ob = main->object.first; ob; ob = ob->id.next) {
@@ -8969,6 +8979,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                ob->data = olddata;
                        }
                }
+
+               for(ma = main->mat.first; ma; ma = ma->id.next) {
+                       if(ma->mode & MA_HALO) {
+                               ma->material_type= MA_TYPE_HALO;
+                               ma->mode &= ~MA_HALO;
+                       }
+               }
        }
 
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
index b690c708dc37853232e6a9ff0ff7d70cb8adc6aa..943e23861adc2c086468a351837d355af380084b 100644 (file)
@@ -956,6 +956,11 @@ static void write_pose(WriteData *wd, bPose *pose)
 
        /* Write channels */
        for (chan=pose->chanbase.first; chan; chan=chan->next) {
+               /* Write ID Properties -- and copy this comment EXACTLY for easy finding
+                of library blocks that implement this.*/
+               if (chan->prop)
+                       IDP_WriteProperty(chan->prop, wd);
+               
                write_constraints(wd, &chan->constraints);
                
                /* prevent crashes with autosave, when a bone duplicated in editmode has not yet been assigned to its posechannel */
index 67f89b3358df22952356d2770964a687ecac4fb6..afad396607bfb6991b23d388d649e27cb82863ad 100644 (file)
@@ -754,7 +754,17 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads,
                Material *ma= give_current_material(ob, a);
                
                /* for now, if no material returned, skip (this shouldn't confuse the user I hope) */
-               if (ELEM3(NULL, ma, ma->adt, ma->adt->action)) continue;
+               if (ELEM(NULL, ma, ma->adt)) 
+                       continue;
+               
+               if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) {
+                       if (ANIMDATA_HAS_KEYS(ma) == 0)
+                               continue;
+               }
+               else {
+                       if (ANIMDATA_HAS_DRIVERS(ma) == 0)
+                               continue;
+               }
                
                /* make a temp list elem for this */
                ld= MEM_callocN(sizeof(LinkData), "DopeSheet-MaterialCache");
@@ -791,10 +801,16 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads,
                                }
                        }
                        
-                       /* add material's F-Curve channels? */
+                       /* add material's F-Curve or Driver channels? */
                        if (FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) {
+                               if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) {
                                        // XXX the 'owner' info here is still subject to improvement
-                               items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);
+                                       items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);
+                               }
+                               else {
+                                       // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?)
+                                       items += animdata_filter_fcurves(anim_data, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);
+                               }       
                        }
                }
        }
index 4d4079a260ad3f2363d1598b9376be2c190d1ceb..c2a1199f6c69029b58c624c2800e07292642da2a 100644 (file)
@@ -148,12 +148,6 @@ void getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
                        
                        /* Array Index - only if applicable */
                        if (RNA_property_array_length(prop)) {
-                                       // XXX the format of these is not final... we don't know how this will go yet
-                                       // format 1 style
-                               //static char *vectoritem[4]= {".X", ".Y", ".Z", ".W"};
-                               //static char *quatitem[4]= {".W", ".X", ".Y", ".Z"};
-                               //static char *coloritem[4]= {".R", ".G", ".B", ".A"};
-                                       // format 2 style
                                static char *vectoritem[4]= {"X ", "Y ", "Z ", "W "};
                                static char *quatitem[4]= {"W ", "X ", "Y ", "Z "};
                                static char *coloritem[4]= {"R ", "G ", "B ", "A "};
@@ -181,8 +175,7 @@ void getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
                        
                        /* putting this all together into the buffer */
                        // XXX we need to check for invalid names...
-                       //BLI_snprintf(name, 128, "%s.%s%s", structname, propname, arrayname);  // format 1
-                       BLI_snprintf(name, 128, "%s%s (%s)", arrayname, propname, structname);  // format 2
+                       BLI_snprintf(name, 128, "%s%s (%s)", arrayname, propname, structname); 
                        
                        /* free temp name if nameprop is set */
                        if (nameprop)
@@ -197,6 +190,7 @@ void getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
 
 /* ------------------------------- Color Codes for F-Curve Channels ---------------------------- */
 
+#if 0
 /* used for FCURVE_COLOR_AUTO_RAINBOW */
 // XXX this still doesn't work too great when there are more than 32 curves (which happens most of the time)
 void ipo_rainbow (int cur, int tot, float *out)
@@ -206,14 +200,60 @@ void ipo_rainbow (int cur, int tot, float *out)
        dfac= (float)(1.0/( (float)tot+1.0));
        
        /* this calculation makes 2 or 4 different cycles of rainbow colors */
+               // 2 different cycles - for hue
        if(cur< tot/2) fac= (float)(cur*2.0f*dfac);
        else fac= (float)((cur-tot/2)*2.0f*dfac +dfac);
+       
+               // third cycle with altered hue
        if(tot > 32) fac= fac*1.95f;
+               // clamping for excessive ranges
        if(fac>1.0f) fac-= 1.0f;
        
+               // saturation adjustments for more visible range
        if(fac>0.5f && fac<0.8f) sat= 0.5f;
        else sat= 0.6f;
        
-       //return hsv_to_cpack(fac, sat, 1.0f);
        hsv_to_rgb(fac, sat, 1.0f, out, out+1, out+2);
 }
+#endif
+
+/* step between the major distinguishable color bands of the primary colors */
+#define HSV_BANDWIDTH  0.3f
+
+/* testbed for FCURVE_COLOR_AUTO_RAINBOW determination methods */
+//void fcurve_rainbow (unsigned int cur, unsigned int tot, float *out)
+void ipo_rainbow (int cur, int tot, float *out)
+{
+       float hue, val, sat, fac;
+       int grouping;
+       
+       /* we try to divide the colours into groupings of n colors,
+        * where n is:
+        *      3 - for 'odd' numbers of curves - there should be a majority of triplets of curves
+        *      4 - for 'even' numbers of curves - there should be a majority of quartets of curves
+        * so the base color is simply one of the three primary colors
+        */
+       grouping= (4 - (tot % 2));
+       hue= HSV_BANDWIDTH * (float)(cur % grouping);
+       
+       /* 'Value' (i.e. darkness) needs to vary so that larger sets of three will be 
+        * 'darker' (i.e. smaller value), so that they don't look that similar to previous ones.
+        * However, only a range of 0.3 to 1.0 is really usable to avoid clashing
+        * with some other stuff 
+        */
+       fac = ((float)cur / (float)tot) * 0.7f;
+       
+       /* the base color can get offset a bit so that the colors aren't so identical */
+       hue += fac * HSV_BANDWIDTH; 
+       if (hue > 1.0f) hue= fmod(hue, 1.0f);
+       
+       /* saturation adjustments for more visible range */
+       if ((hue > 0.5f) && (hue < 0.8f)) sat= 0.5f;
+       else sat= 0.6f;
+       
+       /* value is fixed at 1.0f, otherwise we cannot clearly see the curves... */
+       val= 1.0f;
+       
+       /* finally, conver this to RGB colors */
+       hsv_to_rgb(hue, sat, val, out, out+1, out+2); 
+}
index b09cc3b78e196135849fcf605517cac676e2cc83..4a5f9efa9689fd3f091e8ac4e35e5b8718c3ab02 100644 (file)
@@ -29,6 +29,7 @@
 #include "BKE_action.h"
 #include "BKE_constraint.h"
 #include "BKE_fcurve.h"
+#include "BKE_global.h"
 #include "BKE_utildefines.h"
 #include "BKE_context.h"
 #include "BKE_report.h"
@@ -68,6 +69,7 @@ bAction *verify_adt_action (ID *id, short add)
                adt= BKE_id_add_animdata(id);
        if (adt == NULL) { 
                /* if still none (as not allowed to add, or ID doesn't have animdata for some reason) */
+               printf("ERROR: Couldn't add AnimData (ID = %s) \n", (id) ? (id->name) : "<None>");
                return NULL;
        }
                
@@ -726,8 +728,23 @@ short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_
                float curval= 0.0f;
                
                /* set additional flags for the F-Curve (i.e. only integer values) */
-               if (RNA_property_type(prop) != PROP_FLOAT)
-                       fcu->flag |= FCURVE_INT_VALUES;
+               fcu->flag &= ~(FCURVE_INT_VALUES|FCURVE_DISCRETE_VALUES);
+               switch (RNA_property_type(prop)) {
+                       case PROP_FLOAT:
+                               /* do nothing */
+                               break;
+                       case PROP_INT:
+                               /* do integer (only 'whole' numbers) interpolation between all points */
+                               fcu->flag |= FCURVE_INT_VALUES;
+                               break;
+                       default:
+                               /* do 'discrete' (i.e. enum, boolean values which cannot take any intermediate
+                                * values at all) interpolation between all points
+                                *      - however, we must also ensure that evaluated values are only integers still
+                                */
+                               fcu->flag |= (FCURVE_DISCRETE_VALUES|FCURVE_INT_VALUES);
+                               break;
+               }
                
                /* apply special time tweaking */
                        // XXX check on this stuff...
@@ -793,6 +810,9 @@ short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_
                }
        }
        
+       /* no F-Curve to add keyframes to */
+       printf("ERROR: no F-Curve to add keyframes to \n");
+       
        /* return failure */
        return 0;
 }
@@ -993,7 +1013,7 @@ static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *event)
        uiLayout *layout;
        int i = 0;
        
-       pup= uiPupMenuBegin("Insert Keyframe", 0);
+       pup= uiPupMenuBegin(C, "Insert Keyframe", 0);
        layout= uiPupMenuLayout(pup);
        
        /* active Keying Set */
@@ -1203,11 +1223,11 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
        memset(&ptr, 0, sizeof(PointerRNA));
        uiAnimContextProperty(C, &ptr, &prop, &index);
        
-       if(ptr.data && prop && RNA_property_animateable(&ptr, prop)) {
+       if ((ptr.data && prop) && RNA_property_animateable(&ptr, prop)) {
                path= RNA_path_from_ID_to_property(&ptr, prop);
                
-               if(path) {
-                       if(all) {
+               if (path) {
+                       if (all) {
                                length= RNA_property_array_length(prop);
                                
                                if(length) index= 0;
@@ -1216,14 +1236,23 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
                        else
                                length= 1;
                        
-                       for(a=0; a<length; a++)
+                       for (a=0; a<length; a++)
                                success+= insert_keyframe(ptr.id.data, NULL, NULL, path, index+a, cfra, 0);
                        
                        MEM_freeN(path);
                }
+               else {
+                       if (G.f & G_DEBUG)
+                               printf("Button Insert-Key: no path to property \n");
+                       BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property. Try using a Keying Set instead.");
+               }
+       }
+       else if (G.f & G_DEBUG) {
+               printf("ptr.data = %p, prop = %p,", ptr.data, prop);
+               printf("animateable = %d \n", RNA_property_animateable(&ptr, prop));
        }
        
-       if(success) {
+       if (success) {
                /* send updates */
                ED_anim_dag_flush_update(C);    
                
@@ -1267,11 +1296,11 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
        memset(&ptr, 0, sizeof(PointerRNA));
        uiAnimContextProperty(C, &ptr, &prop, &index);
 
-       if(ptr.data && prop) {
+       if (ptr.data && prop) {
                path= RNA_path_from_ID_to_property(&ptr, prop);
                
-               if(path) {
-                       if(all) {
+               if (path) {
+                       if (all) {
                                length= RNA_property_array_length(prop);
                                
                                if(length) index= 0;
@@ -1280,11 +1309,16 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
                        else
                                length= 1;
                        
-                       for(a=0; a<length; a++)
+                       for (a=0; a<length; a++)
                                success+= delete_keyframe(ptr.id.data, NULL, NULL, path, index+a, cfra, 0);
                        
                        MEM_freeN(path);
                }
+               else if (G.f & G_DEBUG)
+                       printf("Button Delete-Key: no path to property \n");
+       }
+       else if (G.f & G_DEBUG) {
+               printf("ptr.data = %p, prop = %p \n", ptr.data, prop);
        }
        
        
index 98f51a4015d0aa247c00e955ee6697b6edb17d66..1c113c25720651d8ebec08d9b0e0cf3a6a556c9e 100644 (file)
@@ -3461,7 +3461,7 @@ static int armature_subdivs_invoke(bContext *C, wmOperator *op, wmEvent *event)
        uiPopupMenu *pup;
        uiLayout *layout;
 
-       pup= uiPupMenuBegin("Subdivision Type", 0);
+       pup= uiPupMenuBegin(C, "Subdivision Type", 0);
        layout= uiPupMenuLayout(pup);
        uiItemsEnumO(layout, "ARMATURE_OT_subdivs", "type");
        uiPupMenuEnd(C, pup);
@@ -3744,7 +3744,7 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op)
 static int armature_parent_set_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
        EditBone *actbone = CTX_data_active_bone(C);
-       uiPopupMenu *pup= uiPupMenuBegin("Make Parent ", 0);
+       uiPopupMenu *pup= uiPupMenuBegin(C, "Make Parent ", 0);
        uiLayout *layout= uiPupMenuLayout(pup);
        int allchildbones = 0;
        
index 43590346299ee3e4f20aa4054dbeaa365ddfe6fd..8cbfebebff6f942d5d3743b77fe405917b4fc3bc 100644 (file)
@@ -326,9 +326,9 @@ static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt)
                return OPERATOR_CANCELLED;
        
        /* start building */
-       pup= uiPupMenuBegin(op->type->name, 0);
+       pup= uiPupMenuBegin(C, op->type->name, 0);
        layout= uiPupMenuLayout(pup);
-       uiLayoutContext(layout, WM_OP_EXEC_DEFAULT);
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
        
        /* add new (adds to the first unoccupied frame) */
        uiItemIntO(layout, "Add New", 0, "POSELIB_OT_pose_add", "frame", poselib_get_free_index(ob->poselib));
@@ -460,9 +460,9 @@ static int poselib_stored_pose_menu_invoke (bContext *C, wmOperator *op, wmEvent
                return OPERATOR_CANCELLED;
        
        /* start building */
-       pup= uiPupMenuBegin(op->type->name, 0);
+       pup= uiPupMenuBegin(C, op->type->name, 0);
        layout= uiPupMenuLayout(pup);
-       uiLayoutContext(layout, WM_OP_EXEC_DEFAULT);
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
        
        /* add each marker to this menu */
        for (marker=act->markers.first, i=0; marker; marker= marker->next, i++)
index 49d86d08db22470df61465da7e1c06219ebf14db..5292d86d3c9ab1385a0e6f63f2a98bc8151845c9 100644 (file)
@@ -70,7 +70,7 @@ static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
        uiPopupMenu *pup;
        uiLayout *layout;
 
-       pup= uiPupMenuBegin("Specials", 0);
+       pup= uiPupMenuBegin(C, "Specials", 0);
        layout= uiPupMenuLayout(pup);
        uiItemO(layout, NULL, 0, "CURVE_OT_subdivide");
        uiItemO(layout, NULL, 0, "CURVE_OT_switch_direction");
index c60007680baf335e4d868deaff3b5003a560a757..45b9a589bd51d5f32ba2928e4b2f0143471d373a 100644 (file)
@@ -3567,7 +3567,7 @@ static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *event)
        for(nu= editnurb->first; nu; nu= nu->next) {
                if(nu->pntsu>1 || nu->pntsv>1) {
                        if(nu->type==CU_NURBS) {
-                               pup= uiPupMenuBegin("Direction", 0);
+                               pup= uiPupMenuBegin(C, "Direction", 0);
                                layout= uiPupMenuLayout(pup);
                                uiItemsEnumO(layout, op->type->idname, "direction");
                                uiPupMenuEnd(C, pup);
@@ -4511,14 +4511,14 @@ static int delete_invoke(bContext *C, wmOperator *op, wmEvent *event)
        uiLayout *layout;
 
        if(obedit->type==OB_SURF) {
-               pup= uiPupMenuBegin("Delete", 0);
+               pup= uiPupMenuBegin(C, "Delete", 0);
                layout= uiPupMenuLayout(pup);
                uiItemEnumO(layout, NULL, 0, op->type->idname, "type", 0);
                uiItemEnumO(layout, NULL, 0, op->type->idname, "type", 2);
                uiPupMenuEnd(C, pup);
        }
        else {
-               pup= uiPupMenuBegin("Delete", 0);
+               pup= uiPupMenuBegin(C, "Delete", 0);
                layout= uiPupMenuLayout(pup);
                uiItemsEnumO(layout, op->type->idname, "type");
                uiPupMenuEnd(C, pup);
index e3fdee554f7432d8e7bc26935d24a6c39b332210..fa000034caf3061b38731fdbec8c433afcf2f2e1 100644 (file)
 /* DataToC output of file <blenderbuttons> */
 
-int datatoc_blenderbuttons_size= 146052;
+int datatoc_blenderbuttons_size= 177005;
 char datatoc_blenderbuttons[]= {
-137, 80, 78, 71,
- 13, 10, 26, 10,  0,  0,  0, 13, 73, 72, 68, 82,  0,  0,  2, 88,  0,  0,  2,  0,  8,  6,  0,  0,  0, 94,187, 18, 70,  0,  0,  0,
-  4,115, 66, 73, 84,  8,  8,  8,  8,124,  8,100,136,  0,  0,  0,  9,112, 72, 89,115,  0,  0, 13,215,  0,  0, 13,215,  1, 66, 40,
-155,120,  0,  0,  0, 25,116, 69, 88,116, 83,111,102,116,119, 97,114,101,  0,119,119,119, 46,105,110,107,115, 99, 97,112,101, 46,
-111,114,103,155,238, 60, 26,  0,  0, 32,  0, 73, 68, 65, 84,120,156,236,157,119,120, 20,213,254,198,223, 51,101,251,166,147, 30,
- 58,  4,129,208,  3, 74,  2,130,116, 17, 69,184,162,128,160,226,245, 94, 44,168, 88,126,130,  5, 21,  5,162, 94, 21, 69, 17,229,
- 90, 16, 68,175,168, 32,241, 42, 77,  1, 41, 82, 69, 18,138, 92, 74,164,133,146, 72,250,246,153,243,251, 99,119,134,205,102, 91,
- 96,163,128,231,243, 60,243,236, 78,123,231,156,169,239,124, 79, 25, 66, 41, 69, 67, 65,  8,233, 64, 41, 45, 96,154, 76,147,105,
- 50, 77,166,201, 52,153, 38,211,252, 43,193,213,119,  5, 66, 72,196, 29, 25, 33,132,122,134, 62,151,186,102,164,180,188, 53,149,
- 33,130,154,125, 60,154,207, 69, 80,179, 33,211,217,231, 82,213, 84,242, 27, 73, 93,239,125, 24,169,253,233,149,206,136,157,247,
- 13,173,121,177, 90,254, 52, 35,117,142,250, 57,238,207, 69, 80,179, 33,211,217,231, 82,211,244, 61,127, 34,161,235,239,156,188,
-216,253,233, 39,157, 23,125,222,255, 81,154, 23,170, 21, 70, 58, 35,189, 79, 35,254,108,186,148, 17,234,179,112, 67, 24, 12,  0,
-160,148, 18, 47,125,114,169,106, 42, 16, 66,168,162, 31,  9, 34,169,229, 97,109,164, 53,125,246,103,164,120,142, 82, 74,  8, 33,
-235,  0,244,137,144,230, 90,143,230, 69, 31,119,159,188, 70, 68,183, 33,205, 21, 16,185,243,190,161, 53,189,167, 93,204,185,234,
-171, 25,137,243,222,223,113,143,164,102,164,174, 37,159,245, 35,114, 45, 53,196, 57,239,231,252,185,104, 93, 95,205, 72, 92, 75,
-190,154,145, 56,239,255,  8, 77,101,250,197, 92, 75,254, 52, 35,113,222,  7, 58,246, 23,171,123,185, 80,175,  8, 86, 67,238, 24,
-207,  1,232, 27,105,205, 72,167,185, 33, 76,102,164,163, 56, 13,169,137,200, 30,163,231, 60,154,207, 69, 80,179,111,164,142,145,
-239,185, 19,137,183, 46,111,205, 72,157,155,126,210,121,209,199,201,159,230,197,166, 55, 64, 58, 47, 10,127,154, 23,123,222,255,
- 81,154,136,236, 49,138,200,181,228,163, 25,177,107,201, 55,191, 17,140,  8,246,  5, 34,119, 45,249, 73,231, 69, 31, 39,127,154,
- 23,155,222,  0,233,188, 40,252,105, 70, 48, 34, 26,113,221,203,129,122, 69,176, 26,138,134, 48, 66,128,251,162,139,164,118, 67,
- 68,113, 26, 42,210, 22,169, 40,142, 31,221,117, 17,148,139, 88,180, 73,193,147,190,136,188,209,250,209,126,142, 16,242,108,164,
-117, 35,  9,187,150,216,181,132, 75,236, 90,242,119,222, 92,236,181,212, 80, 47,207,222,154,145, 50, 66,126,242,126, 81,215,146,
-239,186,145,184,150, 66,104, 94, 84,132, 57, 80,254, 47, 70,247,114,161,222,117,176, 26,138, 72,148,247,  6,208,139,104, 84, 44,
-210, 52, 80, 58,251, 94, 14,121, 71,  3,164,147, 16,242, 92,  3,229,253,114,217,167,236, 90, 98,215, 82, 68,136,228,181,228,115,
- 78, 70, 36,173,145, 62,207,253,105, 70, 98, 27,222, 26,145, 58, 71, 27, 58,239,145,188,150, 26,226,216, 95, 46,212, 59,130,213,
- 80,111,199,151,131,102, 67,104, 55, 80,222,215,161,  1,222, 14, 26,160, 94,215, 58, 68, 62, 42,240, 28, 34, 88,228,168,228, 57,
-146,105,109,200, 98,194,134, 56, 55, 27,242,124,143,100, 61,143,  6,202,251, 58, 92, 30,199,125, 29, 34,156,206, 72, 93, 75,126,
-142,249, 58, 92,100, 90,253,237,191, 72, 23, 97, 71,242,220,108, 72,205, 72,104, 55, 68, 58,  3,232,174,195, 95, 32,114,165, 64,
-104,  3,118,211,192, 96, 48, 24, 12,  6,131,241, 87, 36, 96,  4,171,107,215,174,249,122,189,190, 85,160,249, 53, 53, 53,197,187,
-118,237,186,174, 97,146,197, 96, 48,174, 36,  8, 33, 28,206, 87, 73,144,  1, 80,202,222,238, 24, 12,198, 21, 76, 64,131,165,209,
-104, 90,172, 95,191, 62, 83,150,101,184, 92, 46, 72,146,  4, 73,146,224,114,185, 96,183,219,241,183,191,253,173,222,197,139,157,
- 59,119, 94,207,113, 92,179,250,172, 35, 73,210,209, 95,126,249,165, 87,160,249,201,201,201,155,  0,180, 32,228,124,212,145, 16,
-  2,101,220,123, 58,199,169, 85,206, 78, 30, 59,118,172,107, 48, 77, 66, 72, 11,111, 61, 95, 45, 63,186, 65, 53,175,186,234,170,
-237,130, 32,100,248, 91, 63,144,182, 44,203,135, 11, 10, 10,114,  2,105, 50, 34, 75,231,206,157,215,243, 60, 95,239,243,115,215,
-174, 93,  1,207,207, 14, 29, 58,252,204,113, 92, 26, 80,247, 24,  7, 56,159,120, 73,146,126,253,229,151, 95,122,  5, 50, 32,169,
-169,169,155, 40,165, 45,194, 60, 47, 21,142, 31, 59,118, 44, 59, 80, 58,149,235, 40, 88, 58,253,104,  7,213,244,210,224,210,211,
-211,243, 18, 19, 19,239,173,169,169,177,  2,160, 28,199,209,118,237,218,213,210,151, 36,233,236,190,125,251, 58,132,210, 99, 48,
- 24,140,203,129,128, 38, 73,150,101,206,102,179,225,192,129,  3,240,119,159,231, 56, 78,170,239,198, 40,165,153,107, 22, 47, 76,
- 50, 36, 38, 67,114,216,161,107,148,164,106,151,237, 45,128,228,112, 64,118, 58,208, 40,251, 26, 37, 13,232,219,183, 47, 31, 66,
- 54, 99,242,228,201, 73, 81, 81, 81,176, 90,173,176, 90,173,176,217,108,176,217,108,176,219,237,176,219,237,112, 56, 28,112, 56,
- 28,112, 58,157,176,217,108, 40, 40, 40,  8,154,118, 66, 72,198,131, 15, 62,168,106,218,108, 54, 88,173, 86, 85,203,102,179,169,
-154,118,187, 29, 54,155, 13,123,246,236,  9,170, 41,  8, 66,198,206,157, 59,147, 52, 26, 13, 40,165,144,101, 25,148,210, 90,131,
-207,190, 66,110,110,174, 35,212, 62,101, 68,148,204,165, 47,205, 72,210, 37, 52,130,236,116, 34,161,115, 55,  0,238, 99,113, 98,
-205,119,144,157, 78,200, 78, 39,154,222, 56, 82,157,222,167, 79,159, 80,231,103,211, 47,166, 77,141,213, 68, 69,193,101,181,162,
-249,176, 17,234,140,194,119, 94,  7,117, 58, 65, 93, 14,116,124,228,105,  0, 64, 73, 73,137,165,109,219,182, 39,225,174,167, 16,
- 40,194,147,113,228,200,145, 36, 37, 13,222, 16, 66,192,113, 92,173, 97,195,134, 13, 24, 55,110, 92,168,188,103, 60,245,212, 83,
- 73,202, 53,226,125,174, 59,157, 78,245,250,113,185, 92,112, 58,157,176,219,237,248,249,231,159, 67,105,130, 16,194,165,166,166,
-190,212,187,119,239,  9,139, 22, 45, 50,125,245,213, 87,166,230,205,155, 67,163,209,128,231,121,240, 60, 15,142,227,192,243, 60,
-134, 15, 31,254,151,169,155,193, 96, 48,174,124,  2, 26, 44,135,195,113,100,208,160, 65, 20,  0,236,118,123,186, 86,171,213,120,
-207,151,101, 57, 45, 55, 55,247, 87,223,245, 66, 21, 29, 26, 18,147,241, 65,243,120,  0,192,168, 67,165,  0,220, 15,133, 37,215,
-118, 81,151, 25,243, 91,185,123, 89,131,  1, 28,199,  5,189,233, 18, 66, 96, 54,155, 49,104,208, 32,104,181, 90,116,235,214, 13,
- 26,141,  6,162, 40,  6, 28,194,193,100, 50,225,249,231,159,  7,  0,  8,130,  0,147, 94,135,251,122, 95,  3, 61,161,248,224,151,
-253,176, 73, 50,  4, 65,128, 32,  8, 16, 69,177, 78, 68,202, 31, 26,141,  6,  5,  5,  5,224,121, 30,130, 32,212,250,229,121, 30,
-203,151, 47,199, 45,183,220,  2,158,231, 97, 52, 26,129,191, 80,101,192, 75,  5, 93, 66, 35,124,209,199, 29,136,188,253, 88,165,
- 58,253,187,209, 55,170,255,199,159,168,  6, 33,  4, 26,141, 38,188,227, 30, 21,133,255,222,114, 61,  0, 96,228,129, 51,234, 57,
-179,251,245, 25, 16,181, 90,  8,162,  6, 29, 38, 63,133,146,146, 18,203,200,145, 35, 55,232,245,250, 21,161, 52, 41,165, 56,122,
-244,168,170, 37,138, 98,157,243,158,227, 56,124,248,225,135,248,237,183,223,194,202,187,197, 98,193,204,153, 51,213,188,249,211,
-245,254, 31, 42,239,132, 16, 46, 37, 37,229,197,222,189,123,143, 91,180,104, 81, 28, 33,  4,115,231,206,133, 32,  8,184,225,134,
- 27,144,144,144,128,149, 43, 87, 66,163,209,224,241,199, 31, 15, 43,141, 12,  6,131,113,185, 16,208, 96,237,218,181,235,122,229,
-255, 53,215, 92,179,111,195,134, 13, 87,121,133,242,225,114,185, 52, 46,151, 43, 83, 41, 54,116,185, 92,176,217,108, 24, 51,102,
- 76,208, 55,122,201, 97,175, 53, 30,232, 38, 29,206,131, 75,193,110,183, 99,212,168, 81,  0, 16,210, 92,133,249, 96,128,205,102,
-131, 32,  8,104,217, 36, 17, 79,143,202, 70, 46, 79, 97, 41,  5, 80, 82,141, 59, 83,  5,236,202,200,196,156,163,165,248,173,162,
- 10,130, 16, 94,105,169, 44,203,181, 12,149,239,255,121,243,230, 97,244,232,209,224,121,190, 78, 17, 18,227,143, 65,118, 58,107,
-141,251, 59,  6,245, 61, 54, 46,171, 21,  0,192,123, 25,114, 81, 20,161,213,235,193,139, 34,  4,173,  6, 37, 37, 37,150,129,  3,
-  7,254,100, 48, 24, 22,164,164,164,156, 56,126,252,120, 64, 61, 66,  8, 40,165, 16, 69, 17,130, 32,  4, 60,231, 63,252,240, 67,
- 44, 92,184, 16, 61,122,244,  8,235,156,183,219,237,208,104, 52,152, 49, 99, 70,157,249,239,188,243, 78, 29,131, 21, 66,143,  0,
-224,146,147,147,239, 91,188,120,113,180,178,253,132,132,  4,136,162,136,172,172, 44, 68, 69, 69, 97,195,134, 13,144, 36, 41,108,
-179,202, 96, 48,254,178,136,  0, 58,  3, 72,  4, 32,  1,168,  4, 16,235, 53,255,172,231, 55,209,107,124,155, 31,157,238,158,101,
-148,249,202,184, 29,128,214,207,244, 82,  0,  6,207, 96,  3,176,  9, 64,150,215,118,148,245,188,211,177, 13,240, 24, 44,226,238,
- 85,117, 45,128,190,254, 58,191, 83,138, 11,247,239,223,239,183,184,208,155, 80,205, 59,117,141,146,212,200,213,231, 45, 19,212,
-233,163,139,202,212, 27,236,127,123,180,134,206,108, 66,246,115,175,  4,221,150, 39,237,176,219,237, 56,115,230, 76,157, 55,239,
- 11, 53, 88,  0,224,116, 58, 97, 48,232,240,195,187,215,162,248,176, 11, 51,242,143, 97,217,214, 35, 16,  4,  1,195,174,106,141,
-191,185,128,188,120, 61,254,233,146,224,144,105, 88, 15, 48, 74,105, 29,115,229,109,178,  8, 33,234, 52,246,176,249,115, 72,232,
-220, 77,141, 92, 45,106, 28,165, 78, 87,162, 86,  0,176,172, 75, 51,232,163,204,200,122,104, 74, 72, 61, 66,  8,154, 15, 27,161,
- 70,174,190,233,214,  2,130, 70,  3, 81,167,197,223,126, 57,  6,192, 93, 44,216,175, 99,187,117,101,188,246,163, 59,238,184,227,
-240,154, 53,107,140,225,164, 85,163,209,212, 50,108,254,204,149, 32,  8,112,250,152,198, 64,233,180,217,108,  1,141,147,114, 93,
-213, 39,130,  5,  0, 53, 53, 53,246,101,203,150, 97,206,156, 57, 72, 72, 72,192,160, 65,131,144,146,146,130, 37, 75,150,128, 82,
-138,  7, 30,120,  0,  6,131,  1,  6,131,129,157,243, 12,198, 95,156, 16, 94,228,218,169, 83,167,102,231,229,229,205,236,217,179,
-231,167,155, 54,109, 90, 76,  8,201, 87,102, 82, 74,135,121, 52,242,189,198,187,163,182,201, 18,  1, 36, 18, 66,242,149,229,189,
-199,189,166, 15,  0,160, 85,198,167, 78,157,154,149,151,151, 55,115,202,148, 41, 79,206,154, 53, 75, 51,117,234,212,142,121,121,
-121, 51,149,237,248, 75,  7,112, 62,130, 21,180, 23, 96,135,195,113,100,192,128,  1, 97,181,248,177, 88, 44,167,130,205, 87, 12,
-154,191, 74,222,202, 52, 93,148, 25,134,168, 40,144,224,165,131, 42, 78,167, 19,130, 32,128,227, 56,172, 90,181, 10,  6,131,  1,
- 67,135, 14,189,224, 34, 66,197,180,105,181, 26,  8,177, 28,238,120,109, 59,206,158,171, 81,139,  4, 87, 23, 29,195, 86,131,  1,
- 79,183,235,  8,115, 85, 17, 42,108,246,144,154, 64,224,  8,214,232,209,163, 97,181, 90,193,113,156, 58,141,227,184,  6,237,203,
-139, 17,156, 64,141, 16,  8, 33,208, 71, 71, 65,111, 54,131, 23, 66, 85,191,114, 67, 41, 61,111,132,180, 90,136, 58, 45,  4,141,
-187,196, 93,137, 92,149,241,218,143, 78,156, 56,241, 19,  0,125,184,  6, 75,137, 96,  5, 51, 87,130, 32,192,225,112,132,101, 94,
-108, 54, 27, 52,154,243, 53,  1,142, 30, 61,170,254,247,103,176, 66,228,153, 18, 66,100, 66,136,220,162, 69, 11,117,157,228,228,
-100,196,198,198, 66,150,101,200,178, 12,189, 94, 15,131,193, 80,107,187, 12,  6,227, 47, 75, 48, 47,162,203,203,203,155,233,109,
- 96,128,218,134,198,219, 56,249,152, 40,133,107,167, 78,157,154, 21, 44,  1,222,102, 75,153,166,108,151, 16,146, 63,107,214,172,
- 97, 33,210,161, 68,210,206, 23, 17,  6,235, 21,214,187,184, 48, 18,248, 43, 98,241,126,128, 25, 98,162,161, 53,153,224,169,126,
- 21,212,216, 17, 66,224,112, 56,212, 58, 39,247,222,123,111,192,183,122,239,186, 41,161,176,219,237,224, 57, 30,208, 53,135,140,
- 45,234,195, 74, 29, 52, 26, 20, 53,233,  4,114,234,  4,  4, 33,188,250,254, 74,  4, 75, 49, 81, 15, 60,240,  0,230,207,159,175,
- 86, 76,  6,  0,158,231,209,166, 77, 27, 28, 58,116, 40, 44, 77, 70,100,161, 52,112, 52, 82,153,174,143,142,130,206,108,  6, 31,
- 70,164, 81,153,175,214, 97,210,235,192,107, 52, 16, 52,238, 98,193,155,110,186,105, 93, 89, 89,217, 71,237,219,183,255, 31,220,
-221, 24,132,116, 66,202,245,227,239, 60,255,232,163,143,106,153,171,250, 68,176,148,235,200, 27,127,197,133, 35, 71,142, 12, 55,
-130, 69,  9, 33, 84, 20, 69, 12, 24, 48,  0, 29, 59,118,196,178,101,203, 32,203, 50,238,191,255,126, 24, 12,  6,204,158, 61, 27,
- 46,151, 11,121,121,121, 44,130,197, 96, 48,130,121, 17,203,148, 41, 83,158, 36,132,228,123, 34, 73,133,158,229,253, 25, 41,127,
-116, 71,109,147,118,214,223, 66,222,145, 44,111,147,229,253, 95, 97,234,212,169, 89,126,210,161, 70,204, 84,131,229,229, 26, 27,
-148,178,189,  5,106,133,118,165, 88,144, 16,130,239,114,174,130,214,108,130,222,108, 70,175,165, 63,  2,112,191, 53,227,197, 87,
- 67,106, 58,157, 78,213, 56,149,150,150,134, 44, 34, 12,  7,167,211,  9, 94, 35,226, 39,179,  8, 42,242,181, 30, 88,162, 40,130,
- 19, 68, 20, 37,102,130,  8, 43, 33, 72,174,176, 30, 14, 74, 36,195,187,245,212, 29,119,220,  1,142,227, 84,147,213,165, 75, 23,
-239, 85,216, 19,231, 15,230,228,247, 43,240,237,109,238,107,213,187, 88, 48,191, 71, 43,232,162,204,208,153, 76,232,179,124,147,
- 90,156,139,217,239,133,212,220,255,254,219, 40,124, 99, 22,  4, 81,196,136,157, 69,  0,220,145,171,220,171, 90,255,100, 55, 69,
-127,116,244,232,209,159,  0,112,183,221,118, 91,108,215,174, 93,195, 10,139, 17, 66,106, 85, 60, 23,  4,193,175,185, 18,  4,  1,
- 46,151, 43,172,188, 59, 28,142,176, 34, 73, 74, 20, 43, 20,148, 82,218,182,109, 91,240, 60,143,152,152, 24, 68, 69, 69,169, 45,
-104,149,200,149, 82,127, 51,220,235,146,193, 96, 92,217,  4,241, 34,182, 89,179,102, 21,206,154, 53, 75,141, 36,121,150, 15,101,
-174,110,128,219, 76, 37, 42,230, 12,238,186, 84,254,234,103, 41,105,168,163,233,107,184,  0,119,100,203, 79, 58,212, 98, 73,191,
-181,179, 59,119,238,252,173,209,104,108, 30, 34,209, 42,245,233,116, 84,114,156,239,121, 64, 49, 87,132, 16,232,205,102,104,163,
-204,208,153,205,181,230,133,130, 16,162, 22, 17,242, 60,175, 62,116, 22, 44, 88,  0,179,217,140,187,238,186,235,130, 42,185,187,
- 13, 22,143,175, 53,  7,  0,141, 80,231,161,197,139, 34,142,198, 52,  6, 39,138, 16,164,240, 34,  4,229,229,229,224,121, 30,207,
- 62,251, 44,242,242,242,212,102,244,222, 77,235,149,101, 25,127, 14,222,149,220,107, 69, 85,163,162,212,243,211,123,122,168, 58,
-137,132, 16, 64,114,185, 91, 11,234,220,245, 32,149,200,149,221, 20,253,209, 85, 87, 93,165, 68,174, 56,163,209, 24,178,213,172,
-162,233, 93,223,208,215, 92, 41, 81, 82,229,191,211,233, 12,235,156, 87, 12,214,252,249,243,131,190,140, 40,219, 13,247, 60,229,
- 56, 14,235,215,175,199,206,157, 59,113,239,189,247,194, 96, 48,224,205, 55,223,132,203,229,194,244,233,211, 97, 48, 24,160,213,
-106, 67, 11, 49, 24,140,191, 50,113,138,193,241,152, 36,  0,181,235, 92,121,155,160, 64, 69,133,158,136,211,250, 16,219,250,  6,
-110, 99,230, 23, 37,146,230, 61,205,119,187,128,199, 96,249,126,203, 75,171,213, 54,223,184,113, 99,166, 44,203,144, 36,  9,193,
-126,237,118, 59,110,189,245,214,176, 59, 29,149,157,110,131,197,249,180,148,211, 69, 71, 65,107, 62,255,  0,243,122,136,133,188,
-139, 43, 17, 44,111,131,245,236,179,207, 66, 16,  4,204,159, 63, 31,  0,240,216, 99,143,213, 59,130, 69,101, 96,147,180, 22,105,
-115, 59,129,126,164,199,233,245,251, 32,138, 34, 82,122, 12,132,156,253, 55,148,106,163, 97,242,212,171, 10,167,216,177,180,180,
- 20,191,253,246, 27,  8, 33,120,228,145, 71,130,154,171, 85,171, 86,177, 58, 88,127,  2,138,193,226,120,119, 32,201,223,249,233,
- 61, 61,156,243,147,186, 92, 16,117,186, 90,173,  5,203,202,202, 62, 58,122,244,232, 22,  0,100,220,184,113,177, 70,163, 17,239,
-191,255,126, 13,  0,205,210,165, 75, 13,161, 52,189,235,241,249, 70,174,124, 13,150, 36,133, 46,194, 86, 94, 42,194,137,246,214,
-199, 96, 41,231, 55, 33,  4,146, 36,169,145, 4