Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--SConstruct2
-rw-r--r--intern/ghost/GHOST_C-api.h17
-rw-r--r--intern/ghost/GHOST_IWindow.h15
-rw-r--r--intern/ghost/intern/GHOST_C-api.cpp15
-rw-r--r--intern/ghost/intern/GHOST_Window.cpp2
-rw-r--r--intern/ghost/intern/GHOST_Window.h14
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.h19
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.mm60
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp18
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.h3
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp6
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.h1
-rw-r--r--release/scripts/io/export_3ds.py5
-rw-r--r--release/scripts/io/export_fbx.py12
-rw-r--r--release/scripts/io/export_mdd.py2
-rw-r--r--release/scripts/io/export_obj.py48
-rw-r--r--release/scripts/io/export_ply.py4
-rw-r--r--release/scripts/io/export_x3d.py21
-rw-r--r--release/scripts/io/netrender/client.py8
-rw-r--r--release/scripts/io/netrender/operators.py2
-rwxr-xr-xrelease/scripts/io/netrender/repath.py12
-rw-r--r--release/scripts/io/netrender/ui.py4
-rw-r--r--release/scripts/modules/add_object_utils.py28
-rw-r--r--release/scripts/modules/bpy/__init__.py8
-rw-r--r--release/scripts/modules/bpy/utils.py12
-rw-r--r--release/scripts/modules/graphviz_export.py2
-rw-r--r--release/scripts/modules/rigify/__init__.py2
-rw-r--r--release/scripts/op/add_mesh_torus.py6
-rw-r--r--release/scripts/op/console_python.py72
-rw-r--r--release/scripts/op/image.py30
-rw-r--r--release/scripts/op/sequencer.py8
-rw-r--r--release/scripts/op/uv.py4
-rw-r--r--release/scripts/op/wm.py15
-rw-r--r--release/scripts/ui/properties_data_armature_rigify.py4
-rw-r--r--release/scripts/ui/properties_data_lamp.py2
-rw-r--r--release/scripts/ui/properties_data_modifier.py2
-rw-r--r--release/scripts/ui/properties_particle.py11
-rw-r--r--release/scripts/ui/properties_texture.py4
-rw-r--r--release/scripts/ui/space_info.py95
-rw-r--r--release/scripts/ui/space_sequencer.py7
-rw-r--r--release/scripts/ui/space_text.py8
-rw-r--r--release/scripts/ui/space_userpref.py35
-rw-r--r--release/scripts/ui/space_view3d.py19
-rw-r--r--source/blender/blenkernel/BKE_customdata.h2
-rw-r--r--source/blender/blenkernel/BKE_multires.h1
-rw-r--r--source/blender/blenkernel/BKE_particle.h2
-rw-r--r--source/blender/blenkernel/BKE_report.h2
-rw-r--r--source/blender/blenkernel/BKE_subsurf.h1
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c18
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c4
-rw-r--r--source/blender/blenkernel/intern/anim.c20
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c14
-rw-r--r--source/blender/blenkernel/intern/customdata.c21
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c22
-rw-r--r--source/blender/blenkernel/intern/fcurve.c2
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c2
-rw-r--r--source/blender/blenkernel/intern/image.c6
-rw-r--r--source/blender/blenkernel/intern/library.c2
-rw-r--r--source/blender/blenkernel/intern/multires.c20
-rw-r--r--source/blender/blenkernel/intern/particle.c91
-rw-r--r--source/blender/blenkernel/intern/particle_system.c90
-rw-r--r--source/blender/blenkernel/intern/pointcache.c2
-rw-r--r--source/blender/blenkernel/intern/report.c12
-rw-r--r--source/blender/blenkernel/intern/sound.c2
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c46
-rw-r--r--source/blender/blenkernel/intern/texture.c5
-rw-r--r--source/blender/blenlib/BLI_pbvh.h2
-rw-r--r--source/blender/blenlib/intern/bpath.c8
-rw-r--r--source/blender/blenlib/intern/math_geom.c8
-rw-r--r--source/blender/blenlib/intern/path_util.c22
-rw-r--r--source/blender/blenlib/intern/pbvh.c7
-rw-r--r--source/blender/blenloader/intern/readfile.c49
-rw-r--r--source/blender/editors/include/UI_interface.h2
-rw-r--r--source/blender/editors/interface/interface.c2
-rw-r--r--source/blender/editors/interface/interface_handlers.c3
-rw-r--r--source/blender/editors/interface/interface_regions.c21
-rw-r--r--source/blender/editors/interface/interface_templates.c83
-rw-r--r--source/blender/editors/interface/interface_widgets.c14
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c16
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c14
-rw-r--r--source/blender/editors/object/object_edit.c40
-rw-r--r--source/blender/editors/object/object_intern.h1
-rw-r--r--source/blender/editors/object/object_ops.c1
-rw-r--r--source/blender/editors/physics/particle_edit.c2
-rw-r--r--source/blender/editors/physics/physics_fluid.c41
-rw-r--r--source/blender/editors/screen/screen_ops.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c70
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h2
-rw-r--r--source/blender/editors/sound/sound_ops.c2
-rw-r--r--source/blender/editors/space_image/image_buttons.c2
-rw-r--r--source/blender/editors/space_info/info_intern.h2
-rw-r--r--source/blender/editors/space_info/info_ops.c98
-rw-r--r--source/blender/editors/space_info/space_info.c4
-rw-r--r--source/blender/editors/space_logic/logic_window.c49
-rw-r--r--source/blender/editors/space_node/drawnode.c2
-rw-r--r--source/blender/editors/space_outliner/outliner.c165
-rw-r--r--source/blender/editors/space_script/script_edit.c20
-rw-r--r--source/blender/editors/space_script/script_intern.h1
-rw-r--r--source/blender/editors/space_script/script_ops.c1
-rw-r--r--source/blender/editors/space_view3d/drawobject.c22
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h2
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c43
-rw-r--r--source/blender/imbuf/IMB_thumbs.h2
-rw-r--r--source/blender/imbuf/intern/IMB_filetype.h1
-rw-r--r--source/blender/imbuf/intern/filetype.c5
-rw-r--r--source/blender/imbuf/intern/thumbs.c2
-rw-r--r--source/blender/imbuf/intern/thumbs_blend.c56
-rw-r--r--source/blender/imbuf/intern/tiff.c16
-rw-r--r--source/blender/makesdna/DNA_ID.h2
-rw-r--r--source/blender/makesdna/DNA_texture_types.h6
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h9
-rw-r--r--source/blender/makesrna/intern/rna_ID.c4
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c18
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c2
-rw-r--r--source/blender/makesrna/intern/rna_image.c8
-rw-r--r--source/blender/makesrna/intern/rna_main.c10
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c14
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c17
-rw-r--r--source/blender/makesrna/intern/rna_scene.c20
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c34
-rw-r--r--source/blender/makesrna/intern/rna_sound.c8
-rw-r--r--source/blender/makesrna/intern/rna_text.c4
-rw-r--r--source/blender/makesrna/intern/rna_texture.c35
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c4
-rw-r--r--source/blender/makesrna/intern/rna_vfont.c4
-rw-r--r--source/blender/modifiers/intern/MOD_multires.c8
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c6
-rw-r--r--source/blender/python/BPY_extern.h6
-rw-r--r--source/blender/python/doc/sphinx_doc_gen.py5
-rw-r--r--source/blender/python/generic/bpy_internal_import.c12
-rw-r--r--source/blender/python/generic/bpy_internal_import.h3
-rw-r--r--source/blender/python/generic/mathutils_vector.c45
-rw-r--r--source/blender/python/intern/bpy_driver.c10
-rw-r--r--source/blender/python/intern/bpy_interface.c51
-rw-r--r--source/blender/render/intern/source/convertblender.c8
-rw-r--r--source/blender/render/intern/source/voxeldata.c164
-rw-r--r--source/blender/windowmanager/WM_api.h4
-rw-r--r--source/blender/windowmanager/intern/wm.c16
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c87
-rw-r--r--source/blender/windowmanager/intern/wm_files.c31
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c15
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c12
-rw-r--r--source/blender/windowmanager/intern/wm_window.c12
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c2
-rw-r--r--source/creator/creator.c65
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp25
-rw-r--r--source/gameengine/PyDoc/bge.events.rst67
-rw-r--r--source/gameengine/PyDoc/bge.logic.rst392
-rw-r--r--source/gameengine/PyDoc/bge.render.rst11
-rw-r--r--source/gameengine/PyDoc/bge.types.rst1934
154 files changed, 3579 insertions, 1594 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index da116758f04..287b3394456 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -538,14 +538,16 @@ IF(WIN32)
ENDIF(WITH_OPENCOLLADA)
IF(WITH_FFMPEG)
- # TODO
- SET(WITH_FFMPEG OFF)
+ SET(FFMPEG ${LIBDIR}/ffmpeg)
+ SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include)
+ SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
+ SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
ENDIF(WITH_FFMPEG)
IF(WITH_OPENEXR)
SET(OPENEXR ${LIBDIR}/gcc/openexr)
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/OpenEXR)
- SET(OPENEXR_LIB Half IlmImf Iex IlmThread)
+ SET(OPENEXR_LIB Half IlmImf Iex)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
ENDIF(WITH_OPENEXR)
diff --git a/SConstruct b/SConstruct
index 0d8f6f96d72..dc6198bd81e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -457,8 +457,6 @@ if env['OURPLATFORM']!='darwin':
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + dp.split(os.sep)[2:])) # skip bin/.blender
else: dir= os.path.join(*([BLENDERPATH] + dp.split(os.sep)[1:])) # skip bin
- # print dir+ os.sep + f
- print dir
dottargetlist.append(dir + os.sep + f)
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 346fa292520..a5fec1f101c 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -264,7 +264,24 @@ extern int GHOST_DispatchEvents(GHOST_SystemHandle systemhandle);
extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
GHOST_EventConsumerHandle consumerhandle);
+/***************************************************************************************
+ ** Progress bar functionality
+ ***************************************************************************************/
+
+/**
+ * Sets the progress bar value displayed in the window/application icon
+ * @param windowhandle The handle to the window
+ * @param progress The progress % (0.0 to 1.0)
+ */
+extern GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress);
+/**
+ * Hides the progress bar in the icon
+ * @param windowhandle The handle to the window
+ */
+extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
+
+
/***************************************************************************************
** N-degree of freedom device management functionality
***************************************************************************************/
diff --git a/intern/ghost/GHOST_IWindow.h b/intern/ghost/GHOST_IWindow.h
index a024b2b51e5..83757b17e8b 100644
--- a/intern/ghost/GHOST_IWindow.h
+++ b/intern/ghost/GHOST_IWindow.h
@@ -235,6 +235,21 @@ public:
virtual const GHOST_TabletData* GetTabletData() = 0;
/***************************************************************************************
+ ** Progress bar functionality
+ ***************************************************************************************/
+
+ /**
+ * Sets the progress bar value displayed in the window/application icon
+ * @param progress The progress %
+ */
+ virtual GHOST_TSuccess setProgressBar(float progress) = 0;
+
+ /**
+ * Hides the progress bar in the icon
+ */
+ virtual GHOST_TSuccess endProgressBar() = 0;
+
+ /***************************************************************************************
** Cursor management functionality
***************************************************************************************/
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 44b361d21e4..9da20200f63 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -248,6 +248,21 @@ GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_Eve
return system->addEventConsumer((GHOST_CallbackEventConsumer*)consumerhandle);
}
+GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle,float progress)
+{
+ GHOST_IWindow* window = (GHOST_IWindow*) windowhandle;
+
+ return window->setProgressBar(progress);
+}
+
+GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle)
+{
+ GHOST_IWindow* window = (GHOST_IWindow*) windowhandle;
+
+ return window->endProgressBar();
+}
+
+
int GHOST_OpenNDOF(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
diff --git a/intern/ghost/intern/GHOST_Window.cpp b/intern/ghost/intern/GHOST_Window.cpp
index e1d0d40e225..374b620c348 100644
--- a/intern/ghost/intern/GHOST_Window.cpp
+++ b/intern/ghost/intern/GHOST_Window.cpp
@@ -53,6 +53,8 @@ GHOST_Window::GHOST_Window(
m_isUnsavedChanges = false;
m_canAcceptDragOperation = false;
+ m_progressBarVisible = false;
+
m_cursorGrabAccumPos[0] = 0;
m_cursorGrabAccumPos[1] = 0;
diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h
index bec9cecc830..d4d53787357 100644
--- a/intern/ghost/intern/GHOST_Window.h
+++ b/intern/ghost/intern/GHOST_Window.h
@@ -192,6 +192,17 @@ public:
virtual GHOST_TSuccess getCursorGrabBounds(GHOST_Rect& bounds);
/**
+ * Sets the progress bar value displayed in the window/application icon
+ * @param progress The progress % (0.0 to 1.0)
+ */
+ virtual GHOST_TSuccess setProgressBar(float progress) {return GHOST_kFailure;};
+
+ /**
+ * Hides the progress bar in the icon
+ */
+ virtual GHOST_TSuccess endProgressBar() {return GHOST_kFailure;};
+
+ /**
* Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
*/
virtual void setAcceptDragOperation(bool canAccept);
@@ -313,6 +324,9 @@ protected:
/** The current shape of the cursor */
GHOST_TStandardCursor m_cursorShape;
+ /** The presence of progress indicator with the application icon */
+ bool m_progressBarVisible;
+
/** The acceptance of the "drop candidate" of the current drag'n'drop operation */
bool m_canAcceptDragOperation;
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.h b/intern/ghost/intern/GHOST_WindowCocoa.h
index cb27ee4e83e..7948e88e1ab 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.h
+++ b/intern/ghost/intern/GHOST_WindowCocoa.h
@@ -226,6 +226,17 @@ public:
GHOST_TabletData& GetCocoaTabletData()
{ return m_tablet; }
+
+ /**
+ * Sets the progress bar value displayed in the window/application icon
+ * @param progress The progress % (0.0 to 1.0)
+ */
+ virtual GHOST_TSuccess setProgressBar(float progress);
+
+ /**
+ * Hides the progress bar icon
+ */
+ virtual GHOST_TSuccess endProgressBar();
protected:
/**
* Tries to install a rendering context in this window.
@@ -291,14 +302,6 @@ protected:
NSCursor* m_customCursor;
GHOST_TabletData m_tablet;
-
- /**
- * The width/height of the size rectangle in the lower right corner of a
- * Mac/Carbon window. This is also the height of the gutter area.
- */
-#ifdef GHOST_DRAW_CARBON_GUTTER
- static const GHOST_TInt32 s_sizeRectSize;
-#endif // GHOST_DRAW_CARBON_GUTTER
};
#endif // _GHOST_WINDOW_COCOA_H_
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 6dc2fa5a745..abcb8bcd5cc 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -1020,6 +1020,66 @@ GHOST_TSuccess GHOST_WindowCocoa::invalidate()
return GHOST_kSuccess;
}
+#pragma mark Progress bar
+
+GHOST_TSuccess GHOST_WindowCocoa::setProgressBar(float progress)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ if ((progress >=0.0) && (progress <=1.0)) {
+ NSImage* dockIcon = [[NSImage alloc] initWithSize:NSMakeSize(128,128)];
+
+ [dockIcon lockFocus];
+ NSRect progressBox = {{4, 4}, {120, 16}};
+
+ [[NSImage imageNamed:@"NSApplicationIcon"] dissolveToPoint:NSZeroPoint fraction:1.0];
+
+ // Track & Outline
+ [[NSColor blackColor] setFill];
+ NSRectFill(progressBox);
+
+ [[NSColor whiteColor] set];
+ NSFrameRect(progressBox);
+
+ // Progress fill
+ progressBox = NSInsetRect(progressBox, 1, 1);
+ [[NSColor knobColor] setFill];
+ progressBox.size.width = progressBox.size.width * progress;
+ NSRectFill(progressBox);
+
+ [dockIcon unlockFocus];
+
+ [NSApp setApplicationIconImage:dockIcon];
+ [dockIcon release];
+
+ m_progressBarVisible = true;
+ }
+
+ [pool drain];
+ return GHOST_kSuccess;
+}
+
+
+GHOST_TSuccess GHOST_WindowCocoa::endProgressBar()
+{
+ if (!m_progressBarVisible) return GHOST_kFailure;
+ m_progressBarVisible = false;
+
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSImage* dockIcon = [[NSImage alloc] initWithSize:NSMakeSize(128,128)];
+ [dockIcon lockFocus];
+ [[NSImage imageNamed:@"NSApplicationIcon"] dissolveToPoint:NSZeroPoint fraction:1.0];
+ [dockIcon unlockFocus];
+ [NSApp setApplicationIconImage:dockIcon];
+ [dockIcon release];
+
+ [pool drain];
+ return GHOST_kSuccess;
+}
+
+
+
#pragma mark Cursor handling
void GHOST_WindowCocoa::loadCursor(bool visible, GHOST_TStandardCursor cursor) const
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 19c3e061159..bbfa84dbae0 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -64,6 +64,7 @@
LPCSTR GHOST_WindowWin32::s_windowClassName = "GHOST_WindowClass";
const int GHOST_WindowWin32::s_maxTitleLength = 128;
HGLRC GHOST_WindowWin32::s_firsthGLRc = NULL;
+HDC GHOST_WindowWin32::s_firstHDC = NULL;
static int WeightPixelFormat(PIXELFORMATDESCRIPTOR& pfd);
static int EnumPixelFormats(HDC hdc);
@@ -134,6 +135,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
m_top(top),
m_width(width),
m_height(height),
+ m_normal_state(GHOST_kWindowStateNormal),
m_stereo(stereoVisual),
m_nextWindow(NULL)
{
@@ -162,7 +164,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
height = th;
top = rect.top;
}
- else if(top > rect.top)
+ else if(top < rect.top)
top = rect.top;
m_hWnd = ::CreateWindow(
@@ -202,6 +204,10 @@ GHOST_WindowWin32::GHOST_WindowWin32(
// Store the device context
m_hDC = ::GetDC(m_hWnd);
+ if(!s_firstHDC) {
+ s_firstHDC = m_hDC;
+ }
+
// Show the window
int nCmdShow;
switch (state) {
@@ -308,10 +314,11 @@ GHOST_WindowWin32::~GHOST_WindowWin32()
m_customCursor = NULL;
}
+ ::wglMakeCurrent(NULL, NULL);
m_multisampleEnabled = GHOST_kFailure;
m_multisample = 0;
setDrawingContextType(GHOST_kDrawingContextTypeNone);
- if (m_hDC) {
+ if (m_hDC && m_hDC != s_firstHDC) {
::ReleaseDC(m_hWnd, m_hDC);
m_hDC = 0;
}
@@ -482,9 +489,13 @@ void GHOST_WindowWin32::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST
GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
{
+ GHOST_TWindowState curstate = getState();
WINDOWPLACEMENT wp;
wp.length = sizeof(WINDOWPLACEMENT);
::GetWindowPlacement(m_hWnd, &wp);
+
+ if (state == GHOST_kWindowStateNormal)
+ state = m_normal_state;
switch (state) {
case GHOST_kWindowStateMinimized:
wp.showCmd = SW_SHOWMINIMIZED;
@@ -495,6 +506,8 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
break;
case GHOST_kWindowStateFullScreen:
+ if (curstate != state && curstate != GHOST_kWindowStateMinimized)
+ m_normal_state = curstate;
wp.showCmd = SW_SHOWMAXIMIZED;
wp.ptMaxPosition.x = 0;
wp.ptMaxPosition.y = 0;
@@ -637,6 +650,7 @@ GHOST_TSuccess GHOST_WindowWin32::installDrawingContext(GHOST_TDrawingContextTyp
m_hGlRc = ::wglCreateContext(m_hDC);
if (m_hGlRc) {
if (s_firsthGLRc) {
+ ::wglCopyContext(s_firsthGLRc, m_hGlRc, GL_ALL_ATTRIB_BITS);
wglShareLists(s_firsthGLRc, m_hGlRc);
} else {
s_firsthGLRc = m_hGlRc;
diff --git a/intern/ghost/intern/GHOST_WindowWin32.h b/intern/ghost/intern/GHOST_WindowWin32.h
index 5e1f708f61c..a4d31f87ffa 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.h
+++ b/intern/ghost/intern/GHOST_WindowWin32.h
@@ -315,6 +315,8 @@ protected:
HGLRC m_hGlRc;
/** The first created OpenGL context (for sharing display lists) */
static HGLRC s_firsthGLRc;
+ /** The first created device context handle. */
+ static HDC s_firstHDC;
/** Flag for if window has captured the mouse */
bool m_hasMouseCaptured;
/** Count of number of pressed buttons */
@@ -351,6 +353,7 @@ protected:
GHOST_TInt32 m_top;
GHOST_TUns32 m_width;
GHOST_TUns32 m_height;
+ GHOST_TWindowState m_normal_state;
bool m_stereo;
/** The GHOST_System passes this to wm if this window is being replaced */
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 9be278706a8..b3b1c8ae0f7 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -159,6 +159,7 @@ GHOST_WindowX11(
GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples),
m_context(NULL),
m_display(display),
+ m_normal_state(GHOST_kWindowStateNormal),
m_system (system),
m_valid_setup (false),
m_invalid_window(false),
@@ -1036,6 +1037,9 @@ GHOST_TSuccess GHOST_WindowX11::setState(GHOST_TWindowState state)
is_motif_full = motifIsFullScreen();
+ if (state == GHOST_kWindowStateNormal)
+ state = m_normal_state;
+
if (state == GHOST_kWindowStateNormal) {
if (is_max == True)
netwmMaximized(False);
@@ -1055,6 +1059,8 @@ GHOST_TSuccess GHOST_WindowX11::setState(GHOST_TWindowState state)
if (cur_state == GHOST_kWindowStateMinimized)
return (GHOST_kFailure);
+ m_normal_state = cur_state;
+
if (is_max == True)
netwmMaximized(False);
if (is_full == False)
diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h
index f2420c4c493..2f45378117d 100644
--- a/intern/ghost/intern/GHOST_WindowX11.h
+++ b/intern/ghost/intern/GHOST_WindowX11.h
@@ -327,6 +327,7 @@ private :
Window m_window;
Display *m_display;
XVisualInfo *m_visual;
+ GHOST_TWindowState m_normal_state;
/** The first created OpenGL context (for sharing display lists) */
static GLXContext s_firstContext;
diff --git a/release/scripts/io/export_3ds.py b/release/scripts/io/export_3ds.py
index 5833dd01f3c..9cb5f3a077b 100644
--- a/release/scripts/io/export_3ds.py
+++ b/release/scripts/io/export_3ds.py
@@ -494,8 +494,7 @@ def make_material_texture_chunk(id, images):
mat_sub = _3ds_chunk(id)
def add_image(img):
- filename = os.path.basename(image.filename)
-# filename = image.filename.split('\\')[-1].split('/')[-1]
+ filename = os.path.basename(image.filepath)
mat_sub_file = _3ds_chunk(MATMAPFILE)
mat_sub_file.add_variable("mapfile", _3ds_string(sane_name(filename)))
mat_sub.add_subchunk(mat_sub_file)
@@ -1142,7 +1141,7 @@ class Export3DS(bpy.types.Operator):
# Add to a menu
def menu_func(self, context):
- default_path = bpy.data.filename.replace(".blend", ".3ds")
+ default_path = bpy.data.filepath.replace(".blend", ".3ds")
self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").path = default_path
diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py
index f0b20837e26..5fe7f519b1d 100644
--- a/release/scripts/io/export_fbx.py
+++ b/release/scripts/io/export_fbx.py
@@ -75,7 +75,7 @@ def copy_images(dest_dir, textures):
image_paths = set()
for tex in textures:
- image_paths.add(Blender.sys.expandpath(tex.filename))
+ image_paths.add(bpy.utils.expandpath(tex.filepath))
# Now copy images
copyCount = 0
@@ -1255,7 +1255,7 @@ def write(filename, batch_objects = None, \
file.write('\n\t}')
def copy_image(image):
- fn = bpy.utils.expandpath(image.filename)
+ fn = bpy.utils.expandpath(image.filepath)
fn_strip = os.path.basename(fn)
if EXP_IMAGE_COPY:
@@ -1282,7 +1282,7 @@ def write(filename, batch_objects = None, \
Property: "Height", "int", "",0''')
if tex:
fname_rel, fname_strip = copy_image(tex)
-# fname, fname_strip, fname_rel = derived_paths(tex.filename, basepath, EXP_IMAGE_COPY)
+# fname, fname_strip, fname_rel = derived_paths(tex.filepath, basepath, EXP_IMAGE_COPY)
else:
fname = fname_strip = fname_rel = ''
@@ -1347,7 +1347,7 @@ def write(filename, batch_objects = None, \
if tex:
fname_rel, fname_strip = copy_image(tex)
-# fname, fname_strip, fname_rel = derived_paths(tex.filename, basepath, EXP_IMAGE_COPY)
+# fname, fname_strip, fname_rel = derived_paths(tex.filepath, basepath, EXP_IMAGE_COPY)
else:
fname = fname_strip = fname_rel = ''
@@ -3414,7 +3414,7 @@ class ExportFBX(bpy.types.Operator):
# if __name__ == "__main__":
-# bpy.ops.EXPORT_OT_ply(filename="/tmp/test.ply")
+# bpy.ops.EXPORT_OT_ply(path="/tmp/test.ply")
# NOTES (all line numbers correspond to original export_fbx.py (under release/scripts)
@@ -3441,7 +3441,7 @@ class ExportFBX(bpy.types.Operator):
def menu_func(self, context):
- default_path = bpy.data.filename.replace(".blend", ".fbx")
+ default_path = bpy.data.filepath.replace(".blend", ".fbx")
self.layout.operator(ExportFBX.bl_idname, text="Autodesk FBX (.fbx)").path = default_path
diff --git a/release/scripts/io/export_mdd.py b/release/scripts/io/export_mdd.py
index 578813db2c6..3ae6ed3de9b 100644
--- a/release/scripts/io/export_mdd.py
+++ b/release/scripts/io/export_mdd.py
@@ -183,7 +183,7 @@ class ExportMDD(bpy.types.Operator):
def menu_func(self, context):
- default_path = bpy.data.filename.replace(".blend", ".mdd")
+ default_path = bpy.data.filepath.replace(".blend", ".mdd")
self.layout.operator(ExportMDD.bl_idname, text="Lightwave Point Cache (.mdd)").path = default_path
diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py
index 2d09844e592..9c065c6dac9 100644
--- a/release/scripts/io/export_obj.py
+++ b/release/scripts/io/export_obj.py
@@ -65,15 +65,15 @@ def fixName(name):
else:
return name.replace(' ', '_')
-def write_mtl(scene, filename, copy_images, mtl_dict):
+def write_mtl(scene, filepath, copy_images, mtl_dict):
world = scene.world
worldAmb = world.ambient_color
- dest_dir = os.path.dirname(filename)
+ dest_dir = os.path.dirname(filepath)
def copy_image(image):
- fn = bpy.utils.expandpath(image.filename)
+ fn = bpy.utils.expandpath(image.filepath)
fn_strip = os.path.basename(fn)
if copy_images:
rel = fn_strip
@@ -86,9 +86,9 @@ def write_mtl(scene, filename, copy_images, mtl_dict):
return rel
- file = open(filename, "w")
+ file = open(filepath, "w")
# XXX
-# file.write('# Blender MTL File: %s\n' % Blender.Get('filename').split('\\')[-1].split('/')[-1])
+# file.write('# Blender MTL File: %s\n' % Blender.Get('filepath').split('\\')[-1].split('/')[-1])
file.write('# Material Count: %i\n' % len(mtl_dict))
# Write material/image combinations we have used.
for key, (mtl_mat_name, mat, img) in mtl_dict.items():
@@ -131,15 +131,15 @@ def write_mtl(scene, filename, copy_images, mtl_dict):
# write relative image path
rel = copy_image(img)
file.write('map_Kd %s\n' % rel) # Diffuse mapping image
-# file.write('map_Kd %s\n' % img.filename.split('\\')[-1].split('/')[-1]) # Diffuse mapping image
+# file.write('map_Kd %s\n' % img.filepath.split('\\')[-1].split('/')[-1]) # Diffuse mapping image
elif mat: # No face image. if we havea material search for MTex image.
for mtex in mat.texture_slots:
if mtex and mtex.texture.type == 'IMAGE':
try:
- filename = copy_image(mtex.texture.image)
-# filename = mtex.texture.image.filename.split('\\')[-1].split('/')[-1]
- file.write('map_Kd %s\n' % filename) # Diffuse mapping image
+ filepath = copy_image(mtex.texture.image)
+# filepath = mtex.texture.image.filepath.split('\\')[-1].split('/')[-1]
+ file.write('map_Kd %s\n' % filepath) # Diffuse mapping image
break
except:
# Texture has no image though its an image type, best ignore.
@@ -189,7 +189,7 @@ def copy_images(dest_dir):
copyCount = 0
# for bImage in uniqueImages.values():
-# image_path = bpy.utils.expandpath(bImage.filename)
+# image_path = bpy.utils.expandpath(bImage.filepath)
# if bpy.sys.exists(image_path):
# # Make a name for the target path.
# dest_image_path = dest_dir + image_path.split('\\')[-1].split('/')[-1]
@@ -282,7 +282,7 @@ def write_nurb(file, ob, ob_mat):
return tot_verts
-def write(filename, objects, scene,
+def write(filepath, objects, scene,
EXPORT_TRI=False,
EXPORT_EDGES=False,
EXPORT_NORMALS=False,
@@ -351,23 +351,23 @@ def write(filename, objects, scene,
return ret
- print('OBJ Export path: "%s"' % filename)
+ print('OBJ Export path: "%s"' % filepath)
temp_mesh_name = '~tmp-mesh'
time1 = time.clock()
# time1 = sys.time()
# scn = Scene.GetCurrent()
- file = open(filename, "w")
+ file = open(filepath, "w")
# Write Header
- file.write('# Blender v%s OBJ File: %s\n' % (bpy.app.version_string, bpy.data.filename.split('/')[-1].split('\\')[-1] ))
+ file.write('# Blender v%s OBJ File: %s\n' % (bpy.app.version_string, bpy.data.filepath.split('/')[-1].split('\\')[-1] ))
file.write('# www.blender.org\n')
# Tell the obj file what material file to use.
if EXPORT_MTL:
- mtlfilename = '%s.mtl' % '.'.join(filename.split('.')[:-1])
- file.write('mtllib %s\n' % ( mtlfilename.split('\\')[-1].split('/')[-1] ))
+ mtlfilepath = '%s.mtl' % '.'.join(filepath.split('.')[:-1])
+ file.write('mtllib %s\n' % ( mtlfilepath.split('\\')[-1].split('/')[-1] ))
if EXPORT_ROTX90:
mat_xrot90= mathutils.RotationMatrix(-math.pi/2, 4, 'X')
@@ -782,22 +782,22 @@ def write(filename, objects, scene,
# Now we have all our materials, save them
if EXPORT_MTL:
- write_mtl(scene, mtlfilename, EXPORT_COPY_IMAGES, mtl_dict)
+ write_mtl(scene, mtlfilepath, EXPORT_COPY_IMAGES, mtl_dict)
# if EXPORT_COPY_IMAGES:
-# dest_dir = os.path.basename(filename)
-# # dest_dir = filename
+# dest_dir = os.path.basename(filepath)
+# # dest_dir = filepath
# # # Remove chars until we are just the path.
# # while dest_dir and dest_dir[-1] not in '\\/':
# # dest_dir = dest_dir[:-1]
# if dest_dir:
# copy_images(dest_dir, mtl_dict)
# else:
-# print('\tError: "%s" could not be used as a base for an image path.' % filename)
+# print('\tError: "%s" could not be used as a base for an image path.' % filepath)
print("OBJ Export time: %.2f" % (time.clock() - time1))
# print "OBJ Export time: %.2f" % (sys.time() - time1)
-def do_export(filename, context,
+def do_export(filepath, context,
EXPORT_APPLY_MODIFIERS = True, # not used
EXPORT_ROTX90 = True, # wrong
EXPORT_TRI = False, # ok
@@ -817,7 +817,7 @@ def do_export(filename, context,
EXPORT_POLYGROUPS = False,
EXPORT_CURVE_AS_NURBS = True):
- base_name, ext = splitExt(filename)
+ base_name, ext = splitExt(filepath)
context_name = [base_name, '', '', ext] # Base name, scene name, frame number, extension
orig_scene = context.scene
@@ -853,7 +853,7 @@ def do_export(filename, context,
# Loop through all frames in the scene and export.
for frame in scene_frames:
- if EXPORT_ANIMATION: # Add frame to the filename.
+ if EXPORT_ANIMATION: # Add frame to the filepath.
context_name[2] = '_%.6d' % frame
scn.frame_current = frame
@@ -964,7 +964,7 @@ class ExportOBJ(bpy.types.Operator):
def menu_func(self, context):
- default_path = bpy.data.filename.replace(".blend", ".obj")
+ default_path = bpy.data.filepath.replace(".blend", ".obj")
self.layout.operator(ExportOBJ.bl_idname, text="Wavefront (.obj)").path = default_path
diff --git a/release/scripts/io/export_ply.py b/release/scripts/io/export_ply.py
index 8249ce553bb..d0f2fab9c3e 100644
--- a/release/scripts/io/export_ply.py
+++ b/release/scripts/io/export_ply.py
@@ -203,7 +203,7 @@ def write(filename, scene, ob, \
file.write('ply\n')
file.write('format ascii 1.0\n')
- file.write('comment Created by Blender %s - www.blender.org, source file: %s\n' % (bpy.app.version_string, bpy.data.filename.split('/')[-1].split('\\')[-1]))
+ file.write('comment Created by Blender %s - www.blender.org, source file: %s\n' % (bpy.app.version_string, bpy.data.filepath.split('/')[-1].split('\\')[-1]))
file.write('element vertex %d\n' % len(ply_verts))
@@ -310,7 +310,7 @@ class ExportPLY(bpy.types.Operator):
def menu_func(self, context):
- default_path = bpy.data.filename.replace(".blend", ".ply")
+ default_path = bpy.data.filepath.replace(".blend", ".ply")
self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)").path = default_path
diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py
index 619c0b3d373..61f216af833 100644
--- a/release/scripts/io/export_x3d.py
+++ b/release/scripts/io/export_x3d.py
@@ -717,7 +717,7 @@ class x3d_class:
def writeImageTexture(self, image):
name = image.name
- filename = image.filename.split('/')[-1].split('\\')[-1]
+ filename = image.filepath.split('/')[-1].split('\\')[-1]
if name in self.texNames:
self.writeIndented("<ImageTexture USE=\"%s\" />\n" % self.cleanStr(name))
self.texNames[name] += 1
@@ -794,28 +794,28 @@ class x3d_class:
pic = tex.image
# using .expandpath just in case, os.path may not expect //
- basename = os.path.basename(bpy.utils.expandpath(pic.filename))
+ basename = os.path.basename(bpy.utils.expandpath(pic.filepath))
pic = alltextures[i].image
# pic = alltextures[i].getImage()
if (namemat == "back") and (pic != None):
self.file.write("\n\tbackUrl=\"%s\" " % basename)
- # self.file.write("\n\tbackUrl=\"%s\" " % pic.filename.split('/')[-1].split('\\')[-1])
+ # self.file.write("\n\tbackUrl=\"%s\" " % pic.filepath.split('/')[-1].split('\\')[-1])
elif (namemat == "bottom") and (pic != None):
self.writeIndented("bottomUrl=\"%s\" " % basename)
- # self.writeIndented("bottomUrl=\"%s\" " % pic.filename.split('/')[-1].split('\\')[-1])
+ # self.writeIndented("bottomUrl=\"%s\" " % pic.filepath.split('/')[-1].split('\\')[-1])
elif (namemat == "front") and (pic != None):
self.writeIndented("frontUrl=\"%s\" " % basename)
- # self.writeIndented("frontUrl=\"%s\" " % pic.filename.split('/')[-1].split('\\')[-1])
+ # self.writeIndented("frontUrl=\"%s\" " % pic.filepath.split('/')[-1].split('\\')[-1])
elif (namemat == "left") and (pic != None):
self.writeIndented("leftUrl=\"%s\" " % basename)
- # self.writeIndented("leftUrl=\"%s\" " % pic.filename.split('/')[-1].split('\\')[-1])
+ # self.writeIndented("leftUrl=\"%s\" " % pic.filepath.split('/')[-1].split('\\')[-1])
elif (namemat == "right") and (pic != None):
self.writeIndented("rightUrl=\"%s\" " % basename)
- # self.writeIndented("rightUrl=\"%s\" " % pic.filename.split('/')[-1].split('\\')[-1])
+ # self.writeIndented("rightUrl=\"%s\" " % pic.filepath.split('/')[-1].split('\\')[-1])
elif (namemat == "top") and (pic != None):
self.writeIndented("topUrl=\"%s\" " % basename)
- # self.writeIndented("topUrl=\"%s\" " % pic.filename.split('/')[-1].split('\\')[-1])
+ # self.writeIndented("topUrl=\"%s\" " % pic.filepath.split('/')[-1].split('\\')[-1])
self.writeIndented("/>\n\n")
##########################################################
@@ -1215,9 +1215,6 @@ def x3d_export_ui(filename):
#########################################################
-# if __name__ == '__main__':
-# Blender.Window.FileSelector(x3d_export_ui,"Export X3D", Blender.Get('filename').replace('.blend', '.x3d'))
-
from bpy.props import *
class ExportX3D(bpy.types.Operator):
@@ -1245,7 +1242,7 @@ class ExportX3D(bpy.types.Operator):
def menu_func(self, context):
- default_path = bpy.data.filename.replace(".blend", ".x3d")
+ default_path = bpy.data.filepath.replace(".blend", ".x3d")
self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)").path = default_path
diff --git a/release/scripts/io/netrender/client.py b/release/scripts/io/netrender/client.py
index 5c01884a20e..9f6d1a7639e 100644
--- a/release/scripts/io/netrender/client.py
+++ b/release/scripts/io/netrender/client.py
@@ -101,7 +101,7 @@ def clientSendJob(conn, scene, anim = False):
else:
job.addFrame(scene.frame_current)
- filename = bpy.data.filename
+ filename = bpy.data.filepath
job.addFile(filename)
job_name = netsettings.job_name
@@ -113,7 +113,7 @@ def clientSendJob(conn, scene, anim = False):
# LIBRARIES
###########################
for lib in bpy.data.libraries:
- file_path = bpy.utils.expandpath(lib.filename)
+ file_path = bpy.utils.expandpath(lib.filepath)
if os.path.exists(file_path):
job.addFile(file_path)
@@ -122,7 +122,7 @@ def clientSendJob(conn, scene, anim = False):
###########################
for image in bpy.data.images:
if image.source == "FILE" and not image.packed_file:
- file_path = bpy.utils.expandpath(image.filename)
+ file_path = bpy.utils.expandpath(image.filepath)
if os.path.exists(file_path):
job.addFile(file_path)
@@ -149,7 +149,7 @@ def clientSendJob(conn, scene, anim = False):
if modifier.domain_settings.highres:
addPointCache(job, object, modifier.domain_settings.point_cache_high, default_path)
elif modifier.type == "MULTIRES" and modifier.external:
- file_path = bpy.utils.expandpath(modifier.filename)
+ file_path = bpy.utils.expandpath(modifier.filepath)
job.addFile(file_path)
# particles modifier are stupid and don't contain data
diff --git a/release/scripts/io/netrender/operators.py b/release/scripts/io/netrender/operators.py
index fbb0f0b4043..02cb864cd1a 100644
--- a/release/scripts/io/netrender/operators.py
+++ b/release/scripts/io/netrender/operators.py
@@ -39,7 +39,7 @@ class RENDER_OT_netslave_bake(bpy.types.Operator):
scene = context.scene
netsettings = scene.network_render
- filename = bpy.data.filename
+ filename = bpy.data.filepath
path, name = os.path.split(filename)
root, ext = os.path.splitext(name)
default_path = path + os.sep + "blendcache_" + root + os.sep # need an API call for that
diff --git a/release/scripts/io/netrender/repath.py b/release/scripts/io/netrender/repath.py
index 5287fc03221..7d399172906 100755
--- a/release/scripts/io/netrender/repath.py
+++ b/release/scripts/io/netrender/repath.py
@@ -87,20 +87,20 @@ def process(paths):
# LIBRARIES
###########################
for lib in bpy.data.libraries:
- file_path = bpy.utils.expandpath(lib.filename)
+ file_path = bpy.utils.expandpath(lib.filepath)
new_path = path_map.get(file_path, None)
if new_path:
- lib.filename = new_path
+ lib.filepath = new_path
###########################
# IMAGES
###########################
for image in bpy.data.images:
if image.source == "FILE" and not image.packed_file:
- file_path = bpy.utils.expandpath(image.filename)
+ file_path = bpy.utils.expandpath(image.filepath)
new_path = path_map.get(file_path, None)
if new_path:
- image.filename = new_path
+ image.filepath = new_path
###########################
@@ -119,10 +119,10 @@ def process(paths):
if modifier.domain_settings.highres:
processPointCache(modifier.domain_settings.point_cache_high)
elif modifier.type == "MULTIRES" and modifier.external:
- file_path = bpy.utils.expandpath(modifier.filename)
+ file_path = bpy.utils.expandpath(modifier.filepath)
new_path = path_map.get(file_path, None)
if new_path:
- modifier.filename = new_path
+ modifier.filepath = new_path
# particles modifier are stupid and don't contain data
# we have to go through the object property
diff --git a/release/scripts/io/netrender/ui.py b/release/scripts/io/netrender/ui.py
index c554c3031fb..c60b10c484a 100644
--- a/release/scripts/io/netrender/ui.py
+++ b/release/scripts/io/netrender/ui.py
@@ -37,8 +37,8 @@ DONE = 2
ERROR = 3
def init_file():
- if netrender.init_file != bpy.data.filename:
- netrender.init_file = bpy.data.filename
+ if netrender.init_file != bpy.data.filepath:
+ netrender.init_file = bpy.data.filepath
netrender.init_data = True
netrender.init_address = True
diff --git a/release/scripts/modules/add_object_utils.py b/release/scripts/modules/add_object_utils.py
index e4130d9136a..350191af807 100644
--- a/release/scripts/modules/add_object_utils.py
+++ b/release/scripts/modules/add_object_utils.py
@@ -21,21 +21,29 @@
import bpy
import mathutils
-def _align_matrix(context):
- # TODO, local view cursor!
- location = mathutils.TranslationMatrix(context.scene.cursor_location)
+def add_object_align_init(context, operator):
- if context.user_preferences.edit.object_align == 'VIEW' and context.space_data.type == 'VIEW_3D':
- rotation = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+ if operator and operator.properties.is_property_set("location") and operator.properties.is_property_set("rotation"):
+ location = mathutils.TranslationMatrix(mathutils.Vector(operator.properties.location))
+ rotation = mathutils.Euler(operator.properties.rotation).to_matrix().resize4x4()
else:
- rotation = mathutils.Matrix()
+ # TODO, local view cursor!
+ location = mathutils.TranslationMatrix(context.scene.cursor_location)
- align_matrix = location * rotation
+ if context.user_preferences.edit.object_align == 'VIEW' and context.space_data.type == 'VIEW_3D':
+ rotation = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+ else:
+ rotation = mathutils.Matrix()
- return align_matrix
+ # set the operator properties
+ if operator:
+ operator.properties.location = location.translation_part()
+ operator.properties.rotation = rotation.to_euler()
+ return location * rotation
-def add_object_data(obdata, context):
+
+def add_object_data(context, obdata, operator=None):
scene = context.scene
@@ -52,7 +60,7 @@ def add_object_data(obdata, context):
base.layers_from_view(context.space_data)
- obj_new.matrix = _align_matrix(context)
+ obj_new.matrix = add_object_align_init(context, operator)
obj_act = scene.objects.active
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py
index f0025290f09..1e6db441599 100644
--- a/release/scripts/modules/bpy/__init__.py
+++ b/release/scripts/modules/bpy/__init__.py
@@ -43,17 +43,11 @@ def _main():
## people need to explain how this is even a fix.
# _sys.path[:] = filter(None, _sys.path)
- # a bit nasty but this prevents help() and input() from locking blender
- # Ideally we could have some way for the console to replace sys.stdin but
- # python would lock blender while waiting for a return value, not easy :|
-
- if not app.debug:
- _sys.stdin = None
-
# because of how the console works. we need our own help() pager func.
# replace the bold function because it adds crazy chars
import pydoc
pydoc.getpager = lambda: pydoc.plainpager
+ pydoc.Helper.getline = lambda self, prompt: None
pydoc.TextDoc.bold = lambda self, text: text
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py
index cab5ee5e684..9b411945da6 100644
--- a/release/scripts/modules/bpy/utils.py
+++ b/release/scripts/modules/bpy/utils.py
@@ -144,6 +144,9 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
_loaded.append(mod)
if reload_scripts:
+
+ # TODO, this is broken but should work, needs looking into
+ '''
# reload modules that may not be directly included
for type_class_name in dir(_bpy.types):
type_class = getattr(_bpy.types, type_class_name)
@@ -156,6 +159,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
for module_name in sorted(loaded_modules):
print("Reloading:", module_name)
test_reload(_sys.modules[module_name])
+ '''
# loop over and unload all scripts
_loaded.reverse()
@@ -166,6 +170,10 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
unregister()
except:
traceback.print_exc()
+
+ for mod in _loaded:
+ reload(mod)
+
_loaded[:] = []
user_path = user_script_path()
@@ -209,7 +217,7 @@ def expandpath(path):
Returns the absolute path relative to the current blend file using the "//" prefix.
"""
if path.startswith("//"):
- return _os.path.join(_os.path.dirname(_bpy.data.filename), path[2:])
+ return _os.path.join(_os.path.dirname(_bpy.data.filepath), path[2:])
return path
@@ -223,7 +231,7 @@ def relpath(path, start=None):
"""
if not path.startswith("//"):
if start is None:
- start = _os.path.dirname(_bpy.data.filename)
+ start = _os.path.dirname(_bpy.data.filepath)
return "//" + _os.path.relpath(path, start)
return path
diff --git a/release/scripts/modules/graphviz_export.py b/release/scripts/modules/graphviz_export.py
index fd32a7ee3b9..874b79d8ea2 100644
--- a/release/scripts/modules/graphviz_export.py
+++ b/release/scripts/modules/graphviz_export.py
@@ -57,7 +57,7 @@ def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True,
fileobject = open(path, "w")
fw = fileobject.write
fw(header)
- fw('label = "%s::%s" ;' % (bpy.data.filename.split("/")[-1].split("\\")[-1], obj.name))
+ fw('label = "%s::%s" ;' % (bpy.data.filepath.split("/")[-1].split("\\")[-1], obj.name))
arm = obj.data
diff --git a/release/scripts/modules/rigify/__init__.py b/release/scripts/modules/rigify/__init__.py
index 8a9894c4380..ef8f62ad058 100644
--- a/release/scripts/modules/rigify/__init__.py
+++ b/release/scripts/modules/rigify/__init__.py
@@ -534,7 +534,7 @@ def generate_test_all(context, GRAPH=False):
new_objects = rigify.generate_test(context)
if GRAPH:
- base_name = os.path.splitext(bpy.data.filename)[0]
+ base_name = os.path.splitext(bpy.data.filepath)[0]
for obj, obj_new in new_objects:
for obj in (obj, obj_new):
fn = base_name + "-" + bpy.utils.clean_name(obj.name)
diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py
index d79cbcf3e64..16bf4e1c92c 100644
--- a/release/scripts/op/add_mesh_torus.py
+++ b/release/scripts/op/add_mesh_torus.py
@@ -102,6 +102,10 @@ class AddTorus(bpy.types.Operator):
description="Total Interior Radius of the torus",
default=0.5, min=0.01, max=100.0)
+ # generic transform props
+ location = FloatVectorProperty(name="Location")
+ rotation = FloatVectorProperty(name="Rotation")
+
def execute(self, context):
props = self.properties
@@ -123,7 +127,7 @@ class AddTorus(bpy.types.Operator):
mesh.update()
import add_object_utils
- add_object_utils.add_object_data(mesh, context)
+ add_object_utils.add_object_data(context, mesh, operator=self)
return {'FINISHED'}
diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py
index 87abe0b6f47..1f0d9dbde60 100644
--- a/release/scripts/op/console_python.py
+++ b/release/scripts/op/console_python.py
@@ -85,7 +85,7 @@ def execute(context):
sc = context.space_data
try:
- line = sc.history[-1].line
+ line_object = sc.history[-1]
except:
return {'CANCELLED'}
@@ -102,13 +102,26 @@ def execute(context):
sys.stdout = stdout
sys.stderr = stderr
- # run the console
- if not line.strip():
- line_exec = '\n' # executes a multiline statement
- else:
- line_exec = line
+ # dont allow the stdin to be used, can lock blender.
+ stdin_backup = sys.stdin
+ sys.stdin = None
+
+ # incase exception happens
+ line = "" # incase of encodingf error
+ is_multiline = False
+
+ try:
+ line = line_object.line
- is_multiline = console.push(line_exec)
+ # run the console, "\n" executes a multiline statement
+ line_exec = line if line.strip() else "\n"
+
+ is_multiline = console.push(line_exec)
+ except:
+ # unlikely, but this can happen with unicode errors for example.
+ import traceback
+ stderr.write(traceback.format_exc())
+
stdout.seek(0)
stderr.seek(0)
@@ -144,6 +157,9 @@ def execute(context):
if output_err:
add_scrollback(output_err, 'ERROR')
+ # restore the stdin
+ sys.stdin = stdin_backup
+
return {'FINISHED'}
@@ -154,23 +170,37 @@ def autocomplete(context):
console = get_console(hash(context.region))[0]
- current_line = sc.history[-1]
- line = current_line.line
-
if not console:
return {'CANCELLED'}
if sc.console_type != 'PYTHON':
return {'CANCELLED'}
- # This function isnt aware of the text editor or being an operator
- # just does the autocomp then copy its results back
- current_line.line, current_line.current_character, scrollback = \
- intellisense.expand(
- line=current_line.line,
- cursor=current_line.current_character,
- namespace=console.locals,
- private=bpy.app.debug)
+ # dont allow the stdin to be used, can lock blender.
+ # note: unlikely stdin would be used for autocomp. but its possible.
+ stdin_backup = sys.stdin
+ sys.stdin = None
+
+ scrollback = ""
+ scrollback_error = ""
+
+ try:
+ current_line = sc.history[-1]
+ line = current_line.line
+
+ # This function isnt aware of the text editor or being an operator
+ # just does the autocomp then copy its results back
+ current_line.line, current_line.current_character, scrollback = \
+ intellisense.expand(
+ line=current_line.line,
+ cursor=current_line.current_character,
+ namespace=console.locals,
+ private=bpy.app.debug)
+ except:
+ # unlikely, but this can happen with unicode errors for example.
+ # or if the api attribute access its self causes an error.
+ import traceback
+ scrollback_error = traceback.format_exc()
# Separate automplete output by command prompts
if scrollback != '':
@@ -182,6 +212,12 @@ def autocomplete(context):
if scrollback:
add_scrollback(scrollback, 'INFO')
+ if scrollback_error:
+ add_scrollback(scrollback_error, 'ERROR')
+
+ # restore the stdin
+ sys.stdin = stdin_backup
+
context.area.tag_redraw()
return {'FINISHED'}
diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py
index 9907362502e..873500d8343 100644
--- a/release/scripts/op/image.py
+++ b/release/scripts/op/image.py
@@ -70,7 +70,7 @@ class EditExternally(bpy.types.Operator):
def invoke(self, context, event):
try:
- path = context.space_data.image.filename
+ path = context.space_data.image.filepath
except:
self.report({'ERROR'}, "Image not found on disk")
return {'CANCELLED'}
@@ -91,7 +91,7 @@ class SaveDirty(bpy.types.Operator):
unique_paths = set()
for image in bpy.data.images:
if image.dirty:
- path = bpy.utils.expandpath(image.filename)
+ path = bpy.utils.expandpath(image.filepath)
if "\\" not in path and "/" not in path:
self.report({'WARNING'}, "Invalid path: " + path)
elif path in unique_paths:
@@ -131,37 +131,37 @@ class ProjectEdit(bpy.types.Operator):
self.report({'ERROR'}, "Could not make new image")
return {'CANCELLED'}
- filename = os.path.basename(bpy.data.filename)
- filename = os.path.splitext(filename)[0]
- # filename = bpy.utils.clean_name(filename) # fixes <memory> rubbish, needs checking
+ filepath = os.path.basename(bpy.data.filepath)
+ filepath = os.path.splitext(filepath)[0]
+ # filepath = bpy.utils.clean_name(filepath) # fixes <memory> rubbish, needs checking
- if filename.startswith(".") or filename == "":
+ if filepath.startswith(".") or filepath == "":
# TODO, have a way to check if the file is saved, assume .B25.blend
tmpdir = context.user_preferences.filepaths.temporary_directory
- filename = os.path.join(tmpdir, "project_edit")
+ filepath = os.path.join(tmpdir, "project_edit")
else:
- filename = "//" + filename
+ filepath = "//" + filepath
obj = context.object
if obj:
- filename += "_" + bpy.utils.clean_name(obj.name)
+ filepath += "_" + bpy.utils.clean_name(obj.name)
- filename_final = filename + "." + EXT
+ filepath_final = filepath + "." + EXT
i = 0
- while os.path.exists(bpy.utils.expandpath(filename_final)):
- filename_final = filename + ("%.3d.%s" % (i, EXT))
+ while os.path.exists(bpy.utils.expandpath(filepath_final)):
+ filepath_final = filepath + ("%.3d.%s" % (i, EXT))
i += 1
- image_new.name = os.path.basename(filename_final)
+ image_new.name = os.path.basename(filepath_final)
ProjectEdit._proj_hack[0] = image_new.name
- image_new.filename_raw = filename_final # TODO, filename raw is crummy
+ image_new.filepath_raw = filepath_final # TODO, filepath raw is crummy
image_new.file_format = 'PNG'
image_new.save()
- bpy.ops.image.external_edit(path=filename_final)
+ bpy.ops.image.external_edit(path=filepath_final)
return {'FINISHED'}
diff --git a/release/scripts/op/sequencer.py b/release/scripts/op/sequencer.py
index 8715f7eeec5..48f83613147 100644
--- a/release/scripts/op/sequencer.py
+++ b/release/scripts/op/sequencer.py
@@ -94,11 +94,14 @@ class SequencerCutMulticam(bpy.types.Operator):
s = context.scene.sequence_editor.active_strip
+ if s.multicam_source == camera:
+ return {'FINISHED'}
+
if not s.selected:
s.selected = True
cfra = context.scene.frame_current
- bpy.ops.sequencer.cut(frame=cfra, type='HARD', side='RIGHT')
+ bpy.ops.sequencer.cut(frame=cfra, type='SOFT', side='RIGHT')
for s in context.scene.sequence_editor.sequences_all:
if s.selected and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
context.scene.sequence_editor.active_strip = s
@@ -135,7 +138,6 @@ def register():
register(SequencerCutMulticam)
register(SequencerDeinterlaceSelectedMovies)
-
def unregister():
unregister = bpy.types.unregister
@@ -143,5 +145,7 @@ def unregister():
unregister(SequencerCutMulticam)
unregister(SequencerDeinterlaceSelectedMovies)
+
+
if __name__ == "__main__":
register()
diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py
index ad25553a41c..1a64f61a11a 100644
--- a/release/scripts/op/uv.py
+++ b/release/scripts/op/uv.py
@@ -123,7 +123,7 @@ class ExportUVLayout(bpy.types.Operator):
fw(' "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')
fw('<svg width="%dpx" height="%dpx" viewBox="0px 0px %dpx %dpx"\n' % (image_width, image_height, image_width, image_height))
fw(' xmlns="http://www.w3.org/2000/svg" version="1.1">\n')
- desc = "%s, %s, %s (Blender %s)" % (basename(bpy.data.filename), obj.name, mesh.name, bpy.app.version_string)
+ desc = "%s, %s, %s (Blender %s)" % (basename(bpy.data.filepath), obj.name, mesh.name, bpy.app.version_string)
fw('<desc>%s</desc>\n' % escape(desc))
# svg colors
@@ -210,7 +210,7 @@ class ExportUVLayout(bpy.types.Operator):
def menu_func(self, context):
- default_path = bpy.data.filename.replace(".blend", ".svg")
+ default_path = bpy.data.filepath.replace(".blend", ".svg")
self.layout.operator(ExportUVLayout.bl_idname).path = default_path
diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py
index af72c96a412..d04d6c7a1dd 100644
--- a/release/scripts/op/wm.py
+++ b/release/scripts/op/wm.py
@@ -418,7 +418,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
class WM_OT_url_open(bpy.types.Operator):
- "Open the Blender Wiki in the Webbrowser"
+ "Open a website in the Webbrowser"
bl_idname = "wm.url_open"
bl_label = ""
@@ -543,17 +543,6 @@ class WM_OT_doc_edit(bpy.types.Operator):
return wm.invoke_props_dialog(self, width=600)
-class WM_OT_reload_scripts(bpy.types.Operator):
- '''Load online reference docs'''
- bl_idname = "wm.reload_scripts"
- bl_label = "Reload Scripts"
-
- def execute(self, context):
- MOD = type(bpy)
- bpy.utils.load_scripts(True)
- return {'FINISHED'}
-
-
import rna_prop_ui
classes = [
@@ -577,8 +566,6 @@ classes = [
WM_OT_doc_view,
WM_OT_doc_edit,
- WM_OT_reload_scripts,
-
# experemental!
rna_prop_ui.WM_OT_properties_edit,
rna_prop_ui.WM_OT_properties_add,
diff --git a/release/scripts/ui/properties_data_armature_rigify.py b/release/scripts/ui/properties_data_armature_rigify.py
index 5ec50973ea4..0eba1fb045b 100644
--- a/release/scripts/ui/properties_data_armature_rigify.py
+++ b/release/scripts/ui/properties_data_armature_rigify.py
@@ -212,7 +212,7 @@ class Graph(bpy.types.Operator):
import bpy
reload(graphviz_export)
obj = bpy.context.object
- path = os.path.splitext(bpy.data.filename)[0] + "-" + bpy.utils.clean_name(obj.name)
+ path = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.utils.clean_name(obj.name)
path_dot = path + ".dot"
path_png = path + ".png"
saved = graphviz_export.graph_armature(bpy.context.object, path_dot, CONSTRAINTS=False, DRIVERS=False)
@@ -249,7 +249,7 @@ class AsScript(bpy.types.Operator):
def invoke(self, context, event):
import os
obj = context.object
- self.properties.path = os.path.splitext(bpy.data.filename)[0] + "-" + bpy.utils.clean_name(obj.name) + ".py"
+ self.properties.path = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.utils.clean_name(obj.name) + ".py"
wm = context.manager
wm.add_fileselect(self)
return {'RUNNING_MODAL'}
diff --git a/release/scripts/ui/properties_data_lamp.py b/release/scripts/ui/properties_data_lamp.py
index 4338489ac5a..14493301b1e 100644
--- a/release/scripts/ui/properties_data_lamp.py
+++ b/release/scripts/ui/properties_data_lamp.py
@@ -24,7 +24,7 @@ narrowui = bpy.context.user_preferences.view.properties_width_check
class LAMP_MT_sunsky_presets(bpy.types.Menu):
- bl_label = "Render Presets"
+ bl_label = "Sun & Sky Presets"
preset_subdir = "sunsky"
preset_operator = "script.execute_preset"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
diff --git a/release/scripts/ui/properties_data_modifier.py b/release/scripts/ui/properties_data_modifier.py
index a6d6e098812..cd80d3e9c91 100644
--- a/release/scripts/ui/properties_data_modifier.py
+++ b/release/scripts/ui/properties_data_modifier.py
@@ -455,7 +455,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
row.operator("object.multires_pack_external", text="Pack External")
row.label()
row = col.row()
- row.prop(md, "filename", text="")
+ row.prop(md, "filepath", text="")
else:
row.operator("object.multires_save_external", text="Save External...")
row.label()
diff --git a/release/scripts/ui/properties_particle.py b/release/scripts/ui/properties_particle.py
index 35c1f84cca5..328a9816524 100644
--- a/release/scripts/ui/properties_particle.py
+++ b/release/scripts/ui/properties_particle.py
@@ -705,12 +705,6 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
sub = split.column()
sub.prop(part, "velocity_length")
elif part.ren_as == 'PATH':
-
- if part.type != 'HAIR' and part.physics_type != 'KEYED' and (psys.point_cache.baked is False):
- box = layout.box()
- box.label(text="Baked or keyed particles needed for correct rendering.")
- return
-
sub.prop(part, "render_strand")
subsub = sub.column()
subsub.active = (part.render_strand is False)
@@ -862,11 +856,6 @@ class PARTICLE_PT_draw(ParticleButtonsPanel):
path = (part.ren_as == 'PATH' and part.draw_as == 'RENDER') or part.draw_as == 'PATH'
- if path and part.type != 'HAIR' and part.physics_type != 'KEYED' and psys.point_cache.baked is False:
- box = layout.box()
- box.label(text="Baked or keyed particles needed for correct drawing.")
- return
-
row = layout.row()
row.prop(part, "display", slider=True)
if part.draw_as != 'RENDER' or part.ren_as == 'HALO':
diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py
index 39c6bdf1d9f..eb1c547e419 100644
--- a/release/scripts/ui/properties_texture.py
+++ b/release/scripts/ui/properties_texture.py
@@ -961,7 +961,9 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel):
layout.prop(vd, "domain_object")
layout.prop(vd, "smoke_data_type")
elif vd.file_format == 'IMAGE_SEQUENCE':
- layout.template_image(tex, "image", tex.image_user)
+ layout.template_ID(tex, "image", open="image.open")
+ layout.template_image(tex, "image", tex.image_user, compact=True)
+ #layout.prop(vd, "frames")
layout.prop(vd, "still")
row = layout.row()
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py
index 3ffe10ffeac..7d28b5a883c 100644
--- a/release/scripts/ui/space_info.py
+++ b/release/scripts/ui/space_info.py
@@ -65,10 +65,9 @@ class INFO_HT_header(bpy.types.Header):
layout.template_running_jobs()
- if last_op and last_op.has_reports:
- layout.template_reports_banner(last_op)
- else:
- layout.label(text=scene.statistics())
+ layout.template_reports_banner()
+
+ layout.label(text=scene.statistics())
# XXX: this should be right-aligned to the RHS of the region
layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER', text="")
@@ -310,19 +309,19 @@ class INFO_MT_help(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.operator("help.manual", icon='HELP')
- layout.operator("help.release_logs", icon='URL')
+ layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual'
+ layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-250/'
layout.separator()
- layout.operator("help.blender_website", icon='URL')
- layout.operator("help.blender_eshop", icon='URL')
- layout.operator("help.developer_community", icon='URL')
- layout.operator("help.user_community", icon='URL')
+ layout.operator("wm.url_open", text="Blender Website", icon='URL').url = 'http://www.blender.org/'
+ layout.operator("wm.url_open", text="Blender e-Shop", icon='URL').url = 'http://www.blender.org/e-shop'
+ layout.operator("wm.url_open", text="Developer Community", icon='URL').url = 'http://www.blender.org/community/get-involved/'
+ layout.operator("wm.url_open", text="User Community", icon='URL').url = 'http://www.blender.org/community/user-community/'
layout.separator()
- layout.operator("help.report_bug", icon='URL')
+ layout.operator("wm.url_open", text="Report a Bug", icon='URL').url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
layout.separator()
- layout.operator("help.python_api", icon='URL')
+ layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = 'http://www.blender.org/documentation/250PythonDoc/contents.html'
layout.operator("help.operator_cheat_sheet")
layout.separator()
layout.operator("wm.splash")
@@ -331,70 +330,6 @@ class INFO_MT_help(bpy.types.Menu):
# Help operators
-class HelpOperator(bpy.types.Operator):
-
- def execute(self, context):
- import webbrowser
- webbrowser.open(self._url)
- return {'FINISHED'}
-
-
-class HELP_OT_manual(HelpOperator):
- '''The Blender Wiki manual'''
- bl_idname = "help.manual"
- bl_label = "Manual"
- _url = 'http://wiki.blender.org/index.php/Doc:Manual'
-
-
-class HELP_OT_release_logs(HelpOperator):
- '''Information about the changes in this version of Blender'''
- bl_idname = "help.release_logs"
- bl_label = "Release Log"
- _url = 'http://www.blender.org/development/release-logs/blender-250/'
-
-
-class HELP_OT_blender_website(HelpOperator):
- '''The official Blender website'''
- bl_idname = "help.blender_website"
- bl_label = "Blender Website"
- _url = 'http://www.blender.org/'
-
-
-class HELP_OT_blender_eshop(HelpOperator):
- '''Buy official Blender resources and merchandise online'''
- bl_idname = "help.blender_eshop"
- bl_label = "Blender e-Shop"
- _url = 'http://www.blender.org/e-shop'
-
-
-class HELP_OT_developer_community(HelpOperator):
- '''Get involved with Blender development'''
- bl_idname = "help.developer_community"
- bl_label = "Developer Community"
- _url = 'http://www.blender.org/community/get-involved/'
-
-
-class HELP_OT_user_community(HelpOperator):
- '''Get involved with other Blender users'''
- bl_idname = "help.user_community"
- bl_label = "User Community"
- _url = 'http://www.blender.org/community/user-community/'
-
-
-class HELP_OT_report_bug(HelpOperator):
- '''Report a bug in the Blender bug tracker'''
- bl_idname = "help.report_bug"
- bl_label = "Report a Bug"
- _url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
-
-
-class HELP_OT_python_api(HelpOperator):
- '''Reference for operator and data Python API'''
- bl_idname = "help.python_api"
- bl_label = "Python API Reference"
- _url = 'http://www.blender.org/documentation/250PythonDoc/contents.html'
-
-
class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
bl_idname = "help.operator_cheat_sheet"
bl_label = "Operator Cheat Sheet (new textblock)"
@@ -435,14 +370,6 @@ classes = [
INFO_MT_render,
INFO_MT_help,
- HELP_OT_manual,
- HELP_OT_release_logs,
- HELP_OT_blender_website,
- HELP_OT_blender_eshop,
- HELP_OT_developer_community,
- HELP_OT_user_community,
- HELP_OT_report_bug,
- HELP_OT_python_api,
HELP_OT_operator_cheat_sheet]
diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py
index e300cfd3d32..b94acf6f3ad 100644
--- a/release/scripts/ui/space_sequencer.py
+++ b/release/scripts/ui/space_sequencer.py
@@ -457,6 +457,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
row = layout.row(align=True)
sub = row.row()
sub.scale_x = 2.0
+
if not context.screen.animation_playing:
sub.operator("screen.animation_play", text="", icon='PLAY')
else:
@@ -665,6 +666,12 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel):
row.prop(strip.sound, "caching")
layout.prop(strip, "volume")
+ layout.prop(strip, "attenuation")
+
+ col = layout.column(align=True)
+ col.label(text="Trim Duration:")
+ col.prop(strip, "animation_start_offset", text="Start")
+ col.prop(strip, "animation_end_offset", text="End")
class SEQUENCER_PT_scene(SequencerButtonsPanel):
diff --git a/release/scripts/ui/space_text.py b/release/scripts/ui/space_text.py
index 10740f788f5..1eca1a9e05c 100644
--- a/release/scripts/ui/space_text.py
+++ b/release/scripts/ui/space_text.py
@@ -57,11 +57,11 @@ class TEXT_HT_header(bpy.types.Header):
row.prop(text, "use_module")
row = layout.row()
- if text.filename != "":
+ if text.filepath:
if text.dirty:
- row.label(text="File: *%s (unsaved)" % text.filename)
+ row.label(text="File: *%s (unsaved)" % text.filepath)
else:
- row.label(text="File: %s" % text.filename)
+ row.label(text="File: %s" % text.filepath)
else:
if text.library:
row.label(text="Text: External")
@@ -147,7 +147,7 @@ class TEXT_MT_text(bpy.types.Menu):
layout.operator("text.save")
layout.operator("text.save_as")
- if text.filename != "":
+ if text.filepath:
layout.operator("text.make_internal")
layout.column()
diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py
index d5346c545eb..075a844c543 100644
--- a/release/scripts/ui/space_userpref.py
+++ b/release/scripts/ui/space_userpref.py
@@ -1198,7 +1198,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
# If there are Infos or UI is expanded
if info["expanded"]:
row.operator("wm.addon_expand", icon="TRIA_DOWN").module = module_name
- elif info["author"] or info["version"] or info["url"] or info["location"]:
+ elif info["author"] or info["version"] or info["wiki_url"] or info["location"]:
row.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name
else:
# Else, block UI
@@ -1227,12 +1227,19 @@ class USERPREF_PT_addons(bpy.types.Panel):
split = column.row().split(percentage=0.15)
split.label(text='Description:')
split.label(text=info["description"])
- if info["url"]:
+ if info["wiki_url"] or info["tracker_url"]:
split = column.row().split(percentage=0.15)
split.label(text="Internet:")
- split.operator("wm.addon_links", text="Link to the Wiki").link = info["url"]
- split.separator()
- split.separator()
+ if info["wiki_url"]:
+ split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"]
+ if info["tracker_url"]:
+ split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"]
+
+ if info["wiki_url"] and info["tracker_url"]:
+ split.separator()
+ else:
+ split.separator()
+ split.separator()
# Append missing scripts
# First collect scripts that are used but have no script file.
@@ -1256,7 +1263,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
from bpy.props import *
-def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "description": "", "url": "", "category": "", "expanded": False}):
+def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "description": "", "wiki_url": "", "tracker_url": "", "category": "", "expanded": False}):
addon_info = getattr(mod, "bl_addon_info", {})
# avoid re-initializing
@@ -1421,19 +1428,6 @@ class WM_OT_addon_expand(bpy.types.Operator):
return {'FINISHED'}
-class WM_OT_addon_links(bpy.types.Operator):
- "Open the Blender Wiki in the Webbrowser"
- bl_idname = "wm.addon_links"
- bl_label = ""
-
- link = StringProperty(name="Link", description="Link to open")
-
- def execute(self, context):
- import webbrowser
- webbrowser.open(self.properties.link)
- return {'FINISHED'}
-
-
classes = [
USERPREF_HT_header,
USERPREF_PT_tabs,
@@ -1451,8 +1445,7 @@ classes = [
WM_OT_addon_enable,
WM_OT_addon_disable,
WM_OT_addon_install,
- WM_OT_addon_expand,
- WM_OT_addon_links]
+ WM_OT_addon_expand]
def register():
diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py
index 4a3818eae73..ba2705331a9 100644
--- a/release/scripts/ui/space_view3d.py
+++ b/release/scripts/ui/space_view3d.py
@@ -675,7 +675,11 @@ class VIEW3D_MT_object(bpy.types.Menu):
layout.menu("VIEW3D_MT_object_track")
layout.menu("VIEW3D_MT_object_group")
layout.menu("VIEW3D_MT_object_constraints")
+
+ layout.separator()
+
layout.menu("VIEW3D_MT_object_game_properties")
+ layout.menu("VIEW3D_MT_object_game_logicbricks")
layout.separator()
@@ -853,8 +857,18 @@ class VIEW3D_MT_object_game_properties(bpy.types.Menu):
layout.operator("object.game_property_copy", text="Replace").operation="REPLACE"
layout.operator("object.game_property_copy", text="Merge").operation="MERGE"
- # layout.operator("object.game_property_copy").operation="CLEAR" doesn't really belong as part of copy...
layout.operator_menu_enum("object.game_property_copy", "property", text="Copy...")
+ layout.separator()
+ layout.operator("object.game_property_clear")
+
+
+class VIEW3D_MT_object_game_logicbricks(bpy.types.Menu):
+ bl_label = "Logic Bricks"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator("object.logic_bricks_copy", text="Copy")
# ********** Vertex paint menu **********
@@ -2222,10 +2236,11 @@ classes = [
VIEW3D_MT_object_track,
VIEW3D_MT_object_group,
VIEW3D_MT_object_constraints,
- VIEW3D_MT_object_game_properties,
VIEW3D_MT_object_showhide,
VIEW3D_MT_make_single_user,
VIEW3D_MT_make_links,
+ VIEW3D_MT_object_game_properties,
+ VIEW3D_MT_object_game_logicbricks,
VIEW3D_MT_hook,
VIEW3D_MT_vertex_group,
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 7ca6bbe67a7..ce4286f01c8 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -292,6 +292,8 @@ void CustomData_external_write(struct CustomData *data,
struct ID *id, CustomDataMask mask, int totelem, int free);
void CustomData_external_read(struct CustomData *data,
struct ID *id, CustomDataMask mask, int totelem);
+void CustomData_external_reload(struct CustomData *data,
+ struct ID *id, CustomDataMask mask, int totelem);
#endif
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index 258fb6f1b3f..8716794bbd4 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -42,6 +42,7 @@ void multires_mark_as_modified(struct Object *ob);
void multires_force_update(struct Object *ob);
void multires_force_render_update(struct Object *ob);
+void multires_force_external_reload(struct Object *ob);
struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*,
int local_mmd, struct DerivedMesh*, struct Object *, int, int);
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index fcef00ae9b3..33a41821fe2 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -255,9 +255,11 @@ void psys_threads_free(ParticleThread *threads);
void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3], float zvec[3], float center[3]);
/* particle_system.c */
+void psys_update_path_cache(struct ParticleSimulationData *sim, float cfra);
struct ParticleSystem *psys_get_target_system(struct Object *ob, struct ParticleTarget *pt);
void psys_count_keyed_targets(struct ParticleSimulationData *sim);
void psys_update_particle_tree(struct ParticleSystem *psys, float cfra);
+void psys_update_children(struct ParticleSimulationData *sim);
void psys_make_temp_pointcache(struct Object *ob, struct ParticleSystem *psys);
void psys_get_pointcache_start_end(struct Scene *scene, ParticleSystem *psys, int *sfra, int *efra);
diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h
index 62381bbc1f5..d7b7801d697 100644
--- a/source/blender/blenkernel/BKE_report.h
+++ b/source/blender/blenkernel/BKE_report.h
@@ -59,6 +59,8 @@ void BKE_report_store_level_set(ReportList *reports, ReportType level);
char *BKE_reports_string(ReportList *reports, ReportType level);
void BKE_reports_print(ReportList *reports, ReportType level);
+Report *BKE_reports_last_displayable(ReportList *reports);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h
index ef3ad3ad2e9..940a0027d0b 100644
--- a/source/blender/blenkernel/BKE_subsurf.h
+++ b/source/blender/blenkernel/BKE_subsurf.h
@@ -72,6 +72,7 @@ typedef struct CCGDerivedMesh {
char *faceFlags;
struct PBVH *pbvh;
+ int pbvh_draw;
struct ListBase *fmap;
struct IndexNode *fmap_mem;
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index 6778c9eb8ad..8fad398f00a 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -1159,7 +1159,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss,
int normalDataOffset = ss->normalDataOffset;
int vertDataSize = ss->meshIFC.vertDataSize;
- #pragma omp parallel for private(ptrIdx) schedule(static)
+ //#pragma omp parallel for private(ptrIdx) schedule(static)
for (ptrIdx=0; ptrIdx<numEffectedF; ptrIdx++) {
CCGFace *f = (CCGFace*) effectedF[ptrIdx];
int S, x, y;
@@ -1285,7 +1285,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss,
}
}
- #pragma omp parallel for private(ptrIdx) schedule(static)
+ //#pragma omp parallel for private(ptrIdx) schedule(static)
for (ptrIdx=0; ptrIdx<numEffectedF; ptrIdx++) {
CCGFace *f = (CCGFace*) effectedF[ptrIdx];
int S, x, y;
@@ -1351,7 +1351,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
int vertDataSize = ss->meshIFC.vertDataSize;
void *q = ss->q, *r = ss->r;
- #pragma omp parallel for private(ptrIdx) schedule(static)
+ //#pragma omp parallel for private(ptrIdx) schedule(static)
for (ptrIdx=0; ptrIdx<numEffectedF; ptrIdx++) {
CCGFace *f = (CCGFace*) effectedF[ptrIdx];
int S, x, y;
@@ -1685,17 +1685,17 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
}
}
- #pragma omp parallel private(ptrIdx)
+ //#pragma omp parallel private(ptrIdx)
{
void *q, *r;
- #pragma omp critical
+ //#pragma omp critical
{
q = MEM_mallocN(ss->meshIFC.vertDataSize, "CCGSubsurf q");
r = MEM_mallocN(ss->meshIFC.vertDataSize, "CCGSubsurf r");
}
- #pragma omp for schedule(static)
+ //#pragma omp for schedule(static)
for (ptrIdx=0; ptrIdx<numEffectedF; ptrIdx++) {
CCGFace *f = (CCGFace*) effectedF[ptrIdx];
int S, x, y;
@@ -1779,7 +1779,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
}
}
- #pragma omp critical
+ //#pragma omp critical
{
MEM_freeN(q);
MEM_freeN(r);
@@ -1791,14 +1791,14 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
gridSize = 1 + (1<<((nextLvl)-1));
cornerIdx = gridSize-1;
- #pragma omp parallel for private(i) schedule(static)
+ //#pragma omp parallel for private(i) schedule(static)
for (i=0; i<numEffectedE; i++) {
CCGEdge *e = effectedE[i];
VertDataCopy(EDGE_getCo(e, nextLvl, 0), VERT_getCo(e->v0, nextLvl));
VertDataCopy(EDGE_getCo(e, nextLvl, edgeSize-1), VERT_getCo(e->v1, nextLvl));
}
- #pragma omp parallel for private(i) schedule(static)
+ //#pragma omp parallel for private(i) schedule(static)
for (i=0; i<numEffectedF; i++) {
CCGFace *f = effectedF[i];
int S, x;
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 85791d5024d..9d649edd81a 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1870,10 +1870,6 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
/* grab modifiers until index i */
if((index >= 0) && (modifiers_indexInObject(ob, md) >= index))
break;
-
- /*don't allow other modifiers past multires if in sculpt mode*/
- if (!useRenderParams && ((ob->mode & OB_MODE_SCULPT) && ob->sculpt))
- break;
}
for(md=firstmd; md; md=md->next)
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 82168fddd8f..20afc715c77 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -1188,11 +1188,21 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
BLI_srandom(31415926 + psys->seed);
lay= scene->lay;
- if((psys->renderdata || part->draw_as==PART_DRAW_REND) &&
- ((part->ren_as == PART_DRAW_OB && part->dup_ob) ||
- (part->ren_as == PART_DRAW_GR && part->dup_group && part->dup_group->gobject.first))) {
+ if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
- psys_check_group_weights(part);
+ /* first check for loops (particle system object used as dupli object) */
+ if(part->ren_as == PART_DRAW_OB) {
+ if(ELEM(part->dup_ob, NULL, par))
+ return;
+ }
+ else { /*PART_DRAW_GR */
+ if(part->dup_group == NULL || part->dup_group->gobject.first == NULL)
+ return;
+
+ for(go=part->dup_group->gobject.first; go; go=go->next)
+ if(go->ob == par)
+ return;
+ }
/* if we have a hair particle system, use the path cache */
if(part->type == PART_HAIR) {
@@ -1206,6 +1216,8 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
totpart = psys->totcached;
}
+ psys_check_group_weights(part);
+
psys->lattice = psys_get_lattice(&sim);
/* gather list of objects or single object */
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 204ff2a0369..e15e5bc9b45 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -74,6 +74,7 @@ typedef struct {
/* Cached */
struct PBVH *pbvh;
+ int pbvh_draw;
/* Mesh connectivity */
struct ListBase *fmap;
struct IndexNode *fmap_mem;
@@ -188,6 +189,7 @@ static ListBase *cdDM_getFaceMap(Object *ob, DerivedMesh *dm)
static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
+ Mesh *me= (ob)? ob->data: NULL;
if(!ob) {
cddm->pbvh= NULL;
@@ -196,13 +198,17 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
if(!ob->sculpt)
return NULL;
- if(ob->sculpt->pbvh)
+ if(ob->sculpt->pbvh) {
cddm->pbvh= ob->sculpt->pbvh;
+ cddm->pbvh_draw = (cddm->mvert == me->mvert);
+ }
+ /* always build pbvh from original mesh, and only use it for drawing if
+ this derivedmesh is just original mesh. it's the multires subsurf dm
+ that this is actually for, to support a pbvh on a modified mesh */
if(!cddm->pbvh && ob->type == OB_MESH) {
- Mesh *me= ob->data;
-
cddm->pbvh = BLI_pbvh_new();
+ cddm->pbvh_draw = (cddm->mvert == me->mvert);
BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert,
me->totface, me->totvert);
}
@@ -417,7 +423,7 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
glVertex3fv(mvert[index].co); \
}
- if(cddm->pbvh) {
+ if(cddm->pbvh && cddm->pbvh_draw) {
if(dm->numFaceData) {
float (*face_nors)[3] = CustomData_get_layer(&dm->faceData, CD_NORMAL);
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 361e6f3fd22..dcc0a0b876f 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2316,12 +2316,31 @@ int CustomData_verify_versions(struct CustomData *data, int index)
static void customdata_external_filename(char filename[FILE_MAX], ID *id, CustomDataExternal *external)
{
- char *path = (id->lib)? id->lib->filename: G.sce;
+ char *path = (id->lib)? id->lib->filepath: G.sce;
BLI_strncpy(filename, external->filename, FILE_MAX);
BLI_path_abs(filename, path);
}
+void CustomData_external_reload(CustomData *data, ID *id, CustomDataMask mask, int totelem)
+{
+ CustomDataLayer *layer;
+ const LayerTypeInfo *typeInfo;
+ int i;
+
+ for(i=0; i<data->totlayer; i++) {
+ layer = &data->layers[i];
+ typeInfo = layerType_getInfo(layer->type);
+
+ if(!(mask & (1<<layer->type)));
+ else if((layer->flag & CD_FLAG_EXTERNAL) && (layer->flag & CD_FLAG_IN_MEMORY)) {
+ if(typeInfo->free)
+ typeInfo->free(layer->data, totelem, typeInfo->size);
+ layer->flag &= ~CD_FLAG_IN_MEMORY;
+ }
+ }
+}
+
void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int totelem)
{
CustomDataExternal *external= data->external;
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 0568050950f..bdeacdf6946 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2286,11 +2286,7 @@ void DAG_id_flush_update(ID *id, short flag)
/* no point in trying in this cases */
if(!id || id->us <= 1)
id= NULL;
- /* curves and surfaces only need to mark one object, since
- otherwise cu->displist would be computed multiple times */
- else if(ob->type==OB_CURVE || ob->type==OB_SURF)
- id= NULL;
- /* also for locked shape keys we make an exception */
+ /* for locked shape keys we make an exception */
else if(ob_get_key(ob) && (ob->shapeflag & OB_SHAPE_LOCK))
id= NULL;
}
@@ -2301,15 +2297,23 @@ void DAG_id_flush_update(ID *id, short flag)
idtype= GS(id->name);
if(ELEM7(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR)) {
+ int first_ob= 1;
for(obt=bmain->object.first; obt; obt= obt->id.next) {
if(!(ob && obt == ob) && obt->data == id) {
+
+ /* try to avoid displist recalculation for linked curves */
+ if (!first_ob && ELEM(obt->type, OB_CURVE, OB_SURF)) {
+ /* if curve object has got derivedFinal it means this
+ object has got constructive modifiers and object
+ should be recalculated anyhow */
+ if (!obt->derivedFinal)
+ continue;
+ }
+
obt->recalc |= OB_RECALC_DATA;
BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH);
- /* for these we only flag one object, otherwise cu->displist
- would be computed multiple times */
- if(obt->type==OB_CURVE || obt->type==OB_SURF)
- break;
+ first_ob= 0;
}
}
}
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 619bb1a58f9..43f01199b69 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1418,7 +1418,7 @@ static float evaluate_driver (ChannelDriver *driver, float evaltime)
/* this evaluates the expression using Python,and returns its result:
* - on errors it reports, then returns 0.0f
*/
- driver->curval= BPY_pydriver_eval(driver);
+ driver->curval= BPY_eval_driver(driver);
}
#endif /* DISABLE_PYTHON*/
}
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 868b06f2348..6fcc49f9ec1 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -44,7 +44,7 @@
#include "BKE_utildefines.h"
#ifndef DISABLE_PYTHON
-#include "BPY_extern.h" /* for BPY_pydriver_eval() */
+#include "BPY_extern.h" /* for BPY_eval_driver() */
#endif
#define SMALL -1.0e-10
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 39efd9fe72e..f860f579930 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1562,7 +1562,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
BLI_strncpy(name, ima->name, sizeof(name));
if(ima->id.lib)
- BLI_path_abs(name, ima->id.lib->filename);
+ BLI_path_abs(name, ima->id.lib->filepath);
else
BLI_path_abs(name, G.sce);
@@ -1669,7 +1669,7 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
BLI_strncpy(str, ima->name, FILE_MAX);
if(ima->id.lib)
- BLI_path_abs(str, ima->id.lib->filename);
+ BLI_path_abs(str, ima->id.lib->filepath);
else
BLI_path_abs(str, G.sce);
@@ -1727,7 +1727,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
/* get the right string */
BLI_strncpy(str, ima->name, sizeof(str));
if(ima->id.lib)
- BLI_path_abs(str, ima->id.lib->filename);
+ BLI_path_abs(str, ima->id.lib->filepath);
else
BLI_path_abs(str, G.sce);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 1381a3b19dd..5931bf973af 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1225,7 +1225,7 @@ static void image_fix_relative_path(Image *ima)
{
if(ima->id.lib==NULL) return;
if(strncmp(ima->name, "//", 2)==0) {
- BLI_path_abs(ima->name, ima->id.lib->filename);
+ BLI_path_abs(ima->name, ima->id.lib->filepath);
BLI_path_rel(ima->name, G.sce);
}
}
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index d8c39abc44a..ee8a74d6fbb 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -139,6 +139,14 @@ void multires_force_update(Object *ob)
}
}
+void multires_force_external_reload(Object *ob)
+{
+ Mesh *me = get_mesh(ob);
+
+ CustomData_external_reload(&me->fdata, &me->id, CD_MASK_MDISPS, me->totface);
+ multires_force_update(ob);
+}
+
void multires_force_render_update(Object *ob)
{
if(ob && (ob->mode & OB_MODE_SCULPT) && modifiers_findByType(ob, eModifierType_Multires))
@@ -552,7 +560,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int
dGridSize = multires_side_tot[totlvl];
dSkip = (dGridSize-1)/(gridSize-1);
- #pragma omp parallel for private(i) schedule(static)
+ //#pragma omp parallel for private(i) schedule(static)
for(i = 0; i < me->totface; ++i) {
const int numVerts = mface[i].v4 ? 4 : 3;
MDisps *mdisp = &mdisps[i];
@@ -560,7 +568,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int
/* when adding new faces in edit mode, need to allocate disps */
if(!mdisp->disps)
- #pragma omp critical
+ //#pragma omp critical
{
multires_reallocate_mdisps(me, mdisps, totlvl);
}
@@ -646,7 +654,9 @@ static void multiresModifier_update(DerivedMesh *dm)
int i, j, numGrids, highGridSize, lowGridSize;
/* create subsurf DM from original mesh at high level */
- cddm = CDDM_from_mesh(me, NULL);
+ if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
+ else cddm = CDDM_from_mesh(me, NULL);
+
highdm = subsurf_dm_create_local(ob, cddm, totlvl, mmd->simple, 0);
/* create multires DM from original mesh and displacements */
@@ -697,7 +707,9 @@ static void multiresModifier_update(DerivedMesh *dm)
else {
DerivedMesh *cddm, *subdm;
- cddm = CDDM_from_mesh(me, NULL);
+ if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
+ else cddm = CDDM_from_mesh(me, NULL);
+
subdm = subsurf_dm_create_local(ob, cddm, mmd->totlvl, mmd->simple, 0);
cddm->release(cddm);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index fffbd31aa02..0c55cc2aaac 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -433,7 +433,7 @@ void free_keyed_keys(ParticleSystem *psys)
}
}
}
-static void free_child_path_cache(ParticleSystem *psys)
+void psys_free_child_path_cache(ParticleSystem *psys)
{
psys_free_path_cache_buffers(psys->childcache, &psys->childcachebufs);
psys->childcache = NULL;
@@ -451,7 +451,7 @@ void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit)
psys->pathcache= NULL;
psys->totcached= 0;
- free_child_path_cache(psys);
+ psys_free_child_path_cache(psys);
}
}
void psys_free_children(ParticleSystem *psys)
@@ -462,7 +462,7 @@ void psys_free_children(ParticleSystem *psys)
psys->totchild=0;
}
- free_child_path_cache(psys);
+ psys_free_child_path_cache(psys);
}
void psys_free_particles(ParticleSystem *psys)
{
@@ -1037,6 +1037,7 @@ typedef struct ParticleInterpolationData {
ParticleKey *kkey[2];
PointCache *cache;
+ PTCacheMem *pm;
PTCacheEditPoint *epoint;
PTCacheEditKey *ekey[2];
@@ -1045,31 +1046,74 @@ typedef struct ParticleInterpolationData {
int bspline;
} ParticleInterpolationData;
/* Assumes pointcache->mem_cache exists, so for disk cached particles call psys_make_temp_pointcache() before use */
-static void get_pointcache_keys_for_time(Object *ob, PointCache *cache, int index, float t, ParticleKey *key1, ParticleKey *key2)
+/* It uses ParticleInterpolationData->pm to store the current memory cache frame so it's thread safe. */
+static void get_pointcache_keys_for_time(Object *ob, PointCache *cache, PTCacheMem **cur, int index, float t, ParticleKey *key1, ParticleKey *key2)
{
- static PTCacheMem *pm = NULL; /* not thread safe */
+ static PTCacheMem *pm = NULL;
if(index < 0) { /* initialize */
- pm = cache->mem_cache.first;
+ *cur = cache->mem_cache.first;
- if(pm)
- pm = pm->next;
+ if(*cur)
+ *cur = (*cur)->next;
}
else {
- if(pm) {
- while(pm && pm->next && (float)pm->frame < t)
- pm = pm->next;
+ if(*cur) {
+ while(*cur && (*cur)->next && (float)(*cur)->frame < t)
+ *cur = (*cur)->next;
+
+ pm = *cur;
BKE_ptcache_make_particle_key(key2, pm->index_array ? pm->index_array[index] - 1 : index, pm->data, (float)pm->frame);
- BKE_ptcache_make_particle_key(key1, pm->prev->index_array ? pm->prev->index_array[index] - 1 : index, pm->prev->data, (float)pm->prev->frame);
+ if(pm->prev->index_array && pm->prev->index_array[index] == 0)
+ copy_particle_key(key1, key2, 1);
+ else
+ BKE_ptcache_make_particle_key(key1, pm->prev->index_array ? pm->prev->index_array[index] - 1 : index, pm->prev->data, (float)pm->prev->frame);
}
else if(cache->mem_cache.first) {
- PTCacheMem *pm2 = cache->mem_cache.first;
- BKE_ptcache_make_particle_key(key2, pm2->index_array ? pm2->index_array[index] - 1 : index, pm2->data, (float)pm2->frame);
+ pm = cache->mem_cache.first;
+ BKE_ptcache_make_particle_key(key2, pm->index_array ? pm->index_array[index] - 1 : index, pm->data, (float)pm->frame);
copy_particle_key(key1, key2, 1);
}
}
}
+static int get_pointcache_times_for_particle(PointCache *cache, int index, float *start, float *end)
+{
+ PTCacheMem *pm;
+ int ret = 0;
+
+ for(pm=cache->mem_cache.first; pm; pm=pm->next) {
+ if(pm->index_array) {
+ if(pm->index_array[index]) {
+ *start = pm->frame;
+ ret++;
+ break;
+ }
+ }
+ else {
+ *start = pm->frame;
+ ret++;
+ break;
+ }
+ }
+
+ for(pm=cache->mem_cache.last; pm; pm=pm->prev) {
+ if(pm->index_array) {
+ if(pm->index_array[index]) {
+ *end = pm->frame;
+ ret++;
+ break;
+ }
+ }
+ else {
+ *end = pm->frame;
+ ret++;
+ break;
+ }
+ }
+
+ return ret == 2;
+}
static void init_particle_interpolation(Object *ob, ParticleSystem *psys, ParticleData *pa, ParticleInterpolationData *pind)
{
@@ -1091,10 +1135,15 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic
pind->dietime = (key + pa->totkey - 1)->time;
}
else if(pind->cache) {
- get_pointcache_keys_for_time(ob, pind->cache, -1, 0.0f, NULL, NULL);
-
+ float start, end;
+ get_pointcache_keys_for_time(ob, pind->cache, &pind->pm, -1, 0.0f, NULL, NULL);
pind->birthtime = pa ? pa->time : pind->cache->startframe;
pind->dietime = pa ? pa->dietime : pind->cache->endframe;
+
+ if(get_pointcache_times_for_particle(pind->cache, pa - psys->particles, &start, &end)) {
+ pind->birthtime = MAX2(pind->birthtime, start);
+ pind->dietime = MIN2(pind->dietime, end);
+ }
}
else {
HairKey *key = pa->hair;
@@ -1224,7 +1273,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
memcpy(keys + 2, pind->kkey[1], sizeof(ParticleKey));
}
else if(pind->cache) {
- get_pointcache_keys_for_time(NULL, pind->cache, p, real_t, keys+1, keys+2);
+ get_pointcache_keys_for_time(NULL, pind->cache, &pind->pm, p, real_t, keys+1, keys+2);
}
else {
hair_to_particle(keys + 1, pind->hkey[0]);
@@ -2672,7 +2721,7 @@ void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, int editupd
}
else {
/* clear out old and create new empty path cache */
- free_child_path_cache(sim->psys);
+ psys_free_child_path_cache(sim->psys);
sim->psys->childcache= psys_alloc_path_cache_buffers(&sim->psys->childcachebufs, totchild, ctx->steps+1);
sim->psys->totchildcache = totchild;
}
@@ -2743,7 +2792,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
int keyed, baked;
/* we don't have anything valid to create paths from so let's quit here */
- if((psys->flag & PSYS_HAIR_DONE || psys->flag & PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED)==0)
+ if((psys->flag & PSYS_HAIR_DONE || psys->flag & PSYS_KEYED || psys->pointcache)==0)
return;
if(psys_in_edit_mode(sim->scene, psys))
@@ -2753,7 +2802,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
BLI_srandom(psys->seed);
keyed = psys->flag & PSYS_KEYED;
- baked = !hair_dm && psys->pointcache->flag & PTCACHE_BAKED;
+ baked = !hair_dm && psys->pointcache->mem_cache.first;
/* clear out old and create new empty path cache */
psys_free_path_cache(psys, psys->edit);
@@ -3148,7 +3197,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
edit->totcached = totpart;
- if(psys && psys->part->type == PART_HAIR) {
+ if(psys) {
ParticleSimulationData sim = {scene, ob, psys, psys_get_modifier(ob, psys), NULL};
psys_cache_child_paths(&sim, cfra, 1);
}
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 25328a06328..ce84ee96d01 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3075,66 +3075,18 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
/* Hair */
/************************************************/
/* check if path cache or children need updating and do it if needed */
-static void psys_update_path_cache(ParticleSimulationData *sim, float cfra)
+void psys_update_path_cache(ParticleSimulationData *sim, float cfra)
{
ParticleSystem *psys = sim->psys;
ParticleSettings *part = psys->part;
- ParticleEditSettings *pset = &sim->scene->toolsettings->particle;
- int distr=0, alloc=0, skip=0;
-
- if((psys->part->childtype && psys->totchild != get_psys_tot_child(sim->scene, psys)) || psys->recalc&PSYS_RECALC_RESET)
- alloc=1;
-
- if(alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (sim->ob && sim->ob->mode & OB_MODE_WEIGHT_PAINT)))
- distr=1;
-
- if(distr){
- if(alloc)
- realloc_particles(sim, sim->psys->totpart);
-
- if(get_psys_tot_child(sim->scene, psys)) {
- /* don't generate children while computing the hair keys */
- if(!(psys->part->type == PART_HAIR) || (psys->flag & PSYS_HAIR_DONE)) {
- distribute_particles(sim, PART_FROM_CHILD);
-
- if(part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES && part->parents!=0.0)
- psys_find_parents(sim);
- }
- }
- else
- psys_free_children(psys);
- }
-
- if((part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED)==0)
- skip = 1; /* only hair, keyed and baked stuff can have paths */
- else if(part->ren_as != PART_DRAW_PATH && !(part->type==PART_HAIR && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)))
- skip = 1; /* particle visualization must be set as path */
- else if(!psys->renderdata) {
- if(part->draw_as != PART_DRAW_REND)
- skip = 1; /* draw visualization */
- else if(psys->pointcache->flag & PTCACHE_BAKING)
- skip = 1; /* no need to cache paths while baking dynamics */
- else if(psys_in_edit_mode(sim->scene, psys)) {
- if((pset->flag & PE_DRAW_PART)==0)
- skip = 1;
- else if(part->childtype==0 && (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED)==0)
- skip = 1; /* in edit mode paths are needed for child particles and dynamic hair */
- }
- }
-
- if(!skip) {
+
+ /* only hair, keyed and baked stuff can have paths */
+ if(part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->mem_cache.first) {
psys_cache_paths(sim, cfra);
/* for render, child particle paths are computed on the fly */
- if(part->childtype) {
- if(!psys->totchild)
- skip = 1;
- else if((psys->part->type == PART_HAIR && psys->flag & PSYS_HAIR_DONE)==0)
- skip = 1;
-
- if(!skip)
- psys_cache_child_paths(sim, cfra, 0);
- }
+ if(part->childtype && psys->totchild)
+ psys_cache_child_paths(sim, cfra, 0);
}
else if(psys->pathcache)
psys_free_path_cache(psys, NULL);
@@ -3249,6 +3201,8 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
psys->hair_out_dm = clothModifier_do(psys->clmd, sim->scene, sim->ob, dm, 0, 0);
psys->clmd->sim_parms->effector_weights = NULL;
+
+ psys_free_path_cache(psys, NULL);
}
static void hair_step(ParticleSimulationData *sim, float cfra)
{
@@ -3278,10 +3232,6 @@ static void hair_step(ParticleSimulationData *sim, float cfra)
if(psys->part->type==PART_HAIR && psys->flag & PSYS_HAIR_DYNAMICS)
do_hair_dynamics(sim);
- psys_update_effectors(sim);
-
- psys_update_path_cache(sim, cfra);
-
psys->flag |= PSYS_HAIR_UPDATED;
}
@@ -3500,14 +3450,19 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
}
free_collider_cache(&sim->colliders);
+
+ if(psys->pathcache)
+ psys_free_path_cache(psys, NULL);
}
-static void update_children(ParticleSimulationData *sim)
+void psys_update_children(ParticleSimulationData *sim)
{
if((sim->psys->part->type == PART_HAIR) && (sim->psys->flag & PSYS_HAIR_DONE)==0)
/* don't generate children while growing hair - waste of time */
psys_free_children(sim->psys);
- else if(sim->psys->part->childtype && sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
- distribute_particles(sim, PART_FROM_CHILD);
+ else if(sim->psys->part->childtype) {
+ if(sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
+ distribute_particles(sim, PART_FROM_CHILD);
+ }
else
psys_free_children(sim->psys);
}
@@ -3762,8 +3717,6 @@ static void system_step(ParticleSimulationData *sim, float cfra)
if(ELEM(cache_result, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED)) {
cached_step(sim, cfra);
- update_children(sim);
- psys_update_path_cache(sim, cfra);
BKE_ptcache_validate(cache, framenr);
@@ -3827,9 +3780,6 @@ static void system_step(ParticleSimulationData *sim, float cfra)
BKE_ptcache_write_cache(use_cache, framenr);
}
- if(init)
- update_children(sim);
-
/* cleanup */
if(psys->lattice){
end_latt_deform(psys->lattice);
@@ -3992,6 +3942,13 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
/* execute drivers only, as animation has already been done */
BKE_animsys_evaluate_animdata(&part->id, part->adt, cfra, ADT_RECALC_DRIVERS);
+ /* TODO: only free child paths in case of PSYS_RECALC_CHILD */
+ if(psys->recalc & PSYS_RECALC)
+ psys_free_path_cache(psys, NULL);
+
+ if(psys->recalc & PSYS_RECALC_CHILD)
+ psys_free_children(psys);
+
if(psys->recalc & PSYS_RECALC_TYPE)
psys_changed_type(&sim);
else if(psys->recalc & PSYS_RECALC_PHYS)
@@ -4048,7 +4005,6 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
if(part->phystype == PART_PHYS_KEYED) {
psys_count_keyed_targets(&sim);
set_keyed_keys(&sim);
- psys_update_path_cache(&sim,(int)cfra);
}
break;
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index cb596622431..e14828d0f20 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1080,7 +1080,7 @@ static int ptcache_path(PTCacheID *pid, char *filename)
char file[MAX_PTCACHE_PATH]; /* we dont want the dir, only the file */
char *blendfilename;
- blendfilename= (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH)==0) ? lib->filename: G.sce;
+ blendfilename= (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH)==0) ? lib->filepath: G.sce;
BLI_split_dirfile(blendfilename, NULL, file);
i = strlen(file);
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index da8b018d3f8..d5990ce81ec 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -32,6 +32,7 @@
#include "BKE_report.h"
#include "BKE_global.h" /* G.background only */
+#include "BKE_utildefines.h"
#include <stdarg.h>
#include <stdio.h>
@@ -262,3 +263,14 @@ void BKE_reports_print(ReportList *reports, ReportType level)
MEM_freeN(cstring);
}
+Report *BKE_reports_last_displayable(ReportList *reports)
+{
+ Report *report=NULL;
+
+ for (report= (Report *)reports->list.last; report; report=report->prev) {
+ if (ELEM3(report->type, RPT_ERROR, RPT_WARNING, RPT_INFO))
+ return report;
+ }
+
+ return NULL;
+} \ No newline at end of file
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 24e5014a741..6402f908422 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -256,7 +256,7 @@ void sound_load(struct Main *bmain, struct bSound* sound)
BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
if(sound->id.lib)
- path = sound->id.lib->filename;
+ path = sound->id.lib->filepath;
else
path = bmain ? bmain->name : G.sce;
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 72236a76032..53206bb3970 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -44,6 +44,7 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
+#include "BKE_modifier.h"
#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_subsurf.h"
@@ -2229,10 +2230,28 @@ static ListBase *ccgDM_getFaceMap(Object *ob, DerivedMesh *dm)
return ccgdm->fmap;
}
+static int ccgDM_use_grid_pbvh(CCGDerivedMesh *ccgdm)
+{
+ ModifierData *md;
+ MultiresModifierData *mmd= ccgdm->multires.mmd;
+
+ /* in sync with sculpt mode, only use multires grid pbvh if we are
+ the last enabled modifier in the stack, otherwise we use the base
+ mesh */
+ if(!mmd)
+ return 0;
+
+ for(md=mmd->modifier.next; md; md= md->next)
+ if(modifier_isEnabled(mmd->modifier.scene, md, eModifierMode_Realtime))
+ return 0;
+
+ return 1;
+}
+
static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
{
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
- int gridSize, numGrids;
+ int gridSize, numGrids, grid_pbvh;
if(!ob) {
ccgdm->pbvh= NULL;
@@ -2241,13 +2260,30 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
if(!ob->sculpt)
return NULL;
- if(ob->sculpt->pbvh)
- ccgdm->pbvh= ob->sculpt->pbvh;
+
+ grid_pbvh = ccgDM_use_grid_pbvh(ccgdm);
+
+ if(ob->sculpt->pbvh) {
+ if(grid_pbvh) {
+ /* pbvh's grids, gridadj and gridfaces points to data inside ccgdm
+ but this can be freed on ccgdm release, this updates the pointers
+ when the ccgdm gets remade, the assumption is that the topology
+ does not change. */
+ ccgdm_create_grids(dm);
+ BLI_pbvh_grids_update(ob->sculpt->pbvh, ccgdm->gridData, ccgdm->gridAdjacency, (void**)ccgdm->gridFaces);
+ }
+
+ ccgdm->pbvh = ob->sculpt->pbvh;
+ ccgdm->pbvh_draw = grid_pbvh;
+ }
if(ccgdm->pbvh)
return ccgdm->pbvh;
- if(ccgdm->multires.mmd) {
+ /* no pbvh exists yet, we need to create one. only in case of multires
+ we build a pbvh over the modified mesh, in other cases the base mesh
+ is being sculpted, so we build a pbvh from that. */
+ if(grid_pbvh) {
ccgdm_create_grids(dm);
gridSize = ccgDM_getGridSize(dm);
@@ -2256,6 +2292,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
BLI_pbvh_build_grids(ccgdm->pbvh, ccgdm->gridData, ccgdm->gridAdjacency,
numGrids, gridSize, (void**)ccgdm->gridFaces);
+ ccgdm->pbvh_draw = 1;
}
else if(ob->type == OB_MESH) {
Mesh *me= ob->data;
@@ -2263,6 +2300,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
BLI_pbvh_build_mesh(ccgdm->pbvh, me->mface, me->mvert,
me->totface, me->totvert);
+ ccgdm->pbvh_draw = 0;
}
return ccgdm->pbvh;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 873a4103e3e..6d8c339d2b9 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -1149,7 +1149,8 @@ void BKE_free_pointdensity(PointDensity *pd)
void BKE_free_voxeldatadata(struct VoxelData *vd)
{
if (vd->dataset) {
- MEM_freeN(vd->dataset);
+ if(vd->file_format != TEX_VD_SMOKE)
+ MEM_freeN(vd->dataset);
vd->dataset = NULL;
}
@@ -1173,6 +1174,8 @@ struct VoxelData *BKE_add_voxeldata(void)
vd->int_multiplier = 1.0;
vd->extend = TEX_CLIP;
vd->object = NULL;
+ vd->cachedframe = -1;
+ vd->ok = 0;
return vd;
}
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h
index 0da5b8529bb..e32e85e70ec 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -111,6 +111,8 @@ void BLI_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max
void BLI_pbvh_update(PBVH *bvh, int flags, float (*face_nors)[3]);
void BLI_pbvh_redraw_BB(PBVH *bvh, float bb_min[3], float bb_max[3]);
void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *totface);
+void BLI_pbvh_grids_update(PBVH *bvh, struct DMGridData **grids,
+ struct DMGridAdjacency *gridadj, void **gridfaces);
/* Vertex Iterator */
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index a2bdcfd0076..9b1d29e6e12 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -335,7 +335,7 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
/* get the path info from this datatype */
Image *ima = (Image *)bpi->data;
- bpi->lib = ima->id.lib ? ima->id.lib->filename : NULL;
+ bpi->lib = ima->id.lib ? ima->id.lib->filepath : NULL;
bpi->path = ima->name;
bpi->name = ima->id.name+2;
bpi->len = sizeof(ima->name);
@@ -356,7 +356,7 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
/* get the path info from this datatype */
bSound *snd = (bSound *)bpi->data;
- bpi->lib = snd->id.lib ? snd->id.lib->filename : NULL;
+ bpi->lib = snd->id.lib ? snd->id.lib->filepath : NULL;
bpi->path = snd->name;
bpi->name = snd->id.name+2;
bpi->len = sizeof(snd->name);
@@ -377,7 +377,7 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
/* get the path info from this datatype */
VFont *vf = (VFont *)bpi->data;
- bpi->lib = vf->id.lib ? vf->id.lib->filename : NULL;
+ bpi->lib = vf->id.lib ? vf->id.lib->filepath : NULL;
bpi->path = vf->name;
bpi->name = vf->id.name+2;
bpi->len = sizeof(vf->name);
@@ -424,7 +424,7 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
if (bpi->data) {
Mesh *me = (Mesh *)bpi->data;
- bpi->lib = me->id.lib ? me->id.lib->filename : NULL;
+ bpi->lib = me->id.lib ? me->id.lib->filepath : NULL;
bpi->path = me->fdata.external->filename;
bpi->name = me->id.name+2;
bpi->len = sizeof(me->fdata.external->filename);
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index f973d4e894b..0a06cd10e1e 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -1669,9 +1669,9 @@ void polarview_m4(float Vm[][4],float dist, float azimuth, float incidence, floa
unit_m4(Vm);
translate_m4(Vm,0.0, 0.0, -dist);
- rotate_m4(Vm,'z',-twist);
- rotate_m4(Vm,'x',-incidence);
- rotate_m4(Vm,'z',-azimuth);
+ rotate_m4(Vm,'Z',-twist);
+ rotate_m4(Vm,'X',-incidence);
+ rotate_m4(Vm,'Z',-azimuth);
}
void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py, float pz, float twist)
@@ -1682,7 +1682,7 @@ void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py,
unit_m4(mat);
unit_m4(mat1);
- rotate_m4(mat,'z',-twist);
+ rotate_m4(mat, 'Z', -twist);
dx = px - vx;
dy = py - vy;
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 85d18d99f96..301b981cdc7 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -354,8 +354,6 @@ void BLI_cleanup_file(const char *relabase, char *dir)
void BLI_path_rel(char *file, const char *relfile)
{
- char * p;
- char * q;
char * lslash;
char temp[FILE_MAXDIR+FILE_MAXFILE];
char res[FILE_MAXDIR+FILE_MAXFILE];
@@ -403,11 +401,18 @@ void BLI_path_rel(char *file, const char *relfile)
{
/* find the prefix of the filename that is equal for both filenames.
This is replaced by the two slashes at the beginning */
- p = temp;
- q = file;
- while (*p == *q) {
+ char *p= temp;
+ char *q= file;
+
+ while ((*p == *q)) {
++p; ++q;
+ /* dont search beyond the end of the string
+ * in the rare case they match */
+ if ((*p=='\0') || (*q=='\0')) {
+ break;
+ }
}
+
/* we might have passed the slash when the beginning of a dir matches
so we rewind. Only check on the actual filename
*/
@@ -839,11 +844,12 @@ static int gethome_path_local(char *targetpath, char *folder_name)
i = s - bprogname + 1;
BLI_strncpy(bprogdir, bprogname, i);
- /* try release/folder_name (CWD relative) */
- if(test_data_path(targetpath, BLI_getwdN(cwd), "release", folder_name))
+ /* try release/folder_name (BIN relative) */
+ if(test_data_path(targetpath, bprogdir, "release", folder_name))
return 1;
- if(test_data_path(targetpath, bprogdir, "release", folder_name))
+ /* try release/folder_name (CWD relative) */
+ if(test_data_path(targetpath, BLI_getwdN(cwd), "release", folder_name))
return 1;
/* try ./.blender/folder_name */
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 8aff062c1d4..1fd18e2967c 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -1323,3 +1323,10 @@ void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], int smo
}
}
+void BLI_pbvh_grids_update(PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridadj, void **gridfaces)
+{
+ bvh->grids= grids;
+ bvh->gridadj= gridadj;
+ bvh->gridfaces= gridfaces;
+}
+
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c74b1e7b374..145d0a9c0c8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -507,7 +507,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *name, c
// printf("blo_find_main: converted to %s\n", name1);
for (m= mainlist->first; m; m= m->next) {
- char *libname= (m->curlib)?m->curlib->filename:m->name;
+ char *libname= (m->curlib)?m->curlib->filepath:m->name;
if (BLI_streq(name1, libname)) {
if(G.f & G_DEBUG) printf("blo_find_main: found library %s\n", libname);
@@ -520,7 +520,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *name, c
lib= alloc_libblock(&m->library, ID_LI, "lib");
strncpy(lib->name, name, sizeof(lib->name)-1);
- BLI_strncpy(lib->filename, name1, sizeof(lib->filename));
+ BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath));
m->curlib= lib;
@@ -2839,6 +2839,7 @@ static void direct_link_texture(FileData *fd, Tex *tex)
tex->vd= newdataadr(fd, tex->vd);
if(tex->vd) {
tex->vd->dataset = NULL;
+ tex->vd->ok = 0;
}
tex->nodetree= newdataadr(fd, tex->nodetree);
@@ -4174,7 +4175,7 @@ static void lib_link_scene(FileData *fd, Main *main)
if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
if(seq->scene) {
seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
- seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs);
+ seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
}
if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
if(seq->sound) {
@@ -4185,7 +4186,7 @@ static void lib_link_scene(FileData *fd, Main *main)
seq->sound= newlibadr(fd, sce->id.lib, seq->sound);
if (seq->sound) {
seq->sound->id.us++;
- seq->scene_sound = sound_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs);
+ seq->scene_sound = sound_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
}
}
seq->anim= 0;
@@ -5237,8 +5238,8 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main)
for(newmain= fd->mainlist.first; newmain; newmain= newmain->next) {
if(newmain->curlib) {
- if(strcmp(newmain->curlib->filename, lib->filename)==0) {
- printf("Fixed error in file; multiple instances of lib:\n %s\n", lib->filename);
+ if(strcmp(newmain->curlib->filepath, lib->filepath)==0) {
+ printf("Fixed error in file; multiple instances of lib:\n %s\n", lib->filepath);
change_idid_adr(&fd->mainlist, fd, lib, newmain->curlib);
// change_idid_adr_fd(fd, lib, newmain->curlib);
@@ -5253,8 +5254,8 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main)
}
}
/* make sure we have full path in lib->filename */
- BLI_strncpy(lib->filename, lib->name, sizeof(lib->name));
- cleanup_path(fd->relabase, lib->filename);
+ BLI_strncpy(lib->filepath, lib->name, sizeof(lib->name));
+ cleanup_path(fd->relabase, lib->filepath);
// printf("direct_link_library: name %s\n", lib->name);
// printf("direct_link_library: filename %s\n", lib->filename);
@@ -5287,7 +5288,7 @@ static void fix_relpaths_library(const char *basepath, Main *main)
/* Libraries store both relative and abs paths, recreate relative paths,
* relative to the blend file since indirectly linked libs will be relative to their direct linked library */
if (strncmp(lib->name, "//", 2)==0) { /* if this is relative to begin with? */
- strncpy(lib->name, lib->filename, sizeof(lib->name));
+ strncpy(lib->name, lib->filepath, sizeof(lib->name));
BLI_path_rel(lib->name, basepath);
}
}
@@ -12220,7 +12221,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in
if(flag & FILE_RELPATH) {
/* use the full path, this could have been read by other library even */
- BLI_strncpy(mainl->curlib->name, mainl->curlib->filename, sizeof(mainl->curlib->name));
+ BLI_strncpy(mainl->curlib->name, mainl->curlib->filepath, sizeof(mainl->curlib->name));
/* uses current .blend file as reference */
BLI_path_rel(mainl->curlib->name, G.sce);
@@ -12337,10 +12338,10 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if(fd==NULL) {
/* printf and reports for now... its important users know this */
- BKE_reportf(basefd->reports, RPT_INFO, "read library: '%s', '%s'\n", mainptr->curlib->filename, mainptr->curlib->name);
- if(!G.background && basefd->reports) printf("read library: '%s', '%s'\n", mainptr->curlib->filename, mainptr->curlib->name);
+ BKE_reportf(basefd->reports, RPT_INFO, "read library: '%s', '%s'\n", mainptr->curlib->filepath, mainptr->curlib->name);
+ if(!G.background && basefd->reports) printf("read library: '%s', '%s'\n", mainptr->curlib->filepath, mainptr->curlib->name);
- fd= blo_openblenderfile(mainptr->curlib->filename, basefd->reports);
+ fd= blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
/* allow typing in a new lib path */
if(G.rt==-666) {
@@ -12348,19 +12349,19 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
char newlib_path[240] = { 0 };
printf("Missing library...'\n");
printf(" current file: %s\n", G.sce);
- printf(" absolute lib: %s\n", mainptr->curlib->filename);
+ printf(" absolute lib: %s\n", mainptr->curlib->filepath);
printf(" relative lib: %s\n", mainptr->curlib->name);
printf(" enter a new path:\n");
if(scanf("%s", newlib_path) > 0) {
strcpy(mainptr->curlib->name, newlib_path);
- strcpy(mainptr->curlib->filename, newlib_path);
- cleanup_path(G.sce, mainptr->curlib->filename);
+ strcpy(mainptr->curlib->filepath, newlib_path);
+ cleanup_path(G.sce, mainptr->curlib->filepath);
- fd= blo_openblenderfile(mainptr->curlib->filename, basefd->reports);
+ fd= blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
if(fd) {
- printf("found: '%s', party on macuno!\n", mainptr->curlib->filename);
+ printf("found: '%s', party on macuno!\n", mainptr->curlib->filepath);
}
}
}
@@ -12383,8 +12384,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
else mainptr->curlib->filedata= NULL;
if (fd==NULL) {
- BKE_reportf(basefd->reports, RPT_ERROR, "Can't find lib '%s'\n", mainptr->curlib->filename);
- if(!G.background && basefd->reports) printf("ERROR: can't find lib %s \n", mainptr->curlib->filename);
+ BKE_reportf(basefd->reports, RPT_ERROR, "Can't find lib '%s'\n", mainptr->curlib->filepath);
+ if(!G.background && basefd->reports) printf("ERROR: can't find lib %s \n", mainptr->curlib->filepath);
}
}
if(fd) {
@@ -12401,8 +12402,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
append_id_part(fd, mainptr, id, &realid);
if (!realid) {
- BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
- if(!G.background && basefd->reports) printf("LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
+ BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
+ if(!G.background && basefd->reports) printf("LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
}
change_idid_adr(mainlist, basefd, id, realid);
@@ -12437,8 +12438,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
ID *idn= id->next;
if(id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id);
- BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
- if(!G.background && basefd->reports)printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
+ BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
+ if(!G.background && basefd->reports)printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
change_idid_adr(mainlist, basefd, id, NULL);
MEM_freeN(id);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index c62963c5b3b..db479b45472 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -693,7 +693,7 @@ void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C);
void uiTemplateOperatorSearch(uiLayout *layout);
void uiTemplateHeader3D(uiLayout *layout, struct bContext *C);
void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex);
-void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C, struct wmOperator *op);
+void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activeprop, int rows, int maxrows, int type);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 7f8d6e8e3cb..3f0cd3bee78 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1633,7 +1633,7 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
bUnit_ReplaceString(str_unit_convert, sizeof(str_unit_convert), but->drawstr, ui_get_but_scale_unit(but, 1.0), scene->unit.system, unit_type);
}
- if(BPY_button_eval(C, str_unit_convert, &value)) {
+ if(BPY_eval_button(C, str_unit_convert, &value)) {
value = ui_get_but_val(but); /* use its original value */
if(str[0])
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 4e3ffad48ae..1f9c2bb9ce0 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -176,6 +176,7 @@ typedef struct uiAfterFunc {
int autokey;
} uiAfterFunc;
+static int ui_but_contains_pt(uiBut *but, int mx, int my);
static int ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y);
static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state);
static int ui_handler_region_menu(bContext *C, wmEvent *event, void *userdata);
@@ -1659,7 +1660,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
my= event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if (ui_mouse_inside_button(data->region, but, mx, my)) {
+ if (ui_but_contains_pt(but, mx, my)) {
ui_textedit_set_cursor_pos(but, data, mx);
but->selsta = but->selend = but->pos;
data->selstartx= mx;
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 30f2ee7b923..0e58f73c87e 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1559,12 +1559,21 @@ void ui_set_but_hsv(uiBut *but)
}
/* also used by small picker, be careful with name checks below... */
-void ui_update_block_buts_rgb(uiBlock *block, float *rgb)
+void ui_update_block_buts_rgb(uiBlock *block, float *rgb, float *rhsv)
{
uiBut *bt;
float hsv[3];
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ /* this is to keep the H and S value when V is equal to zero
+ * and we are working in HSV mode, of course!
+ */
+ if (rhsv) {
+ hsv[0]= rhsv[0];
+ hsv[1]= rhsv[1];
+ hsv[2]= rhsv[2];
+ }
+ else
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
// this updates button strings, is hackish... but button pointers are on stack of caller function
for(bt= block->buttons.first; bt; bt= bt->next) {
@@ -1630,7 +1639,7 @@ static void do_picker_rna_cb(bContext *C, void *bt1, void *unused)
if (prop) {
RNA_property_float_get_array(&ptr, prop, rgb);
- ui_update_block_buts_rgb(but->block, rgb);
+ ui_update_block_buts_rgb(but->block, rgb, NULL);
}
if(popup)
@@ -1646,7 +1655,7 @@ static void do_hsv_rna_cb(bContext *C, void *bt1, void *hsv_arg)
hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
- ui_update_block_buts_rgb(but->block, rgb);
+ ui_update_block_buts_rgb(but->block, rgb, hsv);
if(popup)
popup->menuretval= UI_RETURN_UPDATE;
@@ -1667,7 +1676,7 @@ static void do_hex_rna_cb(bContext *C, void *bt1, void *hexcl)
srgb_to_linearrgb_v3_v3(rgb, rgb);
}
- ui_update_block_buts_rgb(but->block, rgb);
+ ui_update_block_buts_rgb(but->block, rgb, NULL);
if(popup)
popup->menuretval= UI_RETURN_UPDATE;
@@ -1876,7 +1885,7 @@ static int ui_picker_small_wheel(const bContext *C, uiBlock *block, wmEvent *eve
ui_set_but_vectorf(but, col);
- ui_update_block_buts_rgb(block, col);
+ ui_update_block_buts_rgb(block, col, NULL);
if(popup)
popup->menuretval= UI_RETURN_UPDATE;
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4183ff49e51..05c162ef639 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -30,6 +30,7 @@
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
+#include "DNA_windowmanager_types.h"
#include "BLI_string.h"
@@ -53,6 +54,8 @@
#include "UI_interface.h"
#include "interface_intern.h"
+#include "BLF_api.h"
+
void ui_template_fix_linking()
{
}
@@ -2455,49 +2458,59 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, "Capture", 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop screencast");
if(screen->animtimer)
uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, "Anim Player", 0,0,100,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop animation playback");
-
- uiItemS(layout);
}
/************************* Reports for Last Operator Template **************************/
-void uiTemplateReportsBanner(uiLayout *layout, bContext *C, wmOperator *op)
+void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
{
- ReportList *reports = op->reports;
- uiLayout *box;
+ ReportList *reports = CTX_wm_reports(C);
+ Report *report= BKE_reports_last_displayable(reports);
+ ReportTimerInfo *rti;
- /* sanity checks */
- if (ELEM(NULL, op, reports)) {
- printf("uiTemplateReportsBanner: no operator with reports!\n");
- return;
- }
+ uiLayout *abs;
+ uiBlock *block;
+ uiBut *but;
+ uiStyle *style= U.uistyles.first;
+ int width;
+ float hsv[3];
+
+ /* if the report display has timed out, don't show */
+ if (!reports->reporttimer) return;
+
+ rti= (ReportTimerInfo *)reports->reporttimer->customdata;
+
+ if (!rti || rti->widthfac==0.0 || !report) return;
+
+ abs = uiLayoutAbsolute(layout, 0);
+ block= uiLayoutGetBlock(abs);
+
+ rgb_to_hsv(rti->col[0], rti->col[1], rti->col[2], hsv+0, hsv+1, hsv+2);
+
+ width = BLF_width(style->widget.uifont_id, report->message);
+ width = MIN2(rti->widthfac*width, width);
+ width = MAX2(width, 10);
/* make a box around the report to make it stand out */
- box = uiLayoutBox(layout);
- uiLayoutSetScaleY(box, 0.48); /* experimentally determined value to reduce execessive padding... */
+ uiBlockBeginAlign(block);
+ but= uiDefBut(block, ROUNDBOX, 0, "", 0, 0, UI_UNIT_X+10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+ copy_v3_v3(but->hsv, hsv); /* set the report's bg colour in but->hsv - ROUNDBOX feature */
- /* if more than one report, we need to show the popup when user clicks on the temp label... */
- if (reports->list.first != reports->list.last) {
- int numReports = BLI_countlist(&reports->list);
- char buf[64];
-
- // XXX: we need uiItem* to return uiBut pointer so that we can use it to set callbacks
- // used to call uiPupMenuReports... as alternative, we could fall back to the "old ways"
- //sprintf(buf, "Last Operator had %d errors. Click to see more...", numReports);
- sprintf(buf, "Last Operator had %d errors", numReports);
- uiItemL(box, buf, ICON_INFO);
- }
- else {
- /* single report, so show report directly */
- // XXX: what if the report is too long? should we truncate the text?
- Report *report= (Report *)reports->list.first;
-
- if(report->type >= RPT_ERROR)
- uiItemL(box, report->message, ICON_ERROR);
- else if(report->type >= RPT_WARNING)
- uiItemL(box, report->message, ICON_ERROR);
- else if(report->type >= RPT_INFO)
- uiItemL(box, report->message, ICON_INFO);
- }
+ but= uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+ but->hsv[0] = but->hsv[1] = 0.0; /* set a greyscale bg colour in but->hsv - ROUNDBOX feature */
+ but->hsv[2] = rti->greyscale;
+ uiBlockEndAlign(block);
+
+
+ /* icon and report message on top */
+ if(report->type & RPT_ERROR_ALL)
+ uiDefIconBut(block, LABEL, 0, ICON_ERROR, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+ else if(report->type & RPT_WARNING_ALL)
+ uiDefIconBut(block, LABEL, 0, ICON_ERROR, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+ else if(report->type & RPT_INFO_ALL)
+ uiDefIconBut(block, LABEL, 0, ICON_INFO, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+
+ uiDefBut(block, LABEL, 0, report->message, UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index c419c73c1e0..dfca12b1d49 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2368,9 +2368,21 @@ static void widget_radiobut(uiWidgetColors *wcol, rcti *rect, int state, int rou
static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
{
uiWidgetBase wtb;
+ char old_col[3];
widget_init(&wtb);
+ VECCOPY(old_col, wcol->inner);
+
+ /* abuse but->hsv - if it's non-zero, use this colour as the box's background */
+ if ((but->hsv[0] != 0.0) || (but->hsv[1] != 0.0) || (but->hsv[2] != 0.0)) {
+ float rgb[3];
+ hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], rgb+0, rgb+1, rgb+2);
+ wcol->inner[0] = rgb[0] * 255;
+ wcol->inner[1] = rgb[1] * 255;
+ wcol->inner[2] = rgb[2] * 255;
+ }
+
/* half rounded */
round_box_edges(&wtb, roundboxalign, rect, 4.0f);
@@ -2379,6 +2391,8 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state,
/* store the box bg as gl clearcolor, to retrieve later when drawing semi-transparent rects
* over the top to indicate disabled buttons */
glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0);
+
+ VECCOPY(wcol->inner, old_col);
}
static void widget_but(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index 612facb85c1..4bc5030094e 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -4317,6 +4317,10 @@ static int smooth_vertex(bContext *C, wmOperator *op)
if(eve->f & SELECT) {
if(eve->f1) {
+ int xaxis= RNA_boolean_get(op->ptr, "xaxis");
+ int yaxis= RNA_boolean_get(op->ptr, "yaxis");
+ int zaxis= RNA_boolean_get(op->ptr, "zaxis");
+
if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
eve_mir= editmesh_get_x_mirror_vert(obedit, em, eve, eve->co, index);
}
@@ -4324,9 +4328,12 @@ static int smooth_vertex(bContext *C, wmOperator *op)
adr = eve->tmp.p;
fac= 0.5/(float)eve->f1;
- eve->co[0]= 0.5*eve->co[0]+fac*adr[0];
- eve->co[1]= 0.5*eve->co[1]+fac*adr[1];
- eve->co[2]= 0.5*eve->co[2]+fac*adr[2];
+ if(xaxis)
+ eve->co[0]= 0.5*eve->co[0]+fac*adr[0];
+ if(yaxis)
+ eve->co[1]= 0.5*eve->co[1]+fac*adr[1];
+ if(zaxis)
+ eve->co[2]= 0.5*eve->co[2]+fac*adr[2];
/* clip if needed by mirror modifier */
@@ -4395,6 +4402,9 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Smooth Iterations", "", 1, INT_MAX);
+ RNA_def_boolean(ot->srna, "xaxis", 1, "X-Axis", "Smooth along the X axis.");
+ RNA_def_boolean(ot->srna, "yaxis", 1, "Y-Axis", "Smooth along the Y axis.");
+ RNA_def_boolean(ot->srna, "zaxis", 1, "Z-Axis", "Smooth along the Z axis.");
}
void vertexnoise(Object *obedit, EditMesh *em)
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 8cd8688d448..13656ca1b7e 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -481,15 +481,11 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op)
{
Object *obedit= CTX_data_edit_object(C);
EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data));
- /*char msg[100];*/
-
- /*int cnt =*/ removedoublesflag(em,1,0,RNA_float_get(op->ptr, "limit"));
- /*XXX this messes up last operator panel
- if(cnt)
- {
- sprintf(msg, "Removed %d vertices", cnt);
- BKE_report(op->reports, RPT_INFO, msg);
- }*/
+
+ int count = removedoublesflag(em,1,0,RNA_float_get(op->ptr, "limit"));
+
+ if(count)
+ BKE_reportf(op->reports, RPT_INFO, "Removed %d vertices", count);
DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 28b9fa241ca..8afed42758a 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -2151,6 +2151,7 @@ static int game_property_new(bContext *C, wmOperator *op)
BLI_addtail(&ob->prop, prop);
unique_property(NULL, prop, 0); // make_unique_prop_names(prop->name);
+ WM_event_add_notifier(C, NC_LOGIC, NULL);
return OPERATOR_FINISHED;
}
@@ -2183,6 +2184,8 @@ static int game_property_remove(bContext *C, wmOperator *op)
if(prop) {
BLI_remlink(&ob->prop, prop);
free_property(prop);
+
+ WM_event_add_notifier(C, NC_LOGIC, NULL);
return OPERATOR_FINISHED;
}
else {
@@ -2208,13 +2211,11 @@ void OBJECT_OT_game_property_remove(wmOperatorType *ot)
#define COPY_PROPERTIES_REPLACE 1
#define COPY_PROPERTIES_MERGE 2
-#define COPY_PROPERTIES_CLEAR 3
-#define COPY_PROPERTIES_COPY 4
+#define COPY_PROPERTIES_COPY 3
static EnumPropertyItem game_properties_copy_operations[] ={
{COPY_PROPERTIES_REPLACE, "REPLACE", 0, "Replace Properties", ""},
{COPY_PROPERTIES_MERGE, "MERGE", 0, "Merge Properties", ""},
- {COPY_PROPERTIES_CLEAR, "CLEAR", 0, "Clear All", ""},
{COPY_PROPERTIES_COPY, "COPY", 0, "Copy a Property", ""},
{0, NULL, 0, NULL, NULL}};
@@ -2264,7 +2265,7 @@ static int game_property_copy_exec(bContext *C, wmOperator *op)
} CTX_DATA_END;
}
}
- else if (ELEM3(type, COPY_PROPERTIES_REPLACE, COPY_PROPERTIES_MERGE, COPY_PROPERTIES_CLEAR)) {
+ else if (ELEM(type, COPY_PROPERTIES_REPLACE, COPY_PROPERTIES_MERGE)) {
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
if (ob != ob_iter) {
if (ob->data != ob_iter->data){
@@ -2272,7 +2273,7 @@ static int game_property_copy_exec(bContext *C, wmOperator *op)
for(prop = ob->prop.first; prop; prop= prop->next ) {
set_ob_property(ob_iter, prop);
}
- } else /* replace or clear */
+ } else /* replace */
copy_properties( &ob_iter->prop, &ob->prop );
}
}
@@ -2297,12 +2298,39 @@ void OBJECT_OT_game_property_copy(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_enum(ot->srna, "operation", game_properties_copy_operations, 4, "Operation", "");
+ RNA_def_enum(ot->srna, "operation", game_properties_copy_operations, 3, "Operation", "");
prop=RNA_def_enum(ot->srna, "property", gameprops_items, 0, "Property", "Properties to copy");
RNA_def_enum_funcs(prop, gameprops_itemf);
ot->prop=prop;
}
+static int game_property_clear_exec(bContext *C, wmOperator *op)
+{
+ Object *ob=ED_object_active_context(C);
+ bProperty *prop;
+
+ CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
+ free_properties(&ob_iter->prop);
+ }
+ CTX_DATA_END;
+
+ WM_event_add_notifier(C, NC_LOGIC, NULL);
+ return OPERATOR_FINISHED;
+}
+void OBJECT_OT_game_property_clear(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Clear Game Property";
+ ot->idname= "OBJECT_OT_game_property_clear";
+
+ /* api callbacks */
+ ot->exec= game_property_clear_exec;
+ ot->poll= ED_operator_object_active_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
/************************ Copy Logic Bricks ***********************/
static int logicbricks_copy_exec(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 5b446b3a828..f82b4e0324f 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -88,6 +88,7 @@ void OBJECT_OT_paths_clear(struct wmOperatorType *ot);
void OBJECT_OT_game_property_new(struct wmOperatorType *ot);
void OBJECT_OT_game_property_remove(struct wmOperatorType *ot);
void OBJECT_OT_game_property_copy(struct wmOperatorType *ot);
+void OBJECT_OT_game_property_clear(struct wmOperatorType *ot);
void OBJECT_OT_logic_bricks_copy(struct wmOperatorType *ot);
/* object_select.c */
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 602b94034bd..274e8ff2d73 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -184,6 +184,7 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_game_property_new);
WM_operatortype_append(OBJECT_OT_game_property_remove);
WM_operatortype_append(OBJECT_OT_game_property_copy);
+ WM_operatortype_append(OBJECT_OT_game_property_clear);
WM_operatortype_append(OBJECT_OT_logic_bricks_copy);
WM_operatortype_append(OBJECT_OT_shape_key_add);
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 6ec744ad027..541b0cf494f 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -160,7 +160,7 @@ void PE_free_ptcache_edit(PTCacheEdit *edit)
edit->emitter_field= 0;
}
- psys_free_path_cache(NULL, edit);
+ psys_free_path_cache(edit->psys, edit);
MEM_freeN(edit);
}
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 3cf6ed24807..4d62d823345 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -297,6 +297,8 @@ static void set_vertex_channel(float *channel, float time, struct Scene *scene,
static void free_domain_channels(FluidAnimChannels *channels)
{
+ if (!channels->timeAtFrame)
+ return;
MEM_freeN(channels->timeAtFrame);
channels->timeAtFrame = NULL;
MEM_freeN(channels->DomainGravity);
@@ -781,6 +783,26 @@ int runSimulationCallback(void *data, int status, int frame) {
return FLUIDSIM_CBRET_CONTINUE;
}
+static void fluidbake_free_data(FluidAnimChannels *channels, ListBase *fobjects, elbeemSimulationSettings *fsset, FluidBakeJob *fb)
+{
+ free_domain_channels(channels);
+ MEM_freeN(channels);
+ channels = NULL;
+
+ free_all_fluidobject_channels(fobjects);
+ BLI_freelistN(fobjects);
+ MEM_freeN(fobjects);
+ fobjects = NULL;
+
+ MEM_freeN(fsset);
+ fsset = NULL;
+
+ if (fb) {
+ MEM_freeN(fb);
+ fb = NULL;
+ }
+}
+
int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
{
Scene *scene= CTX_data_scene(C);
@@ -827,13 +849,14 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
noFrames = scene->r.efra - 0;
if(noFrames<=0) {
BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings.");
+ fluidbake_free_data(channels, fobjects, fsset, fb);
return 0;
}
/* check scene for sane object/modifier settings */
- if (!fluid_validate_scene(reports, scene, fsDomain)) {
+ if (!fluid_validate_scene(reports, scene, fsDomain))
+ fluidbake_free_data(channels, fobjects, fsset, fb);
return 0;
- }
/* these both have to be valid, otherwise we wouldnt be here */
@@ -928,12 +951,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
elbeemDebugOut(debugStrBuffer);
BKE_report(reports, RPT_ERROR, "Invalid object matrix.");
- free_domain_channels(channels);
- MEM_freeN(channels);
-
- free_all_fluidobject_channels(fobjects);
- BLI_freelistN(fobjects);
- MEM_freeN(fobjects);
+ fluidbake_free_data(channels, fobjects, fsset, fb);
return 0;
}
@@ -1023,12 +1041,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
WM_jobs_start(CTX_wm_manager(C), steve);
/* ******** free stored animation data ******** */
- free_domain_channels(channels);
- MEM_freeN(channels);
-
- free_all_fluidobject_channels(fobjects);
- BLI_freelistN(fobjects);
- MEM_freeN(fobjects);
+ fluidbake_free_data(channels, fobjects, fsset, NULL);
// elbeemFree();
return 1;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 8b1c0045fd3..6004820e5c8 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2393,8 +2393,8 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws)
static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event)
{
bScreen *screen= CTX_wm_screen(C);
-
- if(screen->animtimer==event->customdata) {
+
+ if(screen->animtimer && screen->animtimer==event->customdata) {
Scene *scene= CTX_data_scene(C);
wmTimer *wt= screen->animtimer;
ScreenAnimData *sad= wt->customdata;
@@ -2998,7 +2998,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_verify_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0);
- WM_keymap_verify_item(keymap, "WM_OT_reload_scripts", F8KEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "SCRIPT_OT_reload", F8KEY, KM_PRESS, 0, 0);
/* files */
WM_keymap_add_item(keymap, "FILE_OT_execute", RETKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 2da638fca41..64f00caf479 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -5488,7 +5488,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
int h= settings->imapaint.screen_grab_size[1];
int maxsize;
- RNA_string_get(op->ptr, "filename", filename);
+ RNA_string_get(op->ptr, "filepath", filename);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
@@ -5541,5 +5541,5 @@ void PAINT_OT_image_from_view(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER;
- RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file");
+ RNA_def_string_file_name(ot->srna, "filepath", "", FILE_MAX, "File Path", "Name of the file");
}
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 85c33500c5d..cf760f345b5 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -286,10 +286,21 @@ static void update_cb(PBVHNode *node, void *data)
static int sculpt_modifiers_active(Scene *scene, Object *ob)
{
ModifierData *md;
+ MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
+
+ /* check if there are any modifiers after what we are sculpting,
+ for a multires modifier with a deform modifier in front, we
+ do no need to recalculate the modifier stack. note that this
+ needs to be in sync with ccgDM_use_grid_pbvh! */
+ if(mmd)
+ md= mmd->modifier.next;
+ else
+ md= modifiers_getVirtualModifierList(ob);
- for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) {
+ /* exception for shape keys because we can edit those */
+ for(; md; md= md->next) {
if(modifier_isEnabled(scene, md, eModifierMode_Realtime))
- if(!ELEM(md->type, eModifierType_Multires, eModifierType_ShapeKey))
+ if(md->type != eModifierType_ShapeKey)
return 1;
}
@@ -363,7 +374,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
BLI_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb, NULL);
BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw, NULL);
- if((mmd=sculpt_multires_active(ob)))
+ if((mmd=sculpt_multires_active(scene, ob)))
multires_mark_as_modified(ob);
if(sculpt_modifiers_active(scene, ob))
@@ -772,7 +783,7 @@ static void calc_area_normal(Sculpt *sd, SculptSession *ss, float area_normal[3]
copy_v3_v3(out_dir, cache->view_normal_symmetry);
/* threaded loop over nodes */
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
@@ -809,7 +820,7 @@ static void calc_area_normal(Sculpt *sd, SculptSession *ss, float area_normal[3]
BLI_pbvh_vertex_iter_end;
}
- #pragma omp critical
+ //#pragma omp critical
{
/* we sum per node and add together later for threads */
add_v3_v3(out, nout);
@@ -847,7 +858,7 @@ static void do_draw_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int t
offset[2]= area_normal[2]*ss->cache->radius*ss->cache->scale[2]*bstrength;
/* threaded loop over nodes */
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
@@ -961,7 +972,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
BLI_pbvh_node_get_grids(ss->pbvh, node, &grid_indices, &totgrid,
NULL, &gridsize, &griddata, &gridadj);
- #pragma omp critical
+ //#pragma omp critical
tmpgrid= MEM_mallocN(sizeof(float)*3*gridsize*gridsize, "tmpgrid");
for(i = 0; i < totgrid; ++i) {
@@ -1020,7 +1031,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
}
}
- #pragma omp critical
+ //#pragma omp critical
MEM_freeN(tmpgrid);
}
@@ -1029,7 +1040,7 @@ static void do_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int
int iteration, n;
for(iteration = 0; iteration < 2; ++iteration) {
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
sculpt_undo_push_node(ss, nodes[n]);
@@ -1052,7 +1063,7 @@ static void do_pinch_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int
float bstrength= ss->cache->bstrength;
int n;
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
@@ -1086,7 +1097,7 @@ static void do_grab_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int t
copy_v3_v3(grab_delta, ss->cache->grab_delta_symmetry);
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
@@ -1129,7 +1140,7 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int
offset[1]= ss->cache->scale[1]*area_normal[1];
offset[2]= ss->cache->scale[2]*area_normal[2];
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
@@ -1186,7 +1197,7 @@ static void do_inflate_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, in
float bstrength= ss->cache->bstrength;
int n;
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
@@ -1229,7 +1240,7 @@ static void calc_flatten_center(Sculpt *sd, SculptSession *ss, PBVHNode **nodes,
outer_dist[i]= -1.0f;
}
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
@@ -1473,7 +1484,7 @@ static void sculpt_update_tex(Sculpt *sd, SculptSession *ss)
/* Sculpt mode handles multires differently from regular meshes, but only if
it's the last modifier on the stack and it is not on the first level */
-struct MultiresModifierData *sculpt_multires_active(Object *ob)
+struct MultiresModifierData *sculpt_multires_active(Scene *scene, Object *ob)
{
ModifierData *md, *nmd;
@@ -1483,8 +1494,8 @@ struct MultiresModifierData *sculpt_multires_active(Object *ob)
/* Check if any of the modifiers after multires are active
* if not it can use the multires struct */
- for (nmd= md->next; nmd; nmd= nmd->next)
- if(nmd->mode & eModifierMode_Realtime)
+ for(nmd= md->next; nmd; nmd= nmd->next)
+ if(modifier_isEnabled(scene, nmd, eModifierMode_Realtime))
break;
if(!nmd && mmd->sculptlvl > 0)
@@ -1514,10 +1525,11 @@ void sculpt_update_mesh_elements(Scene *scene, Object *ob, int need_fmap)
{
DerivedMesh *dm = mesh_get_derived_final(scene, ob, 0);
SculptSession *ss = ob->sculpt;
-
+ MultiresModifierData *mmd= sculpt_multires_active(scene, ob);
+
ss->ob= ob;
- if((ob->shapeflag & OB_SHAPE_LOCK) && !sculpt_multires_active(ob)) {
+ if((ob->shapeflag & OB_SHAPE_LOCK) && !mmd) {
ss->kb= ob_get_keyblock(ob);
ss->refkb= ob_get_reference_keyblock(ob);
}
@@ -1529,7 +1541,8 @@ void sculpt_update_mesh_elements(Scene *scene, Object *ob, int need_fmap)
/* need to make PBVH with shape key coordinates */
if(ss->kb) sculpt_key_to_mesh(ss->kb, ss->ob);
- if((ss->multires = sculpt_multires_active(ob))) {
+ if(mmd) {
+ ss->multires = mmd;
ss->totvert = dm->getNumVerts(dm);
ss->totface = dm->getNumFaces(dm);
ss->mvert= NULL;
@@ -1543,6 +1556,7 @@ void sculpt_update_mesh_elements(Scene *scene, Object *ob, int need_fmap)
ss->mvert = me->mvert;
ss->mface = me->mface;
ss->face_normals = NULL;
+ ss->multires = NULL;
}
ss->pbvh = dm->getPBVH(ob, dm);
@@ -1951,7 +1965,7 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode);
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
SculptUndoNode *unode;
@@ -2221,13 +2235,19 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = CTX_data_tool_settings(C);
Object *ob = CTX_data_active_object(C);
- MultiresModifierData *mmd = sculpt_multires_active(ob);
+ MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
+ int flush_recalc= 0;
+
+ /* multires in sculpt mode could have different from object mode subdivision level */
+ flush_recalc |= mmd && mmd->sculptlvl != mmd->lvl;
+ /* if object has got active modifiers, it's dm could be different in sculpt mode */
+ //flush_recalc |= sculpt_modifiers_active(scene, ob);
if(ob->mode & OB_MODE_SCULPT) {
- if(sculpt_multires_active(ob))
+ if(mmd)
multires_force_update(ob);
- if(mmd && mmd->sculptlvl != mmd->lvl)
+ if(flush_recalc)
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
/* Leave sculptmode */
@@ -2239,7 +2259,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
/* Enter sculptmode */
ob->mode |= OB_MODE_SCULPT;
- if(mmd && mmd->sculptlvl != mmd->lvl)
+ if(flush_recalc)
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
/* Create persistent sculpt mode data */
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index d3553c008b2..d8043d2c988 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -49,7 +49,7 @@ void sculptmode_draw_mesh(int);
void sculpt_paint_brush(char clear);
void sculpt_stroke_draw(struct SculptStroke *);
void sculpt_radialcontrol_start(int mode);
-struct MultiresModifierData *sculpt_multires_active(struct Object *ob);
+struct MultiresModifierData *sculpt_multires_active(struct Scene *scene, struct Object *ob);
struct Brush *sculptmode_brush(void);
//void do_symmetrical_brush_actions(struct Sculpt *sd, struct wmOperator *wm, struct BrushAction *a, short *, short *);
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index be4f6ff0570..8f195b819ea 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -118,7 +118,7 @@ static int open_exec(bContext *C, wmOperator *op)
RNA_property_update(C, &pprop->ptr, pprop->prop);
}
- MEM_freeN(op->customdata);
+ if(op->customdata) MEM_freeN(op->customdata);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 55b899bc1cd..b08ea810a33 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -841,7 +841,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
if(ima->source != IMA_SRC_GENERATED) {
row= uiLayoutRow(layout, 1);
- uiItemR(row, &imaptr, "filename", 0, "", 0);
+ uiItemR(row, &imaptr, "filepath", 0, "", 0);
uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
}
diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h
index 128c0dace20..4053bbf5a1f 100644
--- a/source/blender/editors/space_info/info_intern.h
+++ b/source/blender/editors/space_info/info_intern.h
@@ -39,5 +39,7 @@ void FILE_OT_make_paths_absolute(struct wmOperatorType *ot);
void FILE_OT_report_missing_files(struct wmOperatorType *ot);
void FILE_OT_find_missing_files(struct wmOperatorType *ot);
+void INFO_OT_reports_display_update(struct wmOperatorType *ot);
+
#endif /* ED_INFO_INTERN_H */
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index e2baeb9abac..64d2c6138c7 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -36,6 +36,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
+#include "BLI_math.h"
#include "BLI_bpath.h"
#include "BKE_context.h"
@@ -300,3 +301,100 @@ void FILE_OT_find_missing_files(wmOperatorType *ot)
/* properties */
WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE);
}
+
+/********************* report box operator *********************/
+
+/* Hard to decide whether to keep this as an operator,
+ * or turn it into a hardcoded ui control feature,
+ * handling TIMER events for all regions in interface_handlers.c
+ * Not sure how good that is to be accessing UI data from
+ * inactive regions, so use this for now. --matt
+ */
+
+#define INFO_TIMEOUT 5.0
+#define INFO_COLOR_TIMEOUT 3.0
+#define ERROR_TIMEOUT 10.0
+#define ERROR_COLOR_TIMEOUT 6.0
+#define COLLAPSE_TIMEOUT 0.2
+static int update_reports_display_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ wmWindowManager *wm= CTX_wm_manager(C);
+ ReportList *reports= CTX_wm_reports(C);
+ Report *report;
+ ReportTimerInfo *rti;
+ float progress=0.0, color_progress=0.0;
+ float neutral_col[3] = {0.35, 0.35, 0.35};
+ float neutral_grey= 0.6;
+ float timeout=0.0, color_timeout=0.0;
+
+ /* escape if not our timer */
+ if(reports->reporttimer==NULL || reports->reporttimer != event->customdata)
+ return OPERATOR_PASS_THROUGH;
+
+ report= BKE_reports_last_displayable(reports);
+ rti = (ReportTimerInfo *)reports->reporttimer->customdata;
+
+ timeout = (report->type & RPT_ERROR_ALL)?ERROR_TIMEOUT:INFO_TIMEOUT;
+ color_timeout = (report->type & RPT_ERROR_ALL)?ERROR_COLOR_TIMEOUT:INFO_COLOR_TIMEOUT;
+
+ /* clear the report display after timeout */
+ if (reports->reporttimer->duration > timeout) {
+ WM_event_remove_timer(wm, NULL, reports->reporttimer);
+ reports->reporttimer = NULL;
+
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
+
+ return (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH);
+ }
+
+ if (rti->widthfac == 0.0) {
+ /* initialise colours based on report type */
+ if(report->type & RPT_ERROR_ALL) {
+ rti->col[0] = 1.0;
+ rti->col[1] = 0.2;
+ rti->col[2] = 0.0;
+ } else if(report->type & RPT_WARNING_ALL) {
+ rti->col[0] = 1.0;
+ rti->col[1] = 1.0;
+ rti->col[2] = 0.0;
+ } else if(report->type & RPT_INFO_ALL) {
+ rti->col[0] = 0.3;
+ rti->col[1] = 0.45;
+ rti->col[2] = 0.7;
+ }
+ rti->greyscale = 0.75;
+ rti->widthfac=1.0;
+ }
+
+ progress = reports->reporttimer->duration / timeout;
+ color_progress = reports->reporttimer->duration / color_timeout;
+
+ /* fade colours out sharply according to progress through fade-out duration */
+ interp_v3_v3v3(rti->col, rti->col, neutral_col, color_progress);
+ rti->greyscale = interpf(neutral_grey, rti->greyscale, color_progress);
+
+ /* collapse report at end of timeout */
+ if (progress*timeout > timeout - COLLAPSE_TIMEOUT) {
+ rti->widthfac = (progress*timeout - (timeout - COLLAPSE_TIMEOUT)) / COLLAPSE_TIMEOUT;
+ rti->widthfac = 1.0 - rti->widthfac;
+ }
+
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
+
+ return (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH);
+}
+
+void INFO_OT_reports_display_update(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Update Reports Display";
+ ot->idname= "INFO_OT_reports_display_update";
+
+ /* api callbacks */
+ ot->invoke= update_reports_display_invoke;
+
+ /* flags */
+ ot->flag= 0;
+
+ /* properties */
+} \ No newline at end of file
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index 4370d2cbc16..0d9f1c90489 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -125,11 +125,15 @@ void info_operatortypes(void)
WM_operatortype_append(FILE_OT_make_paths_absolute);
WM_operatortype_append(FILE_OT_report_missing_files);
WM_operatortype_append(FILE_OT_find_missing_files);
+
+ WM_operatortype_append(INFO_OT_reports_display_update);
}
void info_keymap(struct wmKeyConfig *keyconf)
{
+ wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0);
+ WM_keymap_verify_item(keymap, "INFO_OT_reports_display_update", TIMER, KM_ANY, KM_ANY, 0);
}
/* add handlers, stuff you only do once or on area/region changes */
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index d5c11c58b61..a73902d6a2b 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -3245,9 +3245,12 @@ static void draw_sensor_armature(uiLayout *layout, PointerRNA *ptr)
uiItemR(row, ptr, "value", 0, NULL, 0);
}
-static void draw_sensor_collision(uiLayout *layout, PointerRNA *ptr)
+static void draw_sensor_collision(uiLayout *layout, PointerRNA *ptr, bContext *C)
{
uiLayout *row, *split;
+ PointerRNA main_ptr;
+
+ RNA_main_pointer_create(CTX_data_main(C), &main_ptr);
split = uiLayoutSplit(layout, 0.3, 0);
row = uiLayoutRow(split, 1);
@@ -3259,7 +3262,7 @@ static void draw_sensor_collision(uiLayout *layout, PointerRNA *ptr)
uiItemR(split, ptr, "property", 0, NULL, 0);
break;
case SENS_COLLISION_MATERIAL:
- uiItemR(split, ptr, "material", 0, NULL, 0);
+ uiItemPointerR(split, ptr, "material", &main_ptr, "materials", NULL, ICON_MATERIAL_DATA);
break;
}
}
@@ -3343,9 +3346,6 @@ static void draw_sensor_keyboard(uiLayout *layout, PointerRNA *ptr)
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
uiItemPointerR(layout, ptr, "target", &settings_ptr, "properties", NULL, 0);
uiItemPointerR(layout, ptr, "log", &settings_ptr, "properties", NULL, 0);
-
-// uiItemR(layout, ptr, "target", 0, NULL, 0);
-// uiItemR(layout, ptr, "log", 0, NULL, 0);
}
static void draw_sensor_message(uiLayout *layout, PointerRNA *ptr)
@@ -3414,17 +3414,21 @@ static void draw_sensor_random(uiLayout *layout, PointerRNA *ptr)
uiItemR(layout, ptr, "seed", 0, NULL, 0);
}
-static void draw_sensor_ray(uiLayout *layout, PointerRNA *ptr)
+static void draw_sensor_ray(uiLayout *layout, PointerRNA *ptr, bContext *C)
{
uiLayout *split, *row;
+ PointerRNA main_ptr;
+ RNA_main_pointer_create(CTX_data_main(C), &main_ptr);
split= uiLayoutSplit(layout, 0.3, 0);
uiItemR(split, ptr, "ray_type", 0, "", 0);
switch (RNA_enum_get(ptr, "ray_type")) {
case SENS_RAY_PROPERTY:
- uiItemR(split, ptr, "property", 0, "", 0); break;
+ uiItemR(split, ptr, "property", 0, "", 0);
+ break;
case SENS_RAY_MATERIAL:
- uiItemR(split, ptr, "material", 0, "", 0); break;
+ uiItemPointerR(split, ptr, "material", &main_ptr, "materials", "", ICON_MATERIAL_DATA);
+ break;
}
split= uiLayoutSplit(layout, 0.3, 0);
@@ -3439,7 +3443,7 @@ static void draw_sensor_touch(uiLayout *layout, PointerRNA *ptr)
uiItemR(layout, ptr, "material", 0, NULL, 0);
}
-void draw_brick_sensor(uiLayout *layout, PointerRNA *ptr)
+void draw_brick_sensor(uiLayout *layout, PointerRNA *ptr, bContext *C)
{
uiLayout *box;
@@ -3461,7 +3465,7 @@ void draw_brick_sensor(uiLayout *layout, PointerRNA *ptr)
draw_sensor_armature(box, ptr);
break;
case SENS_COLLISION:
- draw_sensor_collision(box, ptr);
+ draw_sensor_collision(box, ptr, C);
break;
case SENS_DELAY:
draw_sensor_delay(box, ptr);
@@ -3491,7 +3495,7 @@ void draw_brick_sensor(uiLayout *layout, PointerRNA *ptr)
draw_sensor_random(box, ptr);
break;
case SENS_RAY:
- draw_sensor_ray(box, ptr);
+ draw_sensor_ray(box, ptr, C);
break;
case SENS_TOUCH:
draw_sensor_touch(box, ptr);
@@ -3696,9 +3700,12 @@ static void draw_actuator_camera(uiLayout *layout, PointerRNA *ptr)
uiItemR(row, ptr, "max", 0, NULL, 0);
}
-static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr)
+static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext *C)
{
uiLayout *row, *col, *subcol, *split;
+ PointerRNA main_ptr;
+
+ RNA_main_pointer_create(CTX_data_main(C), &main_ptr);
uiItemR(layout, ptr, "mode", 0, NULL, 0);
switch (RNA_enum_get(ptr, "mode"))
@@ -3736,7 +3743,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr)
split = uiLayoutSplit(layout, 0.15, 0);
uiItemR(split, ptr, "detect_material", UI_ITEM_R_TOGGLE, NULL, 0);
if (RNA_boolean_get(ptr, "detect_material"))
- uiItemR(split, ptr, "material", 0, NULL, 0);
+ uiItemPointerR(split, ptr, "material", &main_ptr, "materials", NULL, ICON_MATERIAL_DATA);
else
uiItemR(split, ptr, "property", 0, NULL, 0);
@@ -3780,7 +3787,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr)
split = uiLayoutSplit(layout, 0.15, 0);
uiItemR(split, ptr, "detect_material", UI_ITEM_R_TOGGLE, NULL, 0);
if (RNA_boolean_get(ptr, "detect_material"))
- uiItemR(split, ptr, "material", 0, NULL, 0);
+ uiItemPointerR(split, ptr, "material", &main_ptr, "materials", NULL, ICON_MATERIAL_DATA);
else
uiItemR(split, ptr, "property", 0, NULL, 0);
@@ -3913,16 +3920,18 @@ static void draw_actuator_ipo(uiLayout *layout, PointerRNA *ptr)
uiItemPointerR(row, ptr, "frame_property", &settings_ptr, "properties", NULL, 0);
}
-static void draw_actuator_message(uiLayout *layout, PointerRNA *ptr)
+static void draw_actuator_message(uiLayout *layout, PointerRNA *ptr, bContext *C)
{
Object *ob;
- PointerRNA settings_ptr;
+ PointerRNA main_ptr, settings_ptr;
uiLayout *row;
+ RNA_main_pointer_create(CTX_data_main(C), &main_ptr);
+
ob = (Object *)ptr->id.data;
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
- uiItemR(layout, ptr, "to_property", 0, NULL, 0);
+ uiItemPointerR(layout, ptr, "to_property", &main_ptr, "objects", NULL, ICON_OBJECT_DATA);
uiItemR(layout, ptr, "subject", 0, NULL, 0);
row= uiLayoutRow(layout, 1);
@@ -4281,7 +4290,7 @@ void draw_brick_actuator(uiLayout *layout, PointerRNA *ptr, bContext *C)
draw_actuator_camera(box, ptr);
break;
case ACT_CONSTRAINT:
- draw_actuator_constraint(box, ptr);
+ draw_actuator_constraint(box, ptr, C);
break;
case ACT_EDIT_OBJECT:
draw_actuator_edit_object(box, ptr);
@@ -4296,7 +4305,7 @@ void draw_brick_actuator(uiLayout *layout, PointerRNA *ptr, bContext *C)
draw_actuator_ipo(box, ptr);
break;
case ACT_MESSAGE:
- draw_actuator_message(box, ptr);
+ draw_actuator_message(box, ptr, C);
break;
case ACT_OBJECT:
draw_actuator_motion(box, ptr);
@@ -4523,7 +4532,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
draw_sensor_header(col, &ptr);
/* draw the brick contents */
- draw_brick_sensor(col, &ptr);
+ draw_brick_sensor(col, &ptr, C);
/* put link button to the right */
col = uiLayoutColumn(split, 0);
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 7e79b4b822e..629b1008aa0 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -891,7 +891,7 @@ static void node_composit_buts_file_output(uiLayout *layout, bContext *C, Pointe
uiLayout *col, *row;
col= uiLayoutColumn(layout, 0);
- uiItemR(col, ptr, "filename", 0, "", 0);
+ uiItemR(col, ptr, "filepath", 0, "", 0);
uiItemR(col, ptr, "image_type", 0, "", 0);
row= uiLayoutRow(layout, 0);
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index ccc535a68e6..510bb69c7d4 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -132,7 +132,9 @@ static void error(const char *dummy, ...) {}
static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene, ARegion *ar, SpaceOops *soops, TreeElement *te, int startx, int *starty);
static void outliner_do_object_operation(bContext *C, Scene *scene, SpaceOops *soops, ListBase *lb,
void (*operation_cb)(bContext *C, Scene *scene, TreeElement *, TreeStoreElem *, TreeStoreElem *));
-
+static void outliner_do_group_operation(bContext *C, Scene *scene, SpaceOops *soops, ListBase *lb,
+ void (*operation_cb)(bContext *C, Scene *scene, TreeElement *, TreeStoreElem *, TreeStoreElem *));
+static int group_select_flag(Group *gr);
/* ******************** PERSISTANT DATA ***************** */
@@ -1632,8 +1634,6 @@ void OUTLINER_OT_selectability_toggle(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-/* --- */
-
void object_toggle_renderability_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
{
Base *base= (Base *)te->directdata;
@@ -2347,7 +2347,6 @@ static int tree_element_active_keymap_item(bContext *C, TreeElement *te, TreeSto
/* Context can be NULL when set==0 */
static int tree_element_type_active(bContext *C, Scene *scene, SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, int set)
{
-
switch(tselem->type) {
case TSE_DEFGROUP:
return tree_element_active_defgroup(C, scene, te, tselem, set);
@@ -2425,6 +2424,34 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa
ED_screen_set_scene(C, (Scene *)tselem->id);
}
}
+ else if(te->idcode==ID_GR) {
+ Group *gr= (Group *)tselem->id;
+ GroupObject *gob;
+
+ if(extend) {
+ int sel= BA_SELECT;
+ for(gob= gr->gobject.first; gob; gob= gob->next) {
+ if(gob->ob->flag & SELECT) {
+ sel= BA_DESELECT;
+ break;
+ }
+ }
+
+ for(gob= gr->gobject.first; gob; gob= gob->next) {
+ ED_base_object_select(object_in_scene(gob->ob, scene), sel);
+ }
+ }
+ else {
+ scene_deselect_all(scene);
+
+ for(gob= gr->gobject.first; gob; gob= gob->next) {
+ if((gob->ob->flag & SELECT) == 0)
+ ED_base_object_select(object_in_scene(gob->ob, scene), BA_SELECT);
+ }
+ }
+
+ WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
+ }
else if(ELEM5(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) {
Object *obedit= CTX_data_edit_object(C);
if(obedit)
@@ -3297,6 +3324,31 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li
}
}
+static void outliner_do_group_operation(bContext *C, Scene *scene, SpaceOops *soops, ListBase *lb,
+ void (*operation_cb)(bContext *C, Scene *scene, TreeElement *, TreeStoreElem *, TreeStoreElem *))
+ {
+ TreeElement *te;
+ TreeStoreElem *tselem;
+
+ for(te=lb->first; te; te= te->next) {
+ tselem= TREESTORE(te);
+ if(tselem->flag & TSE_SELECTED) {
+ if(tselem->type==0 && te->idcode==ID_GR) {
+ /* when objects selected in other scenes... dunno if that should be allowed */
+ Scene *sce= (Scene *)outliner_search_back(soops, te, ID_SCE);
+ if(sce && scene != sce) {
+ ED_screen_set_scene(C, sce);
+ }
+
+ operation_cb(C, scene, te, NULL, tselem);
+ }
+ }
+ if((tselem->flag & TSE_CLOSED)==0) {
+ outliner_do_group_operation(C, scene, soops, &te->subtree, operation_cb);
+ }
+ }
+}
+
void outliner_del(bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops)
{
@@ -3400,6 +3452,9 @@ static EnumPropertyItem prop_group_op_types[] = {
{1, "UNLINK", 0, "Unlink", ""},
{2, "LOCAL", 0, "Make Local", ""},
{3, "LINK", 0, "Link Group Objects to Scene", ""},
+ {4, "TOGVIS", 0, "Toggle Visible", ""},
+ {5, "TOGSEL", 0, "Toggle Selectable", ""},
+ {6, "TOGREN", 0, "Toggle Renderable", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -3426,7 +3481,7 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op)
else if(event==3) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_linkobs2scene_cb);
ED_undo_push(C, "Link Group Objects to Scene");
- }
+ }
WM_event_add_notifier(C, NC_GROUP, NULL);
@@ -4496,6 +4551,18 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
active= 2;
}
}
+ else if(te->idcode==ID_GR) {
+ Group *gr = (Group *)tselem->id;
+
+ if(group_select_flag(gr)) {
+ char col[4];
+ UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col);
+ col[3]= 100;
+ glColor4ubv((GLubyte *)col);
+
+ active= 2;
+ }
+ }
else if(te->idcode==ID_OB) {
Object *ob= (Object *)tselem->id;
@@ -4853,6 +4920,73 @@ static void restrictbutton_bone_cb(bContext *C, void *poin, void *poin2)
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
}
+
+static int group_restrict_flag(Group *gr, int flag)
+{
+ GroupObject *gob;
+
+ for(gob= gr->gobject.first; gob; gob= gob->next) {
+ if((gob->ob->restrictflag & flag) == 0)
+ return 0;
+ }
+
+ return 1;
+}
+
+static int group_select_flag(Group *gr)
+{
+ GroupObject *gob;
+
+ for(gob= gr->gobject.first; gob; gob= gob->next)
+ if((gob->ob->flag & SELECT))
+ return 1;
+
+ return 0;
+}
+
+static void restrictbutton_gr_restrict_flag(bContext *C, void *poin, void *poin2, int flag)
+{
+ Scene *scene = (Scene *)poin;
+ GroupObject *gob;
+ Group *gr = (Group *)poin2;
+
+ if(group_restrict_flag(gr, flag)) {
+ for(gob= gr->gobject.first; gob; gob= gob->next) {
+ gob->ob->restrictflag &= ~flag;
+
+ if(flag==OB_RESTRICT_VIEW)
+ if(gob->ob->flag & SELECT)
+ ED_base_object_select(object_in_scene(gob->ob, scene), BA_DESELECT);
+ }
+ }
+ else {
+ for(gob= gr->gobject.first; gob; gob= gob->next) {
+ gob->ob->restrictflag |= flag;
+
+ if(flag==OB_RESTRICT_VIEW)
+ if((gob->ob->flag & SELECT) == 0)
+ ED_base_object_select(object_in_scene(gob->ob, scene), BA_SELECT);
+ }
+ }
+}
+
+static void restrictbutton_gr_restrict_view(bContext *C, void *poin, void *poin2)
+{
+ restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_VIEW);
+ WM_event_add_notifier(C, NC_GROUP, NULL);
+}
+static void restrictbutton_gr_restrict_select(bContext *C, void *poin, void *poin2)
+{
+ restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_SELECT);
+ WM_event_add_notifier(C, NC_GROUP, NULL);
+}
+static void restrictbutton_gr_restrict_render(bContext *C, void *poin, void *poin2)
+{
+ restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_RENDER);
+ WM_event_add_notifier(C, NC_GROUP, NULL);
+}
+
+
static void namebutton_cb(bContext *C, void *tsep, char *oldname)
{
SpaceOops *soops= CTX_wm_space_outliner(C);
@@ -4970,6 +5104,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
TreeElement *te;
TreeStoreElem *tselem;
Object *ob = NULL;
+ Group *gr = NULL;
for(te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
@@ -5000,6 +5135,26 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
uiBlockSetEmboss(block, UI_EMBOSS);
}
+ if(tselem->type==0 && te->idcode==ID_GR){
+ int restrict_bool;
+ gr = (Group *)tselem->id;
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+
+ restrict_bool= group_restrict_flag(gr, OB_RESTRICT_VIEW);
+ bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (short)te->ys, 17, OL_H-1, 0, 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
+ uiButSetFunc(bt, restrictbutton_gr_restrict_view, scene, gr);
+
+ restrict_bool= group_restrict_flag(gr, OB_RESTRICT_SELECT);
+ bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (short)te->ys, 17, OL_H-1, 0, 0, 0, 0, 0, "Restrict/Allow selection in the 3D View");
+ uiButSetFunc(bt, restrictbutton_gr_restrict_select, scene, gr);
+
+ restrict_bool= group_restrict_flag(gr, OB_RESTRICT_RENDER);
+ bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (short)te->ys, 17, OL_H-1, 0, 0, 0, 0, 0, "Restrict/Allow renderability");
+ uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+ }
/* scene render layers and passes have toggle-able flags too! */
else if(tselem->type==TSE_R_LAYER) {
uiBlockSetEmboss(block, UI_EMBOSSN);
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c
index 6ef9a96b478..02993549c94 100644
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@ -84,3 +84,23 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot)
RNA_def_string_file_path(ot->srna, "path", "", 512, "Path", "");
}
+
+static int script_reload_exec(bContext *C, wmOperator *op)
+{
+#ifndef DISABLE_PYTHON
+ BPY_eval_string(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)");
+ return OPERATOR_FINISHED;
+#endif
+ return OPERATOR_CANCELLED;
+}
+
+void SCRIPT_OT_reload(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Reload Scripts";
+ ot->description= "Reload Scripts";
+ ot->idname= "SCRIPT_OT_reload";
+
+ /* api callbacks */
+ ot->exec= script_reload_exec;
+}
diff --git a/source/blender/editors/space_script/script_intern.h b/source/blender/editors/space_script/script_intern.h
index 57e4cc6c793..ed625bb8ec6 100644
--- a/source/blender/editors/space_script/script_intern.h
+++ b/source/blender/editors/space_script/script_intern.h
@@ -39,6 +39,7 @@ void script_operatortypes(void);
void script_keymap(struct wmKeyConfig *keyconf);
/* script_edit.c */
+void SCRIPT_OT_reload(struct wmOperatorType *ot);
void SCRIPT_OT_python_file_run(struct wmOperatorType *ot);
#endif /* ED_SCRIPT_INTERN_H */
diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c
index 353d80f1921..61f7cf425d4 100644
--- a/source/blender/editors/space_script/script_ops.c
+++ b/source/blender/editors/space_script/script_ops.c
@@ -55,6 +55,7 @@
void script_operatortypes(void)
{
WM_operatortype_append(SCRIPT_OT_python_file_run);
+ WM_operatortype_append(SCRIPT_OT_reload);
}
void script_keymap(wmKeyConfig *keyconf)
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 89a82e51cd8..d3b70f4553a 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -3466,12 +3466,11 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
select=1;
}
+ psys_update_children(&sim);
+
psys->flag|=PSYS_DRAWING;
- if(part->type==PART_HAIR && !psys->childcache)
- totchild=0;
- else
- totchild=psys->totchild*part->disp/100;
+ totchild=psys->totchild*part->disp/100;
ma= give_current_material(ob,part->omat);
@@ -3506,11 +3505,18 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
totpart=psys->totpart;
- //if(part->flag&PART_GLOB_TIME)
cfra=bsystem_time(scene, 0, (float)CFRA, 0.0f);
- if(draw_as==PART_DRAW_PATH && psys->pathcache==NULL && psys->childcache==NULL)
- draw_as=PART_DRAW_DOT;
+ if(draw_as==PART_DRAW_PATH) {
+ if(psys->pathcache==NULL && psys->childcache==NULL)
+ psys_update_path_cache(&sim, cfra);
+
+ /* can't create pathcache for some reason*/
+ if(psys->pathcache==NULL && psys->childcache==NULL)
+ draw_as=PART_DRAW_DOT;
+ else if(psys->childcache==NULL)
+ totchild = 0;
+ }
/* 3. */
switch(draw_as){
@@ -3862,7 +3868,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
UI_ThemeColor(TH_WIRE);
}*/
- if(totchild && (part->draw&PART_DRAW_PARENT)==0)
+ if(totchild && ((part->draw&PART_DRAW_PARENT)==0 || psys_in_edit_mode(scene, psys)))
totpart=0;
else if(psys->pathcache==NULL)
totpart=0;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 8a3029c8218..8396f880357 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -691,8 +691,15 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (U.uiflag & USER_AUTOPERSP)
vod->rv3d->persp= RV3D_PERSP;
- else if(vod->rv3d->persp==RV3D_CAMOB)
+ else if(vod->rv3d->persp==RV3D_CAMOB) {
+
+ /* changed since 2.4x, use the camera view */
+ View3D *v3d = CTX_wm_view3d(C);
+ if(v3d->camera)
+ view3d_settings_from_ob(v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, NULL);
+
vod->rv3d->persp= RV3D_PERSP;
+ }
ED_region_tag_redraw(vod->ar);
}
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 53bc5b7c5d5..69e4006770d 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -139,6 +139,8 @@ void VIEW3D_OT_select_border(struct wmOperatorType *ot);
void VIEW3D_OT_select_lasso(struct wmOperatorType *ot);
/* view3d_view.c */
+void view3d_settings_from_ob(struct Object *ob, float *ofs, float *quat, float *dist, float *lens);
+
void VIEW3D_OT_smoothview(struct wmOperatorType *ot);
void VIEW3D_OT_setcameratoview(struct wmOperatorType *ot);
void VIEW3D_OT_setobjectascamera(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 5bce1992b53..ff716a640d8 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -780,7 +780,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *op)
}
}
else {
- CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
+ CTX_DATA_BEGIN(C, Object*, ob, selected_objects) {
VECCOPY(vec, ob->obmat[3]);
add_v3_v3(centroid, vec);
DO_MINMAX(vec, min, max);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 31ddc442cc2..9790e928188 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -138,37 +138,32 @@ static void object_lens_clip_settings(Object *ob, float *lens, float *clipsta, f
*
* The dist is not modified for this function, if NULL its assimed zero
* */
-static void view_settings_from_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens)
-{
- float bmat[4][4];
- float imat[4][4];
- float tmat[3][3];
-
+void view3d_settings_from_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens)
+{
if (!ob) return;
-
+
/* Offset */
if (ofs)
negate_v3_v3(ofs, ob->obmat[3]);
/* Quat */
if (quat) {
- copy_m4_m4(bmat, ob->obmat);
- normalize_m4(bmat);
- invert_m4_m4(imat, bmat);
- copy_m3_m4(tmat, imat);
- mat3_to_quat( quat,tmat);
+ float imat[4][4];
+ invert_m4_m4(imat, ob->obmat);
+ mat4_to_quat(quat, imat);
}
-
+
if (dist) {
- float vec[3];
- copy_m3_m4(tmat, ob->obmat);
-
- vec[0]= vec[1] = 0.0;
- vec[2]= -(*dist);
- mul_m3_v3(tmat, vec);
+ float vec[3] = {0.0f, 0.0f, -(*dist)};
+ float tquat[4];
+
+ mat4_to_quat(tquat, ob->obmat);
+
+ mul_qt_v3(tquat, vec);
+
sub_v3_v3(ofs, vec);
}
-
+
/* Lens */
if (lens)
object_lens_clip_settings(ob, lens, NULL, NULL);
@@ -212,7 +207,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo
if(lens) sms.new_lens= *lens;
if (camera) {
- view_settings_from_ob(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens);
+ view3d_settings_from_ob(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens);
sms.to_camera= 1; /* restore view3d values in end */
}
@@ -259,7 +254,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo
/* original values */
if (oldcamera) {
sms.orig_dist= rv3d->dist; // below function does weird stuff with it...
- view_settings_from_ob(oldcamera, sms.orig_ofs, sms.orig_quat, &sms.orig_dist, &sms.orig_lens);
+ view3d_settings_from_ob(oldcamera, sms.orig_ofs, sms.orig_quat, &sms.orig_dist, &sms.orig_lens);
}
else {
VECCOPY(sms.orig_ofs, rv3d->ofs);
@@ -1122,7 +1117,7 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short
rv3d->persp=RV3D_PERSP;
rv3d->dist= 0.0;
- view_settings_from_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens);
+ view3d_settings_from_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens);
smooth_view(NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX
rv3d->persp=RV3D_CAMOB; /* just to be polite, not needed */
@@ -2688,7 +2683,7 @@ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, f
VECCOPY(orig_ofs, rv3d->ofs);
rv3d->persp= RV3D_PERSP;
rv3d->dist= 0.0;
- view_settings_from_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens);
+ view3d_settings_from_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens);
smooth_view(NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX
} else {
if (rv3d->persp==RV3D_CAMOB) rv3d->persp= RV3D_PERSP; /* switch out of camera mode */
diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h
index ecb0ba8abd1..9248b768cb6 100644
--- a/source/blender/imbuf/IMB_thumbs.h
+++ b/source/blender/imbuf/IMB_thumbs.h
@@ -73,6 +73,8 @@ void IMB_thumb_makedirs();
/* special function for loading a thumbnail embedded into a blend file */
ImBuf *IMB_loadblend_thumb(const char *path);
+void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float aspect);
+
#endif /* _IMB_THUMBS_H */
diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h
index f6afe20cb5c..9fd4108bee9 100644
--- a/source/blender/imbuf/intern/IMB_filetype.h
+++ b/source/blender/imbuf/intern/IMB_filetype.h
@@ -109,6 +109,7 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, int size, int flags);
int imb_savehdr(struct ImBuf * ibuf, char *name, int flags);
/* tiff */
+void imb_inittiff(void);
int imb_is_a_tiff(unsigned char *buf);
struct ImBuf *imb_loadtiff(unsigned char *mem, int size, int flags);
void imb_loadtiletiff(struct ImBuf *ibuf, unsigned char *mem, int size,
diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c
index a0ff4476556..c2140e12013 100644
--- a/source/blender/imbuf/intern/filetype.c
+++ b/source/blender/imbuf/intern/filetype.c
@@ -54,9 +54,6 @@ void quicktime_init(void);
void quicktime_exit(void);
#endif
-void libtiff_init(void);
-void libtiff_exit(void);
-
ImFileType IMB_FILE_TYPES[]= {
{NULL, NULL, imb_is_a_iris, imb_ftype_iris, imb_loadiris, imb_saveiris, NULL, 0, IMAGIC},
{NULL, NULL, imb_is_a_jpeg, imb_ftype_default, imb_load_jpeg, imb_savejpeg, NULL, 0, JPG},
@@ -66,7 +63,7 @@ ImFileType IMB_FILE_TYPES[]= {
{NULL, NULL, imb_is_dpx, imb_ftype_default, imb_loaddpx, imb_save_dpx, NULL, IM_FTYPE_FLOAT, DPX},
{NULL, NULL, imb_is_cineon, imb_ftype_default, imb_loadcineon, imb_savecineon, NULL, IM_FTYPE_FLOAT, CINEON},
#ifdef WITH_TIFF
- {NULL, NULL, imb_is_a_tiff, imb_ftype_default, imb_loadtiff, imb_savetiff, imb_loadtiletiff, 0, TIF},
+ {imb_inittiff, NULL, imb_is_a_tiff, imb_ftype_default, imb_loadtiff, imb_savetiff, imb_loadtiletiff, 0, TIF},
#elif defined(__APPLE__) && defined(IMBUF_COCOA)
{NULL, NULL, imb_is_a_cocoa, imb_ftype_cocoa, imb_imb_cocoaLoadImage, imb_savecocoa, NULL, 0, TIF},
#endif
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 8c75f5ab1ab..234c8837b35 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -347,7 +347,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
if (IMB_saveiff(img, temp, IB_rect | IB_metadata)) {
#ifndef WIN32
chmod(temp, S_IRUSR | S_IWUSR);
-#endif
+#endif
BLI_rename(temp, tpath);
}
diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c
index 6e7bd4e6ca7..4ad983cdff9 100644
--- a/source/blender/imbuf/intern/thumbs_blend.c
+++ b/source/blender/imbuf/intern/thumbs_blend.c
@@ -127,3 +127,59 @@ thumb_error:
if(rect) MEM_freeN(rect);
return NULL;
}
+
+/* add a fake passepartout overlay to a byte buffer, use for blend file thumbnails */
+#define MARGIN 2
+
+void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float aspect)
+{
+ unsigned char *px= (unsigned char *)thumb;
+ int margin_l = MARGIN;
+ int margin_b = MARGIN;
+ int margin_r = width - MARGIN;
+ int margin_t = height - MARGIN;
+
+ if(aspect < 1.0f) {
+ margin_l= (int)((width - ((float)width * aspect)) / 2.0f);
+ margin_l += MARGIN;
+ CLAMP(margin_l, MARGIN, (width/2));
+ margin_r = width - margin_l;
+ }
+ else if (aspect > 1.0f) {
+ margin_b= (int)((height - ((float)height / aspect)) / 2.0f);
+ margin_b += MARGIN;
+ CLAMP(margin_b, MARGIN, (height/2));
+ margin_t = height - margin_b;
+ }
+
+ {
+ int x, y;
+ int hline, vline;
+ int stride_x= (margin_r - margin_l) - 2;
+
+ for(y=0; y < height; y++) {
+ for(x=0; x < width; x++, px+=4) {
+ if((x > margin_l && x < margin_r) && (y > margin_b && y < margin_t)) {
+ /* interior. skip */
+ x += stride_x;
+ px += stride_x * 4;
+ } else if( (hline=(((x == margin_l || x == margin_r)) && y >= margin_b && y <= margin_t)) ||
+ (vline=(((y == margin_b || y == margin_t)) && x >= margin_l && x <= margin_r))
+ ) {
+ /* dashed line */
+ if((hline && y % 2) || (vline && x % 2)) {
+ px[0]= px[1]= px[2]= 0;
+ px[3] = 255;
+ }
+ }
+ else {
+ /* outside, fill in alpha, like passepartout */
+ px[0] *= 0.5f;
+ px[1] *= 0.5f;
+ px[2] *= 0.5f;
+ px[3] = (px[3] * 0.5f) + 96;
+ }
+ }
+ }
+ }
+}
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 488340aec88..99f74fea640 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -356,6 +356,7 @@ static void scanline_separate_32bit(float *rectf, float *fbuf, int scanline_w, i
}
+#if 0
/*
* Use the libTIFF RGBAImage API to read a TIFF image.
* This function uses the "RGBA Image" support from libtiff, which enables
@@ -387,6 +388,7 @@ static int imb_read_tiff_pixels_rgba(ImBuf *ibuf, TIFF *image, int premul)
return success;
}
+#endif
/*
* Use the libTIFF scanline API to read a TIFF image.
@@ -409,12 +411,6 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
TIFFGetField(image, TIFFTAG_PLANARCONFIG, &config);
scanline = TIFFScanlineSize(image);
- /* if file has an unsupported channel count, use libTIFF to
- * convert to an 8 bit RGBA image */
- if (!ELEM(spp, 3, 4))
- return imb_read_tiff_pixels_rgba(ibuf, image, premul);
-
-
if (bitspersample == 32) {
ib_flag = IB_rectfloat;
fbuf = (float *)_TIFFmalloc(scanline);
@@ -427,7 +423,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
}
tmpibuf= IMB_allocImBuf(ibuf->x, ibuf->y, ibuf->depth, ib_flag, 0);
-
+
/* contiguous channels: RGBRGBRGB */
if (config == PLANARCONFIG_CONTIG) {
for (row = 0; row < ibuf->y; row++) {
@@ -512,6 +508,12 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
return success;
}
+void imb_inittiff(void)
+{
+ if (!(G.f & G_DEBUG))
+ TIFFSetErrorHandler(NULL);
+}
+
/**
* Loads a TIFF file.
*
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 55b8374656a..7c3641db379 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -117,7 +117,7 @@ typedef struct Library {
ID *idblock;
struct FileData *filedata;
char name[240]; /* path name used for reading, can be relative and edited in the outliner */
- char filename[240]; /* temp. absolute filepath, only used while reading */
+ char filepath[240]; /* temp. absolute filepath, only used while reading */
int tot, pad; /* tot, idblock and filedata are only fo read and write */
struct Library *parent; /* set for indirectly linked libs, used in the outliner and while reading */
} Library;
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 2c5c50d7dc2..b6f72875c29 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -190,8 +190,12 @@ typedef struct VoxelData {
float int_multiplier;
int still_frame;
char source_path[240];
+
+ /* temporary data */
float *dataset;
-
+ int cachedframe;
+ int ok;
+
} VoxelData;
typedef struct Tex {
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index e1c3dcf82c4..ed52316990e 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -96,7 +96,16 @@ typedef struct ReportList {
int printlevel; /* ReportType */
int storelevel; /* ReportType */
int flag, pad;
+ struct wmTimer *reporttimer;
} ReportList;
+
+/* timer customdata to control reports display */
+typedef struct ReportTimerInfo {
+ float col[3];
+ float greyscale;
+ float widthfac;
+} ReportTimerInfo;
+
/* reports need to be before wmWindowManager */
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 50ab36bd4a4..467eb237b9a 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -399,9 +399,9 @@ static void rna_def_library(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Library", "External .blend file from which data is linked");
RNA_def_struct_ui_icon(srna, ICON_LIBRARY_DATA_DIRECT);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "Path to the library .blend file");
+ RNA_def_property_ui_text(prop, "File Path", "Path to the library .blend file");
/* TODO - lib->filename isnt updated, however the outliner also skips this, probably only needed on read. */
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 72208217984..2ca327f8907 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -284,6 +284,21 @@ static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float valu
*fp = value;
}
+/* ConstraintActuator uses the same property for Material and Property.
+ Therefore we need to clear the property when "detect_material" mode changes */
+static void rna_Actuator_constraint_detect_material_set(struct PointerRNA *ptr, int value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+
+ short old_value = (ca->flag & ACT_CONST_MATERIAL? 1:0);
+
+ if (old_value != value) {
+ ca->flag ^= ACT_CONST_MATERIAL;
+ ca->matprop[0] = '\0';
+ }
+}
+
static void rna_FcurveActuator_add_set(struct PointerRNA *ptr, int value)
{
bActuator *act = (bActuator *)ptr->data;
@@ -1172,6 +1187,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
prop= RNA_def_property(srna, "detect_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_MATERIAL);
RNA_def_property_ui_text(prop, "M/P", "Detect material instead of property");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Actuator_constraint_detect_material_set");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "fh_paralel_axis", PROP_BOOLEAN, PROP_NONE);
@@ -1564,7 +1580,7 @@ static void rna_def_visibility_actuator(BlenderRNA *brna)
RNA_def_struct_sdna_from(srna, "bVisibilityActuator", "data");
prop= RNA_def_property(srna, "visible", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE);
RNA_def_property_ui_text(prop, "Visible", "Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index b1c5cac1865..d126f8543c6 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -64,10 +64,10 @@ EnumPropertyItem constraint_type_items[] ={
{CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", ""},
{CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor", ""},
{CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path", ""},
+ {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", ""},
{CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", ""},
{CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", ""},
{CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", ""},
- {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem space_pchan_items[] = {
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index c4137d5379b..c9b25bf47a6 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -296,15 +296,15 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image");
RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "Image/Movie file name");
+ RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
/* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
- prop= RNA_def_property(srna, "filename_raw", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "Image/Movie file name (without data refreshing)");
+ RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");
prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, image_type_items);
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index b683f5dc4b1..052c9fb3453 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -55,20 +55,20 @@ static int rna_Main_fileissaved_get(PointerRNA *ptr)
return G.relbase_valid;
}
-static void rna_Main_filename_get(PointerRNA *ptr, char *value)
+static void rna_Main_filepath_get(PointerRNA *ptr, char *value)
{
Main *bmain= (Main*)ptr->data;
BLI_strncpy(value, bmain->name, sizeof(bmain->name));
}
-static int rna_Main_filename_length(PointerRNA *ptr)
+static int rna_Main_filepath_length(PointerRNA *ptr)
{
Main *bmain= (Main*)ptr->data;
return strlen(bmain->name);
}
#if 0
-static void rna_Main_filename_set(PointerRNA *ptr, const char *value)
+static void rna_Main_filepath_set(PointerRNA *ptr, const char *value)
{
Main *bmain= (Main*)ptr->data;
BLI_strncpy(bmain->name, value, sizeof(bmain->name));
@@ -308,9 +308,9 @@ void RNA_def_main(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Main", "Main data structure representing a .blend file and all its datablocks");
RNA_def_struct_ui_icon(srna, ICON_BLENDER);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_maxlength(prop, 240);
- RNA_def_property_string_funcs(prop, "rna_Main_filename_get", "rna_Main_filename_length", "rna_Main_filename_set");
+ RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 34eef0bb459..c9e17a562af 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -260,9 +260,9 @@ Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int f
image->id.us--;
return image;
}
-Image *rna_Main_images_load(Main *bmain, char *filename)
+Image *rna_Main_images_load(Main *bmain, char *filepath)
{
- return BKE_add_image_file(filename, 0);
+ return BKE_add_image_file(filepath, 0);
}
void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
{
@@ -316,9 +316,9 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall
BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d.", mb->id.name+2, ID_REAL_USERS(mb));
}
-VFont *rna_Main_fonts_load(Main *bmain, char *filename)
+VFont *rna_Main_fonts_load(Main *bmain, char *filepath)
{
- return load_vfont(filename);
+ return load_vfont(filepath);
}
void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont)
{
@@ -465,7 +465,7 @@ void RNA_api_main(StructRNA *srna)
/*
func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
RNA_def_function_ui_description(func, "Add a new image.");
- parm= RNA_def_string(func, "filename", "", 0, "", "Filename to load image from.");
+ parm= RNA_def_string(func, "filepath", "", 0, "", "File path to load image from.");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "image", "Image", "", "New image.");
RNA_def_function_return(func, parm);
@@ -692,7 +692,7 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "load", "rna_Main_images_load");
RNA_def_function_ui_description(func, "Load a new image into the main database");
- parm= RNA_def_string(func, "filename", "File Name", 0, "", "path of the file to load.");
+ parm= RNA_def_string(func, "filepath", "File Path", 0, "", "path of the file to load.");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
@@ -791,7 +791,7 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "load", "rna_Main_fonts_load");
RNA_def_function_ui_description(func, "Load a new font into the main database");
- parm= RNA_def_string(func, "filename", "File Name", 0, "", "path of the font to load.");
+ parm= RNA_def_string(func, "filepath", "File Path", 0, "", "path of the font to load.");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock.");
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index d2bf791fb67..0ee2360a787 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -40,6 +40,7 @@
#include "BKE_animsys.h"
#include "BKE_bmesh.h" /* For BevelModifierData */
+#include "BKE_multires.h"
#include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */
#include "WM_api.h"
@@ -369,7 +370,7 @@ static int rna_MultiresModifier_external_get(PointerRNA *ptr)
return CustomData_external_test(&me->fdata, CD_MDISPS);
}
-static void rna_MultiresModifier_filename_get(PointerRNA *ptr, char *value)
+static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value)
{
Object *ob= (Object*)ptr->id.data;
CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
@@ -377,16 +378,18 @@ static void rna_MultiresModifier_filename_get(PointerRNA *ptr, char *value)
BLI_strncpy(value, (external)? external->filename: "", sizeof(external->filename));
}
-static void rna_MultiresModifier_filename_set(PointerRNA *ptr, const char *value)
+static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value)
{
Object *ob= (Object*)ptr->id.data;
CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
- if(external)
+ if(external && strcmp(external->filename, value)) {
BLI_strncpy(external->filename, value, sizeof(external->filename));
+ multires_force_external_reload(ob);
+ }
}
-static int rna_MultiresModifier_filename_length(PointerRNA *ptr)
+static int rna_MultiresModifier_filepath_length(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
@@ -603,9 +606,9 @@ static void rna_def_modifier_multires(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_MultiresModifier_external_get", NULL);
RNA_def_property_ui_text(prop, "External", "Store multires displacements outside the .blend file, to save memory");
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
- RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filename_get", "rna_MultiresModifier_filename_length", "rna_MultiresModifier_filename_set");
- RNA_def_property_ui_text(prop, "Filename", "Path to external displacements file");
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filepath_get", "rna_MultiresModifier_filepath_length", "rna_MultiresModifier_filepath_set");
+ RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "optimal_display", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index d6825959083..efa2c3d0027 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -31,6 +31,7 @@
#include "DNA_group_types.h"
#include "DNA_modifier_types.h"
+#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
@@ -798,10 +799,14 @@ static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, Poi
static void object_simplify_update(Object *ob)
{
ModifierData *md;
+ ParticleSystem *psys;
for(md=ob->modifiers.first; md; md=md->next)
if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
- ob->recalc |= OB_RECALC_DATA;
+ ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
+
+ for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ psys->recalc |= PSYS_RECALC_CHILD;
if(ob->dup_group) {
GroupObject *gob;
@@ -811,17 +816,24 @@ static void object_simplify_update(Object *ob)
}
}
-static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
+ Scene *sce;
Base *base;
- for(base= scene->base.first; base; base= base->next)
+ for(SETLOOPER(scene, base))
object_simplify_update(base->object);
DAG_ids_flush_update(0);
WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
}
+static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ if(scene->r.mode & R_SIMPLIFY)
+ rna_Scene_use_simplify_update(bmain, scene, ptr);
+}
+
static int rna_Scene_sync_mode_get(PointerRNA *ptr)
{
Scene *scene= (Scene*)ptr->data;
@@ -2815,7 +2827,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
- RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
+ RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index bbcc1f82826..f1f4a252c16 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -40,9 +40,20 @@
#include "MEM_guardedalloc.h"
#include "WM_types.h"
+#include "BLI_math.h"
#ifdef RNA_RUNTIME
+static float to_dB(float x)
+{
+ return logf(x * x + 1e-30f) * 4.34294480f;
+}
+
+static float from_dB(float x)
+{
+ return expf(x * 0.11512925f);
+}
+
/* build a temp referene to the parent */
static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
{
@@ -393,6 +404,20 @@ static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
return strlen(path)+1;
}
+static float rna_Sequence_attenuation_get(PointerRNA *ptr)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+
+ return to_dB(seq->volume);
+}
+
+static void rna_Sequence_attenuation_set(PointerRNA *ptr, float value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+
+ seq->volume = from_dB(value);
+}
+
/*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
{
@@ -1045,10 +1070,17 @@ static void rna_def_sound(BlenderRNA *brna)
prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume");
- RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+ prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, -100.0f, +40.0f);
+ RNA_def_property_ui_text(prop, "Attenuation/db", "Attenuation in dezibel");
+ RNA_def_property_float_funcs(prop, "rna_Sequence_attenuation_get", "rna_Sequence_attenuation_set", NULL);
+
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "");
RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index 3ff81df02f8..b3c9e36e7b9 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -36,7 +36,7 @@
#include "BKE_sound.h"
#include "BKE_context.h"
-static void rna_Sound_filename_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
sound_load(bmain, (bSound*)ptr->data);
}
@@ -70,10 +70,10 @@ static void rna_def_sound(BlenderRNA *brna)
//rna_def_ipo_common(srna);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "Sound sample file used by this Sound datablock");
- RNA_def_property_update(prop, 0, "rna_Sound_filename_update");
+ RNA_def_property_update(prop, 0, "rna_Sound_filepath_update");
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
@@ -82,7 +82,7 @@ static void rna_def_sound(BlenderRNA *brna)
prop= RNA_def_property(srna, "caching", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set");
RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM");
- RNA_def_property_update(prop, 0, "rna_Sound_filename_update");
+ RNA_def_property_update(prop, 0, "rna_Sound_filepath_update");
}
void RNA_def_sound(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index ad90afb84a6..ccd3b432163 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -174,9 +174,9 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_TEXT);
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set");
- RNA_def_property_ui_text(prop, "Filename", "Filename of the text file");
+ RNA_def_property_ui_text(prop, "File Path", "Filename of the text file");
prop= RNA_def_property(srna, "dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISDIRTY);
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 5e58403e41b..32221e51cb9 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -75,6 +75,7 @@ EnumPropertyItem texture_type_items[] = {
#include "RNA_access.h"
#include "BKE_depsgraph.h"
+#include "BKE_image.h"
#include "BKE_texture.h"
#include "BKE_main.h"
@@ -131,6 +132,22 @@ static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
WM_main_add_notifier(NC_TEXTURE, tex);
}
+static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ tex->vd->ok = 0;
+ rna_Texture_update(bmain, scene, ptr);
+}
+
+static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ tex->ima->source = IMA_SRC_SEQUENCE;
+ rna_Texture_voxeldata_update(bmain, scene, ptr);
+}
+
/* Used for Texture Properties, used (also) for/in Nodes */
static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -1593,7 +1610,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "smoked_type");
RNA_def_property_enum_items(prop, smoked_type_items);
RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
@@ -1611,34 +1628,34 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "file_format");
RNA_def_property_enum_items(prop, file_format_items);
RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render ");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "source_path");
RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resol");
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL);
RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "still_frame");
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
@@ -1656,12 +1673,12 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_image_update");
prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
}
static void rna_def_texture(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 7c78d8a74e7..ccea5fbdf93 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -398,10 +398,6 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "operator", "Operator", "", "");
- RNA_def_property_flag(parm, PROP_REQUIRED);
-
-
func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c
index 1f8be906eb3..c19fbd7d5d3 100644
--- a/source/blender/makesrna/intern/rna_vfont.c
+++ b/source/blender/makesrna/intern/rna_vfont.c
@@ -44,10 +44,10 @@ void RNA_def_vfont(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "VFont");
RNA_def_struct_ui_icon(srna, ICON_FILE_FONT);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_ui_text(prop, "File Path", "");
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index 945f17494f0..71e31656799 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -30,6 +30,8 @@
*
*/
+#include <stddef.h>
+
#include "BKE_cdderivedmesh.h"
#include "BKE_multires.h"
#include "BKE_modifier.h"
@@ -60,6 +62,8 @@ static void copyData(ModifierData *md, ModifierData *target)
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
int useRenderParams, int isFinalCalc)
{
+ SculptSession *ss= ob->sculpt;
+ int sculpting= (ob->mode & OB_MODE_SCULPT) && ss;
MultiresModifierData *mmd = (MultiresModifierData*)md;
DerivedMesh *result;
@@ -73,10 +77,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
result->release(result);
result= cddm;
}
- else if((ob->mode & OB_MODE_SCULPT) && ob->sculpt) {
+ else if(sculpting) {
/* would be created on the fly too, just nicer this
way on first stroke after e.g. switching levels */
- ob->sculpt->pbvh= result->getPBVH(ob, result);
+ ss->pbvh= result->getPBVH(ob, result);
}
return result;
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index b70f145b67b..a1deaa140db 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -137,7 +137,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
int totvert= dm->getNumVerts(dm);
int totedge= dm->getNumEdges(dm);
- char axis_char, close;
+ char axis_char= 'X', close;
float angle= ltmd->angle;
float screw_ofs= ltmd->screw_ofs;
float axis_vec[3]= {0.0f, 0.0f, 0.0f};
@@ -177,7 +177,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
other_axis_1=0;
other_axis_2=2;
break;
- case 2:
+ default: /* 2, use default to quiet warnings */
other_axis_1=0;
other_axis_2=1;
break;
@@ -248,7 +248,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
else {
/* exis char is used by i_rotate*/
- axis_char= 'X' + ltmd->axis;
+ axis_char += ltmd->axis; /* 'X' + axis */
/* useful to be able to use the axis vec in some cases still */
zero_v3(axis_vec);
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index 11208d54a73..40d544ac17e 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -119,9 +119,11 @@ extern "C" {
// short eventValue, unsigned short space_event);
//
// void BPY_pydriver_update(void);
- float BPY_pydriver_eval(struct ChannelDriver *driver);
+ float BPY_eval_driver(struct ChannelDriver *driver);
//
- int BPY_button_eval(struct bContext *C, char *expr, double *value);
+ int BPY_eval_button(struct bContext *C, const char *expr, double *value);
+
+ int BPY_eval_string(struct bContext *C, const char *expr);
/* format importer hook */
int BPY_call_importloader( char *name );
diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py
index 69aa68acdc9..3e81f989d79 100644
--- a/source/blender/python/doc/sphinx_doc_gen.py
+++ b/source/blender/python/doc/sphinx_doc_gen.py
@@ -36,6 +36,7 @@ For PDF generation
make
'''
+# import rpdb2; rpdb2.start_embedded_debugger('test')
import os
import inspect
@@ -134,7 +135,7 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
if type(descr) == GetSetDescriptorType:
fw(ident + ".. attribute:: %s\n\n" % identifier)
- write_indented_lines(ident, fw, doc, False)
+ write_indented_lines(ident + " ", fw, doc, False)
elif type(descr) == MethodDescriptorType: # GetSetDescriptorType, GetSetDescriptorType's are not documented yet
write_indented_lines(ident, fw, doc, False)
else:
@@ -522,7 +523,7 @@ def rna2sphinx(BASEPATH):
if prop.description:
fw(" %s\n\n" % prop.description)
type_descr = prop.get_type_description(class_fmt=":class:`%s`")
- fw(" *type* %s\n\n" % type_descr)
+ fw(" :type: %s\n\n" % type_descr)
# python attributes
py_properties = struct.get_py_properties()
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index 6b79945ccd8..6ac63499988 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -32,6 +32,7 @@
#include "MEM_guardedalloc.h"
#include "BKE_text.h" /* txt_to_buf */
#include "BKE_main.h"
+#include "BKE_global.h" /* grr, only for G.sce */
#include "BLI_listbase.h"
#include <stddef.h>
@@ -55,6 +56,12 @@ void bpy_import_main_set(struct Main *maggie)
bpy_import_main= maggie;
}
+/* returns a dummy filename for a textblock so we can tell what file a text block comes from */
+void bpy_text_filename_get(char *fn, Text *text)
+{
+ sprintf(fn, "%s/%s", text->id.lib ? text->id.lib->filepath : G.sce, text->id.name+2);
+}
+
PyObject *bpy_text_import( Text *text )
{
char *buf = NULL;
@@ -62,8 +69,11 @@ PyObject *bpy_text_import( Text *text )
int len;
if( !text->compiled ) {
+ char fn_dummy[256];
+ bpy_text_filename_get(fn_dummy, text);
+
buf = txt_to_buf( text );
- text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input );
+ text->compiled = Py_CompileString( buf, fn_dummy, Py_file_input );
MEM_freeN( buf );
if( PyErr_Occurred( ) ) {
diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h
index 947e0dfc29d..37136d46c9e 100644
--- a/source/blender/python/generic/bpy_internal_import.h
+++ b/source/blender/python/generic/bpy_internal_import.h
@@ -50,6 +50,9 @@ PyObject* bpy_text_import( struct Text *text );
PyObject* bpy_text_import_name( char *name, int *found );
PyObject* bpy_text_reimport( PyObject *module, int *found );
/* void bpy_text_clear_modules( int clear_all );*/ /* Clear user modules */
+
+void bpy_text_filename_get(char *fn, struct Text *text);
+
extern PyMethodDef bpy_import_meth[];
extern PyMethodDef bpy_reload_meth[];
diff --git a/source/blender/python/generic/mathutils_vector.c b/source/blender/python/generic/mathutils_vector.c
index af549762756..a9bcdacdb03 100644
--- a/source/blender/python/generic/mathutils_vector.c
+++ b/source/blender/python/generic/mathutils_vector.c
@@ -255,8 +255,11 @@ static PyObject *Vector_ToTuple(VectorObject *self, PyObject *args)
{
int ndigits= 0;
- if(!PyArg_ParseTuple(args, "|i:to_tuple", &ndigits) || (ndigits > 22 || ndigits < 0)) {
- PyErr_SetString(PyExc_TypeError, "vector.to_tuple(ndigits): ndigits must be between 0 and 21");
+ if(!PyArg_ParseTuple(args, "|i:to_tuple", &ndigits))
+ return NULL;
+
+ if(ndigits > 22 || ndigits < 0) {
+ PyErr_SetString(PyExc_ValueError, "vector.to_tuple(ndigits): ndigits must be between 0 and 21");
return NULL;
}
@@ -288,10 +291,9 @@ static PyObject *Vector_ToTrackQuat(VectorObject *self, PyObject *args )
char *strack, *sup;
short track = 2, up = 1;
- if(!PyArg_ParseTuple( args, "|ss:to_track_quat", &strack, &sup)) {
- PyErr_SetString( PyExc_TypeError, "expected optional two strings\n" );
+ if(!PyArg_ParseTuple( args, "|ss:to_track_quat", &strack, &sup))
return NULL;
- }
+
if (self->size != 3) {
PyErr_SetString( PyExc_TypeError, "only for 3D vectors\n" );
return NULL;
@@ -498,21 +500,28 @@ static PyObject *Vector_Dot(VectorObject *self, VectorObject *value )
return PyFloat_FromDouble(dot);
}
-static char Vector_Angle_doc[] =
-".. function:: angle(other)\n"
+static char Vector_angle_doc[] =
+".. function:: angle(other, fallback)\n"
"\n"
" Return the angle between two vectors.\n"
"\n"
+" :arg other: another vector to compare the angle with\n"
" :type other: :class:`Vector`\n"
-" :return angle: angle in radians\n"
+" :arg fallback: return this value when the angle cant be calculated (zero length vector)\n"
+" :return angle: angle in radians or fallback when given\n"
" :rtype: float\n"
"\n"
" .. note:: Zero length vectors raise an :exc:`AttributeError`.\n";
-static PyObject *Vector_Angle(VectorObject *self, VectorObject *value)
+static PyObject *Vector_angle(VectorObject *self, PyObject *args)
{
+ VectorObject *value;
double dot = 0.0f, angleRads, test_v1 = 0.0f, test_v2 = 0.0f;
int x, size;
+ PyObject *fallback= NULL;
+ if(!PyArg_ParseTuple(args, "O!|O:angle", &vector_Type, &value, &fallback))
+ return NULL;
+
if (!VectorObject_Check(value)) {
PyErr_SetString( PyExc_TypeError, "vec.angle(value): expected a vector argument" );
return NULL;
@@ -534,8 +543,15 @@ static PyObject *Vector_Angle(VectorObject *self, VectorObject *value)
test_v2 += value->vec[x] * value->vec[x];
}
if (!test_v1 || !test_v2){
- PyErr_SetString(PyExc_AttributeError, "vector.angle(other): zero length vectors are not acceptable arguments\n");
- return NULL;
+ /* avoid exception */
+ if(fallback) {
+ Py_INCREF(fallback);
+ return fallback;
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError, "vector.angle(other): zero length vectors have no valid angle\n");
+ return NULL;
+ }
}
//dot product
@@ -649,10 +665,9 @@ static PyObject *Vector_Lerp(VectorObject *self, PyObject *args)
float fac, ifac, vec[4];
int x;
- if(!PyArg_ParseTuple(args, "O!f:lerp", &vector_Type, &vec2, &fac)) {
- PyErr_SetString(PyExc_TypeError, "vector.lerp(): expects a vector of the same size and float");
+ if(!PyArg_ParseTuple(args, "O!f:lerp", &vector_Type, &vec2, &fac))
return NULL;
- }
+
if(self->size != vec2->size) {
PyErr_SetString(PyExc_AttributeError, "vector.lerp(): expects (2) vector objects of the same size");
return NULL;
@@ -2037,7 +2052,7 @@ static struct PyMethodDef Vector_methods[] = {
{"reflect", ( PyCFunction ) Vector_Reflect, METH_O, Vector_Reflect_doc},
{"cross", ( PyCFunction ) Vector_Cross, METH_O, Vector_Cross_doc},
{"dot", ( PyCFunction ) Vector_Dot, METH_O, Vector_Dot_doc},
- {"angle", ( PyCFunction ) Vector_Angle, METH_O, Vector_Angle_doc},
+ {"angle", ( PyCFunction ) Vector_angle, METH_VARARGS, Vector_angle_doc},
{"difference", ( PyCFunction ) Vector_Difference, METH_O, Vector_Difference_doc},
{"project", ( PyCFunction ) Vector_Project, METH_O, Vector_Project_doc},
{"lerp", ( PyCFunction ) Vector_Lerp, METH_VARARGS, Vector_Lerp_doc},
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index afe6b63458f..8f49263b375 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -103,7 +103,7 @@ static int bpy_pydriver_create_dict(void)
}
/* Update function, it gets rid of pydrivers global dictionary, forcing
- * BPY_pydriver_eval to recreate it. This function is used to force
+ * BPY_eval_driver to recreate it. This function is used to force
* reloading the Blender text module "pydrivers.py", if available, so
* updates in it reach pydriver evaluation.
*/
@@ -153,7 +153,7 @@ static float pydriver_error(ChannelDriver *driver)
* bake operator which intern starts a thread which calls scene update which
* does a driver update. to avoid a deadlock check PyThreadState_Get() if PyGILState_Ensure() is needed.
*/
-float BPY_pydriver_eval (ChannelDriver *driver)
+float BPY_eval_driver (ChannelDriver *driver)
{
PyObject *driver_vars=NULL;
PyObject *retval= NULL;
@@ -246,11 +246,11 @@ float BPY_pydriver_eval (ChannelDriver *driver)
/* this target failed - bad name */
if (targets_ok) {
/* first one - print some extra info for easier identification */
- fprintf(stderr, "\nBPY_pydriver_eval() - Error while evaluating PyDriver:\n");
+ fprintf(stderr, "\nBPY_eval_driver() - Error while evaluating PyDriver:\n");
targets_ok= 0;
}
- fprintf(stderr, "\tBPY_pydriver_eval() - couldn't add variable '%s' to namespace\n", dvar->name);
+ fprintf(stderr, "\tBPY_eval_driver() - couldn't add variable '%s' to namespace\n", dvar->name);
// BPy_errors_to_report(NULL); // TODO - reports
PyErr_Print();
PyErr_Clear();
@@ -290,7 +290,7 @@ float BPY_pydriver_eval (ChannelDriver *driver)
return (float)result;
}
else {
- fprintf(stderr, "\tBPY_pydriver_eval() - driver '%s' evaluates to '%f'\n", dvar->name, result);
+ fprintf(stderr, "\tBPY_eval_driver() - driver '%s' evaluates to '%f'\n", dvar->name, result);
return 0.0f;
}
}
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 285dbb78874..680c5165575 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -327,16 +327,17 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
}
bpy_context_set(C, &gilstate);
-
- py_dict = CreateGlobalDictionary(C, text?text->id.name+2:fn);
if (text) {
+ char fn_dummy[FILE_MAXDIR];
+ bpy_text_filename_get(fn_dummy, text);
+ py_dict = CreateGlobalDictionary(C, fn_dummy);
if( !text->compiled ) { /* if it wasn't already compiled, do it now */
char *buf = txt_to_buf( text );
text->compiled =
- Py_CompileString( buf, text->id.name+2, Py_file_input );
+ Py_CompileString( buf, fn_dummy, Py_file_input );
MEM_freeN( buf );
@@ -347,8 +348,12 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
if(text->compiled)
py_result = PyEval_EvalCode( text->compiled, py_dict, py_dict );
- } else {
- FILE *fp= fopen(fn, "r");
+ }
+ else {
+ FILE *fp= fopen(fn, "r");
+
+ py_dict = CreateGlobalDictionary(C, fn);
+
if(fp) {
#ifdef _WIN32
/* Previously we used PyRun_File to run directly the code on a FILE
@@ -528,7 +533,7 @@ int BPY_run_python_script_space(const char *modulename, const char *func)
#endif
-int BPY_button_eval(bContext *C, char *expr, double *value)
+int BPY_eval_button(bContext *C, const char *expr, double *value)
{
PyGILState_STATE gilstate;
PyObject *dict, *mod, *retval;
@@ -599,6 +604,40 @@ int BPY_button_eval(bContext *C, char *expr, double *value)
return error_ret;
}
+int BPY_eval_string(bContext *C, const char *expr)
+{
+ PyGILState_STATE gilstate;
+ PyObject *dict, *retval;
+ int error_ret = 0;
+
+ if (!expr) return -1;
+
+ if(expr[0]=='\0') {
+ return error_ret;
+ }
+
+ bpy_context_set(C, &gilstate);
+
+ dict= CreateGlobalDictionary(C, NULL);
+
+ retval = PyRun_String(expr, Py_eval_input, dict, dict);
+
+ if (retval == NULL) {
+ error_ret= -1;
+
+ BPy_errors_to_report(CTX_wm_reports(C));
+ }
+ else {
+ Py_DECREF(retval);
+ }
+
+ Py_DECREF(dict);
+ bpy_context_clear(C, &gilstate);
+
+ return error_ret;
+}
+
+
void BPY_load_user_modules(bContext *C)
{
PyGILState_STATE gilstate;
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index f6be316dcfd..deb3d99f9ed 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -1532,8 +1532,6 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
/* 1. check that everything is ok & updated */
if(psys==NULL)
return 0;
-
- totchild=psys->totchild;
part=psys->part;
pars=psys->particles;
@@ -1554,6 +1552,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
if(part->phystype==PART_PHYS_KEYED)
psys_count_keyed_targets(&sim);
+ psys_update_children(&sim);
+ totchild=psys->totchild;
if(G.rendering == 0) { /* preview render */
totchild = (int)((float)totchild * (float)part->disp / 100.0f);
@@ -1657,6 +1657,9 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
transpose_m3(nmat);
/* 2.6 setup strand rendering */
+ if(part->ren_as == PART_DRAW_PATH && psys->pathcache==NULL)
+ psys_update_path_cache(&sim, cfra);
+
if(part->ren_as == PART_DRAW_PATH && psys->pathcache){
path_nbr=(int)pow(2.0,(double) part->ren_step);
@@ -4592,7 +4595,6 @@ void RE_Database_Free(Render *re)
end_render_textures();
free_pointdensities(re);
- free_voxeldata(re);
free_camera_inside_volumes(re);
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index 3ac806f320a..64ba206bb86 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -57,58 +57,72 @@
#include "texture.h"
#include "voxeldata.h"
-static int load_frame_blendervoxel(FILE *fp, float *F, int size, int frame, int offset)
+static int load_frame_blendervoxel(VoxelData *vd, FILE *fp, int frame)
{
- if(fseek(fp,frame*size*sizeof(float)+offset,0) == -1)
+ size_t offset = sizeof(VoxelDataHeader);
+ int size = (vd->resol[0])*(vd->resol[1])*(vd->resol[2]);
+
+ vd->dataset = MEM_mapallocN(sizeof(float)*size, "voxel dataset");
+
+ if(fseek(fp, frame*size*sizeof(float)+offset, 0) == -1)
return 0;
- if(fread(F,sizeof(float),size,fp) != size)
+ if(fread(vd->dataset, sizeof(float), size, fp) != size)
return 0;
+ vd->cachedframe = frame;
+ vd->ok = 1;
return 1;
}
-static int load_frame_raw8(FILE *fp, float *F, int size, int frame)
+static int load_frame_raw8(VoxelData *vd, FILE *fp, int frame)
{
- char *tmp;
+ int size = (vd->resol[0])*(vd->resol[1])*(vd->resol[2]);
+ char *data_c;
int i;
- tmp = (char *)MEM_mallocN(sizeof(char)*size, "temporary voxel file reading storage");
+ vd->dataset = MEM_mapallocN(sizeof(float)*size, "voxel dataset");
+ data_c = (char *)MEM_mallocN(sizeof(char)*size, "temporary voxel file reading storage");
if(fseek(fp,(frame-1)*size*sizeof(char),0) == -1) {
- MEM_freeN(tmp);
+ MEM_freeN(data_c);
return 0;
}
- if(fread(tmp, sizeof(char), size, fp) != size) {
- MEM_freeN(tmp);
+ if(fread(data_c, sizeof(char), size, fp) != size) {
+ MEM_freeN(data_c);
return 0;
}
for (i=0; i<size; i++) {
- F[i] = (float)tmp[i] / 256.f;
+ vd->dataset[i] = (float)data_c[i] / 255.f;
}
- MEM_freeN(tmp);
+ MEM_freeN(data_c);
+
+ vd->cachedframe = frame;
+ vd->ok = 1;
return 1;
}
-static void load_frame_image_sequence(Render *re, VoxelData *vd, Tex *tex)
+static void load_frame_image_sequence(VoxelData *vd, Tex *tex)
{
ImBuf *ibuf;
Image *ima = tex->ima;
- ImageUser *iuser = &tex->iuser;
+ ImageUser *tiuser = &tex->iuser;
+ ImageUser iuser = *(tiuser);
int x=0, y=0, z=0;
float *rf;
- if (!ima || !iuser) return;
+ if (!ima || !tiuser) return;
+ if (iuser.frames == 0) return;
ima->source = IMA_SRC_SEQUENCE;
- iuser->framenr = 1 + iuser->offset;
+ iuser.framenr = 1 + iuser.offset;
/* find the first valid ibuf and use it to initialise the resolution of the data set */
/* need to do this in advance so we know how much memory to allocate */
- ibuf= BKE_image_get_ibuf(ima, iuser);
- while (!ibuf && (iuser->framenr < iuser->frames)) {
- iuser->framenr++;
- ibuf= BKE_image_get_ibuf(ima, iuser);
+ ibuf= BKE_image_get_ibuf(ima, &iuser);
+ while (!ibuf && (iuser.framenr < iuser.frames)) {
+ iuser.framenr++;
+ ibuf= BKE_image_get_ibuf(ima, &iuser);
}
if (!ibuf) return;
if (!ibuf->rect_float) IMB_float_from_rect(ibuf);
@@ -116,15 +130,15 @@ static void load_frame_image_sequence(Render *re, VoxelData *vd, Tex *tex)
vd->flag |= TEX_VD_STILL;
vd->resol[0] = ibuf->x;
vd->resol[1] = ibuf->y;
- vd->resol[2] = iuser->frames;
+ vd->resol[2] = iuser.frames;
vd->dataset = MEM_mapallocN(sizeof(float)*(vd->resol[0])*(vd->resol[1])*(vd->resol[2]), "voxel dataset");
- for (z=0; z < iuser->frames; z++)
+ for (z=0; z < iuser.frames; z++)
{
/* get a new ibuf for each frame */
if (z > 0) {
- iuser->framenr++;
- ibuf= BKE_image_get_ibuf(ima, iuser);
+ iuser.framenr++;
+ ibuf= BKE_image_get_ibuf(ima, &iuser);
if (!ibuf) break;
if (!ibuf->rect_float) IMB_float_from_rect(ibuf);
}
@@ -134,14 +148,17 @@ static void load_frame_image_sequence(Render *re, VoxelData *vd, Tex *tex)
{
for (x=0; x < ibuf->x; x++)
{
- /* currently converted to monchrome */
+ /* currently averaged to monchrome */
vd->dataset[ V_I(x, y, z, vd->resol) ] = (rf[0] + rf[1] + rf[2])*0.333f;
rf +=4;
}
}
- BKE_image_free_anim_ibufs(ima, iuser->framenr);
+ BKE_image_free_anim_ibufs(ima, iuser.framenr);
}
+
+ vd->ok = 1;
+ return;
}
static int read_voxeldata_header(FILE *fp, struct VoxelData *vd)
@@ -162,7 +179,7 @@ static int read_voxeldata_header(FILE *fp, struct VoxelData *vd)
return 1;
}
-static void init_frame_smoke(Render *re, VoxelData *vd, Tex *tex)
+static void init_frame_smoke(VoxelData *vd, Tex *tex)
{
Object *ob;
ModifierData *md;
@@ -232,53 +249,65 @@ static void init_frame_smoke(Render *re, VoxelData *vd, Tex *tex)
} // end of fluid condition
}
}
+
+ vd->ok = 1;
+ return;
}
static void cache_voxeldata(struct Render *re,Tex *tex)
{
VoxelData *vd = tex->vd;
FILE *fp;
- int size;
int curframe;
if (!vd) return;
- /* image sequence gets special treatment */
- if (vd->file_format == TEX_VD_IMAGE_SEQUENCE) {
- load_frame_image_sequence(re, vd, tex);
- return;
- } else if (vd->file_format == TEX_VD_SMOKE) {
- init_frame_smoke(re, vd, tex);
- return;
+ /* only re-cache if dataset needs updating */
+ if ((vd->flag & TEX_VD_STILL) || (vd->cachedframe == re->r.cfra))
+ if (vd->ok) return;
+
+ /* clear out old cache, ready for new */
+ if (vd->dataset) {
+ if(vd->file_format != TEX_VD_SMOKE)
+ MEM_freeN(vd->dataset);
+ vd->dataset = NULL;
}
- if (!BLI_exists(vd->source_path)) return;
- fp = fopen(vd->source_path,"rb");
- if (!fp) return;
-
- if (vd->file_format == TEX_VD_BLENDERVOXEL) {
- if(!read_voxeldata_header(fp, vd)) {
- fclose(fp);
- return;
- }
- }
-
- size = (vd->resol[0])*(vd->resol[1])*(vd->resol[2]);
- vd->dataset = MEM_mapallocN(sizeof(float)*size, "voxel dataset");
-
- if (vd->flag & TEX_VD_STILL) curframe = vd->still_frame;
- else curframe = re->r.cfra;
+ if (vd->flag & TEX_VD_STILL)
+ curframe = vd->still_frame;
+ else
+ curframe = re->r.cfra;
switch(vd->file_format) {
+ case TEX_VD_IMAGE_SEQUENCE:
+ load_frame_image_sequence(vd, tex);
+ return;
+ case TEX_VD_SMOKE:
+ init_frame_smoke(vd, tex);
+ return;
case TEX_VD_BLENDERVOXEL:
- load_frame_blendervoxel(fp, vd->dataset, size, curframe-1, sizeof(VoxelDataHeader));
- break;
+ if (!BLI_exists(vd->source_path)) return;
+ fp = fopen(vd->source_path,"rb");
+ if (!fp) return;
+
+ if(read_voxeldata_header(fp, vd))
+ load_frame_blendervoxel(vd, fp, curframe-1);
+ else
+ fclose(fp);
+
+ return;
case TEX_VD_RAW_8BIT:
- load_frame_raw8(fp, vd->dataset, size, curframe);
- break;
+ if (!BLI_exists(vd->source_path)) return;
+ fp = fopen(vd->source_path,"rb");
+ if (!fp) return;
+
+ if (load_frame_raw8(vd, fp, curframe))
+ ;
+ else
+ fclose(fp);
+
+ return;
}
-
- fclose(fp);
}
void make_voxeldata(struct Render *re)
@@ -300,29 +329,6 @@ void make_voxeldata(struct Render *re)
}
-static void free_voxeldata_one(Render *re, Tex *tex)
-{
- VoxelData *vd = tex->vd;
-
- if (vd->dataset) {
- if(vd->file_format != TEX_VD_SMOKE)
- MEM_freeN(vd->dataset);
- vd->dataset = NULL;
- }
-}
-
-
-void free_voxeldata(Render *re)
-{
- Tex *tex;
-
- for (tex= G.main->tex.first; tex; tex= tex->id.next) {
- if(tex->id.us && tex->type==TEX_VOXELDATA) {
- free_voxeldata_one(re, tex);
- }
- }
-}
-
int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres)
{
int retval = TEX_INT;
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 40186f40e9d..2b159daf6a1 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -324,5 +324,9 @@ void WM_jobs_stop_all(struct wmWindowManager *wm);
char *WM_clipboard_text_get(int selection);
void WM_clipboard_text_set(char *buf, int selection);
+ /* progress */
+void WM_progress_set(struct wmWindow *win, float progress);
+void WM_progress_clear(struct wmWindow *win);
+
#endif /* WM_API_H */
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 452c37dbe77..fcf8951d796 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -98,13 +98,18 @@ void WM_operator_free(wmOperator *op)
MEM_freeN(op);
}
+static void wm_reports_free(wmWindowManager *wm)
+{
+ BKE_reports_clear(&wm->reports);
+ WM_event_remove_timer(wm, NULL, wm->reports.reporttimer);
+}
+
/* all operations get registered in the windowmanager here */
/* called on event handling by event_system.c */
void wm_operator_register(bContext *C, wmOperator *op)
{
wmWindowManager *wm= CTX_wm_manager(C);
int tot;
- char *buf;
BLI_addtail(&wm->operators, op);
tot= BLI_countlist(&wm->operators);
@@ -116,12 +121,6 @@ void wm_operator_register(bContext *C, wmOperator *op)
tot--;
}
-
- /* Report the string representation of the operator */
- buf = WM_operator_pystring(C, op->type, op->ptr, 1);
- BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
- MEM_freeN(buf);
-
/* so the console is redrawn */
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
WM_event_add_notifier(C, NC_WM|ND_HISTORY, NULL);
@@ -309,7 +308,8 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm)
BLI_freelistN(&wm->paintcursors);
BLI_freelistN(&wm->drags);
- BKE_reports_clear(&wm->reports);
+
+ wm_reports_free(wm);
if(C && CTX_wm_manager(C)==wm) CTX_wm_manager_set(C, NULL);
}
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 84a6b3598d7..b55c68ce029 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -372,15 +372,56 @@ int WM_operator_poll(bContext *C, wmOperatorType *ot)
return 1;
}
+static void wm_operator_print(wmOperator *op)
+{
+ char *buf = WM_operator_pystring(NULL, op->type, op->ptr, 1);
+ printf("%s\n", buf);
+ MEM_freeN(buf);
+}
+
+static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int popup)
+{
+ wmWindowManager *wm = CTX_wm_manager(C);
+ ReportList *reports = CTX_wm_reports(C);
+ char *buf;
+
+ if(popup)
+ if(op->reports->list.first)
+ uiPupMenuReports(C, op->reports);
+
+ if(retval & OPERATOR_FINISHED) {
+ if(G.f & G_DEBUG)
+ wm_operator_print(op); /* todo - this print may double up, might want to check more flags then the FINISHED */
+
+ /* Report the python string representation of the operator */
+ buf = WM_operator_pystring(C, op->type, op->ptr, 1);
+ BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
+ MEM_freeN(buf);
+ }
+
+ if (op->reports->list.first) {
+ ReportTimerInfo *rti;
+
+ /* add reports to the global list, otherwise they are not seen */
+ addlisttolist(&CTX_wm_reports(C)->list, &op->reports->list);
+
+ /* After adding reports to the global list, reset the report timer. */
+ WM_event_remove_timer(wm, NULL, reports->reporttimer);
+
+ /* Records time since last report was added */
+ reports->reporttimer= WM_event_add_timer(wm, CTX_wm_window(C), TIMER, 0.02);
+
+ rti = MEM_callocN(sizeof(ReportTimerInfo), "ReportTimerInfo");
+ reports->reporttimer->customdata = rti;
+ }
+}
+
static void wm_operator_finished(bContext *C, wmOperator *op, int repeat)
{
wmWindowManager *wm= CTX_wm_manager(C);
op->customdata= NULL;
- /* add reports to the global list, otherwise they are not seen */
- addlisttolist(&CTX_wm_reports(C)->list, &op->reports->list);
-
/* we don't want to do undo pushes for operators that are being
called from operators that already do an undo push. usually
this will happen for python operators that call C operators */
@@ -424,9 +465,8 @@ static int wm_operator_exec(bContext *C, wmOperator *op, int repeat)
wm->op_undo_depth--;
}
- if(retval & (OPERATOR_FINISHED|OPERATOR_CANCELLED))
- if(op->reports->list.first)
- uiPupMenuReports(C, op->reports);
+ if (retval & (OPERATOR_FINISHED|OPERATOR_CANCELLED) && repeat == 0)
+ wm_operator_reports(C, op, retval, 0);
if(retval & OPERATOR_FINISHED)
wm_operator_finished(C, op, repeat);
@@ -534,13 +574,6 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P
return op;
}
-static void wm_operator_print(wmOperator *op)
-{
- char *buf = WM_operator_pystring(NULL, op->type, op->ptr, 1);
- printf("%s\n", buf);
- MEM_freeN(buf);
-}
-
static void wm_region_mouse_co(bContext *C, wmEvent *event)
{
ARegion *ar= CTX_wm_region(C);
@@ -584,18 +617,14 @@ int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerR
}
else
printf("invalid operator call %s\n", ot->idname); /* debug, important to leave a while, should never happen */
-
+
/* Note, if the report is given as an argument then assume the caller will deal with displaying them
* currently python only uses this */
- if((retval & (OPERATOR_FINISHED|OPERATOR_CANCELLED)) && reports==NULL)
- if(op->reports->list.first) /* only show the report if the report list was not given in the function */
- uiPupMenuReports(C, op->reports);
+ if (!(retval & OPERATOR_HANDLED) && retval & (OPERATOR_FINISHED|OPERATOR_CANCELLED))
+ /* only show the report if the report list was not given in the function */
+ wm_operator_reports(C, op, retval, (reports==NULL));
+
- if (retval & OPERATOR_FINISHED) { /* todo - this may conflict with the other wm_operator_print, if theres ever 2 prints for 1 action will may need to add modal check here */
- if(G.f & G_DEBUG)
- wm_operator_print(op);
- }
-
if(retval & OPERATOR_HANDLED)
; /* do nothing, wm_operator_exec() has been called somewhere */
else if(retval & OPERATOR_FINISHED) {
@@ -1084,17 +1113,11 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
/* this special cases is for areas and regions that get removed */
CTX_wm_area_set(C, NULL);
CTX_wm_region_set(C, NULL);
- }
-
- if(retval & (OPERATOR_FINISHED|OPERATOR_CANCELLED))
- if(op->reports->list.first)
- uiPupMenuReports(C, op->reports);
-
- if (retval & OPERATOR_FINISHED) {
- if(G.f & G_DEBUG)
- wm_operator_print(op); /* todo - this print may double up, might want to check more flags then the FINISHED */
- }
+ }
+ if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED))
+ wm_operator_reports(C, op, retval, 0);
+
if(retval & OPERATOR_FINISHED) {
wm_operator_finished(C, op, 0);
handler->op= NULL;
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index a6e59cde402..44768116c7c 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -491,8 +491,7 @@ static void do_history(char *name, ReportList *reports)
BKE_report(reports, RPT_ERROR, "Unable to make version backup");
}
-/* writes a thumbnail for a blendfile */
-static void writeThumb(const char *path, Scene *scene, int **thumb_pt)
+static ImBuf *blend_file_thumb(const char *path, Scene *scene, int **thumb_pt)
{
/* will be scaled down, but gives some nice oversampling */
ImBuf *ibuf;
@@ -501,15 +500,19 @@ static void writeThumb(const char *path, Scene *scene, int **thumb_pt)
*thumb_pt= NULL;
if(G.background || scene->camera==NULL)
- return;
+ return NULL;
/* gets scaled to BLEN_THUMB_SIZE */
ibuf= ED_view3d_draw_offscreen_imbuf_simple(scene, BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, OB_SOLID);
if(ibuf) {
-
+ float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp);
+
/* dirty oversampling */
IMB_scaleImBuf(ibuf, BLEN_THUMB_SIZE, BLEN_THUMB_SIZE);
+
+ /* add pretty overlay */
+ IMB_overlayblend_thumb(ibuf->rect, ibuf->x, ibuf->y, aspect);
/* first write into thumb buffer */
thumb= MEM_mallocN(((2 + (BLEN_THUMB_SIZE * BLEN_THUMB_SIZE))) * sizeof(int), "write_file thumb");
@@ -518,14 +521,6 @@ static void writeThumb(const char *path, Scene *scene, int **thumb_pt)
thumb[1] = BLEN_THUMB_SIZE;
memcpy(thumb + 2, ibuf->rect, BLEN_THUMB_SIZE * BLEN_THUMB_SIZE * sizeof(int));
-
- /* the image is scaled here */
- ibuf= IMB_thumb_create(path, THB_NORMAL, THB_SOURCE_BLEND, ibuf);
-
- if (ibuf)
- IMB_freeImBuf(ibuf);
-
- ibuf= NULL;
}
else {
/* '*thumb_pt' needs to stay NULL to prevent a bad thumbnail from being handled */
@@ -534,6 +529,8 @@ static void writeThumb(const char *path, Scene *scene, int **thumb_pt)
/* must be freed by caller */
*thumb_pt= thumb;
+
+ return ibuf;
}
int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
@@ -543,6 +540,7 @@ int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
char di[FILE_MAX];
int *thumb= NULL;
+ ImBuf *ibuf_thumb= NULL;
len = strlen(target);
@@ -585,7 +583,7 @@ int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
do_history(di, reports);
/* blend file thumbnail */
- writeThumb(di, CTX_data_scene(C), &thumb);
+ ibuf_thumb= blend_file_thumb(di, CTX_data_scene(C), &thumb);
if (BLO_write_file(CTX_data_main(C), di, fileflags, reports, thumb)) {
strcpy(G.sce, di);
@@ -602,9 +600,16 @@ int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
writeBlog();
+ /* run this function after because the file cant be written before the blend is */
+ if (ibuf_thumb) {
+ ibuf_thumb= IMB_thumb_create(di, THB_NORMAL, THB_SOURCE_BLEND, ibuf_thumb);
+ IMB_freeImBuf(ibuf_thumb);
+ }
+
if(thumb) MEM_freeN(thumb);
}
else {
+ if(ibuf_thumb) IMB_freeImBuf(ibuf_thumb);
if(thumb) MEM_freeN(thumb);
return -1;
}
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index a92a3d746ad..e7df703ba79 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -381,6 +381,9 @@ void wm_jobs_timer_ended(wmWindowManager *wm, wmTimer *wt)
void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
{
wmJob *steve= wm->jobs.first, *stevenext;
+ float total_progress= 0.f;
+ float jobs_progress=0;
+
for(; steve; steve= stevenext) {
stevenext= steve->next;
@@ -434,6 +437,10 @@ void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
BLI_remlink(&wm->jobs, steve);
MEM_freeN(steve);
}
+ } else if (steve->flag & WM_JOB_PROGRESS) {
+ /* accumulate global progress for running jobs */
+ jobs_progress++;
+ total_progress += steve->progress;
}
}
else if(steve->suspended) {
@@ -441,5 +448,13 @@ void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
}
}
}
+
+ /* if there are running jobs, set the global progress indicator */
+ if (jobs_progress > 0) {
+ float progress = total_progress / (float)jobs_progress;
+ WM_progress_set(wm->winactive, progress);
+ } else {
+ WM_progress_clear(wm->winactive);
+ }
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index de748d204ff..842e43b98cf 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1202,11 +1202,11 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
split = uiLayoutSplit(layout, 0, 0);
col = uiLayoutColumn(split, 0);
uiItemL(col, "Links", 0);
- uiItemO(col, NULL, ICON_URL, "HELP_OT_release_logs");
- uiItemO(col, NULL, ICON_URL, "HELP_OT_manual");
- uiItemO(col, NULL, ICON_URL, "HELP_OT_blender_website");
- uiItemO(col, NULL, ICON_URL, "HELP_OT_user_community");
- uiItemO(col, NULL, ICON_URL, "HELP_OT_python_api");
+ uiItemStringO(col, "Release Log", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-250/");
+ uiItemStringO(col, "Manual", ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:Manual");
+ uiItemStringO(col, "Blender Website", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/");
+ uiItemStringO(col, "User Community", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community/");
+ uiItemStringO(col, "Python API Reference", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/documentation/250PythonDoc/contents.html");
uiItemL(col, "", 0);
col = uiLayoutColumn(split, 0);
@@ -1518,7 +1518,7 @@ static void wm_link_make_library_local(Main *main, const char *libname)
/* and now find the latest append lib file */
for(lib= main->library.first; lib; lib=lib->id.next)
- if(BLI_streq(libname, lib->filename))
+ if(BLI_streq(libname, lib->filepath))
break;
/* make local */
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index b4270aa9a94..b730d1a6483 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1018,6 +1018,18 @@ void WM_clipboard_text_set(char *buf, int selection)
#endif
}
+/* ******************* progress bar **************** */
+
+void WM_progress_set(wmWindow *win, float progress)
+{
+ GHOST_SetProgressBar(win->ghostwin, progress);
+}
+
+void WM_progress_clear(wmWindow *win)
+{
+ GHOST_EndProgressBar(win->ghostwin);
+}
+
/* ************************************ */
void wm_window_get_position(wmWindow *win, int *posx_r, int *posy_r)
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 3bfdcdb5aef..add9ac05189 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -353,9 +353,7 @@ int LOD_PreprocessMesh(struct LOD_Decimation_Info *info){return 0;}
int LOD_LoadMesh(struct LOD_Decimation_Info *info){return 0;}
/* smoke */
-void lzo1x_1_compress(void) {return;}
void LzmaCompress(void) { return; }
-void lzo1x_decompress(void) {return;}
void LzmaUncompress(void) {return;}
/* smoke is included anyway
void smoke_export(void) {return;}
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 7da3603061d..2101714dcf7 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -263,6 +263,7 @@ static int print_help(int argc, char **argv, void *data)
printf("\n");
BLI_argsPrintArgDoc(ba, "--python");
+ BLI_argsPrintArgDoc(ba, "--python-console");
#ifdef WIN32
BLI_argsPrintArgDoc(ba, "-R");
@@ -791,36 +792,40 @@ static int set_skip_frame(int argc, char **argv, void *data)
}
}
+/* macro for ugly context setup/reset */
+#ifndef DISABLE_PYTHON
+#define BPY_CTX_SETUP(_cmd) \
+{ \
+ wmWindowManager *wm= CTX_wm_manager(C); \
+ wmWindow *prevwin= CTX_wm_window(C); \
+ Scene *prevscene= CTX_data_scene(C); \
+ if(wm->windows.first) { \
+ CTX_wm_window_set(C, wm->windows.first); \
+ _cmd; \
+ CTX_wm_window_set(C, prevwin); \
+ } \
+ else { \
+ fprintf(stderr, "Python script \"%s\" running with missing context data.\n", argv[1]); \
+ _cmd; \
+ } \
+ CTX_data_scene_set(C, prevscene); \
+} \
+
+#endif /* DISABLE_PYTHON */
+
static int run_python(int argc, char **argv, void *data)
{
#ifndef DISABLE_PYTHON
bContext *C = data;
- /* Make the path absolute because its needed for relative linked blends to be found */
- char filename[FILE_MAXDIR + FILE_MAXFILE];
- BLI_strncpy(filename, argv[1], sizeof(filename));
- BLI_path_cwd(filename);
-
/* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */
if (argc > 1) {
- /* XXX, temp setting the WM is ugly, splash also does this :S */
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow *prevwin= CTX_wm_window(C);
- Scene *prevscene= CTX_data_scene(C);
-
- if(wm->windows.first) {
- CTX_wm_window_set(C, wm->windows.first);
-
- BPY_run_python_script(C, filename, NULL, NULL); // use reports?
-
- CTX_wm_window_set(C, prevwin);
- }
- else {
- fprintf(stderr, "Python script \"%s\" running with missing context data.\n", argv[1]);
- BPY_run_python_script(C, filename, NULL, NULL); // use reports?
- }
+ /* Make the path absolute because its needed for relative linked blends to be found */
+ char filename[FILE_MAXDIR + FILE_MAXFILE];
+ BLI_strncpy(filename, argv[1], sizeof(filename));
+ BLI_path_cwd(filename);
- CTX_data_scene_set(C, prevscene);
+ BPY_CTX_SETUP( BPY_run_python_script(C, filename, NULL, NULL) )
return 1;
} else {
@@ -833,6 +838,21 @@ static int run_python(int argc, char **argv, void *data)
#endif /* DISABLE_PYTHON */
}
+static int run_python_console(int argc, char **argv, void *data)
+{
+#ifndef DISABLE_PYTHON
+ bContext *C = data;
+ const char *expr= "__import__('code').interact()";
+
+ BPY_CTX_SETUP( BPY_eval_string(C, expr) )
+
+ return 0;
+#else
+ printf("This blender was built without python support\n");
+ return 0;
+#endif /* DISABLE_PYTHON */
+}
+
static int load_file(int argc, char **argv, void *data)
{
bContext *C = data;
@@ -957,6 +977,7 @@ void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
BLI_argsAdd(ba, 4, "-e", "--frame-end", "<frame>\n\tSet end to frame <frame> (use before the -a argument)", set_end_frame, C);
BLI_argsAdd(ba, 4, "-j", "--frame-jump", "<frames>\n\tSet number of frames to step forward after each rendered frame", set_skip_frame, C);
BLI_argsAdd(ba, 4, "-P", "--python", "<filename>\n\tRun the given Python script (filename or Blender Text)", run_python, C);
+ BLI_argsAdd(ba, 4, NULL, "--python-console", "\n\tRun blender with an interactive console", run_python_console, C);
BLI_argsAdd(ba, 4, "-o", "--render-output", output_doc, set_output, C);
BLI_argsAdd(ba, 4, "-E", "--engine", "<engine>\n\tSpecify the render engine\n\tuse -E help to list available engines", set_engine, C);
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 0198555753e..e25bdd8982e 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -1310,6 +1310,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_PROPSENSOR_EXPRESSION, SCA_PropertySensor::KX_PROPSENSOR_EXPRESSION);
/* 3. Constraint actuator */
+ /* XXX, TODO NXBGE, move constants names from KX_ACT_CONSTRAINT_foo to KX_CONSTRAINTACT_foo */
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCY);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCZ);
@@ -1318,10 +1319,10 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY);
- KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPZ);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY);
- KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNZ);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIY);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIZ);
@@ -1331,6 +1332,12 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNX);
KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNY);
KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNZ);
+ KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_NORMAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_NORMAL);
+ KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_MATERIAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_MATERIAL);
+ KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_PERMANENT, KX_ConstraintActuator::KX_ACT_CONSTRAINT_PERMANENT);
+ KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DISTANCE, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DISTANCE);
+ KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_LOCAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCAL);
+ KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DOROTFH, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DOROTFH);
/* 4. Ipo actuator, simple part */
KX_MACRO_addTypesToDict(d, KX_IPOACT_PLAY, KX_IpoActuator::KX_ACT_IPO_PLAY);
@@ -1469,6 +1476,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_MOUSE_BUT_MIDDLE, SCA_IInputDevice::KX_MIDDLEMOUSE);
KX_MACRO_addTypesToDict(d, KX_MOUSE_BUT_RIGHT, SCA_IInputDevice::KX_RIGHTMOUSE);
+ /* 2D Filter Actuator */
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_ENABLED, RAS_2DFilterManager::RAS_2DFILTER_ENABLED);
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_DISABLED, RAS_2DFilterManager::RAS_2DFILTER_DISABLED);
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_NOFILTER, RAS_2DFilterManager::RAS_2DFILTER_NOFILTER);
@@ -1484,7 +1492,8 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_SEPIA, RAS_2DFilterManager::RAS_2DFILTER_SEPIA);
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_INVERT, RAS_2DFilterManager::RAS_2DFILTER_INVERT);
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_CUSTOMFILTER, RAS_2DFilterManager::RAS_2DFILTER_CUSTOMFILTER);
-
+
+ /* Sound Actuator */
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_PLAYSTOP, KX_SoundActuator::KX_SOUNDACT_PLAYSTOP);
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_PLAYEND, KX_SoundActuator::KX_SOUNDACT_PLAYEND);
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPSTOP, KX_SoundActuator::KX_SOUNDACT_LOOPSTOP);
@@ -1492,18 +1501,12 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SoundActuator::KX_SOUNDACT_LOOPBIDIRECTIONAL);
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP, KX_SoundActuator::KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP);
+ /* State Actuator */
KX_MACRO_addTypesToDict(d, KX_STATE_OP_CPY, KX_StateActuator::OP_CPY);
KX_MACRO_addTypesToDict(d, KX_STATE_OP_SET, KX_StateActuator::OP_SET);
KX_MACRO_addTypesToDict(d, KX_STATE_OP_CLR, KX_StateActuator::OP_CLR);
KX_MACRO_addTypesToDict(d, KX_STATE_OP_NEG, KX_StateActuator::OP_NEG);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_NORMAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_NORMAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_MATERIAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_MATERIAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_PERMANENT, KX_ConstraintActuator::KX_ACT_CONSTRAINT_PERMANENT);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DISTANCE, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DISTANCE);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_LOCAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DOROTFH, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DOROTFH);
-
/* Game Actuator Modes */
KX_MACRO_addTypesToDict(d, KX_GAME_LOAD, KX_GameActuator::KX_GAME_LOAD);
KX_MACRO_addTypesToDict(d, KX_GAME_START, KX_GameActuator::KX_GAME_START);
@@ -1828,7 +1831,7 @@ static void initPySysObjects(Main *maggie)
while(lib) {
/* lib->name wont work in some cases (on win32),
* even when expanding with gp_GamePythonPath, using lib->filename is less trouble */
- initPySysObjects__append(sys_path, lib->filename);
+ initPySysObjects__append(sys_path, lib->filepath);
lib= (Library *)lib->id.next;
}
diff --git a/source/gameengine/PyDoc/bge.events.rst b/source/gameengine/PyDoc/bge.events.rst
index 4ad0e8d8cbc..e166b8246b7 100644
--- a/source/gameengine/PyDoc/bge.events.rst
+++ b/source/gameengine/PyDoc/bge.events.rst
@@ -2,6 +2,10 @@
Game Engine bge.events module
=============================
+*****
+Intro
+*****
+
This module holds key constants for the SCA_KeyboardSensor.
.. module:: bge.events
@@ -37,6 +41,10 @@ This module holds key constants for the SCA_KeyboardSensor.
if key == bge.keys.DKEY:
# Activate Right!
+*********
+Functions
+*********
+
.. function:: EventToString(event)
Return the string name of a key event. Will raise a ValueError error if its invalid.
@@ -55,8 +63,31 @@ This module holds key constants for the SCA_KeyboardSensor.
:arg shift: set to true if shift is held.
:rtype: string
+****************
+Keys (Constants)
+****************
+
+.. _mouse-keys:
+
+==========
+Mouse Keys
+==========
+
+.. data:: LEFTMOUSE
+.. data:: MIDDLEMOUSE
+.. data:: RIGHTMOUSE
+.. data:: WHEELUPMOUSE
+.. data:: WHEELDOWNMOUSE
+.. data:: MOUSEX
+.. data:: MOUSEY
+
+=============
+Keyboard Keys
+=============
-**Alphabet keys**
+-------------
+Alphabet keys
+-------------
.. data:: AKEY
.. data:: BKEY
@@ -85,7 +116,9 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: YKEY
.. data:: ZKEY
-**Number keys**
+-----------
+Number keys
+-----------
.. data:: ZEROKEY
.. data:: ONEKEY
@@ -98,7 +131,9 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: EIGHTKEY
.. data:: NINEKEY
-**Modifiers**
+--------------
+Modifiers Keys
+--------------
.. data:: CAPSLOCKKEY
.. data:: LEFTCTRLKEY
@@ -108,14 +143,18 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: RIGHTSHIFTKEY
.. data:: LEFTSHIFTKEY
-**Arrow Keys**
+----------
+Arrow Keys
+----------
.. data:: LEFTARROWKEY
.. data:: DOWNARROWKEY
.. data:: RIGHTARROWKEY
.. data:: UPARROWKEY
-**Numberpad Keys**
+--------------
+Numberpad Keys
+--------------
.. data:: PAD0
.. data:: PAD1
@@ -134,7 +173,9 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: PADENTER
.. data:: PADPLUSKEY
-**Function Keys**
+-------------
+Function Keys
+-------------
.. data:: F1KEY
.. data:: F2KEY
@@ -156,7 +197,9 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: F18KEY
.. data:: F19KEY
-**Other Keys**
+----------
+Other Keys
+----------
.. data:: ACCENTGRAVEKEY
.. data:: BACKSLASHKEY
@@ -182,13 +225,3 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: SLASHKEY
.. data:: SPACEKEY
.. data:: TABKEY
-
-**Mouse Events**
-
-.. data:: LEFTMOUSE
-.. data:: MIDDLEMOUSE
-.. data:: RIGHTMOUSE
-.. data:: WHEELUPMOUSE
-.. data:: WHEELDOWNMOUSE
-.. data:: MOUSEX
-.. data:: MOUSEY:
diff --git a/source/gameengine/PyDoc/bge.logic.rst b/source/gameengine/PyDoc/bge.logic.rst
index 4f9b94a7340..f48dc56521c 100644
--- a/source/gameengine/PyDoc/bge.logic.rst
+++ b/source/gameengine/PyDoc/bge.logic.rst
@@ -1,7 +1,10 @@
Game Engine bge.logic Module
============================
-
+*****
+Intro
+*****
+
Module to access logic functions, imported automatically into the python controllers namespace.
.. module:: bge.logic
@@ -14,7 +17,7 @@ Module to access logic functions, imported automatically into the python control
# To get the game object this controller is on:
obj = cont.owner
-:class:`bge.types.KX_GameObject` and :class:`bge.types.KX_Camera` or :class:`bge.types.KX_LightObject` methods are available depending on the type of object
+:class:`~bge.types.KX_GameObject` and :class:`~bge.types.KX_Camera` or :class:`bge.types.~KX_LightObject` methods are available depending on the type of object
.. code-block:: python
@@ -30,18 +33,21 @@ Module to access logic functions, imported automatically into the python control
See the sensor's reference for available methods:
-* :class:`bge.types.SCA_DelaySensor`
-* :class:`bge.types.SCA_JoystickSensor`
-* :class:`bge.types.SCA_KeyboardSensor`
-* :class:`bge.types.KX_MouseFocusSensor`
-* :class:`bge.types.SCA_MouseSensor`
-* :class:`bge.types.KX_NearSensor`
-* :class:`bge.types.KX_NetworkMessageSensor`
-* :class:`bge.types.SCA_PropertySensor`
-* :class:`bge.types.KX_RadarSensor`
-* :class:`bge.types.SCA_RandomSensor`
-* :class:`bge.types.KX_RaySensor`
-* :class:`bge.types.KX_TouchSensor`
+.. hlist::
+ :columns: 3
+
+ * :class:`~bge.types.KX_MouseFocusSensor`
+ * :class:`~bge.types.KX_NearSensor`
+ * :class:`~bge.types.KX_NetworkMessageSensor`
+ * :class:`~bge.types.KX_RadarSensor`
+ * :class:`~bge.types.KX_RaySensor`
+ * :class:`~bge.types.KX_TouchSensor`
+ * :class:`~bge.types.SCA_DelaySensor`
+ * :class:`~bge.types.SCA_JoystickSensor`
+ * :class:`~bge.types.SCA_KeyboardSensor`
+ * :class:`~bge.types.SCA_MouseSensor`
+ * :class:`~bge.types.SCA_PropertySensor`
+ * :class:`~bge.types.SCA_RandomSensor`
You can also access actuators linked to the controller
@@ -56,30 +62,32 @@ You can also access actuators linked to the controller
# Activate an actuator
controller.activate(actuator)
-
See the actuator's reference for available methods
-* :class:`bge.types.SCA_2DFilterActuator`
-* :class:`bge.types.BL_ActionActuator`
-* :class:`bge.types.KX_SCA_AddObjectActuator`
-* :class:`bge.types.KX_CameraActuator`
-* :class:`bge.types.KX_ConstraintActuator`
-* :class:`bge.types.KX_SCA_DynamicActuator`
-* :class:`bge.types.KX_SCA_EndObjectActuator`
-* :class:`bge.types.KX_GameActuator`
-* :class:`bge.types.KX_IpoActuator`
-* :class:`bge.types.KX_NetworkMessageActuator`
-* :class:`bge.types.KX_ObjectActuator`
-* :class:`bge.types.KX_ParentActuator`
-* :class:`bge.types.SCA_PropertyActuator`
-* :class:`bge.types.SCA_RandomActuator`
-* :class:`bge.types.KX_SCA_ReplaceMeshActuator`
-* :class:`bge.types.KX_SceneActuator`
-* :class:`bge.types.BL_ShapeActionActuator`
-* :class:`bge.types.KX_SoundActuator`
-* :class:`bge.types.KX_StateActuator`
-* :class:`bge.types.KX_TrackToActuator`
-* :class:`bge.types.KX_VisibilityActuator`
+.. hlist::
+ :columns: 3
+
+ * :class:`~bge.types.BL_ActionActuator`
+ * :class:`~bge.types.BL_ShapeActionActuator`
+ * :class:`~bge.types.KX_CameraActuator`
+ * :class:`~bge.types.KX_ConstraintActuator`
+ * :class:`~bge.types.KX_GameActuator`
+ * :class:`~bge.types.KX_IpoActuator`
+ * :class:`~bge.types.KX_NetworkMessageActuator`
+ * :class:`~bge.types.KX_ObjectActuator`
+ * :class:`~bge.types.KX_ParentActuator`
+ * :class:`~bge.types.KX_SCA_AddObjectActuator`
+ * :class:`~bge.types.KX_SCA_DynamicActuator`
+ * :class:`~bge.types.KX_SCA_EndObjectActuator`
+ * :class:`~bge.types.KX_SCA_ReplaceMeshActuator`
+ * :class:`~bge.types.KX_SceneActuator`
+ * :class:`~bge.types.KX_SoundActuator`
+ * :class:`~bge.types.KX_StateActuator`
+ * :class:`~bge.types.KX_TrackToActuator`
+ * :class:`~bge.types.KX_VisibilityActuator`
+ * :class:`~bge.types.SCA_2DFilterActuator`
+ * :class:`~bge.types.SCA_PropertyActuator`
+ * :class:`~bge.types.SCA_RandomActuator`
Most logic brick's methods are accessors for the properties available in the logic buttons.
Consult the logic bricks documentation for more information on how each logic brick works.
@@ -99,16 +107,28 @@ Matricies as used by the game engine are **row major**
:class:`bge.types.KX_Camera` has some examples using matricies.
+*********
+Variables
+*********
.. data:: globalDict
A dictionary that is saved between loading blend files so you can use it to store inventory and other variables you want to store between scenes and blend files.
It can also be written to a file and loaded later on with the game load/save actuators.
- .. note:: only python built in types such as int/string/bool/float/tuples/lists can be saved, GameObjects, Actuators etc will not work as expectred.
+ .. note:: only python built in types such as int/string/bool/float/tuples/lists can be saved, GameObjects, Actuators etc will not work as expected.
+
+.. data:: keyboard
+
+ The current keyboard wrapped in an :class:`~bge.types.SCA_PythonKeyboard` object.
-.. data:: keyboard: The current keyboard wrapped in an SCA_PythonKeyboard object.
-.. data:: mouse: The current mouse wrapped in an SCA_PythonMouse object.
+.. data:: mouse
+
+ The current mouse wrapped in an :class:`~bge.types.SCA_PythonMouse` object.
+
+*****************
+General functions
+*****************
.. function:: getCurrentController()
@@ -258,15 +278,9 @@ Matricies as used by the game engine are **row major**
Loads bge.logic.globalDict from a file.
-
+*****************
Utility functions
-
-.. function:: getAverageFrameRate()
-
- Gets the estimated average framerate
-
- :return: The estimed average framerate in frames per second
- :rtype: float
+*****************
.. function:: expandPath(path)
@@ -283,6 +297,12 @@ Utility functions
:return: The converted string
:rtype: string
+.. function:: getAverageFrameRate()
+
+ Gets the estimated average framerate
+
+ :return: The estimed average framerate in frames per second
+ :rtype: float
.. function:: getBlendFileList(path = "//")
@@ -293,20 +313,29 @@ Utility functions
:return: A list of filenames, with no directory prefix
:rtype: list
+.. function:: getRandomFloat()
+
+ Returns a random floating point value in the range [0 - 1)
+
.. function:: PrintGLInfo()
Prints GL Extension Info into the console
+
+*********
+Constants
+*********
-.. function:: getRandomFloat()
+.. data:: KX_TRUE
- Returns a random floating point value in the range [0 - 1)
+ True value used by some modules.
-=========
-Constants
-=========
+.. data:: KX_FALSE
+
+ False value used by some modules.
-.. data:: KX_TRUE: True value used by some modules.
-.. data:: KX_FALSE: False value used by some modules.
+=======
+Sensors
+=======
---------------
Property Sensor
@@ -332,6 +361,49 @@ Property Sensor
Activate when the expression matches
+------------
+Radar Sensor
+------------
+
+See :class:`bge.types.KX_RadarSensor`
+
+.. data:: KX_RADAR_AXIS_POS_X
+.. data:: KX_RADAR_AXIS_POS_Y
+.. data:: KX_RADAR_AXIS_POS_Z
+.. data:: KX_RADAR_AXIS_NEG_X
+.. data:: KX_RADAR_AXIS_NEG_Y
+.. data:: KX_RADAR_AXIS_NEG_Z
+
+----------
+Ray Sensor
+----------
+
+See :class:`bge.types.KX_RaySensor`
+
+.. data:: KX_RAY_AXIS_POS_X
+.. data:: KX_RAY_AXIS_POS_Y
+.. data:: KX_RAY_AXIS_POS_Z
+.. data:: KX_RAY_AXIS_NEG_X
+.. data:: KX_RAY_AXIS_NEG_Y
+.. data:: KX_RAY_AXIS_NEG_Z
+
+
+=========
+Actuators
+=========
+
+---------------
+Action Actuator
+---------------
+
+See :class:`bge.types.BL_ActionActuator`
+
+.. data:: KX_ACTIONACT_PLAY
+.. data:: KX_ACTIONACT_FLIPPER
+.. data:: KX_ACTIONACT_LOOPSTOP
+.. data:: KX_ACTIONACT_LOOPEND
+.. data:: KX_ACTIONACT_PROPERTY
+
-------------------
Constraint Actuator
-------------------
@@ -339,99 +411,95 @@ Constraint Actuator
See :class:`bge.types.KX_ConstraintActuator`
.. data:: KX_CONSTRAINTACT_LOCX
+
+ Limit X coord.
+
.. data:: KX_CONSTRAINTACT_LOCY
+
+ Limit Y coord
+
.. data:: KX_CONSTRAINTACT_LOCZ
+
+ Limit Z coord
+
.. data:: KX_CONSTRAINTACT_ROTX
+
+ Limit X rotation
+
.. data:: KX_CONSTRAINTACT_ROTY
+
+ Limit Y rotation
+
.. data:: KX_CONSTRAINTACT_ROTZ
+
+ Limit Z rotation
+
.. data:: KX_CONSTRAINTACT_DIRNX
-.. data:: KX_CONSTRAINTACT_DIRNY
-.. data:: KX_CONSTRAINTACT_DIRPX
-.. data:: KX_CONSTRAINTACT_DIRPY
-.. data:: KX_CONSTRAINTACT_ORIX
-.. data:: KX_CONSTRAINTACT_ORIY
-.. data:: KX_CONSTRAINTACT_ORIZ
-------------
-IPO Actuator
-------------
+ Set distance along negative X axis
-See :class:`bge.types.KX_IpoActuator`
+.. data:: KX_CONSTRAINTACT_DIRNY
-.. data:: KX_IPOACT_PLAY
-.. data:: KX_IPOACT_PINGPONG
-.. data:: KX_IPOACT_FLIPPER
-.. data:: KX_IPOACT_LOOPSTOP
-.. data:: KX_IPOACT_LOOPEND
-.. data:: KX_IPOACT_FROM_PROP
+ Set distance along negative Y axis
+
+.. data:: KX_CONSTRAINTACT_DIRNZ
---------------------
-Random Distributions
---------------------
+ Set distance along negative Z axis
+
+.. data:: KX_CONSTRAINTACT_DIRPX
-See :class:`bge.types.SCA_RandomActuator`
+ Set distance along positive X axis
-.. data:: KX_RANDOMACT_BOOL_CONST
-.. data:: KX_RANDOMACT_BOOL_UNIFORM
-.. data:: KX_RANDOMACT_BOOL_BERNOUILLI
-.. data:: KX_RANDOMACT_INT_CONST
-.. data:: KX_RANDOMACT_INT_UNIFORM
-.. data:: KX_RANDOMACT_INT_POISSON
-.. data:: KX_RANDOMACT_FLOAT_CONST
-.. data:: KX_RANDOMACT_FLOAT_UNIFORM
-.. data:: KX_RANDOMACT_FLOAT_NORMAL
-.. data:: KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL
+.. data:: KX_CONSTRAINTACT_DIRPY
----------------
-Action Actuator
----------------
+ Set distance along positive Y axis
+
+.. data:: KX_CONSTRAINTACT_DIRPZ
-See :class:`bge.types.BL_ActionActuator`
+ Set distance along positive Z axis
+
+.. data:: KX_CONSTRAINTACT_ORIX
-.. data:: KX_ACTIONACT_PLAY
-.. data:: KX_ACTIONACT_FLIPPER
-.. data:: KX_ACTIONACT_LOOPSTOP
-.. data:: KX_ACTIONACT_LOOPEND
-.. data:: KX_ACTIONACT_PROPERTY
+ Set orientation of X axis
+
+.. data:: KX_CONSTRAINTACT_ORIY
---------------
-Sound Actuator
---------------
+ Set orientation of Y axis
+
+.. data:: KX_CONSTRAINTACT_ORIZ
-See :class:`bge.types.KX_SoundActuator`
+ Set orientation of Z axis
+
+.. data:: KX_ACT_CONSTRAINT_FHNX
-.. data:: KX_SOUNDACT_PLAYSTOP
-.. data:: KX_SOUNDACT_PLAYEND
-.. data:: KX_SOUNDACT_LOOPSTOP
-.. data:: KX_SOUNDACT_LOOPEND
-.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL
-.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
+ Set force field along negative X axis
+
+.. data:: KX_ACT_CONSTRAINT_FHNY
-------------
-Radar Sensor
-------------
+ Set force field along negative Y axis
+
+.. data:: KX_ACT_CONSTRAINT_FHNZ
-See :class:`bge.types.KX_RadarSensor`
+ Set force field along negative Z axis
+
+.. data:: KX_ACT_CONSTRAINT_FHPX
-.. data:: KX_RADAR_AXIS_POS_X
-.. data:: KX_RADAR_AXIS_POS_Y
-.. data:: KX_RADAR_AXIS_POS_Z
-.. data:: KX_RADAR_AXIS_NEG_X
-.. data:: KX_RADAR_AXIS_NEG_Y
-.. data:: KX_RADAR_AXIS_NEG_Z
+ Set force field along positive X axis
-----------
-Ray Sensor
-----------
+.. data:: KX_ACT_CONSTRAINT_FHPY
-See :class:`bge.types.KX_RaySensor`
+ Set force field along positive Y axis
+
+.. data:: KX_ACT_CONSTRAINT_FHPZ
-.. data:: KX_RAY_AXIS_POS_X
-.. data:: KX_RAY_AXIS_POS_Y
-.. data:: KX_RAY_AXIS_POS_Z
-.. data:: KX_RAY_AXIS_NEG_X
-.. data:: KX_RAY_AXIS_NEG_Y
-.. data:: KX_RAY_AXIS_NEG_Z
+ Set force field along positive Z axis
+
+.. data:: KX_ACT_CONSTRAINT_DISTANCE
+.. data:: KX_ACT_CONSTRAINT_DOROTFH
+.. data:: KX_ACT_CONSTRAINT_LOCAL
+.. data:: KX_ACT_CONSTRAINT_MATERIAL
+.. data:: KX_ACT_CONSTRAINT_NORMAL
+.. data:: KX_ACT_CONSTRAINT_PERMANENT
----------------
Dynamic Actuator
@@ -458,6 +526,43 @@ See :class:`bge.types.KX_GameActuator`
.. data:: KX_GAME_SAVECFG
.. data:: KX_GAME_LOADCFG
+------------
+IPO Actuator
+------------
+
+See :class:`bge.types.KX_IpoActuator`
+
+.. data:: KX_IPOACT_PLAY
+.. data:: KX_IPOACT_PINGPONG
+.. data:: KX_IPOACT_FLIPPER
+.. data:: KX_IPOACT_LOOPSTOP
+.. data:: KX_IPOACT_LOOPEND
+.. data:: KX_IPOACT_FROM_PROP
+
+---------------
+Parent Actuator
+---------------
+
+.. data:: KX_PARENT_REMOVE
+.. data:: KX_PARENT_SET
+
+--------------------
+Random Distributions
+--------------------
+
+See :class:`bge.types.SCA_RandomActuator`
+
+.. data:: KX_RANDOMACT_BOOL_CONST
+.. data:: KX_RANDOMACT_BOOL_UNIFORM
+.. data:: KX_RANDOMACT_BOOL_BERNOUILLI
+.. data:: KX_RANDOMACT_INT_CONST
+.. data:: KX_RANDOMACT_INT_UNIFORM
+.. data:: KX_RANDOMACT_INT_POISSON
+.. data:: KX_RANDOMACT_FLOAT_CONST
+.. data:: KX_RANDOMACT_FLOAT_UNIFORM
+.. data:: KX_RANDOMACT_FLOAT_NORMAL
+.. data:: KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL
+
--------------
Scene Actuator
--------------
@@ -473,6 +578,23 @@ See :class:`bge.types.KX_SceneActuator`
.. data:: KX_SCENE_SUSPEND
.. data:: KX_SCENE_RESUME
+--------------
+Sound Actuator
+--------------
+
+See :class:`bge.types.KX_SoundActuator`
+
+.. data:: KX_SOUNDACT_PLAYSTOP
+.. data:: KX_SOUNDACT_PLAYEND
+.. data:: KX_SOUNDACT_LOOPSTOP
+.. data:: KX_SOUNDACT_LOOPEND
+.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL
+.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
+
+=======
+Various
+=======
+
------------
Input Status
------------
@@ -555,30 +677,6 @@ See :class:`bge.types.KX_StateActuator`
.. data:: RAS_2DFILTER_SHARPEN
.. data:: RAS_2DFILTER_SOBEL
--------------------
-Constraint Actuator
--------------------
-
-.. data:: KX_ACT_CONSTRAINT_DISTANCE
-.. data:: KX_ACT_CONSTRAINT_DOROTFH
-.. data:: KX_ACT_CONSTRAINT_FHNX
-.. data:: KX_ACT_CONSTRAINT_FHNY
-.. data:: KX_ACT_CONSTRAINT_FHNZ
-.. data:: KX_ACT_CONSTRAINT_FHPX
-.. data:: KX_ACT_CONSTRAINT_FHPY
-.. data:: KX_ACT_CONSTRAINT_FHPZ
-.. data:: KX_ACT_CONSTRAINT_LOCAL
-.. data:: KX_ACT_CONSTRAINT_MATERIAL
-.. data:: KX_ACT_CONSTRAINT_NORMAL
-.. data:: KX_ACT_CONSTRAINT_PERMANENT
-
----------------
-Parent Actuator
----------------
-
-.. data:: KX_PARENT_REMOVE
-.. data:: KX_PARENT_SET
-
------
Shader
------
diff --git a/source/gameengine/PyDoc/bge.render.rst b/source/gameengine/PyDoc/bge.render.rst
index 01e5a7cd387..cea84f3b506 100644
--- a/source/gameengine/PyDoc/bge.render.rst
+++ b/source/gameengine/PyDoc/bge.render.rst
@@ -2,6 +2,10 @@
Game Engine bge.render Module
=============================
+*****
+Intro
+*****
+
.. module:: bge.render
.. code-block:: python
@@ -41,6 +45,9 @@ Game Engine bge.render Module
# Centre the mouse
bge.render.setMousePosition(bge.render.getWindowWidth()/2, bge.render.getWindowHeight()/2)
+*********
+Constants
+*********
.. data:: KX_TEXFACE_MATERIAL
@@ -54,6 +61,10 @@ Game Engine bge.render Module
Materials approximating blender materials with GLSL.
+*********
+Functions
+*********
+
.. function:: getWindowWidth()
Gets the width of the window (in pixels)
diff --git a/source/gameengine/PyDoc/bge.types.rst b/source/gameengine/PyDoc/bge.types.rst
index e0119c7c4a7..cbf46ebacf0 100644
--- a/source/gameengine/PyDoc/bge.types.rst
+++ b/source/gameengine/PyDoc/bge.types.rst
@@ -11,14 +11,14 @@ Game Engine bge.types Module
.. attribute:: invalid
Test if the object has been freed by the game engine and is no longer valid.
-
+
Normally this is not a problem but when storing game engine data in the GameLogic module,
KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data.
Calling an attribute or method on an invalid object will raise a SystemError.
-
+
The invalid attribute allows testing for this case without exception handling.
- *type* bool
+ :type: boolean
.. method:: isA(game_type)
@@ -27,7 +27,7 @@ Game Engine bge.types Module
:arg game_type: the name of the type or the type its self from the :mod:`bge.types` module.
:type game_type: string or type
:return: True if this object is a type or a subtype of game_type.
- :rtype: bool
+ :rtype: boolean
.. class:: CValue(PyObjectPlus)
@@ -35,8 +35,10 @@ Game Engine bge.types Module
.. attribute:: name
- The name of this CValue derived object (read-only). **type** string
+ The name of this CValue derived object (read-only).
+ :type: string
+
.. class:: CPropValue(CValue)
This class has no python functions
@@ -49,15 +51,19 @@ Game Engine bge.types Module
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
- *type* executePriority: int
+ :type: executePriority: int
.. attribute:: owner
- The game object this logic brick is attached to (read-only). **type** :class:`KX_GameObject` or None in exceptional cases.
+ The game object this logic brick is attached to (read-only).
+
+ :type: :class:`KX_GameObject` or None in exceptional cases.
.. attribute:: name
- The name of this logic brick (read-only). **type** string
+ The name of this logic brick (read-only).
+
+ :type: string
.. class:: SCA_PythonKeyboard(PyObjectPlus)
@@ -67,14 +73,7 @@ Game Engine bge.types Module
A list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
- * 'keycode' matches the values in :mod:`bge.keys`.
- * 'status' uses...
- * :mod:`bge.logic.KX_INPUT_NONE`
- * :mod:`bge.logic.KX_INPUT_JUST_ACTIVATED`
- * :mod:`bge.logic.KX_INPUT_ACTIVE`
- * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
-
- *type* list [[keycode, status], ...]
+ :type: list [[:ref:`keycode<keyboard-keys>`, :ref:`status<input-status>`], ...]
.. class:: SCA_PythonMouse(PyObjectPlus)
@@ -84,22 +83,19 @@ Game Engine bge.types Module
a list of pressed buttons that have either been pressed, or just released, or are active this frame. (read-only).
- * 'keycode' matches the values in :mod:`bge.keys`.
- * 'status' uses...
- * :mod:`bge.logic.KX_INPUT_NONE`
- * :mod:`bge.logic.KX_INPUT_JUST_ACTIVATED`
- * :mod:`bge.logic.KX_INPUT_ACTIVE`
- * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
-
- *type* list [[keycode, status], ...]
-
+ :type: list [[:ref:`keycode<mouse-keys>`, :ref:`status<input-status>`], ...]
+
.. attribute:: position
- The normalized x and y position of the mouse cursor. **type** list [x, y]
+ The normalized x and y position of the mouse cursor.
+
+ :type: list [x, y]
.. attribute:: visible
- The visibility of the mouse cursor. **type** boolean
+ The visibility of the mouse cursor.
+
+ :type: boolean
.. class:: SCA_IObject(CValue)
@@ -111,15 +107,21 @@ Game Engine bge.types Module
.. attribute:: usePosPulseMode
- Flag to turn positive pulse mode on and off. **type** boolean
+ Flag to turn positive pulse mode on and off.
+
+ :type: boolean
.. attribute:: useNegPulseMode
- Flag to turn negative pulse mode on and off. **type** boolean
+ Flag to turn negative pulse mode on and off.
+
+ :type: boolean
.. attribute:: frequency
- The frequency for pulse mode sensors. **type** integer
+ The frequency for pulse mode sensors.
+
+ :type: integer
.. attribute:: level
@@ -130,7 +132,7 @@ Game Engine bge.types Module
A edge detector will wait for a state change before generating a pulse.
note: mutually exclusive with :data:`tap`, enabling will disable :data:`tap`.
- *type* boolean
+ :type: boolean
.. attribute:: tap
@@ -139,30 +141,40 @@ Game Engine bge.types Module
This will make a key thats held act as if its only tapped for an instant.
note: mutually exclusive with :data:`level`, enabling will disable :data:`level`.
- *type* boolean
+ :type: boolean
.. attribute:: invert
- Flag to set if this sensor activates on positive or negative events. **type** boolean
+ Flag to set if this sensor activates on positive or negative events.
+
+ :type: boolean
.. attribute:: triggered
- True if this sensor brick is in a positive state. (read-only). **type** boolean
+ True if this sensor brick is in a positive state. (read-only).
+
+ :type: boolean
.. attribute:: positive
- True if this sensor brick is in a positive state. (read-only). **type** boolean
+ True if this sensor brick is in a positive state. (read-only).
+
+ :type: boolean
.. attribute:: status
- The status of the sensor. (read-only). **type** int from 0-3.
+ The status of the sensor. (read-only).
+
+ :type: int from 0-3.
* KX_SENSOR_INACTIVE
* KX_SENSOR_JUST_ACTIVATED
* KX_SENSOR_ACTIVE
* KX_SENSOR_JUST_DEACTIVATED
- .. note:: this convenient attribute combines the values of triggered and positive attributes.
+ .. note::
+
+ This convenient attribute combines the values of triggered and positive attributes.
.. method:: reset()
@@ -176,27 +188,47 @@ Game Engine bge.types Module
.. attribute:: state
- The controllers state bitmask. This can be used with the GameObject's state to test if the controller is active. **type** int bitmask
+ The controllers state bitmask. This can be used with the GameObject's state to test if the controller is active.
+
+ :type: int bitmask
.. attribute:: sensors
- A list of sensors linked to this controller. **type** sequence supporting index/string lookups and iteration.
+ A list of sensors linked to this controller.
+
+ :type: sequence supporting index/string lookups and iteration.
- .. note:: The sensors are not necessarily owned by the same object.
- .. note:: When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+ .. note::
+
+ The sensors are not necessarily owned by the same object.
+
+ .. note::
+
+ When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
.. attribute:: actuators
- A list of actuators linked to this controller. **type** sequence supporting index/string lookups and iteration.
+ A list of actuators linked to this controller.
+
+ :type: sequence supporting index/string lookups and iteration.
+
+ .. note::
+
+ The sensors are not necessarily owned by the same object.
- .. note:: The sensors are not necessarily owned by the same object.
- .. note:: When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+ .. note::
+
+ When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
.. attribute:: useHighPriority
- When set the controller executes always before all other controllers that dont have this set. **type** bool
+ When set the controller executes always before all other controllers that dont have this set.
+
+ :type: boolen
- .. note:: Order of execution between high priority controllers is not guaranteed.
+ .. note::
+
+ Order of execution between high priority controllers is not guaranteed.
.. class:: SCA_IActuator(SCA_ILogicBrick)
@@ -208,51 +240,75 @@ Game Engine bge.types Module
.. attribute:: action
- The name of the action to set as the current action. **type** string
+ The name of the action to set as the current action.
+
+ :type: string
.. attribute:: channelNames
- A list of channel names that may be used with :data:`setChannel` and :data:`getChannel`. **type** list of strings
+ A list of channel names that may be used with :data:`setChannel` and :data:`getChannel`.
+
+ :type: list of strings
.. attribute:: frameStart
- Specifies the starting frame of the animation. **type** float
+ Specifies the starting frame of the animation.
+
+ :type: float
.. attribute:: frameEnd
- Specifies the ending frame of the animation. **type** float
+ Specifies the ending frame of the animation.
+
+ :type: float
.. attribute:: blendIn
- Specifies the number of frames of animation to generate when making transitions between actions. **type** float
+ Specifies the number of frames of animation to generate when making transitions between actions.
+
+ :type: float
.. attribute:: priority
- Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers. **type** integer
+ Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
+
+ :type: integer
.. attribute:: frame
- Sets the current frame for the animation. **type** float
+ Sets the current frame for the animation.
+
+ :type: float
.. attribute:: propName
- Sets the property to be used in FromProp playback mode. **type** string
+ Sets the property to be used in FromProp playback mode.
+
+ :type: string
.. attribute:: blendTime
- Sets the internal frame timer. This property must be in the range from 0.0 to blendIn. **type** float
+ Sets the internal frame timer. This property must be in the range from 0.0 to blendIn.
+
+ :type: float
.. attribute:: mode
- The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND. **type** integer
+ The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND.
+
+ :type: integer
.. attribute:: useContinue
- The actions continue option, True or False. When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. **type** boolean
+ The actions continue option, True or False. When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame.
+
+ :type: boolean
.. attribute:: framePropName
- The name of the property that is set to the current frame number. **type** string
+ The name of the property that is set to the current frame number.
+
+ :type: string
.. method:: setChannel(channel, matrix)
@@ -263,7 +319,9 @@ Game Engine bge.types Module
:arg matrix: A 4x4 matrix specifying the overriding transformation as an offset from the bone's rest position.
:arg matrix: list [[float]]
- .. note:: These values are relative to the bones rest position, currently the api has no way to get this info (which is annoying), but can be worked around by using bones with a rest pose that has no translation.
+ .. note::
+
+ These values are relative to the bones rest position, currently the api has no way to get this info (which is annoying), but can be worked around by using bones with a rest pose that has no translation.
.. method:: getChannel(channel)
@@ -310,7 +368,7 @@ Game Engine bge.types Module
Check if the shader is valid.
:return: True if the shader is valid
- :rtype: bool
+ :rtype: boolean
.. method:: setAttrib(enum)
@@ -459,7 +517,7 @@ Game Engine bge.types Module
:arg mat: A 3x3 matrix [[f, f, f], [f, f, f], [f, f, f]]
:type mat: 3x3 matrix
:arg transpose: set to True to transpose the matrix
- :type transpose: bool
+ :type transpose: boolean
.. method:: setUniformMatrix4(name, mat, transpose)
@@ -470,7 +528,7 @@ Game Engine bge.types Module
:arg mat: A 4x4 matrix [[f, f, f, f], [f, f, f, f], [f, f, f, f], [f, f, f, f]]
:type mat: 4x4 matrix
:arg transpose: set to True to transpose the matrix
- :type transpose: bool
+ :type transpose: boolean
.. method:: setUniformiv(name, iList)
@@ -491,63 +549,79 @@ Game Engine bge.types Module
.. attribute:: action
- The name of the action to set as the current shape action. **type** string
+ The name of the action to set as the current shape action.
+
+ :type: string
.. attribute:: frameStart
- Specifies the starting frame of the shape animation. **type** float
+ Specifies the starting frame of the shape animation.
+
+ :type: float
.. attribute:: frameEnd
- Specifies the ending frame of the shape animation. **type** float
+ Specifies the ending frame of the shape animation.
+
+ :type: float
.. attribute:: blendIn
- Specifies the number of frames of animation to generate when making transitions between actions. **type** float
+ Specifies the number of frames of animation to generate when making transitions between actions.
+
+ :type: float
.. attribute:: priority
- Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers. **type** integer
+ Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
+
+ :type: integer
.. attribute:: frame
- Sets the current frame for the animation. **type** float
+ Sets the current frame for the animation.
+
+ :type: float
.. attribute:: propName
- Sets the property to be used in FromProp playback mode. **type** string
+ Sets the property to be used in FromProp playback mode.
+
+ :type: string
.. attribute:: blendTime
- Sets the internal frame timer. This property must be in the range from 0.0 to blendin. **type** float
+ Sets the internal frame timer. This property must be in the range from 0.0 to blendin.
+
+ :type: float
.. attribute:: mode
- The operation mode of the actuator in [KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND] **type** integer
+ The operation mode of the actuator in [KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND].
+
+ :type: integer
.. attribute:: framePropName
- The name of the property that is set to the current frame number. **type** string
+ The name of the property that is set to the current frame number.
-.. class:: CListValue(CPropValue)
+ :type: string
- CListValue
+.. class:: CListValue(CPropValue)
This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
- As well as the normal index lookup.
- ``val= clist[i]``
+ As well as the normal index lookup (``val= clist[i]``), CListValue supports string lookups (``val= scene.objects["Cube"]``)
- CListValue supports string lookups.
- ``val= scene.objects["Cube"]``
-
- Other operations such as ``len(clist), list(clist), clist[0:10]`` are also supported.
+ Other operations such as ``len(clist)``, ``list(clist)``, ``clist[0:10]`` are also supported.
.. method:: append(val)
Add an item to the list (like pythons append)
- .. warning:: Appending values to the list can cause crashes when the list is used internally by the game engine.
+ .. warning::
+
+ Appending values to the list can cause crashes when the list is used internally by the game engine.
.. method:: count(val)
@@ -588,7 +662,9 @@ Game Engine bge.types Module
This has the advantage that you can store the id in places you could not store a gameObject.
- .. warning:: the id is derived from a memory location and will be different each time the game engine starts.
+ .. warning::
+
+ The id is derived from a memory location and will be different each time the game engine starts.
.. class:: KX_BlenderMaterial(PyObjectPlus)
@@ -648,23 +724,33 @@ Game Engine bge.types Module
.. attribute:: min
- minimum distance to the target object maintained by the actuator. **type** float
+ minimum distance to the target object maintained by the actuator.
+
+ :type: float
.. attribute:: max
- maximum distance to stay from the target object. **type** float
+ maximum distance to stay from the target object.
+
+ :type: float
.. attribute:: height
- height to stay above the target object. **type** float
+ height to stay above the target object.
+
+ :type: float
.. attribute:: useXY
- axis this actuator is tracking, True=X, False=Y. **type** boolean
+ axis this actuator is tracking, True=X, False=Y.
+
+ :type: boolean
.. attribute:: object
- the object this actuator tracks. **type** :class:`KX_GameObject` or None
+ the object this actuator tracks.
+
+ :type: :class:`KX_GameObject` or None
@author: snail
@@ -676,19 +762,27 @@ Game Engine bge.types Module
.. attribute:: damp
- Time constant of the constraint expressed in frame (not use by Force field constraint). **type** integer
+ Time constant of the constraint expressed in frame (not use by Force field constraint).
+
+ :type: integer
.. attribute:: rotDamp
- Time constant for the rotation expressed in frame (only for the distance constraint), 0 = use damp for rotation as well. **type** integer
+ Time constant for the rotation expressed in frame (only for the distance constraint), 0 = use damp for rotation as well.
+
+ :type: integer
.. attribute:: direction
- The reference direction in world coordinate for the orientation constraint. **type** 3-tuple of float: (x, y, z)
+ The reference direction in world coordinate for the orientation constraint.
+
+ :type: 3-tuple of float: (x, y, z)
.. attribute:: option
- Binary combination of the following values. **type** integer
+ Binary combination of the following values.
+
+ :type: integer
* Applicable to Distance constraint
* KX_ACT_CONSTRAINT_NORMAL ( 64) : Activate alignment to surface
@@ -702,58 +796,62 @@ Game Engine bge.types Module
.. attribute:: time
- activation time of the actuator. The actuator disables itself after this many frame. If set to 0, the actuator is not limited in time. **type** integer
+ activation time of the actuator. The actuator disables itself after this many frame. If set to 0, the actuator is not limited in time.
+
+ :type: integer
.. attribute:: propName
- the name of the property or material for the ray detection of the distance constraint. **type** string
+ the name of the property or material for the ray detection of the distance constraint.
+
+ :type: string
.. attribute:: min
- The lower bound of the constraint. For the rotation and orientation constraint, it represents radiant **type** float
+ The lower bound of the constraint. For the rotation and orientation constraint, it represents radiant.
+
+ :type: float
.. attribute:: distance
- the target distance of the distance constraint **type** float
+ the target distance of the distance constraint.
+
+ :type: float
.. attribute:: max
- the upper bound of the constraint. For rotation and orientation constraints, it represents radiant. **type** float
+ the upper bound of the constraint. For rotation and orientation constraints, it represents radiant.
+
+ :type: float
.. attribute:: rayLength
the length of the ray of the distance constraint.
- *type* float
+ :type: float
.. attribute:: limit
- type of constraint. **type** integer.
-
- use one of the following constant:
-
- * KX_ACT_CONSTRAINT_LOCX ( 1) : limit X coord
- * KX_ACT_CONSTRAINT_LOCY ( 2) : limit Y coord
- * KX_ACT_CONSTRAINT_LOCZ ( 3) : limit Z coord
- * KX_ACT_CONSTRAINT_ROTX ( 4) : limit X rotation
- * KX_ACT_CONSTRAINT_ROTY ( 5) : limit Y rotation
- * KX_ACT_CONSTRAINT_ROTZ ( 6) : limit Z rotation
- * KX_ACT_CONSTRAINT_DIRPX ( 7) : set distance along positive X axis
- * KX_ACT_CONSTRAINT_DIRPY ( 8) : set distance along positive Y axis
- * KX_ACT_CONSTRAINT_DIRPZ ( 9) : set distance along positive Z axis
- * KX_ACT_CONSTRAINT_DIRNX (10) : set distance along negative X axis
- * KX_ACT_CONSTRAINT_DIRNY (11) : set distance along negative Y axis
- * KX_ACT_CONSTRAINT_DIRNZ (12) : set distance along negative Z axis
- * KX_ACT_CONSTRAINT_ORIX (13) : set orientation of X axis
- * KX_ACT_CONSTRAINT_ORIY (14) : set orientation of Y axis
- * KX_ACT_CONSTRAINT_ORIZ (15) : set orientation of Z axis
- * KX_ACT_CONSTRAINT_FHPX (16) : set force field along positive X axis
- * KX_ACT_CONSTRAINT_FHPY (17) : set force field along positive Y axis
- * KX_ACT_CONSTRAINT_FHPZ (18) : set force field along positive Z axis
- * KX_ACT_CONSTRAINT_FHNX (19) : set force field along negative X axis
- * KX_ACT_CONSTRAINT_FHNY (20) : set force field along negative Y axis
- * KX_ACT_CONSTRAINT_FHNZ (21) : set force field along negative Z axis
+ type of constraint.
+
+ Use one of the following constant: :data:`~bge.logic.KX_CONSTRAINTACT_LOCX`,
+ :data:`~bge.logic.KX_CONSTRAINTACT_LOCY`, :data:`~bge.logic.KX_CONSTRAINTACT_LOCZ`,
+ :data:`~bge.logic.KX_CONSTRAINTACT_ROTX`, :data:`~bge.logic.KX_CONSTRAINTACT_ROTY`,
+ :data:`~bge.logic.KX_CONSTRAINTACT_ROTZ`, :data:`~bge.logic.KX_CONSTRAINTACT_DIRPX`,
+ :data:`~bge.logic.KX_CONSTRAINTACT_DIRPY`, :data:`~bge.logic.KX_CONSTRAINTACT_DIRPZ`,
+ :data:`~bge.logic.KX_CONSTRAINTACT_DIRNX`, :data:`~bge.logic.KX_CONSTRAINTACT_DIRNY`,
+ :data:`~bge.logic.KX_CONSTRAINTACT_DIRNZ`, :data:`~bge.logic.KX_CONSTRAINTACT_ORIX`,
+ :data:`~bge.logic.KX_CONSTRAINTACT_ORIY`, :data:`~bge.logic.KX_CONSTRAINTACT_ORIZ`,
+ :data:`~bge.logic.KX_ACT_CONSTRAINT_FHPX`, :data:`~bge.logic.KX_ACT_CONSTRAINT_FHPY`,
+ :data:`~bge.logic.KX_ACT_CONSTRAINT_FHPZ`, :data:`~bge.logic.KX_ACT_CONSTRAINT_FHNX`,
+ :data:`~bge.logic.KX_ACT_CONSTRAINT_FHNY`, :data:`~bge.logic.KX_ACT_CONSTRAINT_FHNZ`,
+ :data:`~bge.logic.KX_ACT_CONSTRAINT_DISTANCE`, :data:`~bge.logic.KX_ACT_CONSTRAINT_DOROTFH`,
+ :data:`~bge.logic.KX_ACT_CONSTRAINT_LOCAL`, :data:`~bge.logic.KX_ACT_CONSTRAINT_MATERIAL`,
+ :data:`~bge.logic.KX_ACT_CONSTRAINT_NORMAL`, :data:`~bge.logic.KX_ACT_CONSTRAINT_PERMANENT`
+
+ :type: integer.
+
.. class:: KX_ConstraintWrapper(PyObjectPlus)
KX_ConstraintWrapper
@@ -773,18 +871,17 @@ Game Engine bge.types Module
.. attribute:: fileName
- the new .blend file to load **type** string.
+ the new .blend file to load.
+
+ :type: string
.. attribute:: mode
- The mode of this actuator **type** Constant in...
+ The mode of this actuator.
- * :mod:`bge.logic.KX_GAME_LOAD`
- * :mod:`bge.logic.KX_GAME_START`
- * :mod:`bge.logic.KX_GAME_RESTART`
- * :mod:`bge.logic.KX_GAME_QUIT`
- * :mod:`bge.logic.KX_GAME_SAVECFG`
- * :mod:`bge.logic.KX_GAME_LOADCFG`
+ :type: Constant in :data:`~bge.logic.KX_GAME_LOAD`, :data:`~bge.logic.KX_GAME_START`,
+ :data:`~bge.logic.KX_GAME_RESTART`, :data:`~bge.logic.KX_GAME_QUIT`,
+ :data:`~bge.logic.KX_GAME_SAVECFG`, :data:`~bge.logic.KX_GAME_LOADCFG`
.. class:: KX_GameObject(SCA_IObject)
@@ -792,143 +889,237 @@ Game Engine bge.types Module
Properties assigned to game objects are accessible as attributes of this class.
- .. note:: Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the :data:`invalid` attribute to check.
+ .. note::
+
+ Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the :data:`invalid` attribute to check.
.. attribute:: name
- The object's name. (read-only). **type** string.
+ The object's name. (read-only).
+
+ :type: string
.. attribute:: mass
The object's mass
- .. note:: The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0 **type** float
+ :type: float
+ .. note::
+
+ The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
+
.. attribute:: linVelocityMin
Enforces the object keeps moving at a minimum velocity.
- .. note:: Applies to dynamic and rigid body objects only.
- .. note:: A value of 0.0 disables this option.
- .. note:: While objects are stationary the minimum velocity will not be applied. **type** float
+ :type: float
+
+ .. note::
+
+ Applies to dynamic and rigid body objects only.
+
+ .. note::
+
+ A value of 0.0 disables this option.
+
+ .. note::
+
+ While objects are stationary the minimum velocity will not be applied.
.. attribute:: linVelocityMax
Clamp the maximum linear velocity to prevent objects moving beyond a set speed.
- .. note:: Applies to dynamic and rigid body objects only.
- .. note:: A value of 0.0 disables this option (rather then setting it stationary). **type** float
+ :type: float
+
+ .. note::
+
+ Applies to dynamic and rigid body objects only.
+
+ .. note::
+
+ A value of 0.0 disables this option (rather then setting it stationary).
.. attribute:: localInertia
- the object's inertia vector in local coordinates. Read only. **type** list [ix, iy, iz]
+ the object's inertia vector in local coordinates. Read only.
+
+ :type: list [ix, iy, iz]
.. attribute:: parent
- The object's parent object. (read-only). **type** :class:`KX_GameObject` or None
+ The object's parent object. (read-only).
+
+ :type: :class:`KX_GameObject` or None
.. attribute:: visible
visibility flag.
- .. note:: Game logic will still run for invisible objects. **type** boolean
+ :type: boolean
+
+ .. note::
+
+ Game logic will still run for invisible objects.
.. attribute:: color
- The object color of the object **type** list [r, g, b, a]
+ The object color of the object.
+
+ :type: list [r, g, b, a]
.. attribute:: occlusion
- occlusion capability flag. **type** boolean
+ occlusion capability flag.
+
+ :type: boolean
.. attribute:: position
The object's position.
- .. deprecated:: use :data:`localPosition` and :data:`worldPosition`. **type** list [x, y, z] On write: local position, on read: world position
+ .. deprecated:: use :data:`localPosition` and :data:`worldPosition`.
+
+ :type: list [x, y, z] On write: local position, on read: world position
.. attribute:: orientation
The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
- .. deprecated:: use :data:`localOrientation` and :data:`worldOrientation`. **type** 3x3 Matrix [[float]] On write: local orientation, on read: world orientation
+ .. deprecated:: use :data:`localOrientation` and :data:`worldOrientation`.
+
+ :type: 3x3 Matrix [[float]] On write: local orientation, on read: world orientation
.. attribute:: scaling
The object's scaling factor. list [sx, sy, sz]
- .. deprecated:: use :data:`localScale` and :data:`worldScale`. **type** list [sx, sy, sz] On write: local scaling, on read: world scaling
+ .. deprecated:: use :data:`localScale` and :data:`worldScale`.
+
+ :type: list [sx, sy, sz] On write: local scaling, on read: world scaling
.. attribute:: localOrientation
- The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. **type** 3x3 Matrix [[float]]
+ The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
+
+ :type: 3x3 Matrix [[float]]
.. attribute:: worldOrientation
- The object's world orientation. **type** 3x3 Matrix [[float]]
+ The object's world orientation.
+
+ :type: 3x3 Matrix [[float]]
.. attribute:: localScale
- The object's local scaling factor. **type** list [sx, sy, sz]
+ The object's local scaling factor.
+
+ :type: list [sx, sy, sz]
.. attribute:: worldScale
- The object's world scaling factor. Read-only **type** list [sx, sy, sz]
+ The object's world scaling factor. Read-only.
+
+ :type: list [sx, sy, sz]
.. attribute:: localPosition
- The object's local position. **type** list [x, y, z]
+ The object's local position.
+
+ :type: list [x, y, z]
.. attribute:: worldPosition
- The object's world position. **type** list [x, y, z]
+ The object's world position.
+
+ :type: list [x, y, z]
.. attribute:: timeOffset
- adjust the slowparent delay at runtime. **type** float
+ adjust the slowparent delay at runtime.
+
+ :type: float
.. attribute:: state
- the game object's state bitmask, using the first 30 bits, one bit must always be set. **type** int
+ the game object's state bitmask, using the first 30 bits, one bit must always be set.
+
+ :type: int
.. attribute:: meshes
a list meshes for this object.
- .. note:: Most objects use only 1 mesh.
- .. note:: Changes to this list will not update the KX_GameObject. **type** list of :class:`KX_MeshProxy`
+ :type: list of :class:`KX_MeshProxy`
+
+ .. note::
+
+ Most objects use only 1 mesh.
+
+ .. note::
+
+ Changes to this list will not update the KX_GameObject.
.. attribute:: sensors
a sequence of :class:`SCA_ISensor` objects with string/index lookups and iterator support.
- .. note:: This attribute is experemental and may be removed (but probably wont be).
- .. note:: Changes to this list will not update the KX_GameObject. **type** list
+ :type: list
+
+ .. note::
+
+ This attribute is experemental and may be removed (but probably wont be).
+
+ .. note::
+
+ Changes to this list will not update the KX_GameObject.
.. attribute:: controllers
a sequence of :class:`SCA_IController` objects with string/index lookups and iterator support.
- .. note:: This attribute is experemental and may be removed (but probably wont be).
- .. note:: Changes to this list will not update the KX_GameObject. **type** list of :class:`SCA_ISensor`.
+
+ :type: list of :class:`SCA_ISensor`
+
+ .. note::
+
+ This attribute is experemental and may be removed (but probably wont be).
+
+ .. note::
+
+ Changes to this list will not update the KX_GameObject.
.. attribute:: actuators
a list of :class:`SCA_IActuator` with string/index lookups and iterator support.
- .. note:: This attribute is experemental and may be removed (but probably wont be).
- .. note:: Changes to this list will not update the KX_GameObject. **type** list
+ :type: list
+
+ .. note::
+
+ This attribute is experemental and may be removed (but probably wont be).
+
+ .. note::
+
+ Changes to this list will not update the KX_GameObject.
.. attribute:: attrDict
- get the objects internal python attribute dictionary for direct (faster) access. **type** dict
+ get the objects internal python attribute dictionary for direct (faster) access.
+
+ :type: dict
.. attribute:: children
- direct children of this object, (read-only). **type** :class:`CListValue` of :class:`KX_GameObject`'s
+ direct children of this object, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`'s
.. attribute:: childrenRecursive
- all children of this object including childrens children, (read-only). **type** :class:`CListValue` of :class:`KX_GameObject`'s
+ all children of this object including childrens children, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`'s
.. method:: endObject()
@@ -943,9 +1134,9 @@ Game Engine bge.types Module
:arg mesh: mesh to replace or the meshes name.
:type mesh: :class:`MeshProxy` or string
:arg useDisplayMesh: when enabled the display mesh will be replaced (optional argument).
- :type useDisplayMesh: bool
+ :type useDisplayMesh: boolean
:arg usePhysicsMesh: when enabled the physics mesh will be replaced (optional argument).
- :type usePhysicsMesh: bool
+ :type usePhysicsMesh: boolean
.. method:: setVisible(visible, recursive)
@@ -1114,7 +1305,9 @@ Game Engine bge.types Module
:return: the reaction force of this object.
:rtype: list [fx, fy, fz]
- .. note:: This is not implimented at the moment.
+ .. note::
+
+ This is not implimented at the moment.
.. method:: applyImpulse(point, impulse)
@@ -1135,7 +1328,9 @@ Game Engine bge.types Module
Resumes physics for this object.
- .. note:: The objects linear velocity will be applied from when the dynamics were suspended.
+ .. note::
+
+ The objects linear velocity will be applied from when the dynamics were suspended.
.. method:: enableRigidBody()
@@ -1143,13 +1338,17 @@ Game Engine bge.types Module
Rigid body physics allows the object to roll on collisions.
- .. note:: This is not working with bullet physics yet.
+ .. note::
+
+ This is not working with bullet physics yet.
.. method:: disableRigidBody()
Disables rigid body physics for this object.
- .. note:: This is not working with bullet physics yet. The angular is removed but rigid body physics can still rotate it later.
+ .. note::
+
+ This is not working with bullet physics yet. The angular is removed but rigid body physics can still rotate it later.
.. method:: setParent(parent, compound=True, ghost=True)
@@ -1173,7 +1372,9 @@ Game Engine bge.types Module
:type ghost: boolean
- .. note:: if the object type is sensor, it stays ghost regardless of ghost parameter
+ .. note::
+
+ If the object type is sensor, it stays ghost regardless of ghost parameter
.. method:: removeParent()
@@ -1288,17 +1489,21 @@ Game Engine bge.types Module
* or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`)
* or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`, 2-tuple (u, v))
- .. note:: The ray ignores the object on which the method is called. It is casted from/to object center or explicit [x, y, z] points.
+ .. note::
+
+ The ray ignores the object on which the method is called. It is casted from/to object center or explicit [x, y, z] points.
.. method:: setCollisionMargin(margin)
Set the objects collision margin.
- .. note:: If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
-
:arg margin: the collision margin distance in blender units.
:type margin: float
+ .. note::
+
+ If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
+
.. method:: sendMessage(subject, body="", to="")
Sends a message.
@@ -1321,15 +1526,29 @@ Game Engine bge.types Module
:arg meshObject: optional argument, set the physics shape from this mesh.
:type meshObject: string, :class:`MeshProxy` or None
- .. note:: if this object has instances the other instances will be updated too.
- .. note:: the gameObject argument has an advantage that it can convert from a mesh with modifiers applied (such as subsurf).
- .. warning:: only triangle mesh type objects are supported currently (not convex hull)
- .. warning:: if the object is a part of a combound object it will fail (parent or child)
- .. warning:: rebuilding the physics mesh can be slow, running many times per second will give a performance hit.
-
:return: True if reinstance succeeded, False if it failed.
:rtype: boolean
+ .. note::
+
+ If this object has instances the other instances will be updated too.
+
+ .. note::
+
+ The gameObject argument has an advantage that it can convert from a mesh with modifiers applied (such as subsurf).
+
+ .. warning::
+
+ Only triangle mesh type objects are supported currently (not convex hull)
+
+ .. warning::
+
+ If the object is a part of a combound object it will fail (parent or child)
+
+ .. warning::
+
+ Rebuilding the physics mesh can be slow, running many times per second will give a performance hit.
+
.. method:: get(key, default=None)
Return the value matching key, or the default value if its not found.
@@ -1341,39 +1560,57 @@ Game Engine bge.types Module
.. attribute:: frameStart
- Start frame. **type** float
+ Start frame.
+
+ :type: float
.. attribute:: frameEnd
- End frame. **type** float
+ End frame.
+
+ :type: float
.. attribute:: propName
- Use this property to define the Ipo position **type** string
+ Use this property to define the Ipo position.
+
+ :type: string
.. attribute:: framePropName
- Assign this property this action current frame number **type** string
+ Assign this property this action current frame number.
+
+ :type: string
.. attribute:: mode
- Play mode for the ipo. (In GameLogic.KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP) **type** integer
+ Play mode for the ipo. (In GameLogic.KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP).
+
+ :type: integer
.. attribute:: useIpoAsForce
- Apply Ipo as a global or local force depending on the local option (dynamic objects only) **type** bool
+ Apply Ipo as a global or local force depending on the local option (dynamic objects only).
+
+ :type: boolean
.. attribute:: useIpoAdd
- Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag **type** bool
+ Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag.
+
+ :type: boolean
.. attribute:: useIpoLocal
- Let the ipo acts in local coordinates, used in Force and Add mode. **type** bool
+ Let the ipo acts in local coordinates, used in Force and Add mode.
+
+ :type: boolean
.. attribute:: useChildren
- Update IPO on all children Objects as well **type** bool
+ Update IPO on all children Objects as well.
+
+ :type: boolean
.. class:: KX_LightObject(KX_GameObject)
@@ -1408,19 +1645,27 @@ Game Engine bge.types Module
.. attribute:: layer
- The layer mask that this light affects object on. **type** bitfield
+ The layer mask that this light affects object on.
+
+ :type: bitfield
.. attribute:: energy
- The brightness of this light. **type** float
+ The brightness of this light.
+
+ :type: float
.. attribute:: distance
- The maximum distance this light can illuminate. (SPOT and NORMAL lights only) **type** float
+ The maximum distance this light can illuminate. (SPOT and NORMAL lights only).
+
+ :type: float
.. attribute:: colour
- The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0]. **type** list [r, g, b]
+ The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
+
+ :type: list [r, g, b]
.. attribute:: color
@@ -1428,21 +1673,31 @@ Game Engine bge.types Module
.. attribute:: lin_attenuation
- The linear component of this light's attenuation. (SPOT and NORMAL lights only) **type** float
+ The linear component of this light's attenuation. (SPOT and NORMAL lights only).
+
+ :type: float
.. attribute:: quad_attenuation
- The quadratic component of this light's attenuation (SPOT and NORMAL lights only) **type** float
+ The quadratic component of this light's attenuation (SPOT and NORMAL lights only).
+
+ :type: float
.. attribute:: spotsize
- The cone angle of the spot light, in degrees (SPOT lights only). **type** float in [0 - 180].
+ The cone angle of the spot light, in degrees (SPOT lights only).
+
+ :type: float in [0 - 180].
.. attribute:: spotblend
- Specifies the intensity distribution of the spot light (SPOT lights only). **type** float in [0 - 1]
+ Specifies the intensity distribution of the spot light (SPOT lights only).
+
+ :type: float in [0 - 1]
- .. note:: Higher values result in a more focused light source.
+ .. note::
+
+ Higher values result in a more focused light source.
.. class:: KX_MeshProxy(SCA_IObject)
@@ -1494,15 +1749,15 @@ Game Engine bge.types Module
.. attribute:: materials
- **type** list of :class:`KX_BlenderMaterial` or :class:`KX_PolygonMaterial` types
+ :type: list of :class:`KX_BlenderMaterial` or :class:`KX_PolygonMaterial` types
.. attribute:: numPolygons
- **type** integer
+ :type: integer
.. attribute:: numMaterials
- **type** integer
+ :type: integer
.. method:: getNumMaterials()
@@ -1571,11 +1826,15 @@ Game Engine bge.types Module
.. attribute:: position
- current [x, y] coordinates of the mouse, in frame coordinates (pixels) **type** [integer, interger]
+ current [x, y] coordinates of the mouse, in frame coordinates (pixels).
+
+ :type: [integer, interger]
.. attribute:: mode
- sensor mode. **type** integer
+ sensor mode.
+
+ :type: integer
* KX_MOUSESENSORMODE_LEFTBUTTON(1)
* KX_MOUSESENSORMODE_MIDDLEBUTTON(2)
@@ -1602,31 +1861,45 @@ Game Engine bge.types Module
.. attribute:: raySource
- The worldspace source of the ray (the view position) **type** list (vector of 3 floats)
+ The worldspace source of the ray (the view position).
+
+ :type: list (vector of 3 floats)
.. attribute:: rayTarget
- The worldspace target of the ray. **type** list (vector of 3 floats)
+ The worldspace target of the ray.
+
+ :type: list (vector of 3 floats)
.. attribute:: rayDirection
- The :data:`rayTarget` - :class:`raySource` normalized. **type** list (normalized vector of 3 floats)
+ The :data:`rayTarget` - :class:`raySource` normalized.
+
+ :type: list (normalized vector of 3 floats)
.. attribute:: hitObject
- the last object the mouse was over. **type** :class:`KX_GameObject` or None
+ the last object the mouse was over.
+
+ :type: :class:`KX_GameObject` or None
.. attribute:: hitPosition
- The worldspace position of the ray intersecton. **type** list (vector of 3 floats)
+ The worldspace position of the ray intersecton.
+
+ :type: list (vector of 3 floats)
.. attribute:: hitNormal
- the worldspace normal from the face at point of intersection. **type** list (normalized vector of 3 floats)
+ the worldspace normal from the face at point of intersection.
+
+ :type: list (normalized vector of 3 floats)
.. attribute:: hitUV
- the UV coordinates at the point of intersection. **type** list (vector of 2 floats)
+ the UV coordinates at the point of intersection.
+
+ :type: list (vector of 2 floats)
If the object has no UV mapping, it returns [0, 0].
@@ -1634,7 +1907,9 @@ Game Engine bge.types Module
.. attribute:: usePulseFocus
- When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set) **type** bool
+ When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set).
+
+ :type: boolean
.. class:: KX_TouchSensor(SCA_ISensor)
@@ -1642,23 +1917,33 @@ Game Engine bge.types Module
.. attribute:: propName
- The property or material to collide with. **type** string
+ The property or material to collide with.
+
+ :type: string
.. attribute:: useMaterial
- Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property. **type** boolean
+ Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property.
+
+ :type: boolean
.. attribute:: usePulseCollision
- When enabled, changes to the set of colliding objects generate a pulse. **type** bool
+ When enabled, changes to the set of colliding objects generate a pulse.
+
+ :type: boolean
.. attribute:: hitObject
- The last collided object. (read-only) **type** :class:`KX_GameObject` or None
+ The last collided object. (read-only).
+
+ :type: :class:`KX_GameObject` or None
.. attribute:: hitObjectList
- A list of colliding objects. (read-only) **type** :class:`CListValue` of :class:`KX_GameObject`
+ A list of colliding objects. (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`
.. class:: KX_NearSensor(KX_TouchSensor)
@@ -1666,11 +1951,15 @@ Game Engine bge.types Module
.. attribute:: distance
- The near sensor activates when an object is within this distance. **type** float
+ The near sensor activates when an object is within this distance.
+
+ :type: float
.. attribute:: resetDistance
- The near sensor deactivates when the object exceeds this distance. **type** float
+ The near sensor deactivates when the object exceeds this distance.
+
+ :type: float
.. class:: KX_NetworkMessageActuator(SCA_IActuator)
@@ -1678,19 +1967,27 @@ Game Engine bge.types Module
.. attribute:: propName
- Messages will only be sent to objects with the given property name. **type** string
+ Messages will only be sent to objects with the given property name.
+
+ :type: string
.. attribute:: subject
- The subject field of the message. **type** string
+ The subject field of the message.
+
+ :type: string
.. attribute:: body
- The body of the message. **type** string
+ The body of the message.
+
+ :type: string
.. attribute:: usePropBody
- Send a property instead of a regular body message. **type** boolean
+ Send a property instead of a regular body message.
+
+ :type: boolean
.. class:: KX_NetworkMessageSensor(SCA_ISensor)
@@ -1700,19 +1997,27 @@ Game Engine bge.types Module
.. attribute:: subject
- The subject the sensor is looking for. **type** string
+ The subject the sensor is looking for.
+
+ :type: string
.. attribute:: frameMessageCount
- The number of messages received since the last frame. (read-only). **type** integer
+ The number of messages received since the last frame. (read-only).
+
+ :type: integer
.. attribute:: subjects
- The list of message subjects received. (read-only). **type** list of strings
+ The list of message subjects received. (read-only).
+
+ :type: list of strings
.. attribute:: bodies
- The list of message bodies received. (read-only) **type** list of strings
+ The list of message bodies received. (read-only).
+
+ :type: list of strings
.. class:: KX_ObjectActuator(SCA_IActuator)
@@ -1722,79 +2027,119 @@ Game Engine bge.types Module
.. attribute:: force
- The force applied by the actuator **type** list [x, y, z]
+ The force applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalForce
- A flag specifying if the force is local **type** bool
+ A flag specifying if the force is local.
+
+ :type: boolean
.. attribute:: torque
- The torque applied by the actuator **type** list [x, y, z]
+ The torque applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalTorque
- A flag specifying if the torque is local **type** bool
+ A flag specifying if the torque is local.
+
+ :type: boolean
.. attribute:: dLoc
- The displacement vector applied by the actuator **type** list [x, y, z]
+ The displacement vector applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalDLoc
- A flag specifying if the dLoc is local **type** bool
+ A flag specifying if the dLoc is local.
+
+ :type: boolean
.. attribute:: dRot
The angular displacement vector applied by the actuator
- .. note:: Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed. **type** list [x, y, z]
+ :type: list [x, y, z]
+
+ .. note::
+
+ Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed.
.. attribute:: useLocalDRot
- A flag specifying if the dRot is local **type** bool
+ A flag specifying if the dRot is local.
+
+ :type: boolean
.. attribute:: linV
- The linear velocity applied by the actuator **type** list [x, y, z]
+ The linear velocity applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalLinV
A flag specifying if the linear velocity is local.
- .. note:: This is the target speed for servo controllers **type** bool
+ :type: boolean
+
+ .. note::
+
+ This is the target speed for servo controllers.
.. attribute:: angV
- The angular velocity applied by the actuator **type** list [x, y, z]
+ The angular velocity applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalAngV
- A flag specifying if the angular velocity is local **type** bool
+ A flag specifying if the angular velocity is local.
+
+ :type: boolean
.. attribute:: damping
- The damping parameter of the servo controller **type** short
+ The damping parameter of the servo controller.
+
+ :type: short
.. attribute:: forceLimitX
- The min/max force limit along the X axis and activates or deactivates the limits in the servo controller **type** list [min(float), max(float), bool]
+ The min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
+
+ :type: list [min(float), max(float), bool]
.. attribute:: forceLimitY
- The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller **type** list [min(float), max(float), bool]
+ The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
+
+ :type: list [min(float), max(float), bool]
.. attribute:: forceLimitZ
- The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller **type** list [min(float), max(float), bool]
+ The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
+
+ :type: list [min(float), max(float), bool]
.. attribute:: pid
- The PID coefficients of the servo controller **type** list of floats [proportional, integral, derivate]
+ The PID coefficients of the servo controller.
+
+ :type: list of floats [proportional, integral, derivate]
.. attribute:: reference
- The object that is used as reference to compute the velocity for the servo controller. **type** :class:`KX_GameObject` or None
+ The object that is used as reference to compute the velocity for the servo controller.
+
+ :type: :class:`KX_GameObject` or None
.. class:: KX_ParentActuator(SCA_IActuator)
@@ -1802,22 +2147,30 @@ Game Engine bge.types Module
.. attribute:: object
- the object this actuator sets the parent too. **type** :class:`KX_GameObject` or None
+ the object this actuator sets the parent too.
+
+ :type: :class:`KX_GameObject` or None
.. attribute:: mode
- The mode of this actuator **type** integer from 0 to 1.
+ The mode of this actuator.
+
+ :type: integer from 0 to 1.
.. attribute:: compound
Whether the object shape should be added to the parent compound shape when parenting.
- Effective only if the parent is already a compound shape **type** bool
+ Effective only if the parent is already a compound shape.
+
+ :type: boolean
.. attribute:: ghost
whether the object should be made ghost when parenting
- Effective only if the shape is not added to the parent compound shape **type** bool
+ Effective only if the shape is not added to the parent compound shape.
+
+ :type: boolean
.. class:: KX_PhysicsObjectWrapper(PyObjectPlus)
@@ -1828,7 +2181,7 @@ Game Engine bge.types Module
Set the object to be active.
:arg active: set to True to be active
- :type active: bool
+ :type active: boolean
.. method:: setAngularVelocity(x, y, z, local)
@@ -1844,7 +2197,7 @@ Game Engine bge.types Module
:type z: float
:arg local: set to True for local axis
- :type local: bool
+ :type local: boolean
.. method:: setLinearVelocity(x, y, z, local)
@@ -1860,7 +2213,7 @@ Game Engine bge.types Module
:type z: float
:arg local: set to True for local axis
- :type local: bool
+ :type local: boolean
.. class:: KX_PolyProxy(SCA_IObject)
@@ -1872,44 +2225,64 @@ Game Engine bge.types Module
.. attribute:: matname
- The name of polygon material, empty if no material. **type** string
+ The name of polygon material, empty if no material.
+
+ :type: string
.. attribute:: material
- The material of the polygon **type** :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
+ The material of the polygon.
+
+ :type: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
.. attribute:: texture
- The texture name of the polygon. **type** string
+ The texture name of the polygon.
+
+ :type: string
.. attribute:: matid
- The material index of the polygon, use this to retrieve vertex proxy from mesh proxy **type** integer
+ The material index of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
.. attribute:: v1
- vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy **type** integer
+ vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
.. attribute:: v2
- vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy **type** integer
+ vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
.. attribute:: v3
- vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy **type** integer
+ vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
.. attribute:: v4
vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
- use this to retrieve vertex proxy from mesh proxy **type** integer
+ use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
.. attribute:: visible
- visible state of the polygon: 1=visible, 0=invisible **type** integer
+ visible state of the polygon: 1=visible, 0=invisible.
+
+ :type: integer
.. attribute:: collide
- collide state of the polygon: 1=receives collision, 0=collision free. **type** integer
+ collide state of the polygon: 1=receives collision, 0=collision free.
+
+ :type: integer
.. method:: getMaterialName()
@@ -1980,12 +2353,11 @@ Game Engine bge.types Module
Materials define the render state to be applied to mesh objects.
- .. warning:: Some of the methods/variables are CObjects. If you mix these up, you will crash blender.
+ .. warning::
- This example requires
+ Some of the methods/variables are CObjects. If you mix these up, you will crash blender.
- * PyOpenGL <http://pyopengl.sourceforge.net>
- * GLEWPy <http://glewpy.sourceforge.net>
+ This example requires `PyOpenGL <http://pyopengl.sourceforge.net>`_ and `GLEWPy <http://glewpy.sourceforge.net>`_
.. code-block:: python
@@ -2117,74 +2489,106 @@ Game Engine bge.types Module
.. attribute:: texture
- Texture name **type** string (read-only)
+ Texture name.
+
+ :type: string (read-only)
.. attribute:: gl_texture
- OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture) **type** integer (read-only)
+ OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture).
+
+ :type: integer (read-only)
.. attribute:: material
- Material name **type** string (read-only)
+ Material name.
+
+ :type: string (read-only)
.. attribute:: tface
- Texture face properties **type** CObject (read-only)
+ Texture face properties.
+
+ :type: CObject (read-only)
.. attribute:: tile
- Texture is tiling **type** boolean
+ Texture is tiling.
+
+ :type: boolean
.. attribute:: tilexrep
- Number of tile repetitions in x direction. **type** integer
+ Number of tile repetitions in x direction.
+
+ :type: integer
.. attribute:: tileyrep
- Number of tile repetitions in y direction. **type** integer
+ Number of tile repetitions in y direction.
+
+ :type: integer
.. attribute:: drawingmode
Drawing mode for the material.
- 2 (drawingmode & 4) Textured
- 4 (drawingmode & 16) Light
- - 14 (drawingmode & 16384) 3d Polygon Text **type** bitfield
+ - 14 (drawingmode & 16384) 3d Polygon Text.
+
+ :type: bitfield
.. attribute:: transparent
This material is transparent. All meshes with this
material will be rendered after non transparent meshes from back
- to front. **type** boolean
+ to front.
+
+ :type: boolean
.. attribute:: zsort
Transparent polygons in meshes with this material will be sorted back to
front before rendering.
- Non-Transparent polygons will be sorted front to back before rendering. **type** boolean
+ Non-Transparent polygons will be sorted front to back before rendering.
+
+ :type: boolean
.. attribute:: lightlayer
- Light layers this material affects. **type** bitfield.
+ Light layers this material affects.
+
+ :type: bitfield.
.. attribute:: triangle
- Mesh data with this material is triangles. It's probably not safe to change this. **type** boolean
+ Mesh data with this material is triangles. It's probably not safe to change this.
+
+ :type: boolean
.. attribute:: diffuse
- The diffuse colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0] **type** list [r, g, b]
+ The diffuse colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
+
+ :type: list [r, g, b]
.. attribute:: specular
- The specular colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0] **type** list [r, g, b]
+ The specular colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
+
+ :type: list [r, g, b]
.. attribute:: shininess
- The shininess (specular exponent) of the material. 0.0 <= shininess <= 128.0 **type** float
+ The shininess (specular exponent) of the material. 0.0 <= shininess <= 128.0.
+
+ :type: float
.. attribute:: specularity
- The amount of specular of the material. 0.0 <= specularity <= 1.0 **type** float
+ The amount of specular of the material. 0.0 <= specularity <= 1.0.
+
+ :type: float
.. method:: updateTexture(tface, rasty)
@@ -2283,23 +2687,33 @@ Game Engine bge.types Module
.. attribute:: coneOrigin
- The origin of the cone with which to test. The origin is in the middle of the cone. (read-only) **type** list of floats [x, y, z]
+ The origin of the cone with which to test. The origin is in the middle of the cone. (read-only).
+
+ :type: list of floats [x, y, z]
.. attribute:: coneTarget
- The center of the bottom face of the cone with which to test. (read-only) **type** list of floats [x, y, z]
+ The center of the bottom face of the cone with which to test. (read-only).
+
+ :type: list of floats [x, y, z]
.. attribute:: distance
- The height of the cone with which to test. **type** float
+ The height of the cone with which to test.
+
+ :type: float
.. attribute:: angle
- The angle of the cone (in degrees) with which to test. **type** float from 0 to 360
+ The angle of the cone (in degrees) with which to test.
+
+ :type: float from 0 to 360
.. attribute:: axis
- The axis on which the radar cone is cast **type** integer from 0 to 5
+ The axis on which the radar cone is cast.
+
+ :type: integer from 0 to 5
KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z,
KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
@@ -2315,39 +2729,57 @@ Game Engine bge.types Module
.. attribute:: propName
- The property the ray is looking for. **type** string
+ The property the ray is looking for.
+
+ :type: string
.. attribute:: range
- The distance of the ray. **type** float
+ The distance of the ray.
+
+ :type: float
.. attribute:: useMaterial
- Whether or not to look for a material (false = property) **type** boolean
+ Whether or not to look for a material (false = property).
+
+ :type: boolean
.. attribute:: useXRay
- Whether or not to use XRay. **type** boolean
+ Whether or not to use XRay.
+
+ :type: boolean
.. attribute:: hitObject
- The game object that was hit by the ray. (read-only) **type** :class:`KX_GameObject`
+ The game object that was hit by the ray. (read-only).
+
+ :type: :class:`KX_GameObject`
.. attribute:: hitPosition
- The position (in worldcoordinates) where the object was hit by the ray. (read-only) **type** list [x, y, z]
+ The position (in worldcoordinates) where the object was hit by the ray. (read-only).
+
+ :type: list [x, y, z]
.. attribute:: hitNormal
- The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (read-only) **type** list [x, y, z]
+ The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (read-only).
+
+ :type: list [x, y, z]
.. attribute:: rayDirection
- The direction from the ray (in worldcoordinates). (read-only) **type** list [x, y, z]
+ The direction from the ray (in worldcoordinates). (read-only).
+
+ :type: list [x, y, z]
.. attribute:: axis
- The axis the ray is pointing on. **type** integer from 0 to 5
+ The axis the ray is pointing on.
+
+ :type: integer from 0 to 5
* KX_RAY_AXIS_POS_X
* KX_RAY_AXIS_POS_Y
@@ -2360,32 +2792,43 @@ Game Engine bge.types Module
Edit Object Actuator (in Add Object Mode)
+ .. warning::
+
+ An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer.
+
+ This will genereate a warning in the console:
+
+ ``Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer)``
+
.. attribute:: object
- the object this actuator adds. **type** :class:`KX_GameObject` or None
+ the object this actuator adds.
+
+ :type: :class:`KX_GameObject` or None
.. attribute:: objectLastCreated
- the last added object from this actuator (read-only). **type** :class:`KX_GameObject` or None
+ the last added object from this actuator (read-only).
+
+ :type: :class:`KX_GameObject` or None
.. attribute:: time
- the lifetime of added objects, in frames. Set to 0 to disable automatic deletion. **type** integer
+ the lifetime of added objects, in frames. Set to 0 to disable automatic deletion.
- .. attribute:: linearVelocity
+ :type: integer
- the initial linear velocity of added objects. **type** list [vx, vy, vz]
+ .. attribute:: linearVelocity
- .. attribute:: angularVelocity
+ the initial linear velocity of added objects.
- the initial angular velocity of added objects. **type** list [vx, vy, vz]
+ :type: list [vx, vy, vz]
- .. warning:: An Add Object actuator will be ignored if at game start, the linked object doesn't exist
- (or is empty) or the linked object is in an active layer.
+ .. attribute:: angularVelocity
- This will genereate a warning in the console:
+ the initial angular velocity of added objects.
- ``Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer)``
+ :type: list [vx, vy, vz]
.. method:: instantAddObject()
@@ -2398,7 +2841,7 @@ Game Engine bge.types Module
.. attribute:: mode
- **type** integer
+ :type: integer
the type of operation of the actuator, 0-4
@@ -2410,7 +2853,9 @@ Game Engine bge.types Module
.. attribute:: mass
- the mass value for the KX_DYN_SET_MASS operation **type** float
+ the mass value for the KX_DYN_SET_MASS operation.
+
+ :type: float
.. class:: KX_SCA_EndObjectActuator(SCA_IActuator)
@@ -2422,6 +2867,14 @@ Game Engine bge.types Module
Edit Object actuator, in Replace Mesh mode.
+ .. warning::
+
+ Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist.
+
+ This will generate a warning in the console
+
+ ``Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object``
+
.. code-block:: python
# Level-of-detail
@@ -2466,25 +2919,25 @@ Game Engine bge.types Module
act.mesh = obj.getName() + newmesh[0]
GameLogic.addActiveActuator(act, True)
- .. warning:: Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist.
-
- This will generate a warning in the console
-
- ``Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object``
-
.. attribute:: mesh
:class:`MeshProxy` or the name of the mesh that will replace the current one.
- Set to None to disable actuator **type** :class:`MeshProxy` or None if no mesh is set
+ Set to None to disable actuator.
+
+ :type: :class:`MeshProxy` or None if no mesh is set
.. attribute:: useDisplayMesh
- when true the displayed mesh is replaced. **type** boolean
+ when true the displayed mesh is replaced.
+
+ :type: boolean
.. attribute:: usePhysicsMesh
- when true the physics mesh is replaced. **type** boolean
+ when true the physics mesh is replaced.
+
+ :type: boolean
.. method:: instantReplaceMesh()
@@ -2530,53 +2983,79 @@ Game Engine bge.types Module
.. attribute:: name
- The scene's name, (read-only). **type** string
+ The scene's name, (read-only).
+
+ :type: string
.. attribute:: objects
- A list of objects in the scene, (read-only). **type** :class:`CListValue` of :class:`KX_GameObject`
+ A list of objects in the scene, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`
.. attribute:: objectsInactive
- A list of objects on background layers (used for the addObject actuator), (read-only). **type** :class:`CListValue` of :class:`KX_GameObject`
+ A list of objects on background layers (used for the addObject actuator), (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`
.. attribute:: lights
- A list of lights in the scene, (read-only). **type** :class:`CListValue` of :class:`KX_LightObject`
+ A list of lights in the scene, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_LightObject`
.. attribute:: cameras
- A list of cameras in the scene, (read-only). **type** :class:`CListValue` of :class:`KX_Camera`
+ A list of cameras in the scene, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_Camera`
.. attribute:: active_camera
The current active camera.
- .. note:: this can be set directly from python to avoid using the :class:`KX_SceneActuator`. **type** :class:`KX_Camera`
+ :type: :class:`KX_Camera`
+
+ .. note::
+
+ This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
.. attribute:: suspended
- True if the scene is suspended, (read-only). **type** boolean
+ True if the scene is suspended, (read-only).
+
+ :type: boolean
.. attribute:: activity_culling
- True if the scene is activity culling **type** boolean
+ True if the scene is activity culling.
+
+ :type: boolean
.. attribute:: activity_culling_radius
- The distance outside which to do activity culling. Measured in manhattan distance. **type** float
+ The distance outside which to do activity culling. Measured in manhattan distance.
+
+ :type: float
.. attribute:: dbvt_culling
- True when Dynamic Bounding box Volume Tree is set (read-only). **type** bool
+ True when Dynamic Bounding box Volume Tree is set (read-only).
+
+ :type: boolean
.. attribute:: pre_draw
- A list of callables to be run before the render step. **type** list
+ A list of callables to be run before the render step.
+
+ :type: list
.. attribute:: post_draw
- A list of callables to be run after the render step. **type** list
+ A list of callables to be run after the render step.
+
+ :type: list
.. method:: addObject(object, other, time=0)
@@ -2623,29 +3102,41 @@ Game Engine bge.types Module
Scene Actuator logic brick.
- .. warning:: Scene actuators that use a scene name will be ignored if at game start, the named scene doesn't exist or is empty
+ .. warning::
+
+ Scene actuators that use a scene name will be ignored if at game start, the named scene doesn't exist or is empty
This will generate a warning in the console:
- ``Error: GameObject 'Name' has a SceneActuator 'ActuatorName' (SetScene) without scene``
+ ``Error: GameObject 'Name' has a SceneActuator 'ActuatorName' (SetScene) without scene``
.. attribute:: scene
- the name of the scene to change to/overlay/underlay/remove/suspend/resume **type** string.
+ the name of the scene to change to/overlay/underlay/remove/suspend/resume.
+
+ :type: string
.. attribute:: camera
the camera to change to.
- .. note:: When setting the attribute, you can use either a :class:`KX_Camera` or the name of the camera. **type** :class:`KX_Camera` on read, string or :class:`KX_Camera` on write
+ :type: :class:`KX_Camera` on read, string or :class:`KX_Camera` on write
+
+ .. note::
+
+ When setting the attribute, you can use either a :class:`KX_Camera` or the name of the camera.
.. attribute:: useRestart
- Set flag to True to restart the sene **type** bool
+ Set flag to True to restart the sene.
+
+ :type: boolean
.. attribute:: mode
- The mode of the actuator **type** integer from 0 to 5.
+ The mode of the actuator.
+
+ :type: integer from 0 to 5.
.. class:: KX_SoundActuator(SCA_IActuator)
@@ -2655,39 +3146,57 @@ Game Engine bge.types Module
.. attribute:: fileName
- The filename of the sound this actuator plays. **type** string
+ The filename of the sound this actuator plays.
+
+ :type: string
.. attribute:: volume
- The volume (gain) of the sound. **type** float
+ The volume (gain) of the sound.
+
+ :type: float
.. attribute:: pitch
- The pitch of the sound. **type** float
+ The pitch of the sound.
+
+ :type: float
.. attribute:: rollOffFactor
- The roll off factor. Rolloff defines the rate of attenuation as the sound gets further away. **type** float
+ The roll off factor. Rolloff defines the rate of attenuation as the sound gets further away.
+
+ :type: float
.. attribute:: looping
- The loop mode of the actuator. **type** integer
+ The loop mode of the actuator.
+
+ :type: integer
.. attribute:: position
- The position of the sound as a list: [x, y, z]. **type** float array
+ The position of the sound as a list: [x, y, z].
+
+ :type: float array
.. attribute:: velocity
- The velocity of the emitter as a list: [x, y, z]. The relative velocity to the observer determines the pitch. List of 3 floats: [x, y, z]. **type** float array
+ The velocity of the emitter as a list: [x, y, z]. The relative velocity to the observer determines the pitch. List of 3 floats: [x, y, z].
+
+ :type: float array
.. attribute:: orientation
- The orientation of the sound. When setting the orientation you can also use quaternion [float, float, float, float] or euler angles [float, float, float] **type** 3x3 matrix [[float]]
+ The orientation of the sound. When setting the orientation you can also use quaternion [float, float, float, float] or euler angles [float, float, float].
+
+ :type: 3x3 matrix [[float]]
.. attribute:: mode
- The operation mode of the actuator. **type** integer
+ The operation mode of the actuator.
+
+ :type: integer
You can use one of the following constants:
* KX_SOUNDACT_PLAYSTOP (1)
@@ -2712,21 +3221,26 @@ Game Engine bge.types Module
* KX_STATE_OP_CPY (0) : Copy state mask
* KX_STATE_OP_SET (1) : Add bits to state mask
* KX_STATE_OP_CLR (2) : Substract bits to state mask
- * KX_STATE_OP_NEG (3) : Invert bits to state mask **type** integer
+ * KX_STATE_OP_NEG (3) : Invert bits to state mask.
+
+ :type: integer
.. attribute:: mask
value that defines the bits that will be modified by the operation.
The bits that are 1 in the mask will be updated in the object state,
the bits that are 0 are will be left unmodified expect for the Copy operation
- which copies the mask to the object state **type** integer
+ which copies the mask to the object state.
+
+ :type: integer
.. class:: KX_TrackToActuator(SCA_IActuator)
Edit Object actuator in Track To mode.
- .. warning:: Track To Actuators will be ignored if at game start, the
- object to track to is invalid.
+ .. warning::
+
+ Track To Actuators will be ignored if at game start, the object to track to is invalid.
This will generate a warning in the console:
@@ -2734,15 +3248,21 @@ Game Engine bge.types Module
.. attribute:: object
- the object this actuator tracks. **type** :class:`KX_GameObject` or None
+ the object this actuator tracks.
+
+ :type: :class:`KX_GameObject` or None
.. attribute:: time
- the time in frames with which to delay the tracking motion **type** integer
+ the time in frames with which to delay the tracking motion.
+
+ :type: integer
.. attribute:: use3D
- the tracking motion to use 3D **type** boolean
+ the tracking motion to use 3D.
+
+ :type: boolean
.. class:: KX_VehicleWrapper(PyObjectPlus)
@@ -2908,19 +3428,27 @@ Game Engine bge.types Module
.. attribute:: XYZ
- The position of the vertex. **type** list [x, y, z]
+ The position of the vertex.
+
+ :type: list [x, y, z]
.. attribute:: UV
- The texture coordinates of the vertex. **type** list [u, v]
+ The texture coordinates of the vertex.
+
+ :type: list [u, v]
.. attribute:: normal
- The normal of the vertex **type** list [nx, ny, nz]
+ The normal of the vertex.
+
+ :type: list [nx, ny, nz]
.. attribute:: colour
- The colour of the vertex. **type** list [r, g, b, a]
+ The colour of the vertex.
+
+ :type: list [r, g, b, a]
Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
@@ -2930,47 +3458,69 @@ Game Engine bge.types Module
.. attribute:: x
- The x coordinate of the vertex. **type** float
+ The x coordinate of the vertex.
+
+ :type: float
.. attribute:: y
- The y coordinate of the vertex. **type** float
+ The y coordinate of the vertex.
+
+ :type: float
.. attribute:: z
- The z coordinate of the vertex. **type** float
+ The z coordinate of the vertex.
+
+ :type: float
.. attribute:: u
- The u texture coordinate of the vertex. **type** float
+ The u texture coordinate of the vertex.
+
+ :type: float
.. attribute:: v
- The v texture coordinate of the vertex. **type** float
+ The v texture coordinate of the vertex.
+
+ :type: float
.. attribute:: u2
- The second u texture coordinate of the vertex. **type** float
+ The second u texture coordinate of the vertex.
+
+ :type: float
.. attribute:: v2
- The second v texture coordinate of the vertex. **type** float
+ The second v texture coordinate of the vertex.
+
+ :type: float
.. attribute:: r
- The red component of the vertex colour. 0.0 <= r <= 1.0 **type** float
+ The red component of the vertex colour. 0.0 <= r <= 1.0.
+
+ :type: float
.. attribute:: g
- The green component of the vertex colour. 0.0 <= g <= 1.0 **type** float
+ The green component of the vertex colour. 0.0 <= g <= 1.0.
+
+ :type: float
.. attribute:: b
- The blue component of the vertex colour. 0.0 <= b <= 1.0 **type** float
+ The blue component of the vertex colour. 0.0 <= b <= 1.0.
+
+ :type: float
.. attribute:: a
- The alpha component of the vertex colour. 0.0 <= a <= 1.0 **type** float
+ The alpha component of the vertex colour. 0.0 <= a <= 1.0.
+
+ :type: float
.. method:: getXYZ()
@@ -2983,7 +3533,7 @@ Game Engine bge.types Module
Sets the position of this vertex.
- **type** list [x, y, z]
+ :type: list [x, y, z]
:arg pos: the new position for this vertex in local coordinates.
@@ -2998,7 +3548,7 @@ Game Engine bge.types Module
Sets the UV (texture) coordinates of this vertex.
- **type** list [u, v]
+ :type: list [u, v]
.. method:: getUV2()
@@ -3011,7 +3561,7 @@ Game Engine bge.types Module
Sets the 2nd UV (texture) coordinates of this vertex.
- **type** list [u, v]
+ :type: list [u, v]
:arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
:arg unit: integer
@@ -3070,7 +3620,7 @@ Game Engine bge.types Module
Sets the normal vector of this vertex.
- **type** sequence of floats [r, g, b]
+ :type: sequence of floats [r, g, b]
:arg normal: the new normal of this vertex.
@@ -3080,15 +3630,21 @@ Game Engine bge.types Module
.. attribute:: visibility
- whether the actuator makes its parent object visible or invisible **type** boolean
+ whether the actuator makes its parent object visible or invisible.
+
+ :type: boolean
.. attribute:: useOcclusion
- whether the actuator makes its parent object an occluder or not **type** boolean
+ whether the actuator makes its parent object an occluder or not.
+
+ :type: boolean
.. attribute:: useRecursion
- whether the visibility/occlusion should be propagated to all children of the object **type** boolean
+ whether the visibility/occlusion should be propagated to all children of the object.
+
+ :type: boolean
.. class:: SCA_2DFilterActuator(SCA_IActuator)
@@ -3104,11 +3660,15 @@ Game Engine bge.types Module
.. attribute:: shaderText
- shader source code for custom shader **type** string
+ shader source code for custom shader.
+
+ :type: string
.. attribute:: disableMotionBlur
- action on motion blur: 0=enable, 1=disable **type** integer
+ action on motion blur: 0=enable, 1=disable.
+
+ :type: integer
.. attribute:: mode
@@ -3128,17 +3688,23 @@ Game Engine bge.types Module
* RAS_2DFILTER_GRAYSCALE (9)
* RAS_2DFILTER_SEPIA (10)
* RAS_2DFILTER_INVERT (11)
- * RAS_2DFILTER_CUSTOMFILTER (12) : customer filter, the code code is set via shaderText property **type** integer
+ * RAS_2DFILTER_CUSTOMFILTER (12) : customer filter, the code code is set via shaderText property.
+
+ :type: integer
.. attribute:: passNumber
order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb.
- Only be one filter can be defined per passNb. **type** integer (0-100)
+ Only be one filter can be defined per passNb.
+
+ :type: integer (0-100)
.. attribute:: value
- argument for motion blur filter **type** float (0.0-100.0)
+ argument for motion blur filter.
+
+ :type: float (0.0-100.0)
.. class:: SCA_ANDController(SCA_IController)
@@ -3156,7 +3722,9 @@ Game Engine bge.types Module
.. attribute:: actuator
- the name of the actuator that the sensor is monitoring. **type** string
+ the name of the actuator that the sensor is monitoring.
+
+ :type: string
.. class:: SCA_AlwaysSensor(SCA_ISensor)
@@ -3178,17 +3746,23 @@ Game Engine bge.types Module
.. attribute:: delay
- length of the initial OFF period as number of frame, 0 for immediate trigger. **type** integer.
+ length of the initial OFF period as number of frame, 0 for immediate trigger.
+
+ :type: integer.
.. attribute:: duration
length of the ON period in number of frame after the initial OFF period.
- If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. **type** integer
+ If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
+
+ :type: integer
.. attribute:: repeat
- 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. **type** integer
+ 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
+
+ :type: integer
.. class:: SCA_JoystickSensor(SCA_ISensor)
@@ -3198,7 +3772,9 @@ Game Engine bge.types Module
.. attribute:: axisValues
- The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only). **type** list of ints.
+ The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only).
+
+ :type: list of ints.
Each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing.
The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
@@ -3210,13 +3786,19 @@ Game Engine bge.types Module
.. attribute:: axisSingle
- like :data:`axisValues` but returns a single axis value that is set by the sensor. (read-only). **type** integer
+ like :data:`axisValues` but returns a single axis value that is set by the sensor. (read-only).
+
+ :type: integer
- .. note:: only use this for "Single Axis" type sensors otherwise it will raise an error.
+ .. note::
+
+ Only use this for "Single Axis" type sensors otherwise it will raise an error.
.. attribute:: hatValues
- The state of the joysticks hats as a list of values :data:`numHats` long. (read-only) **type** list of ints
+ The state of the joysticks hats as a list of values :data:`numHats` long. (read-only).
+
+ :type: list of ints
Each spesifying the direction of the hat from 1 to 12, 0 when inactive.
@@ -3234,49 +3816,69 @@ Game Engine bge.types Module
.. attribute:: hatSingle
- Like :data:`hatValues` but returns a single hat direction value that is set by the sensor. (read-only). **type** integer
+ Like :data:`hatValues` but returns a single hat direction value that is set by the sensor. (read-only).
+
+ :type: integer
.. attribute:: numAxis
- The number of axes for the joystick at this index. (read-only). **type** integer
+ The number of axes for the joystick at this index. (read-only).
+
+ :type: integer
.. attribute:: numButtons
- The number of buttons for the joystick at this index. (read-only). **type** integer
+ The number of buttons for the joystick at this index. (read-only).
+
+ :type: integer
.. attribute:: numHats
- The number of hats for the joystick at this index. (read-only). **type** integer
+ The number of hats for the joystick at this index. (read-only).
+
+ :type: integer
.. attribute:: connected
- True if a joystick is connected at this joysticks index. (read-only). **type** boolean
+ True if a joystick is connected at this joysticks index. (read-only).
+
+ :type: boolean
.. attribute:: index
- The joystick index to use (from 0 to 7). The first joystick is always 0. **type** integer
+ The joystick index to use (from 0 to 7). The first joystick is always 0.
+
+ :type: integer
.. attribute:: threshold
- Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. **type** integer
+ Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive.
+
+ :type: integer
.. attribute:: button
- The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect. **type** integer
+ The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect.
+
+ :type: integer
.. attribute:: axis
The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection]
* axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control.
- * axisDirection: 0=right, 1=up, 2=left, 3=down. **type** [integer, integer]
+ * axisDirection: 0=right, 1=up, 2=left, 3=down.
+
+ :type: [integer, integer]
.. attribute:: hat
The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection]
* hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat (4 max).
- * hatDirection: 1-12 **type** [integer, integer]
+ * hatDirection: 1-12.
+
+ :type: [integer, integer]
.. method:: getButtonActiveList()
@@ -3298,31 +3900,45 @@ Game Engine bge.types Module
.. attribute:: key
- The key code this sensor is looking for. **type** keycode from :mod:`bge.keys` module
+ The key code this sensor is looking for.
+
+ :type: keycode from :mod:`bge.keys` module
.. attribute:: hold1
- The key code for the first modifier this sensor is looking for. **type** keycode from :mod:`bge.keys` module
+ The key code for the first modifier this sensor is looking for.
+
+ :type: keycode from :mod:`bge.keys` module
.. attribute:: hold2
- The key code for the second modifier this sensor is looking for. **type** keycode from :mod:`bge.keys` module
+ The key code for the second modifier this sensor is looking for.
+
+ :type: keycode from :mod:`bge.keys` module
.. attribute:: toggleProperty
- The name of the property that indicates whether or not to log keystrokes as a string. **type** string
+ The name of the property that indicates whether or not to log keystrokes as a string.
+
+ :type: string
.. attribute:: targetProperty
- The name of the property that receives keystrokes in case in case a string is logged. **type** string
+ The name of the property that receives keystrokes in case in case a string is logged.
+
+ :type: string
.. attribute:: useAllKeys
- Flag to determine whether or not to accept all keys. **type** boolean
+ Flag to determine whether or not to accept all keys.
+
+ :type: boolean
.. attribute:: events
- a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only). **type** list [[keycode, status], ...]
+ a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
+
+ :type: list [[keycode, status], ...]
* 'keycode' matches the values in :mod:`bge.keys`.
* 'status' uses...
@@ -3367,15 +3983,21 @@ Game Engine bge.types Module
.. attribute:: propName
- the property on which to operate. **type** string
+ the property on which to operate.
+
+ :type: string
.. attribute:: value
- the value with which the actuator operates. **type** string
+ the value with which the actuator operates.
+
+ :type: string
.. attribute:: mode
- TODO - add constants to game logic dict!. **type** integer
+ TODO - add constants to game logic dict!.
+
+ :type: integer
.. class:: SCA_PropertySensor(SCA_ISensor)
@@ -3385,7 +4007,9 @@ Game Engine bge.types Module
.. attribute:: mode
- Type of check on the property. **type** integer
+ Type of check on the property.
+
+ :type: integer
* KX_PROPSENSOR_EQUAL(1)
* KX_PROPSENSOR_NOTEQUAL(2)
@@ -3395,19 +4019,27 @@ Game Engine bge.types Module
.. attribute:: propName
- the property the sensor operates. **type** string
+ the property the sensor operates.
+
+ :type: string
.. attribute:: value
- the value with which the sensor compares to the value of the property. **type** string
+ the value with which the sensor compares to the value of the property.
+
+ :type: string
.. attribute:: min
- the minimum value of the range used to evaluate the property when in interval mode. **type** string
+ the minimum value of the range used to evaluate the property when in interval mode.
+
+ :type: string
.. attribute:: max
- the maximum value of the range used to evaluate the property when in interval mode. **type** string
+ the maximum value of the range used to evaluate the property when in interval mode.
+
+ :type: string
.. class:: SCA_PythonController(SCA_IController)
@@ -3423,14 +4055,20 @@ Game Engine bge.types Module
* When 'Script' execution mode is set this value contains the entire python script as a single string (not the script name as you might expect) which can be modified to run different scripts.
* When 'Module' execution mode is set this value will contain a single line string - module name and function "module.func" or "package.modile.func" where the module names are python textblocks or external scripts.
- .. note:: once this is set the script name given for warnings will remain unchanged. **type** string
+ :type: string
+
+ .. note::
+
+ Once this is set the script name given for warnings will remain unchanged.
.. attribute:: mode
the execution mode for this controller (read-only).
* Script: 0, Execite the :data:`script` as a python code.
- * Module: 1, Execite the :data:`script` as a module and function. **type** integer
+ * Module: 1, Execite the :data:`script` as a module and function.
+
+ :type: integer
.. method:: activate(actuator)
@@ -3454,25 +4092,33 @@ Game Engine bge.types Module
.. attribute:: seed
- Seed of the random number generator. **type** integer.
+ Seed of the random number generator.
+
+ :type: integer.
Equal seeds produce equal series. If the seed is 0, the generator will produce the same value on every call.
.. attribute:: para1
- the first parameter of the active distribution. **type** float, read-only.
+ the first parameter of the active distribution.
+
+ :type: float, read-only.
Refer to the documentation of the generator types for the meaning of this value.
.. attribute:: para2
- the second parameter of the active distribution. **type** float, read-only
+ the second parameter of the active distribution.
+
+ :type: float, read-only
Refer to the documentation of the generator types for the meaning of this value.
.. attribute:: distribution
- distribution type. (read-only). **type** integer
+ distribution type. (read-only).
+
+ :type: integer
* KX_RANDOMACT_BOOL_CONST
* KX_RANDOMACT_BOOL_UNIFORM
@@ -3487,7 +4133,9 @@ Game Engine bge.types Module
.. attribute:: propName
- the name of the property to set with the random value. **type** string
+ the name of the property to set with the random value.
+
+ :type: string
If the generator and property types do not match, the assignment is ignored.
@@ -3575,11 +4223,15 @@ Game Engine bge.types Module
.. attribute:: lastDraw
- The seed of the random number generator. **type** integer
+ The seed of the random number generator.
+
+ :type: integer
.. attribute:: seed
- The seed of the random number generator. **type** integer
+ The seed of the random number generator.
+
+ :type: integer
.. method:: setSeed(seed)
@@ -3629,50 +4281,79 @@ Game Engine bge.types Module
.. attribute:: lens
- The camera's lens value. **type** float
+ The camera's lens value.
+
+ :type: float
.. attribute:: near
- The camera's near clip distance. **type** float
+ The camera's near clip distance.
+
+ :type: float
.. attribute:: far
- The camera's far clip distance. **type** float
+ The camera's far clip distance.
+
+ :type: float
.. attribute:: perspective
- True if this camera has a perspective transform, False for an orthographic projection. **type** boolean
+ True if this camera has a perspective transform, False for an orthographic projection.
+
+ :type: boolean
.. attribute:: frustum_culling
- True if this camera is frustum culling. **type** boolean
+ True if this camera is frustum culling.
+
+ :type: boolean
.. attribute:: projection_matrix
- This camera's 4x4 projection matrix. **type** 4x4 Matrix [[float]]
+ This camera's 4x4 projection matrix.
+
+ :type: 4x4 Matrix [[float]]
.. attribute:: modelview_matrix
- This camera's 4x4 model view matrix. (read-only). **type** 4x4 Matrix [[float]]
+ This camera's 4x4 model view matrix. (read-only).
+
+ :type: 4x4 Matrix [[float]]
- .. note:: This matrix is regenerated every frame from the camera's position and orientation.
+ .. note::
+
+ This matrix is regenerated every frame from the camera's position and orientation.
.. attribute:: camera_to_world
- This camera's camera to world transform. (read-only). **type** 4x4 Matrix [[float]]
+ This camera's camera to world transform. (read-only).
+
+ :type: 4x4 Matrix [[float]]
- .. note:: This matrix is regenerated every frame from the camera's position and orientation.
+ .. note::
+
+ This matrix is regenerated every frame from the camera's position and orientation.
.. attribute:: world_to_camera
- This camera's world to camera transform. (read-only). **type** 4x4 Matrix [[float]]
+ This camera's world to camera transform. (read-only).
+
+ :type: 4x4 Matrix [[float]]
+
+ .. note::
+
+ Regenerated every frame from the camera's position and orientation.
- .. note:: Regenerated every frame from the camera's position and orientation.
- .. note:: This is camera_to_world inverted.
+ .. note::
+
+ This is camera_to_world inverted.
.. attribute:: useViewport
- True when the camera is used as a viewport, set True to enable a viewport for this camera. **type** boolean
+ True when the camera is used as a viewport, set True to enable a viewport for this camera.
+
+ :type: boolean
.. method:: sphereInsideFrustum(centre, radius)
@@ -3698,7 +4379,9 @@ Game Engine bge.types Module
else:
# Sphere is outside frustum
- .. note:: when the camera is first initialized the result will be invalid because the projection matrix has not been set.
+ .. note::
+
+ When the camera is first initialized the result will be invalid because the projection matrix has not been set.
.. method:: boxInsideFrustum(box)
@@ -3731,7 +4414,9 @@ Game Engine bge.types Module
:type box: list of lists
:return: INSIDE, OUTSIDE or INTERSECT
- .. note:: when the camera is first initialized the result will be invalid because the projection matrix has not been set.
+ .. note::
+
+ When the camera is first initialized the result will be invalid because the projection matrix has not been set.
.. method:: pointInsideFrustum(point)
@@ -3755,7 +4440,9 @@ Game Engine bge.types Module
:return: True if the given point is inside this camera's viewing frustum.
:rtype: boolean
- .. note:: when the camera is first initialized the result will be invalid because the projection matrix has not been set.
+ .. note::
+
+ When the camera is first initialized the result will be invalid because the projection matrix has not been set.
.. method:: getCameraToWorld()
@@ -3852,12 +4539,16 @@ Game Engine bge.types Module
The list of armature constraint defined on this armature.
Elements of the list can be accessed by index or string.
- The key format for string access is '<bone_name>:<constraint_name>' **type** list of :class:`BL_ArmatureConstraint`
+ The key format for string access is '<bone_name>:<constraint_name>'.
+
+ :type: list of :class:`BL_ArmatureConstraint`
.. attribute:: channels
The list of armature channels.
- Elements of the list can be accessed by index or name the bone. **type** list of :class:`BL_ArmatureChannel`
+ Elements of the list can be accessed by index or name the bone.
+
+ :type: list of :class:`BL_ArmatureChannel`
.. method:: update()
@@ -3899,29 +4590,45 @@ Game Engine bge.types Module
* KX_ACT_ARMATURE_ENABLE(1) enable the constraint.
* KX_ACT_ARMATURE_DISABLE(2) disable the constraint (runtime constraint values are not updated).
* KX_ACT_ARMATURE_SETTARGET(3) change target and subtarget of constraint.
- * KX_ACT_ARMATURE_SETWEIGHT(4) change weight of (only for IK constraint). **type** integer
+ * KX_ACT_ARMATURE_SETWEIGHT(4) change weight of (only for IK constraint).
+
+ :type: integer
.. attribute:: constraint
- The constraint object this actuator is controlling. **type** :class:`BL_ArmatureConstraint`
+ The constraint object this actuator is controlling.
+
+ :type: :class:`BL_ArmatureConstraint`
.. attribute:: target
- The object that this actuator will set as primary target to the constraint it controls **type** :class:`KX_GameObject`
+ The object that this actuator will set as primary target to the constraint it controls.
+
+ :type: :class:`KX_GameObject`
.. attribute:: subtarget
- The object that this actuator will set as secondary target to the constraint it controls. **type** :class:`KX_GameObject`.
+ The object that this actuator will set as secondary target to the constraint it controls.
+
+ :type: :class:`KX_GameObject`.
+
+ .. note::
- .. note:: Currently, the only secondary target is the pole target for IK constraint.
+ Currently, the only secondary target is the pole target for IK constraint.
.. attribute:: weight
- The weight this actuator will set on the constraint it controls. **type** float.
+ The weight this actuator will set on the constraint it controls.
- .. note:: Currently only the IK constraint has a weight. It must be a value between 0 and 1.
+ :type: float.
- .. note:: A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`)
+ .. note::
+
+ Currently only the IK constraint has a weight. It must be a value between 0 and 1.
+
+ .. note::
+
+ A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`)
.. class:: KX_ArmatureSensor(SCA_ISensor)
@@ -3937,7 +4644,9 @@ Game Engine bge.types Module
.. attribute:: type
- The type of measurement that the sensor make when it is active. **type** integer.
+ The type of measurement that the sensor make when it is active.
+
+ :type: integer.
* KX_ARMSENSOR_STATE_CHANGED(0) detect that the constraint is changing state (active/inactive)
* KX_ARMSENSOR_LIN_ERROR_BELOW(1) detect that the constraint linear error is above a threshold
@@ -3947,11 +4656,13 @@ Game Engine bge.types Module
.. attribute:: constraint
- The constraint object this sensor is watching. **type** :class:`BL_ArmatureConstraint`
+ The constraint object this sensor is watching.
+
+ :type: :class:`BL_ArmatureConstraint`
.. attribute:: value
- **type** float
+ :type: float
The threshold used in the comparison with the constraint error
The linear error is only updated on CopyPose/Distance IK constraint with iTaSC solver
@@ -3965,7 +4676,9 @@ Game Engine bge.types Module
Proxy to Armature Constraint. Allows to change constraint on the fly.
Obtained through :class:`BL_ArmatureObject`.constraints.
- .. note:: not all armature constraints are supported in the GE.
+ .. note::
+
+ Not all armature constraints are supported in the GE.
Constants related to see :data:`type`
@@ -3997,33 +4710,47 @@ Game Engine bge.types Module
.. attribute:: type
- Type of constraint, (read-only) **type** integer, one of CONSTRAINT_TYPE_* constants
+ Type of constraint, (read-only).
+
+ :type: integer, one of CONSTRAINT_TYPE_* constants
.. attribute:: name
- Name of constraint constructed as <bone_name>:<constraint_name>. constraints list **type** string
+ Name of constraint constructed as <bone_name>:<constraint_name>. constraints list.
+
+ :type: string
This name is also the key subscript on :class:`BL_ArmatureObject`.
.. attribute:: enforce
- fraction of constraint effect that is enforced. Between 0 and 1. **type** float
+ fraction of constraint effect that is enforced. Between 0 and 1.
+
+ :type: float
.. attribute:: headtail
- Position of target between head and tail of the target bone: 0=head, 1=tail. **type** float.
+ Position of target between head and tail of the target bone: 0=head, 1=tail.
+
+ :type: float.
- .. note:: Only used if the target is a bone (i.e target object is an armature.
+ .. note::
+
+ Only used if the target is a bone (i.e target object is an armature.
.. attribute:: lin_error
runtime linear error (in Blender units) on constraint at the current frame.
- This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver. **type** float
+ This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
+
+ :type: float
.. attribute:: rot_error
- Runtime rotation error (in radiant) on constraint at the current frame. **type** float.
+ Runtime rotation error (in radiant) on constraint at the current frame.
+
+ :type: float.
This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
@@ -4031,11 +4758,15 @@ Game Engine bge.types Module
.. attribute:: target
- Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint. **type** :class:`KX_GameObject`.
+ Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint.
+
+ :type: :class:`KX_GameObject`.
.. attribute:: subtarget
- Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint. **type** :class:`KX_GameObject`.
+ Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint.
+
+ :type: :class:`KX_GameObject`.
Currently this is only used for pole target on IK constraint.
@@ -4043,17 +4774,25 @@ Game Engine bge.types Module
True if the constraint is active.
- .. note:: an inactive constraint does not update lin_error and rot_error. **type** boolean
+ :type: boolean
+
+ .. note::
+
+ An inactive constraint does not update lin_error and rot_error.
.. attribute:: ik_weight
Weight of the IK constraint between 0 and 1.
- Only defined for IK constraint. **type** float
+ Only defined for IK constraint.
+
+ :type: float
.. attribute:: ik_type
- Type of IK constraint, (read-only). **type** integer.
+ Type of IK constraint, (read-only).
+
+ :type: integer.
* CONSTRAINT_IK_COPYPOSE(0) constraint is trying to match the position and eventually the rotation of the target.
* CONSTRAINT_IK_DISTANCE(1) constraint is maintaining a certain distance to target subject to ik_mode
@@ -4065,11 +4804,15 @@ Game Engine bge.types Module
* CONSTRAINT_IK_FLAG_TIP(1) : set when the constraint operates on the head of the bone and not the tail
* CONSTRAINT_IK_FLAG_ROT(2) : set when the constraint tries to match the orientation of the target
* CONSTRAINT_IK_FLAG_STRETCH(16) : set when the armature is allowed to stretch (only the bones with stretch factor > 0.0)
- * CONSTRAINT_IK_FLAG_POS(32) : set when the constraint tries to match the position of the target **type** integer
+ * CONSTRAINT_IK_FLAG_POS(32) : set when the constraint tries to match the position of the target.
+
+ :type: integer
.. attribute:: ik_dist
- Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE **type** float
+ Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE.
+
+ :type: float
.. attribute:: ik_mode
@@ -4077,7 +4820,9 @@ Game Engine bge.types Module
* CONSTRAINT_IK_MODE_INSIDE(0) : the constraint tries to keep the bone within ik_dist of target
* CONSTRAINT_IK_MODE_OUTSIDE(1) : the constraint tries to keep the bone outside ik_dist of the target
- * CONSTRAINT_IK_MODE_ONSURFACE(2) : the constraint tries to keep the bone exactly at ik_dist of the target **type** integer
+ * CONSTRAINT_IK_MODE_ONSURFACE(2) : the constraint tries to keep the bone exactly at ik_dist of the target.
+
+ :type: integer
.. class:: BL_ArmatureChannel(PyObjectPlus)
@@ -4096,84 +4841,138 @@ Game Engine bge.types Module
.. attribute:: name
- channel name (=bone name), read-only. **type** string
+ channel name (=bone name), read-only.
+
+ :type: string
.. attribute:: bone
- return the bone object corresponding to this pose channel, read-only. **type** :class:`BL_ArmatureBone`
+ return the bone object corresponding to this pose channel, read-only.
+
+ :type: :class:`BL_ArmatureBone`
.. attribute:: parent
- return the parent channel object, None if root channel, read-only. **type** :class:`BL_ArmatureChannel`
+ return the parent channel object, None if root channel, read-only.
+
+ :type: :class:`BL_ArmatureChannel`
.. attribute:: has_ik
true if the bone is part of an active IK chain, read-only.
- This flag is not set when an IK constraint is defined but not enabled (miss target information for example) **type** boolean
+ This flag is not set when an IK constraint is defined but not enabled (miss target information for example).
+
+ :type: boolean
.. attribute:: ik_dof_x
- true if the bone is free to rotation in the X axis, read-only. **type** boolean
+ true if the bone is free to rotation in the X axis, read-only.
+
+ :type: boolean
.. attribute:: ik_dof_y
- true if the bone is free to rotation in the Y axis, read-only. **type** boolean
+ true if the bone is free to rotation in the Y axis, read-only.
+
+ :type: boolean
.. attribute:: ik_dof_z
- true if the bone is free to rotation in the Z axis, read-only. **type** boolean
+ true if the bone is free to rotation in the Z axis, read-only.
+
+ :type: boolean
.. attribute:: ik_limit_x
- true if a limit is imposed on X rotation, read-only. **type** boolean
+ true if a limit is imposed on X rotation, read-only.
+
+ :type: boolean
.. attribute:: ik_limit_y
- true if a limit is imposed on Y rotation, read-only. **type** boolean
+ true if a limit is imposed on Y rotation, read-only.
+
+ :type: boolean
.. attribute:: ik_limit_z
- true if a limit is imposed on Z rotation, read-only. **type** boolean
+ true if a limit is imposed on Z rotation, read-only.
+
+ :type: boolean
.. attribute:: ik_rot_control
- true if channel rotation should applied as IK constraint, read-only. **type** boolean
+ true if channel rotation should applied as IK constraint, read-only.
+
+ :type: boolean
.. attribute:: ik_lin_control
- true if channel size should applied as IK constraint, read-only. **type** boolean
+ true if channel size should applied as IK constraint, read-only.
+
+ :type: boolean
.. attribute:: location
- displacement of the bone head in armature local space, read-write. **type** vector [X, Y, Z].
+ displacement of the bone head in armature local space, read-write.
+
+ :type: vector [X, Y, Z].
- .. note:: You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
- .. note:: Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`).
+ .. note::
+
+ You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
+
+ .. note::
+
+ Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`).
.. attribute:: scale
- scale of the bone relative to its parent, read-write. **type** vector [sizeX, sizeY, sizeZ].
+ scale of the bone relative to its parent, read-write.
+
+ :type: vector [sizeX, sizeY, sizeZ].
- .. note:: An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
- .. note:: Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+ .. note::
+
+ An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
+
+ .. note::
+
+ Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
.. attribute:: rotation
- rotation of the bone relative to its parent expressed as a quaternion, read-write. **type** vector [qr, qi, qj, qk].
+ rotation of the bone relative to its parent expressed as a quaternion, read-write.
+
+ :type: vector [qr, qi, qj, qk].
- .. note:: This field is only used if rotation_mode is 0. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
- .. note:: Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+ .. note::
+
+ This field is only used if rotation_mode is 0. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
+
+ .. note::
+
+ Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
.. attribute:: euler_rotation
- rotation of the bone relative to its parent expressed as a set of euler angles, read-write. **type** vector [X, Y, Z].
+ rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
+
+ :type: vector [X, Y, Z].
- .. note:: This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field. An IK chain does not update this value, see joint_rotation.
- .. note:: Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+ .. note::
+
+ This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field. An IK chain does not update this value, see joint_rotation.
+
+ .. note::
+
+ Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
.. attribute:: rotation_mode
- Method of updating the bone rotation, read-write. **type** integer
+ Method of updating the bone rotation, read-write.
+
+ :type: integer
Use the following constants (euler mode are named as in Blender UI but the actual axis order is reversed).
@@ -4188,72 +4987,106 @@ Game Engine bge.types Module
.. attribute:: channel_matrix
pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only.
- This field is updated after the graphic render, it represents the current pose. **type** matrix [4][4]
+ This field is updated after the graphic render, it represents the current pose.
+
+ :type: matrix [4][4]
.. attribute:: pose_matrix
pose matrix in armature space, read-only,
- This field is updated after the graphic render, it represents the current pose. **type** matrix [4][4]
+ This field is updated after the graphic render, it represents the current pose.
+
+ :type: matrix [4][4]
.. attribute:: pose_head
- position of bone head in armature space, read-only. **type** vector [x, y, z]
+ position of bone head in armature space, read-only.
+
+ :type: vector [x, y, z]
.. attribute:: pose_tail
- position of bone tail in armature space, read-only. **type** vector [x, y, z]
+ position of bone tail in armature space, read-only.
+
+ :type: vector [x, y, z]
.. attribute:: ik_min_x
- minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only. **type** float
+ minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
+
+ :type: float
.. attribute:: ik_max_x
- maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only. **type** float
+ maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
+
+ :type: float
.. attribute:: ik_min_y
- minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only. **type** float
+ minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
+
+ :type: float
.. attribute:: ik_max_y
- maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only. **type** float
+ maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
+
+ :type: float
.. attribute:: ik_min_z
- minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only. **type** float
+ minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
+
+ :type: float
.. attribute:: ik_max_z
- maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only. **type** float
+ maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
+
+ :type: float
.. attribute:: ik_stiffness_x
- bone rotation stiffness in X axis, read-only **type** float between 0 and 1
+ bone rotation stiffness in X axis, read-only.
+
+ :type: float between 0 and 1
.. attribute:: ik_stiffness_y
- bone rotation stiffness in Y axis, read-only **type** float between 0 and 1
+ bone rotation stiffness in Y axis, read-only.
+
+ :type: float between 0 and 1
.. attribute:: ik_stiffness_z
- bone rotation stiffness in Z axis, read-only **type** float between 0 and 1
+ bone rotation stiffness in Z axis, read-only.
+
+ :type: float between 0 and 1
.. attribute:: ik_stretch
- ratio of scale change that is allowed, 0=bone can't change size, read-only. **type** float
+ ratio of scale change that is allowed, 0=bone can't change size, read-only.
+
+ :type: float
.. attribute:: ik_rot_weight
- weight of rotation constraint when ik_rot_control is set, read-write. **type** float between 0 and 1
+ weight of rotation constraint when ik_rot_control is set, read-write.
+
+ :type: float between 0 and 1
.. attribute:: ik_lin_weight
- weight of size constraint when ik_lin_control is set, read-write. **type** float between 0 and 1
+ weight of size constraint when ik_lin_control is set, read-write.
+
+ :type: float between 0 and 1
.. attribute:: joint_rotation
- Control bone rotation in term of joint angle (for robotic applications), read-write. **type** vector [x, y, z]
+ Control bone rotation in term of joint angle (for robotic applications), read-write.
+
+ :type: vector [x, y, z]
When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode.
@@ -4266,10 +5099,21 @@ Game Engine bge.types Module
* 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane.
* 3DoF joint X+Y+Z: treated as a revolute joint. The [x, y, z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose.
- .. note:: The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
- .. note:: [0, 0, 0] always corresponds to the rest pose.
- .. note:: You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`).
- .. note:: You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
+ .. note::
+
+ The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
+
+ .. note::
+
+ [0, 0, 0] always corresponds to the rest pose.
+
+ .. note::
+
+ You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`).
+
+ .. note::
+
+ You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
.. class:: BL_ArmatureBone(PyObjectPlus)
@@ -4278,62 +5122,94 @@ Game Engine bge.types Module
.. attribute:: name
- bone name **type** string
+ bone name.
+
+ :type: string
.. attribute:: connected
- true when the bone head is struck to the parent's tail **type** boolean
+ true when the bone head is struck to the parent's tail.
+
+ :type: boolean
.. attribute:: hinge
- true when bone doesn't inherit rotation or scale from parent bone **type** boolean
+ true when bone doesn't inherit rotation or scale from parent bone.
+
+ :type: boolean
.. attribute:: inherit_scale
- true when bone inherits scaling from parent bone **type** boolean
+ true when bone inherits scaling from parent bone.
+
+ :type: boolean
.. attribute:: bbone_segments
- number of B-bone segments **type** integer
+ number of B-bone segments.
+
+ :type: integer
.. attribute:: roll
- bone rotation around head-tail axis **type** float
+ bone rotation around head-tail axis.
+
+ :type: float
.. attribute:: head
- location of head end of the bone in parent bone space **type** vector [x, y, z]
+ location of head end of the bone in parent bone space.
+
+ :type: vector [x, y, z]
.. attribute:: tail
- location of head end of the bone in parent bone space **type** vector [x, y, z]
+ location of head end of the bone in parent bone space.
+
+ :type: vector [x, y, z]
.. attribute:: length
- bone length **type** float
+ bone length.
+
+ :type: float
.. attribute:: arm_head
- location of head end of the bone in armature space **type** vector [x, y, z]
+ location of head end of the bone in armature space.
+
+ :type: vector [x, y, z]
.. attribute:: arm_tail
- location of tail end of the bone in armature space **type** vector [x, y, z]
+ location of tail end of the bone in armature space.
+
+ :type: vector [x, y, z]
.. attribute:: arm_mat
- matrix of the bone head in armature space **type** matrix [4][4]
+ matrix of the bone head in armature space.
+
+ :type: matrix [4][4]
- .. note:: This matrix has no scale part.
+ .. note::
+
+ This matrix has no scale part.
.. attribute:: bone_mat
- rotation matrix of the bone in parent bone space. **type** matrix [3][3]
+ rotation matrix of the bone in parent bone space.
+
+ :type: matrix [3][3]
.. attribute:: parent
- parent bone, or None for root bone **type** :class:`BL_ArmatureBone`
+ parent bone, or None for root bone.
+
+ :type: :class:`BL_ArmatureBone`
.. attribute:: children
- list of bone's children. **type** list of :class:`BL_ArmatureBone`
+ list of bone's children.
+
+ :type: list of :class:`BL_ArmatureBone`