Merged changes in the trunk up to revision 32565.

This commit is contained in:
2010-10-18 20:40:43 +00:00
676 changed files with 7637 additions and 5445 deletions

View File

@@ -66,7 +66,6 @@ GET_BLENDER_VERSION()
# Blender internal features # Blender internal features
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
OPTION(WITH_LCMS "Enable color correction with lcms" OFF)
OPTION(WITH_PYTHON "Enable Embedded Python API" ON) OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
OPTION(WITH_BUILDINFO "Include extra build details" ON) OPTION(WITH_BUILDINFO "Include extra build details" ON)
OPTION(WITH_FLUID "Enable Elbeem (Fluid Simulation)" ON) OPTION(WITH_FLUID "Enable Elbeem (Fluid Simulation)" ON)
@@ -126,12 +125,11 @@ IF(APPLE)
OPTION(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF) OPTION(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
ENDIF(APPLE) ENDIF(APPLE)
IF(NOT WITH_BULLET AND WITH_GAMEENGINE) # only for developers who want to make this functional
MESSAGE("WARNING: WITH_GAMEENGINE needs WITH_BULLET") # OPTION(WITH_LCMS "Enable color correction with lcms" OFF)
ENDIF(NOT WITH_BULLET AND WITH_GAMEENGINE)
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE") MESSAGE(FATAL_ERROR "WITH_PLAYER needs WITH_GAMEENGINE")
ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER) ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
IF(NOT WITH_INSTALL AND WITH_PYTHON_INSTALL) IF(NOT WITH_INSTALL AND WITH_PYTHON_INSTALL)
@@ -149,7 +147,7 @@ TEST_SSE_SUPPORT()
# On Macs: # On Macs:
# cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config -G Xcode ../blender # cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config -G Xcode ../blender
# #
# When changing any of this remember to update the notes in doc/blender-cmake.txt # When changing any of this remember to update the notes in doc/build_systems/cmake.txt
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
#Platform specifics #Platform specifics
@@ -315,12 +313,12 @@ IF(UNIX AND NOT APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
ENDIF(WITH_OPENMP) ENDIF(WITH_OPENMP)
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
SET(PLATFORM_LINKFLAGS "-pthread") SET(PLATFORM_LINKFLAGS "-pthread")
# Better warnings # Better warnings
# note: -Wunused-parameter is added below for all GCC compilers
SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas") SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas")
SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare") SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
@@ -332,12 +330,12 @@ IF(WIN32)
# this file is included anyway when building under Windows with cl.exe # this file is included anyway when building under Windows with cl.exe
# INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) # INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows) SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
# Setup 64bit and 64bit windows systems # Setup 64bit and 64bit windows systems
IF(CMAKE_CL_64) IF(CMAKE_CL_64)
message("64 bit compiler detected.") MESSAGE("64 bit compiler detected.")
SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64) SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
ENDIF(CMAKE_CL_64) ENDIF(CMAKE_CL_64)
@@ -487,7 +485,7 @@ IF(WIN32)
SET(LCMS_LIBPATH ${LCMS}/lib) SET(LCMS_LIBPATH ${LCMS}/lib)
SET(LCMS_LIB lcms) SET(LCMS_LIB lcms)
ENDIF(WITH_LCMS) ENDIF(WITH_LCMS)
IF(WITH_FFMPEG) IF(WITH_FFMPEG)
SET(FFMPEG ${LIBDIR}/ffmpeg) SET(FFMPEG ${LIBDIR}/ffmpeg)
SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc) SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
@@ -538,7 +536,7 @@ IF(WIN32)
ELSE(CMAKE_CL_64) ELSE(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
ENDIF(CMAKE_CL_64) ENDIF(CMAKE_CL_64)
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
ELSE(MSVC) # MINGW ELSE(MSVC) # MINGW
@@ -554,17 +552,6 @@ IF(WIN32)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG")
SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DNDEBUG")
IF(WITH_OPENMP) IF(WITH_OPENMP)
SET(LLIBS "${LLIBS} -lgomp") SET(LLIBS "${LLIBS} -lgomp")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
@@ -922,6 +909,26 @@ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Extra compile flags # Extra compile flags
IF((NOT WIN32) AND (NOT MSVC))
# used for internal debug checks
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
# assert() checks for this.
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DNDEBUG")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DNDEBUG")
ENDIF((NOT WIN32) AND (NOT MSVC))
IF(CMAKE_COMPILER_IS_GNUCC)
SET(C_WARNINGS "${C_WARNINGS} -Wunused-parameter -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=return-type")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
@@ -933,9 +940,9 @@ ENDIF(WITH_CXX_GUARDEDALLOC)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Libraries # Libraries
FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "") FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "")
ADD_SUBDIRECTORY(source)
ADD_SUBDIRECTORY(intern) ADD_SUBDIRECTORY(intern)
ADD_SUBDIRECTORY(extern) ADD_SUBDIRECTORY(extern)
ADD_SUBDIRECTORY(source)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

View File

@@ -2,7 +2,7 @@ Blender uses the GNU General Public License, which describes the rights
to distribute or change the code. to distribute or change the code.
Please read this file for the full license. Please read this file for the full license.
doc/GPL-license.txt doc/license/GPL-license.txt
Apart from the GNU GPL, Blender is not available under other licenses. Apart from the GNU GPL, Blender is not available under other licenses.

View File

@@ -340,7 +340,7 @@ BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE = False BF_PROFILE = False
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-DDEBUG']
############################################################################# #############################################################################
################### Output directories ################## ################### Output directories ##################

View File

@@ -204,7 +204,7 @@ BF_PROFILE_CCFLAGS = ['-pg','-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-DDEBUG']
BF_BUILDDIR = '../build/freebsd7' BF_BUILDDIR = '../build/freebsd7'
BF_INSTALLDIR='../install/freebsd7' BF_INSTALLDIR='../install/freebsd7'

View File

@@ -204,7 +204,7 @@ BF_PROFILE_CCFLAGS = ['-pg','-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-DDEBUG']
BF_BUILDDIR = '../build/freebsd8' BF_BUILDDIR = '../build/freebsd8'
BF_INSTALLDIR='../install/freebsd8' BF_INSTALLDIR='../install/freebsd8'

View File

@@ -204,7 +204,7 @@ BF_PROFILE_CCFLAGS = ['-pg','-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-DDEBUG']
BF_BUILDDIR = '../build/freebsd9' BF_BUILDDIR = '../build/freebsd9'
BF_INSTALLDIR='../install/freebsd9' BF_INSTALLDIR='../install/freebsd9'

View File

@@ -204,7 +204,7 @@ REL_CCFLAGS = ['-O2']
##ARFLAGS = ruv ##ARFLAGS = ruv
##ARFLAGSQUIET = ru ##ARFLAGSQUIET = ru
## ##
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement'] C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
CC_WARN = ['-Wall'] CC_WARN = ['-Wall']
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare'] CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
@@ -220,7 +220,7 @@ BF_PROFILE_CCFLAGS = ['-pg','-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-DDEBUG']
BF_BUILDDIR = '../build/linux2' BF_BUILDDIR = '../build/linux2'
BF_INSTALLDIR='../install/linux2' BF_INSTALLDIR='../install/linux2'

View File

@@ -185,7 +185,7 @@ CC_WARN = [ '-Wall' ]
LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++', '-luuid', '-lole32'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ] LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++', '-luuid', '-lole32'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ]
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-DDEBUG']
BF_PROFILE = False BF_PROFILE = False
BF_PROFILE_CCFLAGS = ['-pg','-g'] BF_PROFILE_CCFLAGS = ['-pg','-g']

View File

@@ -147,7 +147,7 @@ BF_PROFILE_CCFLAGS = ['-pg','-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-DDEBUG']
BF_BUILDDIR='../build/openbsd3' BF_BUILDDIR='../build/openbsd3'
BF_INSTALLDIR='../install/openbsd3' BF_INSTALLDIR='../install/openbsd3'

View File

@@ -161,7 +161,7 @@ BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE = False BF_PROFILE = False
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = [] BF_DEBUG_CCFLAGS = ['-DDEBUG']
BF_BUILDDIR = '../build/sunos5' BF_BUILDDIR = '../build/sunos5'
BF_INSTALLDIR='../install/sunos5' BF_INSTALLDIR='../install/sunos5'

View File

@@ -176,7 +176,7 @@ CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid'] LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid']
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS= ['-g'] BF_DEBUG_CCFLAGS= ['-g', '-DDEBUG']
BF_PROFILE_CCFLAGS = ['-pg', '-g'] BF_PROFILE_CCFLAGS = ['-pg', '-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']

View File

@@ -20,7 +20,7 @@ $Id$
with the patch to get started. with the patch to get started.
This document describes the usage of the new SCons scripts. The This document describes the usage of the new SCons scripts. The
inner workings are described in blender-scons-dev.txt. inner workings are described in scons-dev.txt.
Building Blender Building Blender
---------------- ----------------

View File

@@ -0,0 +1,170 @@
Simple Blender Python Developer's Guide
---------------------------------------
This is an outline for a future guide yet to be written. It is meant for
programmers wanting to understand and maybe help with the embedding of Python
inside Blender.
I - Introduction
We could praise Python here for its many qualities, but it's probably better
to just give some links:
The main site is at www.python.org , with documentation at www.python.org/doc/
Also worth of mention: it's an interpreted language and is available for
many different systems. The download includes the interpreter, many modules
(think libs), good documentation and some programs / examples. If you use
linux, there's a high chance you already have Python installed, just try
"man python".
The reason for embedding a language environment inside Blender is to give
users the ability to access the program's internal data and functionality.
This can be used to import / export (from / to other 2d / 3d formats) or
change the data (to create new objects procedurally, among many other
interesting possibilities). Script writers (Blender Python programmers) can
also expand Blender in new ways, adding new features on-the-fly, without having
to recompile it. It is usually much easier and faster to write scripts in
Python than to code the equivalent in C.
II - Reference material:
There are two important texts for us in the documentation that comes
with Python ( docs also available online at www.python.org ):
- Extending and Embedding (tutorial for C/C++ programmers)
and specially
- Python/C API.
You can read the first one to get a feel for how things are done
(reference counting is probably the most important part), but the second
doc is a must. Specially useful as a fast reference is its Index, at letter
P, where all commands are.
Specially useful commands are Py_BuildValue and the family of parsing
functions, PyArg_Parse* (PyArg_Parse(), PyArg_ParseTuple(),
PyArg_ParseTupleAndKeywords()). Py_BuildValue is usually the best way to make
Python Objects (the 'variables' that the Python Interpreter understands)
out of C ones. The PyArg_Parse* functions do the opposite, they parse
Python Objects to C variables.
So, understand PyArg_Parse* functions, Py_BuildValue and reference
counting. The first doc has a good discussion about them.
- C knowledge is also necessary, of course, use your favorite resource.
- The Blender 2.25 API documentation ( www.blender.org ) is, along with
the source, our basic API ref.
III - Directories
The previous Blender Python API's are spread in blender/intern/python
and the C part of the current one, bpython, is at
blender/source/blender/bpython/, specially in intern/. The current
solution is a Python wrapper on top of this bpython one, at
blender/intern/python/modules/Blender/
Note: since it's in Python, they needed the freeze Python utility, a
process/program that creates stand-alone executables out of Python
source files -- that is, it packs together an interpreter, the needed
modules and the source of a Python program so that users of this program
don't need to have the Python interpreter already installed in their
machines to run the program -- Blender, in this case.
The new implementation is pure C, so we won't need to "freeze" it.
Another important dir for starters is blender/source/blender/makesdna,
where the headers with Blender structs lie.
IV - Experimental Python
The new implementation, currently referred to as experimental python -
exppython - was started by Michel Selten. He chose to solve the mess in
Blender Python by starting over from scratch, in C, but keeping API
compatibility with the current 2.25 API used by Blender.
It is in blender/source/blender/python , more specifically inside
api2_2x/
To make it clear, exppython is the new implementation being worked on. It
will possibly become the de-facto implementation in Blender 2.28, the next
Blender version. Currently, Blender still comes with the same implementation
found in the 2.25 version of the program. So we call that the 2.25
implementation, or bpython.
BPython had plenty of "macro magic", lot's of complicate #define's, etc.,
since a lot of the embedding work is quite repetitive. But that makes it
much harder for newbies to jump in and learn, so the new files in exppython
avoid that.
This means: Blender, Object, Camera, Lamp, Image, Text, Window modules
(the files have the same names, ending obviously with .c and .h)
To speed things up, some independent parts of bpython are being
integrated directly into exppython. That already happened with Draw and
BGL, both taken from opy_draw.c in the bpython/intern dir. The same is
happening with NMesh (Mesh is written in Python and imports NMesh to
extend / change its functionality).
For a good example of dexterity with macros (cheers to the NaN
programmer(s)!), look at BGL.[ch], the OpenGL API wrapper. The defines
are in the header.
Besides keeping compatibility with the 2.25 API, there are already some
additions to exppython:
- some modules have access to more variables than 2.25 had;
- there are more method functions and the access is safer;
- the file selector (or file browser, if you prefer) is back:
It's now in the Window module, along with an image selector, too.
- there are totally new modules, unavailable in 2.25:
Fellow new developers joining our team are contributing new modules
that have been requested by the community for a long time.
V - Coding
The Camera module is a good reference, since it is like most others, in
terms of programming, but is smaller and simple. It's in Camera.c and
Camera.h . To have it working, it was also necessary to include a line to
the end of Blender.c (registering it as a Blender submodule) and another to
modules.h (declaring its init and CreateObject method)
Currently, one of our conventions is to prepend M_ to module functions,
doc strings, etc. and C_ to the new types we had to create for Python,
like C_Camera, C_Lamp, etc.
If you look at Camera.[ch], you'll find code for creating the Camera
module and the Camera "type", with all its methods and access policies.
It's really a new type defined in Python, like PyInt or PyFloat,
PyString, etc. In practice, it's a "thin" (because it doesn't make
copies of the variables) wrapper for the Blender Camera Data Object.
A note about Blender: objects in Blender share a common base, the
Object, whose attributes are things like the matrix, the location, the
rotation, the size, etc. A Camera is actually an Object of type Camera
(which means that its "data" field points to a Camera Data obj) and a
Camera Data object, which is the specific camera part of the object
(attributes like lens, clip start, etc.). Same for other objects, like
Lamp, Mesh, etc.
That's why C_Camera is a wrapper for the Blender Camera **Data**
object. The full wrapper is Object("Camera") linked with
Camera("camera_name").
How to write a new module for a simple object? Use Camera.[ch] as
templates, check the specifics of your object in the makesdna dir
(for example, the camera one is DNA_camera_types.h) and make the
necessary changes.
If you want to help exppython and in the process possibly learn more about
embedding, the Python/C API and Blender internals, there's this mailing list:
Bf-python mailing list
Bf-python@blender.org
http://www.blender.org/mailman/listinfo/bf-python
There you can ask what hasn't been done yet, get help, make suggestions for
new features we should consider, send bug reports, etc.

View File

@@ -44,7 +44,7 @@ def man_format(data):
return data return data
blender_bin = os.path.join(os.path.dirname(__file__), "../blender") blender_bin = os.path.join(os.path.dirname(__file__), "../../blender")
blender_help = subprocess.Popen([blender_bin, "--help"], stdout=subprocess.PIPE).communicate()[0].decode() blender_help = subprocess.Popen([blender_bin, "--help"], stdout=subprocess.PIPE).communicate()[0].decode()

View File

@@ -0,0 +1,201 @@
{%- block doctype -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{%- endblock %}
{%- set script_files = script_files + [pathto("_static/jquery.sidebar.js", 1)] %}
{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
{%- set reldelim2 = reldelim2 is not defined and ' •' or reldelim2 %}
{%- macro relbar() %}
<div class="subnav boxheader">
<ul class="noprint"><li><a href="http://www.blender.org/development/coding-guides/">Coding Guides</a></li><li></li><li><a href="http://www.blender.org/development/report-a-bug/">Report a Bug</a></li><li></li><li><a href="http://www.blender.org/development/submit-a-patch/">Submit a Patch</a></li><li></li><li><a href="http://www.blender.org/development/release-logs/">Release Logs</a></li><li></li><li><a href="http://www.blender.org/development/current-projects/">Current Projects</a></li><li></li><li><a href="http://www.blender.org/development/architecture/">Architecture</a></li><li></li><li><a href="http://www.blender.org/development/building-blender/">Building Blender</a></li><li></li><li class="subnav-active"><a href="http://www.blender.org/documentation/250PythonDoc/contents.html">PyAPI</a></li><li></li><li><a href="http://wiki.blender.org/index.php/Main_Page">Wiki</a></li></ul>
</div>
<div class="related subnav">
<h3>{{ _('Navigation') }}</h3>
<ul>
{%- for rellink in rellinks %}
<li class="right">
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
{%- endfor %}
{%- block rootrellink %}
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
{%- endblock %}
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
{%- endfor %}
{%- block relbaritems %} {% endblock %}
</ul>
</div>
{%- endmacro %}
{%- macro sidebar() %}
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{%- block sidebarlogo %}
{%- if logo %}
<p class="logo"><a href="{{ pathto(master_doc) }}">
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
</a></p>
{%- endif %}
{%- endblock %}
{%- block sidebartoc %}
{%- if display_toc %}
<h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
{{ toc }}
{%- endif %}
{%- endblock %}
{%- block sidebarrel %}
{%- if prev %}
<h4>{{ _('Previous topic') }}</h4>
<p class="topless"><a href="{{ prev.link|e }}"
title="{{ _('previous chapter') }}">{{ prev.title }}</a></p>
{%- endif %}
{%- if next %}
<h4>{{ _('Next topic') }}</h4>
<p class="topless"><a href="{{ next.link|e }}"
title="{{ _('next chapter') }}">{{ next.title }}</a></p>
{%- endif %}
{%- endblock %}
{%- block sidebarsourcelink %}
{%- if show_source and has_source and sourcename %}
<h3>{{ _('This Page') }}</h3>
<ul class="this-page-menu">
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Show Source') }}</a></li>
</ul>
{%- endif %}
{%- endblock %}
{%- if customsidebar %}
{% include customsidebar %}
{%- endif %}
{%- block sidebarsearch %}
{%- if pagename != "search" %}
<div id="searchbox" style="display: none">
<h3>{{ _('Quick search') }}</h3>
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="{{ _('Go') }}" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip">
{{ _('Enter search terms or a module, class or function name.') }}
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
{%- endif %}
{%- endblock %}
</div>
</div>
{%- endif %}{% endif %}
{%- endmacro %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{{ metatags }}
{%- if not embedded and docstitle %}
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
<title>{{ title|striptags }}{{ titlesuffix }}</title>
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- if not embedded %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ pathto("", 1) }}',
VERSION: '{{ release|e }}',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '{{ file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
{%- if use_opensearch %}
<link rel="search" type="application/opensearchdescription+xml"
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %}
{%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif %}
{%- endif %}
{%- block linktags %}
{%- if hasdoc('about') %}
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
{%- endif %}
{%- if hasdoc('genindex') %}
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
{%- endif %}
{%- if hasdoc('search') %}
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
{%- endif %}
{%- if hasdoc('copyright') %}
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
{%- endif %}
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
{%- if parents %}
<link rel="up" title="{{ parents[-1].title|striptags }}" href="{{ parents[-1].link|e }}" />
{%- endif %}
{%- if next %}
<link rel="next" title="{{ next.title|striptags }}" href="{{ next.link|e }}" />
{%- endif %}
{%- if prev %}
<link rel="prev" title="{{ prev.title|striptags }}" href="{{ prev.link|e }}" />
{%- endif %}
{%- endblock %}
{%- block extrahead %} {% endblock %}
</head>
<body>
{%- block header %}
<div class="noprint" id="navcontainer"><a href="http://www.blender.org/"><img width="140" height="50" title="blender.org home page" alt="blender.org home page" src="http://www.blender.org/fileadmin/site/_gfx/nav-home.png"></a><a href="http://www.blender.org/features-gallery/"><img width="140" height="50" title="Features &amp; Gallery" alt="Features &amp; Gallery" src="http://www.blender.org/fileadmin/site/_gfx/nav-features.png"></a><a href="http://www.blender.org/download/get-blender/"><img width="140" height="50" title="Download" alt="Download" src="http://www.blender.org/fileadmin/site/_gfx/nav-download.png"></a><a href="http://www.blender.org/education-help/"><img width="140" height="50" title="Tutorials &amp; Help" alt="Tutorials &amp; Help" src="http://www.blender.org/fileadmin/site/_gfx/nav-help.png"></a><a href="http://www.blender.org/community/user-community/"><img width="140" height="50" title="Community" alt="Community" src="http://www.blender.org/fileadmin/site/_gfx/nav-community.png"></a><a href="http://www.blender.org/development/"><img width="140" height="50" title="Development" alt="Development" src="http://www.blender.org/fileadmin/site/_gfx/nav-development-on.png"></a><a href="http://www.blender.org/e-shop/"><img width="140" height="50" title="e-Shop" alt="e-Shop" src="http://www.blender.org/fileadmin/site/_gfx/nav-eshop.png"></a></div>
{% endblock %}
<div class="document">
<div id="pageheader"></div>
{%- block relbar1 %}{{ relbar() }}{% endblock %}
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
{%- block document %}
<div class="documentwrapper">
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
<div class="bodywrapper">
{%- endif %}{% endif %}
<div class="body">
{% block body %} {% endblock %}
</div>
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
</div>
{%- endif %}{% endif %}
</div>
{%- endblock %}
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
<div class="clearer"></div>
{%- block footer %}
<div class="footer">
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
{%- endif %}
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
{%- endif %}
{%- if show_sphinx %}
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
{%- endif %}
</div><b class="round"><b id="r1"></b><b id="r2"></b><b id="r3"></b><b id="r4"></b></b>
{%- endblock %}
</div>
</body>
</html>

View File

@@ -0,0 +1,4 @@
{% extends "layout.html" %}
{% block body %}
{{ body }}
{% endblock %}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -0,0 +1,654 @@
/**
* Sphinx stylesheet -- default theme
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
#navcontainer {
height: 50px;
margin: 0 auto;
position: relative;
width: 980px;
}
#navcontainer img {
width: 140px;
height: 50px;
}
#pageheader {
background-image:url("bg.png");
height:80px;
position:relative;
}
body {
font-family: {{ theme_bodyfont }};
font-size: 12px;
line-height: 145%;
background-color: {{ theme_footerbgcolor }};
color: {{ theme_textcolor }};
min-width: 980px;
margin: 0;
padding: 0;
}
div.document {
margin:20px auto 0;
position:relative;
text-align:left;
width:980px;
/* background-color: {{ theme_sidebarbgcolor }};*/
}
div.documentwrapper {
float: left;
width: 100%;
background-color: {{ theme_bgcolor }};
border-color: {{ theme_bordercolor }};
border-style:solid;
border-width:0 1px;
margin:0 auto;
min-height:30em;
padding:35px;
/* position:relative;*/
text-align:left;
width:908px;
}
div.bodywrapper {
margin: 0 0 0 230px;
}
div.body {
background-color: {{ theme_bgcolor }};
color: {{ theme_textcolor }};
padding: 0;
width: 640px;
}
{%- if theme_rightsidebar|tobool %}
div.bodywrapper {
margin: 0 230px 0 0;
}
{%- endif %}
div.footer {
background: #292929;
border-left: 1px solid #363636;
border-right: 1px solid #363636;
color: #ffffff;
/* width: 100%;*/
margin: 0 auto;
padding: 20px 20px 15px 35px;
text-align: center;
font-size: 75%;
}
div.footer+.round b {
display: block;
background: #292929;
width: auto;
}
div.footer+.round #r1 {
border-left: 1px solid #363636;
border-right: 1px solid #363636;
height: 2px;
margin: 0 1px;
}
div.footer+.round #r2 {
border-left: 1px solid #363636;
border-right: 1px solid #363636;
height: 1px;
margin: 0 2px;
}
div.footer+.round #r3 {
border-left: 1px solid #363636;
border-right: 1px solid #363636;
height: 1px;
margin: 0 3px;
}
div.footer+.round #r4 {
border-bottom: 1px solid #363636;
height: 0px;
margin: 0 5px;
}
div.footer a {
color: {{ theme_footertextcolor }};
text-decoration: underline;
}
.boxheader {
background-color:#3E4D5E;
}
.subnav {
height:auto !important;
min-height:15px;
padding:9px 0px 9px 37px;
position:relative;
}
div.related {
width:auto;
font-size:100%;
font-weight:400;
background-color: {{ theme_relbarbgcolor }};
line-height: 145%;
color: {{ theme_relbartextcolor }};
}
div.related li {
font-size:0.9em;
}
div.related li.right {
margin: 0;
word-spacing: 3px;
}
div.subnav li {
display:inline;
list-style-type:none;
margin:0;
padding:0 7px 0 0;
}
div.subnav ul {
display:inline;
margin:0;
padding:0;
}
.subnav a {
font-weight: bold;
color: #fff;
}
.subnav li.subnav-active a {
color:#F39410;
}
div.related a {
color: {{ theme_relbarlinkcolor }};
}
div.related a:active {
color: {{ theme_relbaractlinkcolor }};
}
div.sphinxsidebar {
width: 280px;
font-size: 100%;
{%- if theme_stickysidebar|tobool %}
/* top: 30px;*/
margin: 0;
position: absolute;
overflow: auto;
height: 100%;
{%- endif %}
{%- if theme_rightsidebar|tobool %}
float: right;
{%- if theme_stickysidebar|tobool %}
right: 0;
{%- endif %}
{%- endif %}
}
div.sphinxsidebarwrapper {
width: inherit;
padding: 0;
position: absolute;
margin-top: 35px;
font-size: 8pt;
}
div.sphinxsidebarwrapper.fixed {
position:fixed;
top:10px;
margin-top: 0;
}
{%- if theme_stickysidebar|tobool %}
/* this is nice, but it it leads to hidden headings when jumping
to an anchor */
/*
div.related {
position: fixed;
}
div.documentwrapper {
margin-top: 30px;
}
*/
{%- endif %}
div.sphinxsidebar h3 {
font-family: {{ theme_headfont }};
color: {{ theme_sidebartextcolor }};
font-size: 12px;
font-weight: bold;
background: #3E4D5E url("rnd.png") no-repeat top left;
height: 16px;
margin: 0;
padding: 10px 5px 10px 18px;
}
div.sphinxsidebar h3 a {
color: {{ theme_sidebartextcolor }};
}
div.sphinxsidebar h4 {
font-family: {{ theme_headfont }};
color: {{ theme_sidebartextcolor }};
background: #3E4D5E url("rnd.png") no-repeat top left;
height: 16px;
font-size: 12px;
font-weight: bold;
margin: 0;
padding: 10px 5px 10px 18px;
}
div.sphinxsidebar form {
margin: 0;
padding: 10px;
background-color: #292929;
{%- if theme_rightsidebar|tobool %}
border-right: 1px solid {{ theme_bordercolor }};
{%- endif %}
}
div.sphinxsidebar p {
background-color: #292929;
padding: 5px 10px 10px 10px;
color: {{ theme_sidebartextcolor }};
{%- if theme_rightsidebar|tobool %}
border-right: 1px solid {{ theme_bordercolor }};
{%- endif %}
margin-top: 0;
}
div.sphinxsidebar p.topless {
margin-bottom: 25px;
}
div.sphinxsidebar ul {
background-color: #292929;
margin: 0;
padding: 0;
color: {{ theme_sidebartextcolor }};
}
div.sphinxsidebar > div > ul {
margin-bottom: 25px;
padding:10px;
}
div.sphinxsidebar a {
color: {{ theme_sidebarlinkcolor }};
}
div.sphinxsidebar input {
border: 1px solid {{ theme_sidebarlinkcolor }};
font-family: sans-serif;
font-size: 1em;
}
/* -- body styles ----------------------------------------------------------- */
a {
color: {{ theme_linkcolor }};
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/*div.body h1,*/
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: {{ theme_headfont }};
background-color: {{ theme_headbgcolor }};
font-weight: bold;
color: {{ theme_headtextcolor }};
/* border-bottom: 1px solid #ccc;*/
margin: 20px -20px 10px -20px;
padding: 3px 0 3px 10px;
}
div.body h1 { margin-top: 0; font-size: 200%;
color:#FFFAE0;
font-family:"Helvetica","Arial",sans-serif;
font-size:34px;
font-weight:normal;
left:32px;
line-height:26px;
margin-top:0;
position:absolute;
top:36px;
}
div.body h2 { font-size: 160%; }
div.body h3 { font-size: 140%; }
div.body h4 { font-size: 120%; }
div.body h5 { font-size: 110%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: {{ theme_headlinkcolor }};
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
}
h1:hover > a.headerlink {
display:none;
}
a.headerlink:hover {
background-color: {{ theme_headlinkcolor }};
color: white;
}
div.body p, div.body dd, div.body li {
text-align: justify;
line-height: 130%;
}
div.note, div.seealso, div.topic, div.warning {
color:white;
}
div.admonition p.admonition-title + p {
display: inline;
}
div.note {
background-color: #555;
border: 1px solid #ddd;
}
div.seealso {
background-color: #525241;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
div.warning {
background-color: #B64444;
border: 1px solid #990606;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
dl div.admonition {
border:medium none;
margin:0;
padding:2px 5px 2px 0;
}
dl.class > dd > div.warning p.admonition-title,
dl.class > dd > div.note p.admonition-title {
display:none;
}
dl.class > dd > div.admonition.warning p,
dl.class > dd > div.admonition.note p {
margin:0;
}
dl.class > dd > div.admonition.warning,
dl.class > dd > div.admonition.note {
margin-bottom:12px;
}
dl div.admonition.note p.admonition-title, dl div.admonition.warning p.admonition-title {
color:inherit;
}
dl div.admonition.warning p {
font-weight:bold;
line-height:150%;
}
dl div.admonition.warning p * {
font-weight:normal;
}
dl div.admonition p.admonition-title {
color:#555555;
display:block;
float:left;
margin:0;
padding-right:12px;
text-align:right;
width:90px;
}
dl div.admonition p.admonition-title+p, dl div.admonition p {
display:block;
margin:0 0 0 102px;
}
dl div.note {
background:none;
color:#E8E481;
}
dl div.warning {
background:none;
color:#FC3030;
}
dl div.seealso {
background:none;
}
dl div.admonition.seealso p+p {
color:#222;
}
dl div.seealso a {
margin-left:-1.3ex;
}
div.admonition.warning pre {
background: #0F0704;
color: #fc3030;
}
div.admonition pre {
margin: 6px 0;
overflow: visible;
white-space: pre-wrap;
}
pre {
padding: 10px;
background-color: #000;
color: #fff;
line-height: normal;
border: 0 solid white;
}
dl.function>dt, dl.method>dt {
text-indent:-118px;
padding-left: 118px;
}
dl.function>dt em, dl.method>dt em {
color: #97b9cf;
}
dl.function>dd em, dl.method>dd em {
color: #97b9cf;
font-weight:bold;
}
dl.function table.field-list tr:first-child td.field-body, dl.method table.field-list tr:first-child td.field-body {
color: #728c96;
}
dl.function>dt em:before, dl.method>dt em:before {
content: " ";
display: block;
}
dl.function>dd>p,dl.method>dd>p,dl.attribute>dd>p,
dl[class]>dd>ol,dl[class]>dd>ul {
color: #999;
}
dl.data>dt {
color:#08C659;
}
dl.data>dd>p {
color:#069643;
}
dl.class>dt {
color: #82a3c7;
}
dl.class>dd>p,dl.class>dd>ol,dl.class>dd>ul {
color: #637b96;
}
dl.function>dt,dl.method>dt,dl.attribute>dt {
color: #fcb100;
}
dl.function>dd>p,dl.method>dd>p,dl.attribute>dd>p,
dl.function>dd>p+ol,dl.method>dd>p+ol,dl.attribute>dd>p+ol,
dl.function>dd>p+ul,dl.method>dd>p+ul,dl.attribute>dd>p+ul {
color: #cb8f00;
}
dl.function>dd>p, dl.method>dd>p, dl.attribute>dd>p {
margin: 0 0 3px 102px;
}
dl.function>dd>p:first-child:before, dl.method>dd>p:first-child:before, dl.attribute>dd>p:first-child:before {
content:"Description:";
color:#555;
font-weight:bold;
font-style:normal;
width:90px;
display:inline-block;
margin-left:-102px;
text-align:right;
padding-right:12px;
}
dt:target, .highlight {
color: #444;
background: #333;
}
.highlight {
background: #E2C788;
}
h1 .highlight {
color:inherit;
background:inherit;
}
dl {
margin-bottom: 25px;
}
dd {
margin: 3px 0 10px 15px;
}
.field-body tt.literal {
font-weight: normal;
}
tt {
background-color: #444;
padding: 0 1px 0 1px;
font-size: 0.95em;
}
.warning tt {
background: #cc6262;
}
.note tt {
background: #444;
}
dl .warning tt {
background:#0F0704;
display:block;
}
dl .note tt {
background:#2C2A1B;
}
table.indextable tr.cap {
background-color: transparent;
}
col.field-name {
width:90px;
}
dd table {
margin-bottom: 0;
}
table.field-list th {
color:#555;
padding:0;
text-align:right;
}
table.field-list td.field-body {
color:#999999;
padding-left:12px;
}
table.field-list td.field-body ul.first {
padding-left:0;
list-style:none;
margin-left:0;
}
dl.function>dd>ol, dl.method>dd>ol, dl.attribute>dd>ol,
dl.function>dd>ul, dl.method>dd>ul, dl.attribute>dd>ul,
dl.function>dd>div[class|="highlight"], dl.method>dd>div[class|="highlight"],
dl.attribute>dd>div[class|="highlight"] {
margin-left:102px;
}
dl.function>dd>ol, dl.method>dd>ol, dl.attribute>dd>ol,
dl.function>dd>ul, dl.method>dd>ul, dl.attribute>dd>ul,
dl.class>dd>ol, dl.class>dd>ul {
padding-left:20px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,26 @@
$(document).ready(function () {
var top = $('.sphinxsidebarwrapper').offset().top - parseFloat($('.sphinxsidebarwrapper').css ('marginTop').replace(/auto/, 0));
var colheight = parseFloat($('.sphinxsidebarwrapper').css('height').replace(/auto/, 0));
$(window).scroll(function (event) {
// what the y position of the scroll is
var y = $(this).scrollTop();
// whether that's below the form
if (y >= top) {
//colheight is checked and according to its vaule the scrolling
//is triggered or not
if (colheight <= window.innerHeight) {
// if so, ad the fixed class
$('.sphinxsidebarwrapper').addClass('fixed');
} else {
// otherwise remove it
$('.sphinxsidebarwrapper').removeClass('fixed');
}
} else {
// otherwise remove it
$('.sphinxsidebarwrapper').removeClass('fixed');
}
});
});

View File

@@ -0,0 +1,61 @@
.hll { background-color: #ffffcc }
.c { color: #7f7f7f; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #0088ff; font-weight: bold } /* Keyword */
.o { color: #993399 } /* Operator */
.cm { color: #7f7f7f; font-style: italic } /* Comment.Multiline */
.cp { color: #007020 } /* Comment.Preproc */
.c1 { color: #408090; font-style: italic } /* Comment.Single */
.cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #FF0000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #00A000 } /* Generic.Inserted */
.go { color: #303030 } /* Generic.Output */
.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0040D0 } /* Generic.Traceback */
.kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.kn { color: #FFFF32; font-weight: bold } /* Keyword.Namespace */
.kp { color: #007020 } /* Keyword.Pseudo */
.kr { color: #FFFF32; font-weight: bold } /* Keyword.Reserved */
.kt { color: #902000 } /* Keyword.Type */
.m { color: #00BAFF } /* Literal.Number */
.s { color: #B7C274 } /* Literal.String */
.na { color: #4070a0 } /* Name.Attribute */
.nb { color: #007020 } /* Name.Builtin */
.nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.no { color: #60add5 } /* Name.Constant */
.nd { color: #555555; font-weight: bold } /* Name.Decorator */
.ni { color: #d55537; font-weight: bold } /* Name.Entity */
.ne { color: #007020 } /* Name.Exception */
.nf { color: #06287e } /* Name.Function */
.nl { color: #002070; font-weight: bold } /* Name.Label */
.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.nt { color: #062873; font-weight: bold } /* Name.Tag */
.nv { color: #bb60d5 } /* Name.Variable */
.ow { color: #007020; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mf { color: #00BAFF } /* Literal.Number.Float */
.mh { color: #00BAFF } /* Literal.Number.Hex */
.mi { color: #00BAFF } /* Literal.Number.Integer */
.mo { color: #00BAFF } /* Literal.Number.Oct */
.sb { color: #B7C274 } /* Literal.String.Backtick */
.sc { color: #B7C274 } /* Literal.String.Char */
.sd { color: #B7C274; font-style: italic } /* Literal.String.Doc */
.s2 { color: #B7C274 } /* Literal.String.Double */
.se { color: #B7C274; font-weight: bold } /* Literal.String.Escape */
.sh { color: #B7C274 } /* Literal.String.Heredoc */
.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.sx { color: #c65d09 } /* Literal.String.Other */
.sr { color: #235388 } /* Literal.String.Regex */
.s1 { color: #4070a0 } /* Literal.String.Single */
.ss { color: #517918 } /* Literal.String.Symbol */
.bp { color: #007020 } /* Name.Builtin.Pseudo */
.vc { color: #bb60d5 } /* Name.Variable.Class */
.vg { color: #bb60d5 } /* Name.Variable.Global */
.vi { color: #bb60d5 } /* Name.Variable.Instance */
.il { color: #00BAFF } /* Literal.Number.Integer.Long */

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

View File

@@ -0,0 +1,30 @@
[theme]
inherit = basic
stylesheet = default.css
pygments_style = sphinx
[options]
rightsidebar = true
stickysidebar = true
footerbgcolor = #000000
footertextcolor = #ffffff
sidebarbgcolor = #1c4e63
sidebartextcolor = #ffffff
sidebarlinkcolor = #97b9cf
relbarbgcolor = #2C3845
relbartextcolor = #D3E0E9
relbarlinkcolor = #D3E0E9
relbaractlinkcolor = #f39410
bgcolor = #232323
bordercolor = #363636
textcolor = #ffffff
headbgcolor = #232323
headtextcolor = #ffffff
headlinkcolor = #97b9cf
linkcolor = #97b9cf
codebgcolor = #eeffcc
codetextcolor = #333333
bodyfont = "Lucida Grande","Lucida Sans Unicode","Lucida Sans","Lucida",Verdana,sans-serif
headfont = "Lucida Grande","Lucida Sans Unicode","Lucida Sans","Lucida",Verdana,sans-serif

View File

@@ -19,20 +19,29 @@
# #**** END GPL LICENSE BLOCK #**** # #**** END GPL LICENSE BLOCK #****
script_help_msg = ''' script_help_msg = '''
Usage, Usage:
run this script from blenders root path once you have compiled blender
./blender.bin -b -P /b/source/blender/python/doc/sphinx_doc_gen.py
This will generate python files in "./source/blender/python/doc/sphinx-in" For HTML generation
Generate html docs by running... -------------------
- Run this script from blenders root path once you have compiled blender
./blender.bin -b -P doc/python_api/sphinx_doc_gen.py
This will generate python files in doc/python_api/sphinx-in/,
assuming that ./blender.bin is or links to the blender executable
- Generate html docs by running...
sphinx-build source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
assuming that you have sphinx 0.6.7 installed
For PDF generation For PDF generation
------------------
- After you have built doc/python_api/sphinx-in (see above), run:
sphinx-build -b latex source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out sphinx-build -b latex doc/python_api/sphinx-in doc/python_api/sphinx-out
cd source/blender/python/doc/sphinx-out cd doc/python_api/sphinx-out
make make
''' '''
@@ -48,7 +57,6 @@ reload(rna_info)
ClassMethodDescriptorType = type(dict.__dict__['fromkeys']) ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
MethodDescriptorType = type(dict.get) MethodDescriptorType = type(dict.get)
GetSetDescriptorType = type(int.real) GetSetDescriptorType = type(int.real)
StaticMethodType = type(staticmethod(lambda: None))
EXAMPLE_SET = set() EXAMPLE_SET = set()
EXAMPLE_SET_USED = set() EXAMPLE_SET_USED = set()
@@ -283,12 +291,6 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
if type(descr) == GetSetDescriptorType: if type(descr) == GetSetDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key) py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
for key, descr in descr_items:
if type(descr) == StaticMethodType:
descr = getattr(value, key)
write_indented_lines(" ", fw, descr.__doc__ or "Undocumented", False)
fw("\n")
fw("\n\n") fw("\n\n")
file.close() file.close()
@@ -393,7 +395,6 @@ def rna2sphinx(BASEPATH):
fw(" mathutils.rst\n\n") fw(" mathutils.rst\n\n")
fw(" Freestyle.rst\n\n")
fw(" blf.rst\n\n") fw(" blf.rst\n\n")
fw(" aud.rst\n\n") fw(" aud.rst\n\n")
@@ -475,10 +476,6 @@ def rna2sphinx(BASEPATH):
pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities (mathutils)") pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities (mathutils)")
del module del module
import Freestyle as module
pymodule2sphinx(BASEPATH, "Freestyle", module, "Freestyle Operators & Rules (Freestyle)")
del module
import blf as module import blf as module
pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing (blf)") pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing (blf)")
del module del module
@@ -487,13 +484,13 @@ def rna2sphinx(BASEPATH):
pymodule2sphinx(BASEPATH, "aud", module, "Audio System (aud)") pymodule2sphinx(BASEPATH, "aud", module, "Audio System (aud)")
del module del module
# game engine ## game engine
import shutil import shutil
# copy2 keeps time/date stamps # copy2 keeps time/date stamps
shutil.copy2(os.path.join(BASEPATH, "../../../../gameengine/PyDoc/bge.types.rst"), BASEPATH) shutil.copy2(os.path.join(BASEPATH,"..","rst","bge.types.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "../../../../gameengine/PyDoc/bge.logic.rst"), BASEPATH) shutil.copy2(os.path.join(BASEPATH,"..","rst","bge.logic.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "../../../../gameengine/PyDoc/bge.render.rst"), BASEPATH) shutil.copy2(os.path.join(BASEPATH,"..","rst","bge.render.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "../../../../gameengine/PyDoc/bge.events.rst"), BASEPATH) shutil.copy2(os.path.join(BASEPATH,"..","rst","bge.events.rst"), BASEPATH)
if 0: if 0:
@@ -806,9 +803,10 @@ def main():
else: else:
import shutil import shutil
path_in = 'source/blender/python/doc/sphinx-in' script_dir = os.path.dirname(__file__)
path_out = 'source/blender/python/doc/sphinx-out' path_in = os.path.join(script_dir,'sphinx-in')
path_examples = 'source/blender/python/doc/examples' path_out = os.path.join(script_dir,'sphinx-out')
path_examples = os.path.join(script_dir,'examples')
# only for partial updates # only for partial updates
path_in_tmp = path_in + "-tmp" path_in_tmp = path_in + "-tmp"

View File

@@ -10,7 +10,7 @@ SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api
# sed string from hell, 'Blender 2.53 (sub 1) Build' --> '2_53_1' # sed string from hell, 'Blender 2.53 (sub 1) Build' --> '2_53_1'
# "_".join(str(v) for v in bpy.app.version) # "_".join(str(v) for v in bpy.app.version)
# custom blender vars # custom blender vars
blender_srcdir=$(dirname $0)/../../../../ blender_srcdir=$(dirname $0)/../../
blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9) blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9)
blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9) blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9)
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
@@ -18,18 +18,20 @@ BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$b
BLENDER_VERSION=`$BLENDER --version | cut -f2-4 -d" " | sed 's/(//g' | sed 's/)//g' | sed 's/ sub /./g' | sed 's/\./_/g'` BLENDER_VERSION=`$BLENDER --version | cut -f2-4 -d" " | sed 's/(//g' | sed 's/)//g' | sed 's/ sub /./g' | sed 's/\./_/g'`
SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
SPHINXBASE=doc/python_api/
# dont delete existing docs, now partial updates are used for quick builds. # dont delete existing docs, now partial updates are used for quick builds.
$BLENDER --background --python ./source/blender/python/doc/sphinx_doc_gen.py $BLENDER --background --python $SPHINXBASE/sphinx_doc_gen.py
# html # html
sphinx-build source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out sphinx-build $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
cp source/blender/python/doc/sphinx-out/contents.html source/blender/python/doc/sphinx-out/index.html cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html
ssh ideasman42@emo.blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*' ssh ideasman42@emo.blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
rsync --progress -avze "ssh -p 22" /b/source/blender/python/doc/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/ rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
# pdf # pdf
sphinx-build -b latex source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out sphinx-build -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
cd source/blender/python/doc/sphinx-out cd $SPHINXBASE/sphinx-out
make make
cd ../../../../../ cd -
rsync --progress -avze "ssh -p 22" source/blender/python/doc/sphinx-out/contents.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/contents.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf

View File

@@ -24,6 +24,9 @@
# #
# ***** END GPL LICENSE BLOCK ***** # ***** END GPL LICENSE BLOCK *****
# Otherwise we get warnings here that we cant fix in external projects
STRING(REGEX REPLACE "-Wunused-parameter" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
IF(WITH_BULLET) IF(WITH_BULLET)
ADD_SUBDIRECTORY(bullet2) ADD_SUBDIRECTORY(bullet2)
ENDIF(WITH_BULLET) ENDIF(WITH_BULLET)

View File

@@ -246,13 +246,23 @@ void AUD_FFMPEGReader::seek(int position)
{ {
if(position >= 0) if(position >= 0)
{ {
uint64_t st_time = m_formatCtx->streams[m_stream]->start_time;
double time_base =
av_q2d(m_formatCtx->streams[m_stream]->time_base);
uint64_t seek_pos = position / time_base / m_specs.rate;
if (seek_pos < 0) {
seek_pos = 0;
}
if (st_time != AV_NOPTS_VALUE) {
seek_pos += st_time;
}
// a value < 0 tells us that seeking failed // a value < 0 tells us that seeking failed
if(av_seek_frame(m_formatCtx, if(av_seek_frame(m_formatCtx, m_stream, seek_pos,
-1, AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_ANY) >= 0)
(uint64_t)(((uint64_t)position *
(uint64_t)AV_TIME_BASE) /
(uint64_t)m_specs.rate),
AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_ANY) >= 0)
{ {
avcodec_flush_buffers(m_codecCtx); avcodec_flush_buffers(m_codecCtx);
m_position = position; m_position = position;
@@ -273,9 +283,8 @@ void AUD_FFMPEGReader::seek(int position)
if(packet.pts != AV_NOPTS_VALUE) if(packet.pts != AV_NOPTS_VALUE)
{ {
// calculate real position, and read to frame! // calculate real position, and read to frame!
m_position = packet.pts * m_position = (packet.pts -
av_q2d(m_formatCtx->streams[m_stream]->time_base) * ((st_time != AV_NOPTS_VALUE) ? st_time : 0)) * time_base * m_specs.rate;
m_specs.rate;
if(m_position < position) if(m_position < position)
{ {

View File

@@ -80,7 +80,7 @@ BoolOpState BOP_performBooleanOperation(BoolOpType opType,
CSG_FaceIteratorDescriptor obBFaces, CSG_FaceIteratorDescriptor obBFaces,
CSG_VertexIteratorDescriptor obBVertices) CSG_VertexIteratorDescriptor obBVertices)
{ {
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "BEGIN BOP_performBooleanOperation" << endl; cout << "BEGIN BOP_performBooleanOperation" << endl;
#endif #endif
@@ -118,7 +118,7 @@ BoolOpState BOP_performBooleanOperation(BoolOpType opType,
// Invert the output mesh if is required // Invert the output mesh if is required
*outputMesh = BOP_exportMesh(&meshC, invertMeshC); *outputMesh = BOP_exportMesh(&meshC, invertMeshC);
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "END BOP_performBooleanOperation" << endl; cout << "END BOP_performBooleanOperation" << endl;
#endif #endif
@@ -141,7 +141,7 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
bool invertMeshA, bool invertMeshA,
bool invertMeshB) bool invertMeshB)
{ {
#ifdef DEBUG #ifdef BOP_DEBUG
BOP_Chrono chrono; BOP_Chrono chrono;
float t = 0.0f; float t = 0.0f;
float c = 0.0f; float c = 0.0f;
@@ -156,7 +156,7 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
BOP_BSPTree bspB; BOP_BSPTree bspB;
bspB.addMesh(meshC, *facesB); bspB.addMesh(meshC, *facesB);
#ifdef DEBUG #ifdef BOP_DEBUG
c = chrono.stamp(); t += c; c = chrono.stamp(); t += c;
cout << "Create BSP " << c << endl; cout << "Create BSP " << c << endl;
#endif #endif
@@ -172,7 +172,7 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
if ((0.25*facesB->size()) > bspA.getDeep()) if ((0.25*facesB->size()) > bspA.getDeep())
BOP_meshFilter(meshC, facesB, &bspA); BOP_meshFilter(meshC, facesB, &bspA);
#ifdef DEBUG #ifdef BOP_DEBUG
c = chrono.stamp(); t += c; c = chrono.stamp(); t += c;
cout << "mesh Filter " << c << endl; cout << "mesh Filter " << c << endl;
#endif #endif
@@ -180,7 +180,7 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
// Face 2 Face // Face 2 Face
BOP_Face2Face(meshC,facesA,facesB); BOP_Face2Face(meshC,facesA,facesB);
#ifdef DEBUG #ifdef BOP_DEBUG
c = chrono.stamp(); t += c; c = chrono.stamp(); t += c;
cout << "Face2Face " << c << endl; cout << "Face2Face " << c << endl;
#endif #endif
@@ -189,7 +189,7 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
BOP_meshClassify(meshC,facesA,&bspB); BOP_meshClassify(meshC,facesA,&bspB);
BOP_meshClassify(meshC,facesB,&bspA); BOP_meshClassify(meshC,facesB,&bspA);
#ifdef DEBUG #ifdef BOP_DEBUG
c = chrono.stamp(); t += c; c = chrono.stamp(); t += c;
cout << "Classification " << c << endl; cout << "Classification " << c << endl;
#endif #endif
@@ -197,7 +197,7 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
// Process overlapped faces // Process overlapped faces
BOP_removeOverlappedFaces(meshC,facesA,facesB); BOP_removeOverlappedFaces(meshC,facesA,facesB);
#ifdef DEBUG #ifdef BOP_DEBUG
c = chrono.stamp(); t += c; c = chrono.stamp(); t += c;
cout << "Remove overlap " << c << endl; cout << "Remove overlap " << c << endl;
#endif #endif
@@ -205,7 +205,7 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
// Sew two meshes // Sew two meshes
BOP_sew(meshC,facesA,facesB); BOP_sew(meshC,facesA,facesB);
#ifdef DEBUG #ifdef BOP_DEBUG
c = chrono.stamp(); t += c; c = chrono.stamp(); t += c;
cout << "Sew " << c << endl; cout << "Sew " << c << endl;
#endif #endif
@@ -238,7 +238,7 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
#endif #endif
#endif #endif
#ifdef DEBUG #ifdef BOP_DEBUG
c = chrono.stamp(); t += c; c = chrono.stamp(); t += c;
cout << "Merge faces " << c << endl; cout << "Merge faces " << c << endl;
cout << "Total " << t << endl; cout << "Total " << t << endl;

View File

@@ -70,7 +70,7 @@ void dumpmesh ( BOP_Mesh *m, bool force )
} }
if( nonmanifold ) if( nonmanifold )
cout << nonmanifold << " edges detected" << endl; cout << nonmanifold << " edges detected" << endl;
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "---------------------------" << endl; cout << "---------------------------" << endl;
BOP_Edges edges = m->getEdges(); BOP_Edges edges = m->getEdges();
@@ -130,7 +130,7 @@ void BOP_Merge2::mergeFaces(BOP_Mesh *m, BOP_Index v)
{ {
m_mesh = m; m_mesh = m;
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "##############################" << endl; cout << "##############################" << endl;
#endif #endif
cleanup( ); cleanup( );
@@ -147,7 +147,7 @@ void BOP_Merge2::mergeFaces(BOP_Mesh *m, BOP_Index v)
// ... and merge new faces // ... and merge new faces
if( cont ) cont = mergeFaces(); if( cont ) cont = mergeFaces();
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "called mergeFaces " << cont << endl; cout << "called mergeFaces " << cont << endl;
#endif #endif
// ... until the merge is not succesful // ... until the merge is not succesful
@@ -186,7 +186,7 @@ void clean_nonmanifold( BOP_Mesh *m )
unsigned short facecount = 0; unsigned short facecount = 0;
bool found = false; bool found = false;
BOP_Indexs vertList; BOP_Indexs vertList;
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " first edge is " << (*it) << endl; cout << " first edge is " << (*it) << endl;
#endif #endif
vertList.push_back(first); vertList.push_back(first);
@@ -214,7 +214,7 @@ void clean_nonmanifold( BOP_Mesh *m )
edge = NULL; edge = NULL;
} }
if( !edge ) break; if( !edge ) break;
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " next edge is " << edge << endl; cout << " next edge is " << edge << endl;
#endif #endif
tmpface = m->getFace(edge->getFaces().front()); tmpface = m->getFace(edge->getFaces().front());
@@ -231,7 +231,7 @@ void clean_nonmanifold( BOP_Mesh *m )
} }
if(found) { if(found) {
edge = *it; edge = *it;
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " --> found a loop" << endl; cout << " --> found a loop" << endl;
#endif #endif
if( vertList.size() == 3 ) { if( vertList.size() == 3 ) {
@@ -241,7 +241,7 @@ void clean_nonmanifold( BOP_Mesh *m )
BOP_Face4 *face = (BOP_Face4 *)m->getFace(edge->getFaces().front()); BOP_Face4 *face = (BOP_Face4 *)m->getFace(edge->getFaces().front());
face->getNeighbours(first,last,next,last); face->getNeighbours(first,last,next,last);
} else { } else {
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "loop has " << vertList.size() << "verts"; cout << "loop has " << vertList.size() << "verts";
#endif #endif
continue; continue;
@@ -253,7 +253,7 @@ void clean_nonmanifold( BOP_Mesh *m )
BOP_Face3 *f = new BOP_Face3(next,first,last, BOP_Face3 *f = new BOP_Face3(next,first,last,
oface1->getPlane(),oface1->getOriginalFace()); oface1->getPlane(),oface1->getOriginalFace());
m->addFace( f ); m->addFace( f );
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " face is backward: " << f << endl; cout << " face is backward: " << f << endl;
#endif #endif
@@ -261,7 +261,7 @@ void clean_nonmanifold( BOP_Mesh *m )
BOP_Face3 *f = new BOP_Face3(last,first,next, BOP_Face3 *f = new BOP_Face3(last,first,next,
oface1->getPlane(),oface1->getOriginalFace()); oface1->getPlane(),oface1->getOriginalFace());
m->addFace( f ); m->addFace( f );
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " face is forward: " << f << endl; cout << " face is forward: " << f << endl;
#endif #endif
} }
@@ -366,7 +366,7 @@ bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices)
BOP_LFaces facesByOriginalFace; BOP_LFaces facesByOriginalFace;
BOP_Index v = mergeVertices[i]; BOP_Index v = mergeVertices[i];
BOP_Vertex *vert = m_mesh->getVertex(v); BOP_Vertex *vert = m_mesh->getVertex(v);
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "i = " << i << ", v = " << v << ", vert = " << vert << endl; cout << "i = " << i << ", v = " << v << ", vert = " << vert << endl;
if (v==48) if (v==48)
cout << "found vert 48" << endl; cout << "found vert 48" << endl;
@@ -381,7 +381,7 @@ bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices)
vert->setTAG(BROKEN); vert->setTAG(BROKEN);
break; break;
case 2: { case 2: {
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "size of fBOF = " << facesByOriginalFace.size() << endl; cout << "size of fBOF = " << facesByOriginalFace.size() << endl;
#endif #endif
BOP_Faces ff = facesByOriginalFace.front(); BOP_Faces ff = facesByOriginalFace.front();
@@ -391,7 +391,7 @@ bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices)
// look for two edges adjacent to v which contain both ofaces // look for two edges adjacent to v which contain both ofaces
BOP_Indexs edges = vert->getEdges(); BOP_Indexs edges = vert->getEdges();
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " ff has " << ff.size() << " faces" << endl; cout << " ff has " << ff.size() << " faces" << endl;
cout << " fb has " << fb.size() << " faces" << endl; cout << " fb has " << fb.size() << " faces" << endl;
cout << " v has " << edges.size() << " edges" << endl; cout << " v has " << edges.size() << " edges" << endl;
@@ -400,14 +400,14 @@ bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices)
++it ) { ++it ) {
BOP_Edge *edge = m_mesh->getEdge(*it); BOP_Edge *edge = m_mesh->getEdge(*it);
BOP_Indexs faces = edge->getFaces(); BOP_Indexs faces = edge->getFaces();
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " " << edge << " has " << edge->getFaces().size() << " faces" << endl; cout << " " << edge << " has " << edge->getFaces().size() << " faces" << endl;
#endif #endif
if( faces.size() == 2 ) { if( faces.size() == 2 ) {
BOP_Face *f0 = m_mesh->getFace(faces[0]); BOP_Face *f0 = m_mesh->getFace(faces[0]);
BOP_Face *f1 = m_mesh->getFace(faces[1]); BOP_Face *f1 = m_mesh->getFace(faces[1]);
if( f0->getOriginalFace() != f1->getOriginalFace() ) { if( f0->getOriginalFace() != f1->getOriginalFace() ) {
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " " << f0 << endl; cout << " " << f0 << endl;
cout << " " << f1 << endl; cout << " " << f1 << endl;
#endif #endif
@@ -416,14 +416,14 @@ bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices)
} }
} }
if(ecount == 2) { if(ecount == 2) {
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " edge indexes are " << eindexs[0]; cout << " edge indexes are " << eindexs[0];
cout << " and " << eindexs[1] << endl; cout << " and " << eindexs[1] << endl;
#endif #endif
BOP_Edge *edge = m_mesh->getEdge(eindexs[0]); BOP_Edge *edge = m_mesh->getEdge(eindexs[0]);
BOP_Index N = edge->getVertex1(); BOP_Index N = edge->getVertex1();
if(N == v) N = edge->getVertex2(); if(N == v) N = edge->getVertex2();
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " ## OK, replace "<<v<<" with "<<N << endl; cout << " ## OK, replace "<<v<<" with "<<N << endl;
#endif #endif
mergeVertex(ff , v, N ); mergeVertex(ff , v, N );
@@ -437,7 +437,7 @@ bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices)
} }
didMerge = true; didMerge = true;
} }
#ifdef DEBUG #ifdef BOP_DEBUG
else { else {
cout << " HUH: ecount was " << ecount << endl; cout << " HUH: ecount was " << ecount << endl;
} }
@@ -461,7 +461,7 @@ void BOP_Merge2::mergeVertex(BOP_Faces &faces, BOP_Index v1, BOP_Index v2)
else else
mergeVertex((BOP_Face4 *) *face, v1, v2); mergeVertex((BOP_Face4 *) *face, v1, v2);
(*face)->setTAG(BROKEN); (*face)->setTAG(BROKEN);
#ifdef DEBUG #ifdef BOP_DEBUG
cout << " breaking " << (*face) << endl; cout << " breaking " << (*face) << endl;
#endif #endif
} }
@@ -506,7 +506,7 @@ void BOP_Merge2::mergeVertex(BOP_Face3 *face, BOP_Index v1, BOP_Index v2)
if( prev != v2 && next != v2 ) { if( prev != v2 && next != v2 ) {
m_mesh->addFace( new BOP_Face3(prev,v2,next, m_mesh->addFace( new BOP_Face3(prev,v2,next,
face->getPlane(),face->getOriginalFace()) ); face->getPlane(),face->getOriginalFace()) );
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "mv3: add " << prev << "," << v2 << "," << next << endl; cout << "mv3: add " << prev << "," << v2 << "," << next << endl;
} else { } else {
cout << "mv3: vertex already in tri: doing nothing" << endl; cout << "mv3: vertex already in tri: doing nothing" << endl;
@@ -524,7 +524,7 @@ void BOP_Merge2::mergeVertex(BOP_Face4 *face, BOP_Index v1, BOP_Index v2)
if( prev == v2 || next == v2 ) { if( prev == v2 || next == v2 ) {
m_mesh->addFace( new BOP_Face3(prev,next,opp, m_mesh->addFace( new BOP_Face3(prev,next,opp,
face->getPlane(),face->getOriginalFace()) ); face->getPlane(),face->getOriginalFace()) );
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "mv4a: add " << prev << "," << next << "," << opp << endl; cout << "mv4a: add " << prev << "," << next << "," << opp << endl;
#endif #endif
} }
@@ -532,7 +532,7 @@ void BOP_Merge2::mergeVertex(BOP_Face4 *face, BOP_Index v1, BOP_Index v2)
else { else {
m_mesh->addFace( new BOP_Face4(prev,v2,next,opp, m_mesh->addFace( new BOP_Face4(prev,v2,next,opp,
face->getPlane(),face->getOriginalFace()) ); face->getPlane(),face->getOriginalFace()) );
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "mv4b: add "<<prev<<","<<v2<<","<<next<<","<<opp<<endl; cout << "mv4b: add "<<prev<<","<<v2<<","<<next<<","<<opp<<endl;
#endif #endif
} }
@@ -570,7 +570,7 @@ bool BOP_Merge2::createQuads()
// Set triangles to BROKEN // Set triangles to BROKEN
deleteFace(m_mesh, *faceI); deleteFace(m_mesh, *faceI);
deleteFace(m_mesh, *faceJ); deleteFace(m_mesh, *faceJ);
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "createQuad: del " << *faceI << endl; cout << "createQuad: del " << *faceI << endl;
cout << "createQuad: del " << *faceJ << endl; cout << "createQuad: del " << *faceJ << endl;
cout << "createQuad: add " << faceK << endl; cout << "createQuad: add " << faceK << endl;
@@ -602,7 +602,7 @@ bool BOP_Merge2::createQuads()
// Set triangles to BROKEN // Set triangles to BROKEN
deleteFace(m_mesh, *faceI); deleteFace(m_mesh, *faceI);
deleteFace(m_mesh, *faceJ); deleteFace(m_mesh, *faceJ);
#ifdef DEBUG #ifdef BOP_DEBUG
cout << "createQuad: del " << *faceI << endl; cout << "createQuad: del " << *faceI << endl;
cout << "createQuad: del " << *faceJ << endl; cout << "createQuad: del " << *faceJ << endl;
cout << "createQuad: add " << faceK << endl; cout << "createQuad: add " << faceK << endl;

View File

@@ -35,10 +35,10 @@
#define _GHOST_DEBUG_H_ #define _GHOST_DEBUG_H_
#if defined(WIN32) && !defined(FREE_WINDOWS) #if defined(WIN32) && !defined(FREE_WINDOWS)
#ifdef _DEBUG #ifdef DEBUG
#pragma warning (disable:4786) // suppress stl-MSVC debug info warning #pragma warning (disable:4786) // suppress stl-MSVC debug info warning
// #define GHOST_DEBUG // #define GHOST_DEBUG
#endif // _DEBUG #endif // DEBUG
#endif // WIN32 #endif // WIN32
#ifdef BF_GHOST_DEBUG #ifdef BF_GHOST_DEBUG

View File

@@ -1163,7 +1163,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
NSEnumerator *enumerator; NSEnumerator *enumerator;
NSImageRep *representation; NSImageRep *representation;
ibuf = IMB_allocImBuf (imgSize.width , imgSize.height, 32, IB_rect, 0); ibuf = IMB_allocImBuf (imgSize.width , imgSize.height, 32, IB_rect);
if (!ibuf) { if (!ibuf) {
[droppedImg release]; [droppedImg release];
return GHOST_kFailure; return GHOST_kFailure;

View File

@@ -34,6 +34,8 @@
* @date May 7, 2001 * @date May 7, 2001
*/ */
#include <iostream>
#include "GHOST_SystemWin32.h" #include "GHOST_SystemWin32.h"
#include "GHOST_EventDragnDrop.h" #include "GHOST_EventDragnDrop.h"
@@ -136,14 +138,15 @@
GHOST_SystemWin32::GHOST_SystemWin32() GHOST_SystemWin32::GHOST_SystemWin32()
: m_hasPerformanceCounter(false), m_freq(0), m_start(0), : m_hasPerformanceCounter(false), m_freq(0), m_start(0)
m_separateLeftRight(false),
m_separateLeftRightInitialized(false)
{ {
m_displayManager = new GHOST_DisplayManagerWin32 (); m_displayManager = new GHOST_DisplayManagerWin32 ();
GHOST_ASSERT(m_displayManager, "GHOST_SystemWin32::GHOST_SystemWin32(): m_displayManager==0\n"); GHOST_ASSERT(m_displayManager, "GHOST_SystemWin32::GHOST_SystemWin32(): m_displayManager==0\n");
m_displayManager->initialize(); m_displayManager->initialize();
// Check if current keyboard layout uses AltGr
this->keyboardAltGr();
// Require COM for GHOST_DropTargetWin32 created in GHOST_WindowWin32. // Require COM for GHOST_DropTargetWin32 created in GHOST_WindowWin32.
OleInitialize(0); OleInitialize(0);
} }
@@ -287,43 +290,24 @@ GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys& keys) const GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys& keys) const
{ {
if (m_separateLeftRight && m_separateLeftRightInitialized) { bool down = HIBYTE(::GetKeyState(VK_SHIFT)) != 0;
bool down = HIBYTE(::GetKeyState(VK_LSHIFT)) != 0; keys.set(GHOST_kModifierKeyLeftShift, down);
keys.set(GHOST_kModifierKeyLeftShift, down); keys.set(GHOST_kModifierKeyRightShift, down);
down = HIBYTE(::GetKeyState(VK_RSHIFT)) != 0;
keys.set(GHOST_kModifierKeyRightShift, down); down = HIBYTE(::GetKeyState(VK_MENU)) != 0;
down = HIBYTE(::GetKeyState(VK_LMENU)) != 0; keys.set(GHOST_kModifierKeyLeftAlt, down);
keys.set(GHOST_kModifierKeyLeftAlt, down); keys.set(GHOST_kModifierKeyRightAlt, down);
down = HIBYTE(::GetKeyState(VK_RMENU)) != 0;
keys.set(GHOST_kModifierKeyRightAlt, down); down = HIBYTE(::GetKeyState(VK_CONTROL)) != 0;
down = HIBYTE(::GetKeyState(VK_LCONTROL)) != 0; keys.set(GHOST_kModifierKeyLeftControl, down);
keys.set(GHOST_kModifierKeyLeftControl, down); keys.set(GHOST_kModifierKeyRightControl, down);
down = HIBYTE(::GetKeyState(VK_RCONTROL)) != 0;
keys.set(GHOST_kModifierKeyRightControl, down); bool lwindown = HIBYTE(::GetKeyState(VK_LWIN)) != 0;
bool lwindown = HIBYTE(::GetKeyState(VK_LWIN)) != 0; bool rwindown = HIBYTE(::GetKeyState(VK_RWIN)) != 0;
bool rwindown = HIBYTE(::GetKeyState(VK_RWIN)) != 0; if(lwindown || rwindown)
if(lwindown || rwindown) keys.set(GHOST_kModifierKeyOS, true);
keys.set(GHOST_kModifierKeyOS, true); else
else keys.set(GHOST_kModifierKeyOS, false);
keys.set(GHOST_kModifierKeyOS, false);
}
else {
bool down = HIBYTE(::GetKeyState(VK_SHIFT)) != 0;
keys.set(GHOST_kModifierKeyLeftShift, down);
keys.set(GHOST_kModifierKeyRightShift, down);
down = HIBYTE(::GetKeyState(VK_MENU)) != 0;
keys.set(GHOST_kModifierKeyLeftAlt, down);
keys.set(GHOST_kModifierKeyRightAlt, down);
down = HIBYTE(::GetKeyState(VK_CONTROL)) != 0;
keys.set(GHOST_kModifierKeyLeftControl, down);
keys.set(GHOST_kModifierKeyRightControl, down);
bool lwindown = HIBYTE(::GetKeyState(VK_LWIN)) != 0;
bool rwindown = HIBYTE(::GetKeyState(VK_RWIN)) != 0;
if(lwindown || rwindown)
keys.set(GHOST_kModifierKeyOS, true);
else
keys.set(GHOST_kModifierKeyOS, false);
}
return GHOST_kSuccess; return GHOST_kSuccess;
} }
@@ -386,7 +370,7 @@ GHOST_TSuccess GHOST_SystemWin32::init()
wc.hbrBackground= (HBRUSH)::GetStockObject(BLACK_BRUSH); wc.hbrBackground= (HBRUSH)::GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = 0; wc.lpszMenuName = 0;
wc.lpszClassName= GHOST_WindowWin32::getWindowClassName(); wc.lpszClassName= GHOST_WindowWin32::getWindowClassName();
// Use RegisterClassEx for setting small icon // Use RegisterClassEx for setting small icon
if (::RegisterClass(&wc) == 0) { if (::RegisterClass(&wc) == 0) {
success = GHOST_kFailure; success = GHOST_kFailure;
@@ -402,10 +386,14 @@ GHOST_TSuccess GHOST_SystemWin32::exit()
} }
GHOST_TKey GHOST_SystemWin32::convertKey(WPARAM wParam, LPARAM lParam) const GHOST_TKey GHOST_SystemWin32::convertKey(GHOST_IWindow *window, WPARAM wParam, LPARAM lParam) const
{ {
GHOST_TKey key;
bool isExtended = (lParam&(1<<24))?true:false; bool isExtended = (lParam&(1<<24))?true:false;
GHOST_TKey key;
GHOST_ModifierKeys oldModifiers, newModifiers;
((GHOST_SystemWin32*)getSystem())->retrieveModifierKeys(oldModifiers);
((GHOST_SystemWin32*)getSystem())->getModifierKeys(newModifiers);
if ((wParam >= '0') && (wParam <= '9')) { if ((wParam >= '0') && (wParam <= '9')) {
// VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) // VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
@@ -469,55 +457,62 @@ GHOST_TKey GHOST_SystemWin32::convertKey(WPARAM wParam, LPARAM lParam) const
case VK_QUOTE: key = GHOST_kKeyQuote; break; case VK_QUOTE: key = GHOST_kKeyQuote; break;
case VK_GR_LESS: key = GHOST_kKeyGrLess; break; case VK_GR_LESS: key = GHOST_kKeyGrLess; break;
// Process these keys separately because we need to distinguish right from left modifier keys
case VK_SHIFT: case VK_SHIFT:
{
bool lchanged = oldModifiers.get(GHOST_kModifierKeyLeftShift) != newModifiers.get(GHOST_kModifierKeyLeftShift);
if(lchanged) {
key = GHOST_kKeyLeftShift;
} else {
key = GHOST_kKeyRightShift;
}
}
break;
case VK_CONTROL: case VK_CONTROL:
{
bool lchanged = oldModifiers.get(GHOST_kModifierKeyLeftControl) != newModifiers.get(GHOST_kModifierKeyLeftControl);
if(lchanged) {
key = GHOST_kKeyLeftControl;
} else {
key = GHOST_kKeyRightControl;
}
}
break;
case VK_MENU: case VK_MENU:
{
// Ignore these keys if(m_hasAltGr && isExtended) {
case VK_NUMLOCK: // We have here an extended RAlt, which is AltGr. The keyboard driver on Windows sends before this a LControl, so
case VK_SCROLL: // to be able to input characters created with AltGr (normal on German, French, Finnish and other keyboards) we
case VK_CAPITAL: // push an extra LControl up event. This ensures we don't have a 'hanging' ctrl event in Blender windowmanager
// when typing in Text editor or Console.
GHOST_Event *extra = new GHOST_EventKey(getSystem()->getMilliSeconds(), GHOST_kEventKeyUp, window, GHOST_kKeyLeftControl, '\0');
((GHOST_SystemWin32*)getSystem())->pushEvent(extra);
newModifiers.set(GHOST_kModifierKeyRightControl, false);
newModifiers.set(GHOST_kModifierKeyLeftControl, false);
}
bool lchanged = oldModifiers.get(GHOST_kModifierKeyLeftAlt) != newModifiers.get(GHOST_kModifierKeyLeftAlt);
if(lchanged) {
key = GHOST_kKeyLeftAlt;
} else {
key = GHOST_kKeyRightAlt;
}
}
break;
case VK_LWIN:
case VK_RWIN:
key = GHOST_kKeyOS;
break;
case VK_NUMLOCK: key = GHOST_kKeyNumLock; break;
case VK_SCROLL: key = GHOST_kKeyScrollLock; break;
case VK_CAPITAL: key = GHOST_kKeyCapsLock; break;
default: default:
key = GHOST_kKeyUnknown; key = GHOST_kKeyUnknown;
break; break;
} }
} }
((GHOST_SystemWin32*)getSystem())->storeModifierKeys(newModifiers);
return key; return key;
} }
void GHOST_SystemWin32::processModifierKeys(GHOST_IWindow *window)
{
GHOST_ModifierKeys oldModifiers, newModifiers;
// Retrieve old state of the modifier keys
((GHOST_SystemWin32*)getSystem())->retrieveModifierKeys(oldModifiers);
// Retrieve current state of the modifier keys
((GHOST_SystemWin32*)getSystem())->getModifierKeys(newModifiers);
// Compare the old and the new
if (!newModifiers.equals(oldModifiers)) {
// Create events for the masks that changed
for (int i = 0; i < GHOST_kModifierKeyNumMasks; i++) {
if (newModifiers.get((GHOST_TModifierKeyMask)i) != oldModifiers.get((GHOST_TModifierKeyMask)i)) {
// Convert the mask to a key code
GHOST_TKey key = GHOST_ModifierKeys::getModifierKeyCode((GHOST_TModifierKeyMask)i);
bool keyDown = newModifiers.get((GHOST_TModifierKeyMask)i);
GHOST_EventKey* event;
if (key != GHOST_kKeyUnknown) {
// Create an event
event = new GHOST_EventKey(getSystem()->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key);
pushEvent(event);
}
}
}
}
// Store new modifier keys state
((GHOST_SystemWin32*)getSystem())->storeModifierKeys(newModifiers);
}
GHOST_EventButton* GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type, GHOST_IWindow *window, GHOST_TButtonMask mask) GHOST_EventButton* GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type, GHOST_IWindow *window, GHOST_TButtonMask mask)
{ {
return new GHOST_EventButton (getSystem()->getMilliSeconds(), type, window, mask); return new GHOST_EventButton (getSystem()->getMilliSeconds(), type, window, mask);
@@ -594,7 +589,7 @@ GHOST_EventWheel* GHOST_SystemWin32::processWheelEvent(GHOST_IWindow *window, WP
GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, bool keyDown, WPARAM wParam, LPARAM lParam) GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, bool keyDown, WPARAM wParam, LPARAM lParam)
{ {
GHOST_TKey key = ((GHOST_SystemWin32*)getSystem())->convertKey(wParam, lParam); GHOST_TKey key = ((GHOST_SystemWin32*)getSystem())->convertKey(window, wParam, lParam);
GHOST_EventKey* event; GHOST_EventKey* event;
if (key != GHOST_kKeyUnknown) { if (key != GHOST_kKeyUnknown) {
MSG keyMsg; MSG keyMsg;
@@ -603,6 +598,7 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, bool k
/* Eat any character related messages */ /* Eat any character related messages */
if (::PeekMessage(&keyMsg, NULL, WM_CHAR, WM_SYSDEADCHAR, PM_REMOVE)) { if (::PeekMessage(&keyMsg, NULL, WM_CHAR, WM_SYSDEADCHAR, PM_REMOVE)) {
ascii = (char) keyMsg.wParam; ascii = (char) keyMsg.wParam;
} }
event = new GHOST_EventKey(getSystem()->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii); event = new GHOST_EventKey(getSystem()->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii);
@@ -651,89 +647,30 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
GHOST_WindowWin32* window = (GHOST_WindowWin32*)::GetWindowLong(hwnd, GWL_USERDATA); GHOST_WindowWin32* window = (GHOST_WindowWin32*)::GetWindowLong(hwnd, GWL_USERDATA);
if (window) { if (window) {
switch (msg) { switch (msg) {
// we need to check if new key layout has AltGr
case WM_INPUTLANGCHANGE:
system->keyboardAltGr();
break;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Keyboard events, processed // Keyboard events, processed
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
case WM_KEYDOWN: case WM_KEYDOWN:
/* The WM_KEYDOWN message is posted to the window with the keyboard focus when a
* nonsystem key is pressed. A nonsystem key is a key that is pressed when the alt
* key is not pressed.
*/
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
/* The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when event = processKeyEvent(window, true, wParam, lParam);
* the user presses the F10 key (which activates the menu bar) or holds down the if (!event) {
* alt key and then presses another key. It also occurs when no window currently GHOST_PRINT("GHOST_SystemWin32::wndProc: key event ")
* has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the GHOST_PRINT(msg)
* active window. The window that receives the message can distinguish between these GHOST_PRINT(" key ignored\n")
* two contexts by checking the context code in the lKeyData parameter. }
*/
switch (wParam) {
case VK_SHIFT:
case VK_CONTROL:
case VK_MENU:
case VK_LWIN:
case VK_RWIN:
if (!system->m_separateLeftRightInitialized) {
// Check whether this system supports separate left and right keys
switch (wParam) {
case VK_SHIFT:
system->m_separateLeftRight =
(HIBYTE(::GetKeyState(VK_LSHIFT)) != 0) ||
(HIBYTE(::GetKeyState(VK_RSHIFT)) != 0) ?
true : false;
break;
case VK_CONTROL:
system->m_separateLeftRight =
(HIBYTE(::GetKeyState(VK_LCONTROL)) != 0) ||
(HIBYTE(::GetKeyState(VK_RCONTROL)) != 0) ?
true : false;
break;
case VK_MENU:
system->m_separateLeftRight =
(HIBYTE(::GetKeyState(VK_LMENU)) != 0) ||
(HIBYTE(::GetKeyState(VK_RMENU)) != 0) ?
true : false;
break;
case VK_LWIN:
case VK_RWIN:
system->m_separateLeftRight = true;
break;
}
system->m_separateLeftRightInitialized = true;
}
system->processModifierKeys(window);
// Bypass call to DefWindowProc
return 0;
default:
event = processKeyEvent(window, true, wParam, lParam);
if (!event) {
GHOST_PRINT("GHOST_SystemWin32::wndProc: key event ")
GHOST_PRINT(msg)
GHOST_PRINT(" key ignored\n")
}
break;
}
break; break;
case WM_KEYUP: case WM_KEYUP:
case WM_SYSKEYUP: case WM_SYSKEYUP:
switch (wParam) { event = processKeyEvent(window, false, wParam, lParam);
case VK_SHIFT: if (!event) {
case VK_CONTROL: GHOST_PRINT("GHOST_SystemWin32::wndProc: key event ")
case VK_MENU: GHOST_PRINT(msg)
case VK_LWIN: GHOST_PRINT(" key ignored\n")
case VK_RWIN:
system->processModifierKeys(window);
// Bypass call to DefWindowProc
return 0;
default:
event = processKeyEvent(window, false, wParam, lParam);
if (!event) {
GHOST_PRINT("GHOST_SystemWin32::wndProc: key event ")
GHOST_PRINT(msg)
GHOST_PRINT(" key ignored\n")
}
break;
} }
break; break;

View File

@@ -239,7 +239,7 @@ protected:
* @param lParam The lParam from the wndproc * @param lParam The lParam from the wndproc
* @return The GHOST key (GHOST_kKeyUnknown if no match). * @return The GHOST key (GHOST_kKeyUnknown if no match).
*/ */
virtual GHOST_TKey convertKey(WPARAM wParam, LPARAM lParam) const; virtual GHOST_TKey convertKey(GHOST_IWindow *window, WPARAM wParam, LPARAM lParam) const;
/** /**
* Creates modifier key event(s) and updates the key data stored locally (m_modifierKeys). * Creates modifier key event(s) and updates the key data stored locally (m_modifierKeys).
@@ -248,7 +248,7 @@ protected:
* events generated for both keys. * events generated for both keys.
* @param window The window receiving the event (the active window). * @param window The window receiving the event (the active window).
*/ */
void processModifierKeys(GHOST_IWindow *window); GHOST_EventKey* processModifierKeys(GHOST_IWindow *window);
/** /**
* Creates mouse button event. * Creates mouse button event.
@@ -310,6 +310,11 @@ protected:
* @param keys The new state of the modifier keys. * @param keys The new state of the modifier keys.
*/ */
inline virtual void storeModifierKeys(const GHOST_ModifierKeys& keys); inline virtual void storeModifierKeys(const GHOST_ModifierKeys& keys);
/**
* Check current key layout for AltGr
*/
inline virtual void keyboardAltGr();
/** /**
* Windows call back routine for our window class. * Windows call back routine for our window class.
@@ -324,11 +329,8 @@ protected:
__int64 m_freq; __int64 m_freq;
/** High frequency timer variable. */ /** High frequency timer variable. */
__int64 m_start; __int64 m_start;
/** Stores the capability of this system to distinguish left and right modifier keys. */ /** AltGr on current keyboard layout. */
bool m_separateLeftRight; bool m_hasAltGr;
/** Stores the initialization state of the member m_leftRightDistinguishable. */
bool m_separateLeftRightInitialized;
}; };
inline void GHOST_SystemWin32::retrieveModifierKeys(GHOST_ModifierKeys& keys) const inline void GHOST_SystemWin32::retrieveModifierKeys(GHOST_ModifierKeys& keys) const
@@ -341,5 +343,22 @@ inline void GHOST_SystemWin32::storeModifierKeys(const GHOST_ModifierKeys& keys)
m_modifierKeys = keys; m_modifierKeys = keys;
} }
inline void GHOST_SystemWin32::keyboardAltGr()
{
HKL keylayout = GetKeyboardLayout(0); // get keylayout for current thread
int i;
SHORT s;
for(m_hasAltGr = false, i = 32; i < 256; ++i) {
s = VkKeyScanEx((char)i, keylayout);
// s == -1 means no key that translates passed char code
// high byte contains shift state. bit 2 ctrl pressed, bit 4 alt pressed
// if both are pressed, we have AltGr keycombo on keylayout
if(s!=-1 && (s & 0x600) == 0x600) {
m_hasAltGr = true;
break;
}
}
}
#endif // _GHOST_SYSTEM_WIN32_H_ #endif // _GHOST_SYSTEM_WIN32_H_

View File

@@ -150,6 +150,10 @@ extern "C" {
/*get the peak memory usage in bytes, including mmap allocations*/ /*get the peak memory usage in bytes, including mmap allocations*/
uintptr_t MEM_get_peak_memory(void); uintptr_t MEM_get_peak_memory(void);
#ifndef NDEBUG
const char *MEM_name_ptr(void *vmemh);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -856,4 +856,18 @@ int MEM_get_memory_blocks_in_use(void)
return _totblock; return _totblock;
} }
#ifndef NDEBUG
const char *MEM_name_ptr(void *vmemh)
{
if (vmemh) {
MemHead *memh= vmemh;
memh--;
return memh->name;
}
else {
return "MEM_name_ptr(NULL)";
}
}
#endif
/* eof */ /* eof */

View File

@@ -45,6 +45,7 @@ public:
std::list<IK_QTask*> tasks; std::list<IK_QTask*> tasks;
}; };
// FIXME: locks still result in small "residual" changes to the locked axes...
IK_QSegment *CreateSegment(int flag, bool translate) IK_QSegment *CreateSegment(int flag, bool translate)
{ {
int ndof = 0; int ndof = 0;

View File

@@ -48,7 +48,7 @@
MT_CDECL int MT_QueryAssert(const char *file, int line, const char *predicate, int *do_assert); MT_CDECL int MT_QueryAssert(const char *file, int line, const char *predicate, int *do_assert);
#ifdef NDEBUG #if !defined(DEBUG)
#define MT_assert(predicate) ((void)0) #define MT_assert(predicate) ((void)0)
#define BREAKPOINT() ((void)0) #define BREAKPOINT() ((void)0)
#else #else
@@ -93,7 +93,7 @@ abort();
} }
#endif /* windows */ #endif /* windows */
#endif /* NDEBUG */ #endif /* !defined(DEBUG) */
#endif #endif

View File

@@ -228,7 +228,7 @@ extern void check_tempv(int, float *);
extern int print_int_vec(char *what, int n, int *vec); extern int print_int_vec(char *what, int n, int *vec);
extern int sp_symetree(int *acolst, int *acolend, int *arow, int n, int *parent); extern int sp_symetree(int *acolst, int *acolend, int *arow, int n, int *parent);
extern void sprint_lu_col(char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu); // added to build with debug for blender - campbell
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -32,8 +32,13 @@ BLENDER_PATH = sys.argv[0]
CANCEL_POLL_SPEED = 2 CANCEL_POLL_SPEED = 2
MAX_TIMEOUT = 10 MAX_TIMEOUT = 10
INCREMENT_TIMEOUT = 1 INCREMENT_TIMEOUT = 1
try:
system = platform.system()
except UnicodeDecodeError:
import sys
system = sys.platform
if platform.system() == 'Windows' and platform.version() >= '5': # Error mode is only available on Win2k or higher, that's version 5 if system in ('Windows', 'win32') and platform.version() >= '5': # Error mode is only available on Win2k or higher, that's version 5
import ctypes import ctypes
def SetErrorMode(): def SetErrorMode():
val = ctypes.windll.kernel32.SetErrorMode(0x0002) val = ctypes.windll.kernel32.SetErrorMode(0x0002)

View File

@@ -111,6 +111,7 @@ def classes_recursive(base_type, clss=None):
def find_path_new(id_data, data_path, rna_update_dict, rna_update_from_map): def find_path_new(id_data, data_path, rna_update_dict, rna_update_from_map):
# note!, id_data can be ID type or a node tree
# ignore ID props for now # ignore ID props for now
if data_path.startswith("["): if data_path.startswith("["):
return data_path return data_path
@@ -156,36 +157,43 @@ def update_data_paths(rna_update):
rna_update_from_map.setdefault(ren_from, []).append(ren_to) rna_update_from_map.setdefault(ren_from, []).append(ren_to)
for id_data in id_iter(): for id_data in id_iter():
anim_data = getattr(id_data, "animation_data", None)
if anim_data is None: # check node-trees too
continue anim_data_ls = [(id_data, getattr(id_data, "animation_data", None))]
node_tree = getattr(id_data, "node_tree", None)
for fcurve in anim_data.drivers: if node_tree:
for var in fcurve.driver.variables: anim_data_ls.append((node_tree, node_tree.animation_data))
if var.type == 'SINGLE_PROP':
for tar in var.targets: for anim_data_base, anim_data in anim_data_ls:
id_data_other = tar.id if anim_data is None:
data_path = tar.data_path continue
if id_data_other and data_path: for fcurve in anim_data.drivers:
data_path_new = find_path_new(id_data_other, data_path, rna_update_dict, rna_update_from_map) for var in fcurve.driver.variables:
# print(data_path_new) if var.type == 'SINGLE_PROP':
if data_path_new != data_path: for tar in var.targets:
if not IS_TESTING: id_data_other = tar.id
tar.data_path = data_path_new data_path = tar.data_path
print("driver (%s): %s -> %s" % (id_data_other.name, data_path, data_path_new))
if id_data_other and data_path:
data_path_new = find_path_new(id_data_other, data_path, rna_update_dict, rna_update_from_map)
# print(data_path_new)
if data_path_new != data_path:
if not IS_TESTING:
tar.data_path = data_path_new
print("driver (%s): %s -> %s" % (id_data_other.name, data_path, data_path_new))
for action in anim_data_actions(anim_data):
for action in anim_data_actions(anim_data): for fcu in action.fcurves:
for fcu in action.fcurves: data_path = fcu.data_path
data_path = fcu.data_path data_path_new = find_path_new(anim_data_base, data_path, rna_update_dict, rna_update_from_map)
data_path_new = find_path_new(id_data, data_path, rna_update_dict, rna_update_from_map) # print(data_path_new)
# print(data_path_new) if data_path_new != data_path:
if data_path_new != data_path: if not IS_TESTING:
if not IS_TESTING: fcu.data_path = data_path_new
fcu.data_path = data_path_new print("fcurve (%s): %s -> %s" % (id_data.name, data_path, data_path_new))
print("fcurve (%s): %s -> %s" % (id_data.name, data_path, data_path_new))
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -258,15 +258,15 @@ class _GenericBone:
return bones return bones
class PoseBone(StructRNA, _GenericBone): class PoseBone(StructRNA, _GenericBone, metaclass=StructMetaIDProp):
__slots__ = () __slots__ = ()
class Bone(StructRNA, _GenericBone): class Bone(StructRNA, _GenericBone, metaclass=StructMetaIDProp):
__slots__ = () __slots__ = ()
class EditBone(StructRNA, _GenericBone): class EditBone(StructRNA, _GenericBone, metaclass=StructMetaIDProp):
__slots__ = () __slots__ = ()
def align_orientation(self, other): def align_orientation(self, other):

View File

@@ -75,10 +75,10 @@ def complete(line, cursor, namespace, private=True):
# unquoted word -> module or attribute completion # unquoted word -> module or attribute completion
word = re_unquoted_word.group(1) word = re_unquoted_word.group(1)
if RE_MODULE.match(line): if RE_MODULE.match(line):
import complete_import from . import complete_import
matches = complete_import.complete(line) matches = complete_import.complete(line)
else: else:
import complete_namespace from . import complete_namespace
matches = complete_namespace.complete(word, namespace, private) matches = complete_namespace.complete(word, namespace, private)
else: else:
# for now we don't have completers for strings # for now we don't have completers for strings
@@ -112,7 +112,7 @@ def expand(line, cursor, namespace, private=True):
'abs(number) -> number\\nReturn the absolute value of the argument.' 'abs(number) -> number\\nReturn the absolute value of the argument.'
""" """
if line[:cursor].strip().endswith('('): if line[:cursor].strip().endswith('('):
import complete_calltip from . import complete_calltip
matches, word, scrollback = complete_calltip.complete(line, matches, word, scrollback = complete_calltip.complete(line,
cursor, namespace) cursor, namespace)
no_calltip = False no_calltip = False

View File

@@ -534,7 +534,11 @@ def generate_test_all(context, GRAPH=False):
new_objects = rigify.generate_test(context) new_objects = rigify.generate_test(context)
if GRAPH: if GRAPH:
base_name = os.path.splitext(bpy.data.filepath)[0] if(bpy.data.filepath):
base_name = os.path.splitext(bpy.data.filepath)[0]
else:
import tempfile
base_name = tempfile.mktemp(prefix=bpy.app.tempdir)
for obj, obj_new in new_objects: for obj, obj_new in new_objects:
for obj in (obj, obj_new): for obj in (obj, obj_new):
fn = base_name + "-" + bpy.path.clean_name(obj.name) fn = base_name + "-" + bpy.path.clean_name(obj.name)

View File

@@ -152,7 +152,7 @@ class InfoStructRNA:
functions.append((identifier, attr)) functions.append((identifier, attr))
return functions return functions
def __repr__(self): def __str__(self):
txt = "" txt = ""
txt += self.identifier txt += self.identifier
@@ -285,7 +285,7 @@ class InfoPropertyRNA:
return type_str return type_str
def __repr__(self): def __str__(self):
txt = '' txt = ''
txt += ' * ' + self.identifier + ': ' + self.description txt += ' * ' + self.identifier + ': ' + self.description
@@ -319,7 +319,7 @@ class InfoFunctionRNA:
self.return_values = tuple(self.return_values) self.return_values = tuple(self.return_values)
def __repr__(self): def __str__(self):
txt = '' txt = ''
txt += ' * ' + self.identifier + '(' txt += ' * ' + self.identifier + '('

View File

@@ -0,0 +1,103 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# classes for extracting info from blenders internal classes
import bpy
import bgl
import sys
def cutPoint(text, length):
"Returns position of the last space found before 'length' chars"
l = length
c = text[l]
while c != ' ':
l -= 1
if l == 0: return length # no space found
c = text[l]
return l
def textWrap(text, length = 70):
lines = []
while len(text) > 70:
cpt = cutPoint(text, length)
line, text = text[:cpt], text[cpt + 1:]
lines.append(line)
lines.append(text)
return lines
def write_sysinfo(op):
output_filename = "system-info.txt"
warnings = 0
notices = 0
if output_filename in bpy.data.texts.keys():
output = bpy.data.texts[output_filename]
output.clear()
else:
output = bpy.data.texts.new(name=output_filename)
header = '= Blender {} System Information =\n'.format(bpy.app.version_string)
lilies = '{}\n\n'.format(len(header)*'=')
firstlilies = '{}\n'.format(len(header)*'=')
output.write(firstlilies)
output.write(header)
output.write(lilies)
# build info
output.write('\nBlender:\n')
output.write(lilies)
output.write('version {}, revision {}. {}\n'.format(bpy.app.version_string, bpy.app.build_revision, bpy.app.build_type))
output.write('build date: {}, {}\n'.format(bpy.app.build_date, bpy.app.build_time))
output.write('platform: {}\n'.format(bpy.app.build_platform))
output.write('binary path: {}\n\n'.format(bpy.app.binary_path))
# python info
output.write('\nPython:\n')
output.write(lilies)
output.write('version: {}\n'.format(sys.version))
output.write('paths:\n')
for p in sys.path:
output.write('\t{}\n'.format(p))
output.write('\nDirectories:\n')
output.write(lilies)
output.write('scripts: {}\n'.format(bpy.utils.script_paths()))
output.write('user scripts: {}\n'.format(bpy.utils.user_script_path()))
output.write('datafiles: {}\n'.format(bpy.utils.user_resource('DATAFILES')))
output.write('config: {}\n'.format(bpy.utils.user_resource('CONFIG')))
output.write('scripts : {}\n'.format(bpy.utils.user_resource('SCRIPTS')))
output.write('autosave: {}\n'.format(bpy.utils.user_resource('AUTOSAVE')))
output.write('tempdir: {}\n'.format(bpy.app.tempdir))
output.write('\nOpenGL\n')
output.write(lilies)
output.write('renderer:\t{}\n'.format(bgl.glGetString(bgl.GL_RENDERER)))
output.write('vendor:\t\t{}\n'.format(bgl.glGetString(bgl.GL_VENDOR)))
output.write('version:\t{}\n'.format(bgl.glGetString(bgl.GL_VERSION)))
output.write('extensions:\n')
glext = bgl.glGetString(bgl.GL_EXTENSIONS)
glext = textWrap(glext, 70)
for l in glext:
output.write('\t\t{}\n'.format(l))
op.report({'INFO'}, "System information generated in 'system-info.txt'")

View File

@@ -32,13 +32,17 @@ class EditExternally(bpy.types.Operator):
def _editor_guess(self, context): def _editor_guess(self, context):
import platform import platform
system = platform.system() try:
system = platform.system()
except UnicodeDecodeError:
import sys
system = sys.platform
image_editor = context.user_preferences.filepaths.image_editor image_editor = context.user_preferences.filepaths.image_editor
# use image editor in the preferences when available. # use image editor in the preferences when available.
if not image_editor: if not image_editor:
if system == 'Windows': if system in ('Windows', 'win32'):
image_editor = ["start"] # not tested! image_editor = ["start"] # not tested!
elif system == 'Darwin': elif system == 'Darwin':
image_editor = ["open"] image_editor = ["open"]
@@ -84,7 +88,7 @@ class EditExternally(bpy.types.Operator):
class SaveDirty(bpy.types.Operator): class SaveDirty(bpy.types.Operator):
'''Select object matching a naming pattern''' """Save all modified textures"""
bl_idname = "image.save_dirty" bl_idname = "image.save_dirty"
bl_label = "Save Dirty" bl_label = "Save Dirty"
bl_options = {'REGISTER', 'UNDO'} bl_options = {'REGISTER', 'UNDO'}
@@ -105,7 +109,7 @@ class SaveDirty(bpy.types.Operator):
class ProjectEdit(bpy.types.Operator): class ProjectEdit(bpy.types.Operator):
'''Select object matching a naming pattern''' """Edit a snapshot if the viewport in an external image editor"""
bl_idname = "image.project_edit" bl_idname = "image.project_edit"
bl_label = "Project Edit" bl_label = "Project Edit"
bl_options = {'REGISTER'} bl_options = {'REGISTER'}
@@ -170,7 +174,7 @@ class ProjectEdit(bpy.types.Operator):
class ProjectApply(bpy.types.Operator): class ProjectApply(bpy.types.Operator):
'''Select object matching a naming pattern''' """Project edited image back onto the object"""
bl_idname = "image.project_apply" bl_idname = "image.project_apply"
bl_label = "Project Apply" bl_label = "Project Apply"
bl_options = {'REGISTER'} bl_options = {'REGISTER'}

View File

@@ -750,7 +750,7 @@ def _write(context, filepath,
# Export an animation? # Export an animation?
if EXPORT_ANIMATION: if EXPORT_ANIMATION:
scene_frames = range(scene.frame_start, context.frame_end + 1) # Up to and including the end frame. scene_frames = range(scene.frame_start, scene.frame_end + 1) # Up to and including the end frame.
else: else:
scene_frames = [orig_frame] # Dont export an animation. scene_frames = [orig_frame] # Dont export an animation.
@@ -803,7 +803,7 @@ Currently the exporter lacks these features:
def save(operator, context, filepath="", def save(operator, context, filepath="",
use_triangles=False, use_triangles=False,
use_edges=False, use_edges=True,
use_normals=False, use_normals=False,
use_hq_normals=False, use_hq_normals=False,
use_uvs=True, use_uvs=True,

View File

@@ -30,14 +30,18 @@ import os
def guess_player_path(preset): def guess_player_path(preset):
import platform import platform
system = platform.system() try:
system = platform.system()
except UnicodeDecodeError:
import sys
system = sys.platform
if preset == 'BLENDER24': if preset == 'BLENDER24':
player_path = "blender" player_path = "blender"
if system == 'Darwin': if system == 'Darwin':
test_path = "/Applications/blender 2.49.app/Contents/MacOS/blender" test_path = "/Applications/blender 2.49.app/Contents/MacOS/blender"
elif system == 'Windows': elif system in ('Windows', 'win32'):
test_path = "/Program Files/Blender Foundation/Blender/blender.exe" test_path = "/Program Files/Blender Foundation/Blender/blender.exe"
if os.path.exists(test_path): if os.path.exists(test_path):

View File

@@ -235,7 +235,7 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
class ExportUVLayout(bpy.types.Operator): class ExportUVLayout(bpy.types.Operator):
'''Export the Mesh as SVG''' """Export UV layout to file"""
bl_idname = "uv.export_layout" bl_idname = "uv.export_layout"
bl_label = "Export UV Layout" bl_label = "Export UV Layout"
@@ -251,7 +251,7 @@ class ExportUVLayout(bpy.types.Operator):
name="Format", name="Format",
description="File format to export the UV layout to", description="File format to export the UV layout to",
default='PNG') default='PNG')
size = IntVectorProperty(size=2, default=(1024, 1024), min=8, max=32768) size = IntVectorProperty(size=2, default=(1024, 1024), min=8, max=32768, description="Dimensions of the exported file")
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):

View File

@@ -779,6 +779,15 @@ class WM_OT_keyconfig_activate(bpy.types.Operator):
bpy.utils.keyconfig_set(self.filepath) bpy.utils.keyconfig_set(self.filepath)
return {'FINISHED'} return {'FINISHED'}
class WM_OT_sysinfo(bpy.types.Operator):
'''Generate System Info'''
bl_idname = "wm.sysinfo"
bl_label = "System Info"
def execute(self, context):
import sys_info
sys_info.write_sysinfo(self)
return {'FINISHED'}
def register(): def register():
pass pass

View File

@@ -5,4 +5,4 @@ bpy.context.scene.render.resolution_percentage = 100
bpy.context.scene.render.pixel_aspect_x = 4 bpy.context.scene.render.pixel_aspect_x = 4
bpy.context.scene.render.pixel_aspect_y = 3 bpy.context.scene.render.pixel_aspect_y = 3
bpy.context.scene.render.fps = 24 bpy.context.scene.render.fps = 24
bpy.context.scene.render.fps_base = 1 bpy.context.scene.render.fps_base = 1.001

View File

@@ -0,0 +1,8 @@
import bpy
bpy.context.scene.render.resolution_x = 1440
bpy.context.scene.render.resolution_y = 1080
bpy.context.scene.render.resolution_percentage = 100
bpy.context.scene.render.pixel_aspect_x = 4
bpy.context.scene.render.pixel_aspect_y = 3
bpy.context.scene.render.fps = 30
bpy.context.scene.render.fps_base = 1.001

View File

@@ -0,0 +1,8 @@
import bpy
bpy.context.scene.render.resolution_x = 1440
bpy.context.scene.render.resolution_y = 1080
bpy.context.scene.render.resolution_percentage = 100
bpy.context.scene.render.pixel_aspect_x = 4
bpy.context.scene.render.pixel_aspect_y = 3
bpy.context.scene.render.fps = 25
bpy.context.scene.render.fps_base = 1

View File

@@ -1,10 +1,7 @@
# This script must be assigned to a python controller # This script must be assigned to a python controller
# where it can access the object that owns it and the sensors/actuators that it connects to. # where it can access the object that owns it and the sensors/actuators that it connects to.
# GameLogic has been added to the global namespace no need to import import bge
# for keyboard event comparison
# import GameKeys
# support for Vector(), Matrix() types and advanced functions like Matrix.Scale(...) and Matrix.Rotation(...) # support for Vector(), Matrix() types and advanced functions like Matrix.Scale(...) and Matrix.Rotation(...)
# import mathutils # import mathutils
@@ -13,7 +10,7 @@
# import Rasterizer # import Rasterizer
def main(): def main():
cont = GameLogic.getCurrentController() cont = bge.logic.getCurrentController()
# The KX_GameObject that owns this controller. # The KX_GameObject that owns this controller.
own = cont.owner own = cont.owner
@@ -57,7 +54,7 @@ def main():
# Loop through all other objects in the scene # Loop through all other objects in the scene
sce = GameLogic.getCurrentScene() sce = bge.logic.getCurrentScene()
print('Scene Objects:', sce.name) print('Scene Objects:', sce.name)
for ob in sce.objects: for ob in sce.objects:
print(' ', ob.name, ob.worldPosition) print(' ', ob.name, ob.worldPosition)

View File

@@ -1,7 +1,8 @@
import bge
def main(): def main():
cont = GameLogic.getCurrentController() cont = bge.logic.getCurrentController()
own = cont.owner own = cont.owner
sens = cont.sensors['mySensor'] sens = cont.sensors['mySensor']

View File

@@ -5,7 +5,7 @@
# * External text modules are supported as long as they are at # * External text modules are supported as long as they are at
# the same location as the blendfile or one of its libraries. # the same location as the blendfile or one of its libraries.
import GameLogic import bge
# variables defined here will only be set once when the # variables defined here will only be set once when the
# module is first imported. Set object spesific vars # module is first imported. Set object spesific vars
@@ -23,4 +23,4 @@ def main(cont):
else: else:
cont.deactivate(actu) cont.deactivate(actu)
# dont call main(GameLogic.getCurrentController()), the py controller will # dont call main(bge.logic.getCurrentController()), the py controller will

View File

@@ -211,14 +211,23 @@ class Graph(bpy.types.Operator):
import bpy import bpy
reload(graphviz_export) reload(graphviz_export)
obj = bpy.context.object obj = bpy.context.object
path = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.path.clean_name(obj.name) if(bpy.data.filepath):
path = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.path.clean_name(obj.name)
else:
import tempfile
path = tempfile.mktemp(prefix=bpy.app.tempdir) + "-" + bpy.path.clean_name(obj.name)
path_dot = path + ".dot" path_dot = path + ".dot"
path_png = path + ".png" path_png = path + ".png"
saved = graphviz_export.graph_armature(bpy.context.object, path_dot, CONSTRAINTS=False, DRIVERS=False) saved = graphviz_export.graph_armature(bpy.context.object, path_dot, CONSTRAINTS=False, DRIVERS=False)
if saved: if saved:
# if we seriously want this working everywhere we'll need some new approach # if we seriously want this working everywhere we'll need some new approach
os.system("dot -Tpng %s > %s; gnome-open %s &" % (path_dot, path_png, path_png)) os.system("dot -Tpng %r > %r" % (path_dot, path_png))
if not os.path.exists(path_png) or os.stat(path_png)[6] == 0:
self.report('ERROR', "Graphvis could not create %r check graphviz is installed" % path_png)
return {'CANCELLED'}
bpy.ops.image.external_edit(filepath=path_png)
#os.system("python /b/xdot.py '%s' &" % path_dot) #os.system("python /b/xdot.py '%s' &" % path_dot)
return {'FINISHED'} return {'FINISHED'}

View File

@@ -182,7 +182,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, bpy.types.Panel):
enable_edit = ob.mode != 'EDIT' enable_edit = ob.mode != 'EDIT'
enable_edit_value = False enable_edit_value = False
if ob.show_shape_key is False: if ob.show_only_shape_key is False:
if enable_edit or (ob.type == 'MESH' and ob.use_shape_key_edit_mode): if enable_edit or (ob.type == 'MESH' and ob.use_shape_key_edit_mode):
enable_edit_value = True enable_edit_value = True
@@ -218,7 +218,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, bpy.types.Panel):
sub = row.row(align=True) sub = row.row(align=True)
subsub = sub.row(align=True) subsub = sub.row(align=True)
subsub.active = enable_edit_value subsub.active = enable_edit_value
subsub.prop(ob, "show_shape_key", text="") subsub.prop(ob, "show_only_shape_key", text="")
subsub.prop(kb, "mute", text="") subsub.prop(kb, "mute", text="")
sub.prop(ob, "use_shape_key_edit_mode", text="") sub.prop(ob, "use_shape_key_edit_mode", text="")

View File

@@ -68,6 +68,31 @@ class OBJECT_PT_transform(ObjectButtonsPanel, bpy.types.Panel):
row.column().prop(ob, "scale") row.column().prop(ob, "scale")
layout.prop(ob, "rotation_mode") layout.prop(ob, "rotation_mode")
class OBJECT_PT_delta_transform(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Delta Transform"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.column().prop(ob, "delta_location")
if ob.rotation_mode == 'QUATERNION':
row.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
elif ob.rotation_mode == 'AXIS_ANGLE':
#row.column().label(text="Rotation")
#row.column().prop(pchan, "delta_rotation_angle", text="Angle")
#row.column().prop(pchan, "delta_rotation_axis", text="Axis")
#row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation")
row.column().label(ob, text="Not for Axis-Angle")
else:
row.column().prop(ob, "delta_rotation_euler", text="Rotation")
row.column().prop(ob, "delta_scale")
class OBJECT_PT_transform_locks(ObjectButtonsPanel, bpy.types.Panel): class OBJECT_PT_transform_locks(ObjectButtonsPanel, bpy.types.Panel):

View File

@@ -84,10 +84,11 @@ class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel):
col.operator("scene.render_layer_add", icon='ZOOMIN', text="") col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="") col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
row = layout.row()
rl = rd.layers.active rl = rd.layers.active
if rl: if rl:
layout.prop(rl, "name") row.prop(rl, "name")
row.prop(rd, "use_single_layer", text="", icon_only=True)
split = layout.split() split = layout.split()

View File

@@ -119,7 +119,7 @@ class INFO_MT_file(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_context = 'EXEC_AREA' layout.operator_context = 'EXEC_AREA'
layout.operator("wm.exit_blender", text="Quit", icon='QUIT') layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
class INFO_MT_file_import(bpy.types.Menu): class INFO_MT_file_import(bpy.types.Menu):
@@ -219,6 +219,18 @@ class INFO_MT_surface_add(bpy.types.Menu):
layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere") layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere")
layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus") layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus")
class INFO_MT_curve_handle_type_set(bpy.types.Menu):
bl_idname = "INFO_MT_curve_handle_type_set"
bl_label = "Handle Type"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("curve.handle_type_set", text="Automatic").type = "AUTOMATIC"
layout.operator("curve.handle_type_set", text="Vector").type = "VECTOR"
layout.operator("curve.handle_type_set", text="Align").type = "ALIGN"
layout.operator("curve.handle_type_set", text="Free Align").type = "FREE_ALIGN"
class INFO_MT_armature_add(bpy.types.Menu): class INFO_MT_armature_add(bpy.types.Menu):
bl_idname = "INFO_MT_armature_add" bl_idname = "INFO_MT_armature_add"
@@ -333,6 +345,7 @@ class INFO_MT_help(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = "http://www.blender.org/documentation/blender_python_api_%s/contents.html" % "_".join(str(v) for v in bpy.app.version) layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = "http://www.blender.org/documentation/blender_python_api_%s/contents.html" % "_".join(str(v) for v in bpy.app.version)
layout.operator("help.operator_cheat_sheet", icon='TEXT') layout.operator("help.operator_cheat_sheet", icon='TEXT')
layout.operator("wm.sysinfo", icon='TEXT')
layout.separator() layout.separator()
layout.operator("anim.update_data_paths", text="FCurve/Driver 2.54 fix", icon='HELP') layout.operator("anim.update_data_paths", text="FCurve/Driver 2.54 fix", icon='HELP')
layout.separator() layout.separator()

View File

@@ -1394,82 +1394,35 @@ class VIEW3D_MT_edit_mesh_select_mode(bpy.types.Menu):
class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu): class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu):
bl_label = "Extrude" bl_label = "Extrude"
_extrude_funcs = { \
"VERT": lambda layout: layout.operator("mesh.extrude_vertices_move", text="Vertices Only"),
"EDGE": lambda layout: layout.operator("mesh.extrude_edges_move", text="Edges Only"),
"FACE": lambda layout: layout.operator("mesh.extrude_faces_move", text="Individual Faces"),
"REGION": lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region"),
}
@staticmethod @staticmethod
def extrude_options(context): def extrude_options(context):
mesh = context.object.data mesh = context.object.data
select_mode = context.tool_settings.mesh_select_mode select_mode = context.tool_settings.mesh_select_mode
totface = mesh.total_face_sel menu = []
totedge = mesh.total_edge_sel if mesh.total_face_sel:
totvert = mesh.total_vert_sel menu += ["REGION", "FACE"]
if mesh.total_edge_sel and (select_mode[0] or select_mode[1]):
# the following is dependent on selection modes menu += ["EDGE"]
# we don't really want that if mesh.total_vert_sel and select_mode[0]:
# if select_mode[0]: # vert menu += ["VERT"]
# if totvert == 0:
# return ()
# elif totvert == 1:
# return (3,)
# elif totedge == 0:
# return (3,)
# elif totface == 0:
# return (2, 3)
# elif totface == 1:
# return (0, 2, 3)
# else:
# return (0, 1, 2, 3)
# elif select_mode[1]: # edge
# if totedge == 0:
# return ()
# elif totedge == 1:
# return (2,)
# elif totface == 0:
# return (2,)
# elif totface == 1:
# return (0, 2)
# else:
# return (0, 1, 2)
# elif select_mode[2]: # face
# if totface == 0:
# return ()
# elif totface == 1:
# return (0,)
# else:
# return (0, 1)
if totvert == 0:
return ()
elif totedge == 0:
return (0, 3)
elif totface == 0:
return (0, 2, 3)
else:
return (0, 1, 2, 3)
# should never get here # should never get here
return () return menu
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
def region_menu(): for menu_id in self.extrude_options(context):
layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region") self._extrude_funcs[menu_id](layout)
def face_menu():
layout.operator("mesh.extrude_faces_move", text="Individual Faces")
def edge_menu():
layout.operator("mesh.extrude_edges_move", text="Edges Only")
def vert_menu():
layout.operator("mesh.extrude_vertices_move", text="Vertices Only")
menu_funcs = region_menu, face_menu, edge_menu, vert_menu
for i in self.extrude_options(context):
func = menu_funcs[i]
func()
class VIEW3D_OT_edit_mesh_extrude_individual_move(bpy.types.Operator): class VIEW3D_OT_edit_mesh_extrude_individual_move(bpy.types.Operator):
@@ -1903,7 +1856,7 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator("armature.subdivide_multi", text="Subdivide") layout.operator("armature.subdivide", text="Subdivide")
layout.operator("armature.switch_direction", text="Switch Direction") layout.operator("armature.switch_direction", text="Switch Direction")
layout.separator() layout.separator()
@@ -1937,7 +1890,7 @@ class VIEW3D_MT_armature_specials(bpy.types.Menu):
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("armature.subdivide_multi", text="Subdivide") layout.operator("armature.subdivide", text="Subdivide")
layout.operator("armature.switch_direction", text="Switch Direction") layout.operator("armature.switch_direction", text="Switch Direction")
layout.separator() layout.separator()

View File

@@ -311,7 +311,7 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel, bpy.types.Panel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Modeling:") col.label(text="Modeling:")
col.operator("armature.extrude_move") col.operator("armature.extrude_move")
col.operator("armature.subdivide_multi", text="Subdivide") col.operator("armature.subdivide", text="Subdivide")
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Repeat:") col.label(text="Repeat:")

View File

@@ -24,23 +24,23 @@
# #
# ***** END GPL LICENSE BLOCK ***** # ***** END GPL LICENSE BLOCK *****
ADD_SUBDIRECTORY(windowmanager)
ADD_SUBDIRECTORY(editors) ADD_SUBDIRECTORY(editors)
ADD_SUBDIRECTORY(avi) ADD_SUBDIRECTORY(windowmanager)
ADD_SUBDIRECTORY(nodes)
ADD_SUBDIRECTORY(blenkernel) ADD_SUBDIRECTORY(blenkernel)
ADD_SUBDIRECTORY(modifiers)
ADD_SUBDIRECTORY(blenlib) ADD_SUBDIRECTORY(blenlib)
ADD_SUBDIRECTORY(blenloader)
ADD_SUBDIRECTORY(blenpluginapi)
ADD_SUBDIRECTORY(imbuf)
ADD_SUBDIRECTORY(gpu)
ADD_SUBDIRECTORY(makesdna)
ADD_SUBDIRECTORY(makesrna)
ADD_SUBDIRECTORY(readblenfile)
ADD_SUBDIRECTORY(render) ADD_SUBDIRECTORY(render)
ADD_SUBDIRECTORY(blenfont) ADD_SUBDIRECTORY(blenfont)
ADD_SUBDIRECTORY(blenloader)
ADD_SUBDIRECTORY(readblenfile)
ADD_SUBDIRECTORY(blenpluginapi)
ADD_SUBDIRECTORY(ikplugin) ADD_SUBDIRECTORY(ikplugin)
ADD_SUBDIRECTORY(gpu)
ADD_SUBDIRECTORY(imbuf)
ADD_SUBDIRECTORY(avi)
ADD_SUBDIRECTORY(nodes)
ADD_SUBDIRECTORY(modifiers)
ADD_SUBDIRECTORY(makesdna)
ADD_SUBDIRECTORY(makesrna)
ADD_SUBDIRECTORY(freestyle) ADD_SUBDIRECTORY(freestyle)
IF(WITH_IMAGE_OPENEXR) IF(WITH_IMAGE_OPENEXR)

View File

@@ -51,6 +51,8 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu
unsigned char *buf; unsigned char *buf;
AviBitmapInfoHeader *bi; AviBitmapInfoHeader *bi;
short bits= 32; short bits= 32;
(void)size; /* unused */
bi= (AviBitmapInfoHeader *) movie->streams[stream].sf; bi= (AviBitmapInfoHeader *) movie->streams[stream].sf;
if (bi) bits= bi->BitCount; if (bi) bits= bi->BitCount;
@@ -120,6 +122,8 @@ void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buff
int y, x, i, rowstride; int y, x, i, rowstride;
unsigned char *buf; unsigned char *buf;
(void)stream; /* unused */
*size= movie->header->Height * movie->header->Width * 3; *size= movie->header->Height * movie->header->Width * 3;
if (movie->header->Width%2) *size+= movie->header->Height; if (movie->header->Width%2) *size+= movie->header->Height;

View File

@@ -206,6 +206,8 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t
MEM_freeN (data); MEM_freeN (data);
#else /* WORDS_BIGENDIAN */ #else /* WORDS_BIGENDIAN */
(void)movie; /* unused */
(void)type; /* unused */
fwrite (datain, block, size, fp); fwrite (datain, block, size, fp);
#endif /* WORDS_BIGENDIAN */ #endif /* WORDS_BIGENDIAN */
} }

View File

@@ -144,6 +144,8 @@ static int Decode_JPEG(unsigned char *inBuffer, unsigned char *outBuffer, unsign
unsigned int y; unsigned int y;
struct jpeg_decompress_struct dinfo; struct jpeg_decompress_struct dinfo;
struct jpeg_error_mgr jerr; struct jpeg_error_mgr jerr;
(void)width; /* unused */
numbytes= 0; numbytes= 0;
@@ -324,7 +326,9 @@ static void check_and_compress_jpeg(int quality, unsigned char *outbuf, unsigned
void *avi_converter_from_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, int *size) { void *avi_converter_from_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
int deint; int deint;
unsigned char *buf; unsigned char *buf;
(void)stream; /* unused */
buf= MEM_mallocN (movie->header->Height * movie->header->Width * 3, "avi.avi_converter_from_mjpeg 1"); buf= MEM_mallocN (movie->header->Height * movie->header->Width * 3, "avi.avi_converter_from_mjpeg 1");
deint= check_and_decode_jpeg(buffer, buf, movie->header->Width, movie->header->Height, *size); deint= check_and_decode_jpeg(buffer, buf, movie->header->Width, movie->header->Height, *size);
@@ -374,10 +378,11 @@ void *avi_converter_to_mjpeg (AviMovie *movie, int stream, unsigned char *buffer
/* Compression from memory */ /* Compression from memory */
static void jpegmemdestmgr_init_destination(j_compress_ptr cinfo) { static void jpegmemdestmgr_init_destination(j_compress_ptr cinfo) {
; (void)cinfo; /* unused */
} }
static boolean jpegmemdestmgr_empty_output_buffer(j_compress_ptr cinfo) { static boolean jpegmemdestmgr_empty_output_buffer(j_compress_ptr cinfo) {
(void)cinfo; /* unused */
return TRUE; return TRUE;
} }
@@ -403,7 +408,7 @@ static void jpegmemdestmgr_build(j_compress_ptr cinfo, unsigned char *buffer, in
/* Decompression from memory */ /* Decompression from memory */
static void jpegmemsrcmgr_init_source(j_decompress_ptr dinfo) { static void jpegmemsrcmgr_init_source(j_decompress_ptr dinfo) {
; (void)dinfo;
} }
static boolean jpegmemsrcmgr_fill_input_buffer(j_decompress_ptr dinfo) { static boolean jpegmemsrcmgr_fill_input_buffer(j_decompress_ptr dinfo) {

View File

@@ -41,6 +41,8 @@
AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data) { AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data) {
int i; int i;
(void)stream; /* unused */
if (movie->header->TotalFrames != 0) /* Can't change params after we have already started writing frames */ if (movie->header->TotalFrames != 0) /* Can't change params after we have already started writing frames */
return AVI_ERROR_OPTION; return AVI_ERROR_OPTION;

View File

@@ -41,6 +41,8 @@ void *avi_converter_from_rgb32 (AviMovie *movie, int stream, unsigned char *buff
int y, x, rowstridea, rowstrideb; int y, x, rowstridea, rowstrideb;
unsigned char *buf; unsigned char *buf;
(void)stream; /* unused */
buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromrgb32buf"); buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromrgb32buf");
*size = movie->header->Height * movie->header->Width * 3; *size = movie->header->Height * movie->header->Width * 3;
@@ -65,6 +67,8 @@ void *avi_converter_to_rgb32 (AviMovie *movie, int stream, unsigned char *buffer
unsigned char *buf; unsigned char *buf;
unsigned char *to, *from; unsigned char *to, *from;
(void)stream; /* unused */
buf= MEM_mallocN (movie->header->Height * movie->header->Width * 4, "torgb32buf"); buf= MEM_mallocN (movie->header->Height * movie->header->Width * 4, "torgb32buf");
*size= movie->header->Height * movie->header->Width * 4; *size= movie->header->Height * movie->header->Width * 4;

View File

@@ -118,11 +118,13 @@ void BLF_lang_init(void)
void BLF_lang_encoding(char *str) void BLF_lang_encoding(char *str)
{ {
(void)str;
return; return;
} }
void BLF_lang_set(char *str) void BLF_lang_set(char *str)
{ {
(void)str;
return; return;
} }

View File

@@ -50,8 +50,8 @@ struct Main;
#define BLENDER_MINVERSION 250 #define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0 #define BLENDER_MINSUBVERSION 0
int BKE_read_file(struct bContext *C, char *dir, void *type_r, struct ReportList *reports); int BKE_read_file(struct bContext *C, char *dir, struct ReportList *reports);
int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, void *type_r, struct ReportList *reports); int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, struct ReportList *reports);
int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports); int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports);
void free_blender(void); void free_blender(void);

View File

@@ -220,7 +220,7 @@ void clmdSetInterruptCallBack ( int ( *f ) ( void ) );
// needed for modifier.c // needed for modifier.c
void cloth_free_modifier_extern ( struct ClothModifierData *clmd ); void cloth_free_modifier_extern ( struct ClothModifierData *clmd );
void cloth_free_modifier ( struct Object *ob, struct ClothModifierData *clmd ); void cloth_free_modifier ( struct ClothModifierData *clmd );
void cloth_init ( struct ClothModifierData *clmd ); void cloth_init ( struct ClothModifierData *clmd );
struct DerivedMesh *clothModifier_do ( struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc ); struct DerivedMesh *clothModifier_do ( struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc );

View File

@@ -52,9 +52,9 @@ typedef struct Global {
struct Main *main; struct Main *main;
/* strings: lastsaved */ /* strings: lastsaved */
char ima[256], sce[256], lib[256]; char ima[256], lib[256];
/* flag: if != 0 G.sce contains valid relative base path */ /* flag: if != 0 G.main->name contains valid relative base path */
int relbase_valid; int relbase_valid;
/* strings of recent opend files */ /* strings of recent opend files */

View File

@@ -112,7 +112,7 @@ struct ImBuf *BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser,
void BKE_image_release_ibuf(struct Image *ima, void *lock); void BKE_image_release_ibuf(struct Image *ima, void *lock);
/* returns existing Image when filename/type is same (frame optional) */ /* returns existing Image when filename/type is same (frame optional) */
struct Image *BKE_add_image_file(const char *name, int frame); struct Image *BKE_add_image_file(const char *name);
/* adds image, adds ibuf, generates color or pattern */ /* adds image, adds ibuf, generates color or pattern */
struct Image *BKE_add_image_size(unsigned int width, unsigned int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4]); struct Image *BKE_add_image_size(unsigned int width, unsigned int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);

Some files were not shown because too many files have changed in this diff Show More