[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21472] branches/soc-2009-yukishiro: merge till 21471
Jingyuan Huang
jingyuan.huang at gmail.com
Fri Jul 10 05:41:17 CEST 2009
Revision: 21472
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21472
Author: yukishiro
Date: 2009-07-10 05:41:16 +0200 (Fri, 10 Jul 2009)
Log Message:
-----------
merge till 21471
Modified Paths:
--------------
branches/soc-2009-yukishiro/intern/ghost/GHOST_C-api.h
branches/soc-2009-yukishiro/intern/ghost/GHOST_IWindow.h
branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_C-api.cpp
branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_SystemX11.cpp
branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_Window.cpp
branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_Window.h
branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_WindowX11.cpp
branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_WindowX11.h
branches/soc-2009-yukishiro/release/ui/buttons_data_armature.py
branches/soc-2009-yukishiro/release/ui/buttons_data_bone.py
branches/soc-2009-yukishiro/release/ui/buttons_data_camera.py
branches/soc-2009-yukishiro/release/ui/buttons_data_curve.py
branches/soc-2009-yukishiro/release/ui/buttons_data_lamp.py
branches/soc-2009-yukishiro/release/ui/buttons_data_lattice.py
branches/soc-2009-yukishiro/release/ui/buttons_data_mesh.py
branches/soc-2009-yukishiro/release/ui/buttons_data_text.py
branches/soc-2009-yukishiro/release/ui/buttons_material.py
branches/soc-2009-yukishiro/release/ui/buttons_objects.py
branches/soc-2009-yukishiro/release/ui/buttons_particle.py
branches/soc-2009-yukishiro/release/ui/buttons_texture.py
branches/soc-2009-yukishiro/release/ui/buttons_world.py
branches/soc-2009-yukishiro/source/blender/blenkernel/intern/cloth.c
branches/soc-2009-yukishiro/source/blender/blenkernel/intern/packedFile.c
branches/soc-2009-yukishiro/source/blender/blenkernel/intern/particle.c
branches/soc-2009-yukishiro/source/blender/blenkernel/intern/particle_system.c
branches/soc-2009-yukishiro/source/blender/blenkernel/intern/pointcache.c
branches/soc-2009-yukishiro/source/blender/blenlib/intern/storage.c
branches/soc-2009-yukishiro/source/blender/blenlib/intern/util.c
branches/soc-2009-yukishiro/source/blender/blenloader/intern/readfile.c
branches/soc-2009-yukishiro/source/blender/editors/armature/BIF_retarget.h
branches/soc-2009-yukishiro/source/blender/editors/armature/editarmature_retarget.c
branches/soc-2009-yukishiro/source/blender/editors/armature/editarmature_sketch.c
branches/soc-2009-yukishiro/source/blender/editors/datafiles/blenderbuttons.c
branches/soc-2009-yukishiro/source/blender/editors/include/ED_armature.h
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_handlers.c
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_layout.c
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_panel.c
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_templates.c
branches/soc-2009-yukishiro/source/blender/editors/object/object_edit.c
branches/soc-2009-yukishiro/source/blender/editors/object/object_modifier.c
branches/soc-2009-yukishiro/source/blender/editors/physics/ed_pointcache.c
branches/soc-2009-yukishiro/source/blender/editors/screen/area.c
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_vertex.c
branches/soc-2009-yukishiro/source/blender/editors/space_buttons/buttons_context.c
branches/soc-2009-yukishiro/source/blender/editors/space_buttons/buttons_ops.c
branches/soc-2009-yukishiro/source/blender/editors/space_file/file_ops.c
branches/soc-2009-yukishiro/source/blender/editors/space_file/file_panels.c
branches/soc-2009-yukishiro/source/blender/editors/space_file/filelist.c
branches/soc-2009-yukishiro/source/blender/editors/space_file/filelist.h
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_buttons.c
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_edit.c
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_header.c
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_intern.h
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_ops.c
branches/soc-2009-yukishiro/source/blender/editors/transform/transform_input.c
branches/soc-2009-yukishiro/source/blender/editors/transform/transform_manipulator.c
branches/soc-2009-yukishiro/source/blender/editors/transform/transform_ndofinput.c
branches/soc-2009-yukishiro/source/blender/makesdna/DNA_space_types.h
branches/soc-2009-yukishiro/source/blender/makesdna/DNA_windowmanager_types.h
branches/soc-2009-yukishiro/source/blender/makesdna/intern/dna_genfile.c
branches/soc-2009-yukishiro/source/blender/makesdna/intern/makesdna.c
branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_object_force.c
branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_particle.c
branches/soc-2009-yukishiro/source/blender/python/BPY_extern.h
branches/soc-2009-yukishiro/source/blender/python/generic/euler.c
branches/soc-2009-yukishiro/source/blender/python/generic/quat.c
branches/soc-2009-yukishiro/source/blender/python/generic/vector.c
branches/soc-2009-yukishiro/source/blender/python/intern/bpy_interface.c
branches/soc-2009-yukishiro/source/blender/python/intern/bpy_rna.c
branches/soc-2009-yukishiro/source/blender/render/intern/source/zbuf.c
branches/soc-2009-yukishiro/source/blender/windowmanager/WM_api.h
branches/soc-2009-yukishiro/source/blender/windowmanager/intern/wm_cursors.c
branches/soc-2009-yukishiro/source/blender/windowmanager/intern/wm_event_system.c
Modified: branches/soc-2009-yukishiro/intern/ghost/GHOST_C-api.h
===================================================================
--- branches/soc-2009-yukishiro/intern/ghost/GHOST_C-api.h 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/intern/ghost/GHOST_C-api.h 2009-07-10 03:41:16 UTC (rev 21472)
@@ -367,6 +367,17 @@
GHOST_TInt32 x,
GHOST_TInt32 y);
+/**
+ * Grabs the cursor for a modal operation, to keep receiving
+ * events when the mouse is outside the window. X11 only, others
+ * do this automatically.
+ * @param windowhandle The handle to the window
+ * @param grab The new grab state of the cursor.
+ * @return Indication of success.
+ */
+extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
+ int grab);
+
/***************************************************************************************
** Access to mouse button and keyboard states.
***************************************************************************************/
Modified: branches/soc-2009-yukishiro/intern/ghost/GHOST_IWindow.h
===================================================================
--- branches/soc-2009-yukishiro/intern/ghost/GHOST_IWindow.h 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/intern/ghost/GHOST_IWindow.h 2009-07-10 03:41:16 UTC (rev 21472)
@@ -252,6 +252,14 @@
* @return Indication of success.
*/
virtual GHOST_TSuccess setCursorVisibility(bool visible) = 0;
+
+ /**
+ * Grabs the cursor for a modal operation.
+ * @param grab The new grab state of the cursor.
+ * @return Indication of success.
+ */
+ virtual GHOST_TSuccess setCursorGrab(bool grab) { return GHOST_kSuccess; };
+
};
#endif // _GHOST_IWINDOW_H_
Modified: branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_C-api.cpp
===================================================================
--- branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_C-api.cpp 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_C-api.cpp 2009-07-10 03:41:16 UTC (rev 21472)
@@ -354,7 +354,15 @@
}
+GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
+ int grab)
+{
+ GHOST_IWindow* window = (GHOST_IWindow*) windowhandle;
+
+ return window->setCursorGrab(grab?true:false);
+}
+
GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
GHOST_TModifierKeyMask mask,
int* isDown)
Modified: branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
--- branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_SystemX11.cpp 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_SystemX11.cpp 2009-07-10 03:41:16 UTC (rev 21472)
@@ -550,11 +550,26 @@
// We're not interested in the following things.(yet...)
case NoExpose :
case GraphicsExpose :
+ break;
case EnterNotify:
case LeaveNotify:
+ {
// XCrossingEvents pointer leave enter window.
+ // also do cursor move here, MotionNotify only
+ // happens when motion starts & ends inside window
+ XCrossingEvent &xce = xe->xcrossing;
+
+ g_event = new
+ GHOST_EventCursor(
+ getMilliSeconds(),
+ GHOST_kEventCursorMove,
+ window,
+ xce.x_root,
+ xce.y_root
+ );
break;
+ }
case MapNotify:
/*
* From ICCCM:
Modified: branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_Window.cpp
===================================================================
--- branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_Window.cpp 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_Window.cpp 2009-07-10 03:41:16 UTC (rev 21472)
@@ -50,6 +50,7 @@
:
m_drawingContextType(type),
m_cursorVisible(true),
+ m_cursorGrabbed(true),
m_cursorShape(GHOST_kStandardCursorDefault),
m_stereoVisual(stereoVisual)
{
@@ -93,6 +94,20 @@
}
}
+GHOST_TSuccess GHOST_Window::setCursorGrab(bool grab)
+{
+ if(m_cursorGrabbed == grab)
+ return GHOST_kSuccess;
+
+ if (setWindowCursorGrab(grab)) {
+ m_cursorGrabbed = grab;
+ return GHOST_kSuccess;
+ }
+ else {
+ return GHOST_kFailure;
+ }
+}
+
GHOST_TSuccess GHOST_Window::setCursorShape(GHOST_TStandardCursor cursorShape)
{
if (setWindowCursorShape(cursorShape)) {
Modified: branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_Window.h
===================================================================
--- branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_Window.h 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_Window.h 2009-07-10 03:41:16 UTC (rev 21472)
@@ -167,6 +167,13 @@
virtual GHOST_TSuccess setCursorVisibility(bool visible);
/**
+ * Sets the cursor grab.
+ * @param grab The new grab state of the cursor.
+ * @return Indication of success.
+ */
+ virtual GHOST_TSuccess setCursorGrab(bool grab);
+
+ /**
* Returns the type of drawing context used in this window.
* @return The current type of drawing context.
*/
@@ -218,6 +225,12 @@
* native window system calls.
*/
virtual GHOST_TSuccess setWindowCursorVisibility(bool visible) = 0;
+
+ /**
+ * Sets the cursor grab on the window using
+ * native window system calls.
+ */
+ virtual GHOST_TSuccess setWindowCursorGrab(bool grab) { return GHOST_kSuccess; };
/**
* Sets the cursor shape on the window using
@@ -242,6 +255,9 @@
/** The current visibility of the cursor */
bool m_cursorVisible;
+
+ /** The current grabbed state of the cursor */
+ bool m_cursorGrabbed;
/** The current shape of the cursor */
GHOST_TStandardCursor m_cursorShape;
Modified: branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_WindowX11.cpp 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_WindowX11.cpp 2009-07-10 03:41:16 UTC (rev 21472)
@@ -1271,6 +1271,21 @@
GHOST_TSuccess
GHOST_WindowX11::
+setWindowCursorGrab(
+ bool grab
+){
+ if(grab)
+ XGrabPointer(m_display, m_window, True, ButtonPressMask| ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
+ else
+ XUngrabPointer(m_display, CurrentTime);
+
+ XFlush(m_display);
+
+ return GHOST_kSuccess;
+}
+
+ GHOST_TSuccess
+GHOST_WindowX11::
setWindowCursorShape(
GHOST_TStandardCursor shape
){
Modified: branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_WindowX11.h
===================================================================
--- branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_WindowX11.h 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/intern/ghost/intern/GHOST_WindowX11.h 2009-07-10 03:41:16 UTC (rev 21472)
@@ -250,6 +250,15 @@
);
/**
+ * Sets the cursor grab on the window using
+ * native window system calls.
+ */
+ GHOST_TSuccess
+ setWindowCursorGrab(
+ bool grab
+ );
+
+ /**
* Sets the cursor shape on the window using
* native window system calls.
*/
Modified: branches/soc-2009-yukishiro/release/ui/buttons_data_armature.py
===================================================================
--- branches/soc-2009-yukishiro/release/ui/buttons_data_armature.py 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/release/ui/buttons_data_armature.py 2009-07-10 03:41:16 UTC (rev 21472)
@@ -9,13 +9,10 @@
def poll(self, context):
return (context.armature != None)
-class DATA_PT_skeleton(DataButtonsPanel):
- __idname__ = "DATA_PT_skeleton"
- __label__ = "Skeleton"
+class DATA_PT_context_arm(DataButtonsPanel):
+ __idname__ = "DATA_PT_context_arm"
+ __no_header__ = True
- def poll(self, context):
- return ((context.object and context.object.type == 'ARMATURE') or context.armature)
-
def draw(self, context):
layout = self.layout
@@ -32,8 +29,19 @@
split.template_ID(space, "pin_id")
split.itemS()
+class DATA_PT_skeleton(DataButtonsPanel):
+ __idname__ = "DATA_PT_skeleton"
+ __label__ = "Skeleton"
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.object
+ arm = context.armature
+ space = context.space_data
+
+
if arm:
- layout.itemS()
layout.itemR(arm, "rest_position")
split = layout.split()
@@ -124,6 +132,7 @@
sub = split.column()
sub.itemR(arm, "ghost_only_selected", text="Selected Only")
+bpy.types.register(DATA_PT_context_arm)
bpy.types.register(DATA_PT_skeleton)
bpy.types.register(DATA_PT_display)
bpy.types.register(DATA_PT_paths)
Modified: branches/soc-2009-yukishiro/release/ui/buttons_data_bone.py
===================================================================
--- branches/soc-2009-yukishiro/release/ui/buttons_data_bone.py 2009-07-10 02:04:50 UTC (rev 21471)
+++ branches/soc-2009-yukishiro/release/ui/buttons_data_bone.py 2009-07-10 03:41:16 UTC (rev 21472)
@@ -9,10 +9,25 @@
def poll(self, context):
return (context.bone or context.edit_bone)
+class BONE_PT_context_bone(BoneButtonsPanel):
+ __idname__ = "BONE_PT_context_bone"
+ __no_header__ = True
+
+ def draw(self, context):
+ layout = self.layout
+ bone = context.bone
+ if not bone:
+ bone = context.edit_bone
+
+ split = layout.split(percentage=0.06)
+ split.itemL(text="", icon="ICON_BONE_DATA")
+ split.itemR(bone, "name", text="")
+
class BONE_PT_bone(BoneButtonsPanel):
__idname__ = "BONE_PT_bone"
__label__ = "Bone"
+
def draw(self, context):
layout = self.layout
bone = context.bone
@@ -22,28 +37,53 @@
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="Layers:")
+ sub.template_layers(bone, "layer")
+
+ sub = split.column()
+
sub.itemL(text="Inherit:")
- sub.itemR(bone, "hinge")
- sub.itemR(bone, "inherit_scale")
+ sub.itemR(bone, "hinge", text="Rotation")
+ sub.itemR(bone, "inherit_scale", text="Scale")
+
+ sub.itemL(text="Display:")
+ sub.itemR(bone, "draw_wire", text="Wireframe")
+ sub.itemR(bone, "hidden", text="Hide")
+
+
+class BONE_PT_deform(BoneButtonsPanel):
+ __idname__ = "BONE_PT_deform"
+ __label__ = "Deform"
+
+ def draw_header(self, context):
+ layout = self.layout
+ bone = context.bone
+ if not bone:
+ bone = context.edit_bone
+
+ layout.itemR(bone, "deform", text="")
+
+ def draw(self, context):
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list