forked from bartvdbraak/blender
Merge with trunk r37475.
This commit is contained in:
commit
8ff0c2e107
@ -98,6 +98,10 @@ option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effect
|
||||
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
option(WITH_PLAYER "Build Player" OFF)
|
||||
|
||||
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
|
||||
mark_as_advanced(WITH_HEADLESS)
|
||||
|
||||
# (unix defaults to OpenMP On)
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
|
||||
@ -184,6 +188,9 @@ if(APPLE)
|
||||
option(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Check for conflicting/unsupported configurations
|
||||
|
||||
if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
|
||||
endif()
|
||||
@ -205,8 +212,16 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
|
||||
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
|
||||
endif()
|
||||
|
||||
# remove old vars
|
||||
unset(WITH_INSTALL CACHE)
|
||||
if(WITH_CODEC_QUICKTIME AND MINGW)
|
||||
message(FATAL_ERROR "MINGW requires WITH_CODEC_QUICKTIME to be OFF "
|
||||
"because it is currently unsupported, remove this "
|
||||
"line if youre a developer who wants to add support.")
|
||||
endif()
|
||||
|
||||
# may as well build python module without a UI
|
||||
if(WITH_PYTHON_MODULE)
|
||||
set(WITH_HEADLESS ON)
|
||||
endif()
|
||||
|
||||
TEST_SSE_SUPPORT()
|
||||
|
||||
@ -216,6 +231,9 @@ TEST_SSE_SUPPORT()
|
||||
# linux only, not cached
|
||||
set(WITH_BINRELOC OFF)
|
||||
|
||||
# MAXOSX only, set to avoid uninitialized
|
||||
set(EXETYPE "")
|
||||
|
||||
# these are added to later on.
|
||||
set(C_WARNINGS "")
|
||||
set(CXX_WARNINGS "")
|
||||
@ -409,15 +427,19 @@ if(UNIX AND NOT APPLE)
|
||||
unset(JEMALLOC)
|
||||
endif()
|
||||
|
||||
find_package(X11 REQUIRED)
|
||||
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
|
||||
mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
|
||||
|
||||
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
|
||||
set(LLIBS "-lutil -lc -lm -lpthread -lstdc++ ${X11_X11_LIB}")
|
||||
set(LLIBS "-lutil -lc -lm -lpthread -lstdc++")
|
||||
|
||||
if(WITH_X11_XINPUT)
|
||||
list(APPEND LLIBS ${X11_Xinput_LIB})
|
||||
if(NOT WITH_HEADLESS)
|
||||
find_package(X11 REQUIRED)
|
||||
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
|
||||
mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
|
||||
|
||||
list(APPEND LLIBS ${X11_X11_LIB})
|
||||
|
||||
if(WITH_X11_XINPUT)
|
||||
list(APPEND LLIBS ${X11_Xinput_LIB})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
@ -1019,7 +1041,7 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure OpenGL.
|
||||
find_package(OpenGL)
|
||||
blender_include_dirs("${OPENGL_INCLUDE_DIR}")
|
||||
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
|
||||
# unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake
|
||||
# unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
|
||||
|
||||
|
10
GNUmakefile
10
GNUmakefile
@ -68,14 +68,12 @@ all:
|
||||
@echo Configuring Blender ...
|
||||
|
||||
if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
|
||||
mkdir -p $(BUILD_DIR) ; \
|
||||
cd $(BUILD_DIR) ; \
|
||||
cmake $(BLENDER_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) ; \
|
||||
cmake -H$(BLENDER_DIR) -B$(BUILD_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) ; \
|
||||
fi
|
||||
|
||||
@echo
|
||||
@echo Building Blender ...
|
||||
cd $(BUILD_DIR) ; make -s -j $(NPROCS) install
|
||||
make -C $(BUILD_DIR) -s -j $(NPROCS) install
|
||||
@echo
|
||||
@echo run blender from "$(BUILD_DIR)/bin/blender"
|
||||
@echo
|
||||
@ -91,7 +89,7 @@ package_pacman:
|
||||
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
|
||||
|
||||
package_archive:
|
||||
cd $(BUILD_DIR) ; make -s package_archive
|
||||
make -C $(BUILD_DIR) -s package_archive
|
||||
@echo archive in "$(BUILD_DIR)/release"
|
||||
|
||||
# forward build targets
|
||||
@ -109,6 +107,6 @@ test_cmake:
|
||||
@echo "written: test_cmake_consistency.log"
|
||||
|
||||
clean:
|
||||
cd $(BUILD_DIR) ; make clean
|
||||
make -C $(BUILD_DIR) clean
|
||||
|
||||
.PHONY: all
|
||||
|
@ -306,10 +306,6 @@ if env['BF_NO_ELBEEM'] == 1:
|
||||
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
|
||||
if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming', 'win64-vc'):
|
||||
env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup')
|
||||
env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
|
||||
|
||||
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
|
||||
B.root_build_dir = env['BF_BUILDDIR']
|
||||
B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
|
||||
@ -409,17 +405,18 @@ if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
|
||||
B.propose_priorities()
|
||||
|
||||
dobj = B.buildinfo(env, "dynamic") + B.resources
|
||||
creob = B.creator(env)
|
||||
thestatlibs, thelibincs = B.setup_staticlibs(env)
|
||||
thesyslibs = B.setup_syslibs(env)
|
||||
|
||||
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
|
||||
env.BlenderProg(B.root_build_dir, "blender", mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||
env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||
if env['WITH_BF_PLAYER']:
|
||||
playerlist = B.create_blender_liblist(env, 'player')
|
||||
playerlist += B.create_blender_liblist(env, 'player2')
|
||||
playerlist += B.create_blender_liblist(env, 'intern')
|
||||
playerlist += B.create_blender_liblist(env, 'extern')
|
||||
env.BlenderProg(B.root_build_dir, "blenderplayer", playerlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
||||
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
||||
|
||||
##### Now define some targets
|
||||
|
||||
|
@ -18,10 +18,18 @@ set(_Python_ABI_FLAGS
|
||||
"m;mu;u; ")
|
||||
|
||||
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
|
||||
set(_Python_PATHS
|
||||
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}" "/opt/py${_PYTHON_VERSION_NO_DOTS}" "/usr" "/usr/local")
|
||||
|
||||
if(NOT DEFINED PYTHON_INCLUDE_DIRS)
|
||||
set(_Python_PATHS
|
||||
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
|
||||
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
|
||||
"/usr"
|
||||
"/usr/local"
|
||||
)
|
||||
|
||||
if(NOT DEFINED PYTHON_INCLUDE_DIRS OR
|
||||
NOT DEFINED PYTHON_LIBRARY OR
|
||||
NOT DEFINED PYTHON_LIBPATH)
|
||||
|
||||
message(STATUS "Looking for include Python.h")
|
||||
set(_Found_PYTHON_H OFF)
|
||||
|
||||
@ -53,20 +61,29 @@ if(NOT DEFINED PYTHON_INCLUDE_DIRS)
|
||||
if(NOT _Found_PYTHON_H)
|
||||
message(FATAL_ERROR "Python.h not found")
|
||||
endif()
|
||||
|
||||
unset(_Found_PYTHON_H)
|
||||
unset(_Python_HEADER)
|
||||
unset(_CURRENT_ABI_FLAGS)
|
||||
unset(_CURRENT_PATH)
|
||||
|
||||
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_INCLUDE_DIRS)
|
||||
set(PYTHON_LIBRARY "python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_LIBRARY)
|
||||
set(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_LIBPATH)
|
||||
# set(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
||||
endif()
|
||||
|
||||
unset(_Python_ABI_FLAGS)
|
||||
unset(_Python_PATHS)
|
||||
|
||||
#=============================================================================
|
||||
# now the python versions are found
|
||||
|
||||
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_INCLUDE_DIRS)
|
||||
set(PYTHON_LIBRARY "python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_LIBRARY)
|
||||
set(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_LIBPATH)
|
||||
# set(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
||||
|
||||
if(NOT EXISTS "${PYTHON_INCLUDE_DIRS}/Python.h")
|
||||
message(FATAL_ERROR " Missing python header: ${PYTHON_INCLUDE_DIRS}/Python.h")
|
||||
endif()
|
||||
|
@ -23,15 +23,16 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
IGNORE = \
|
||||
"/test/",\
|
||||
"/decimate_glut_test/",\
|
||||
"/BSP_GhostTest/",\
|
||||
"/release/",\
|
||||
"/xembed/",\
|
||||
"/decimation/intern/future/",\
|
||||
"/TerraplayNetwork/",\
|
||||
"/ik_glut_test/"
|
||||
IGNORE = (
|
||||
"/test/",
|
||||
"/decimate_glut_test/",
|
||||
"/BSP_GhostTest/",
|
||||
"/release/",
|
||||
"/xembed/",
|
||||
"/decimation/intern/future/",
|
||||
"/TerraplayNetwork/",
|
||||
"/ik_glut_test/",
|
||||
)
|
||||
|
||||
import os
|
||||
from os.path import join, dirname, normpath, abspath, splitext
|
||||
@ -104,7 +105,7 @@ def cmake_get_src(f):
|
||||
found = True
|
||||
break
|
||||
|
||||
if "list(APPEND SRC" in l:
|
||||
if "list(APPEND SRC" in l or ('list(APPEND ' in l and l.endswith("SRC")):
|
||||
if l.endswith(")"):
|
||||
raise Exception("strict formatting not kept 'list(APPEND SRC...)' on 1 line %s:%d" % (f, i))
|
||||
found = True
|
||||
@ -136,7 +137,9 @@ def cmake_get_src(f):
|
||||
if not l:
|
||||
pass
|
||||
elif l.startswith("$"):
|
||||
print("Cant use var '%s' %s:%d" % (l, f, i))
|
||||
# assume if it ends with SRC we know about it
|
||||
if not l.split("}")[0].endswith("SRC"):
|
||||
print("Can't use var '%s' %s:%d" % (l, f, i))
|
||||
elif len(l.split()) > 1:
|
||||
raise Exception("Multi-line define '%s' %s:%d" % (l, f, i))
|
||||
else:
|
||||
|
@ -17,7 +17,7 @@ cd ~/blender-svn/build-cmake
|
||||
|
||||
# cmake without copying files for fast rebuilds
|
||||
# the files from svn will be used in place
|
||||
cmake ../blender -DWITH_INSTALL:BOOL=FALSE
|
||||
cmake ../blender
|
||||
|
||||
# make blender, will take some time
|
||||
make
|
||||
|
@ -5,22 +5,28 @@
|
||||
# use it instead of include_directories()
|
||||
macro(blender_include_dirs
|
||||
includes)
|
||||
|
||||
foreach(inc ${ARGV})
|
||||
get_filename_component(abs_inc ${inc} ABSOLUTE)
|
||||
list(APPEND all_incs ${abs_inc})
|
||||
set(_ALL_INCS "")
|
||||
foreach(_INC ${ARGV})
|
||||
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
|
||||
list(APPEND _ALL_INCS ${_ABS_INC})
|
||||
endforeach()
|
||||
include_directories(${all_incs})
|
||||
include_directories(${_ALL_INCS})
|
||||
unset(_INC)
|
||||
unset(_ABS_INC)
|
||||
unset(_ALL_INCS)
|
||||
endmacro()
|
||||
|
||||
macro(blender_include_dirs_sys
|
||||
includes)
|
||||
|
||||
foreach(inc ${ARGV})
|
||||
get_filename_component(abs_inc ${inc} ABSOLUTE)
|
||||
list(APPEND all_incs ${abs_inc})
|
||||
set(_ALL_INCS "")
|
||||
foreach(_INC ${ARGV})
|
||||
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
|
||||
list(APPEND _ALL_INCS ${_ABS_INC})
|
||||
endforeach()
|
||||
include_directories(SYSTEM ${all_incs})
|
||||
include_directories(SYSTEM ${_ALL_INCS})
|
||||
unset(_INC)
|
||||
unset(_ABS_INC)
|
||||
unset(_ALL_INCS)
|
||||
endmacro()
|
||||
|
||||
macro(blender_source_group
|
||||
@ -29,14 +35,17 @@ macro(blender_source_group
|
||||
# Group by location on disk
|
||||
source_group("Source Files" FILES CMakeLists.txt)
|
||||
|
||||
foreach(SRC ${sources})
|
||||
get_filename_component(SRC_EXT ${SRC} EXT)
|
||||
if(${SRC_EXT} MATCHES ".h" OR ${SRC_EXT} MATCHES ".hpp")
|
||||
source_group("Header Files" FILES ${SRC})
|
||||
foreach(_SRC ${sources})
|
||||
get_filename_component(_SRC_EXT ${_SRC} EXT)
|
||||
if(${_SRC_EXT} MATCHES ".h" OR ${_SRC_EXT} MATCHES ".hpp")
|
||||
source_group("Header Files" FILES ${_SRC})
|
||||
else()
|
||||
source_group("Source Files" FILES ${SRC})
|
||||
source_group("Source Files" FILES ${_SRC})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
unset(_SRC)
|
||||
unset(_SRC_EXT)
|
||||
endmacro()
|
||||
|
||||
|
||||
@ -196,10 +205,11 @@ macro(setup_liblinks
|
||||
endif()
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
if(WIN32 AND NOT UNIX)
|
||||
foreach(loop_var ${OPENEXR_LIB})
|
||||
target_link_libraries(${target} debug ${loop_var}_d)
|
||||
target_link_libraries(${target} optimized ${loop_var})
|
||||
foreach(_LOOP_VAR ${OPENEXR_LIB})
|
||||
target_link_libraries(${target} debug ${_LOOP_VAR}_d)
|
||||
target_link_libraries(${target} optimized ${_LOOP_VAR})
|
||||
endforeach()
|
||||
unset(_LOOP_VAR)
|
||||
else()
|
||||
target_link_libraries(${target} ${OPENEXR_LIB})
|
||||
endif()
|
||||
@ -212,10 +222,11 @@ macro(setup_liblinks
|
||||
endif()
|
||||
if(WITH_OPENCOLLADA)
|
||||
if(WIN32 AND NOT UNIX)
|
||||
foreach(loop_var ${OPENCOLLADA_LIB})
|
||||
target_link_libraries(${target} debug ${loop_var}_d)
|
||||
target_link_libraries(${target} optimized ${loop_var})
|
||||
foreach(_LOOP_VAR ${OPENCOLLADA_LIB})
|
||||
target_link_libraries(${target} debug ${_LOOP_VAR}_d)
|
||||
target_link_libraries(${target} optimized ${_LOOP_VAR})
|
||||
endforeach()
|
||||
unset(_LOOP_VAR)
|
||||
target_link_libraries(${target} debug ${PCRE_LIB}_d)
|
||||
target_link_libraries(${target} optimized ${PCRE_LIB})
|
||||
if(EXPAT_LIB)
|
||||
@ -472,4 +483,13 @@ macro(blender_project_hack_post)
|
||||
|
||||
unset(_reset_standard_cflags_rel)
|
||||
unset(_reset_standard_cxxflags_rel)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# workaround for omission in cmake 2.8.4's GNU.cmake, fixed in 2.8.5
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
if(NOT DARWIN)
|
||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
|
@ -35,7 +35,7 @@ BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
@ -118,7 +118,7 @@ BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype2ST'
|
||||
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
|
||||
|
||||
WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
|
||||
WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME
|
||||
BF_QUICKTIME = LIBDIR + '/QTDevWin'
|
||||
BF_QUICKTIME_INC = '${BF_QUICKTIME}/CIncludes'
|
||||
BF_QUICKTIME_LIB = 'qtmlClient'
|
||||
|
@ -170,7 +170,7 @@ CCFLAGS = ['/nologo', '/Ob1', '/J', '/W0', '/Gd', '/we4013', '/wd4018', '/wd4244
|
||||
CXXFLAGS = ['/EHsc']
|
||||
BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast']
|
||||
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od']
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-DFTGL_LIBRARY_STATIC', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
REL_CFLAGS = ['-O2', '-DNDEBUG']
|
||||
|
@ -258,7 +258,10 @@ def setup_syslibs(lenv):
|
||||
syslibs += Split(lenv['BF_PTHREADS_LIB'])
|
||||
if lenv['WITH_BF_COLLADA']:
|
||||
syslibs.append(lenv['BF_PCRE_LIB'])
|
||||
syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
|
||||
if lenv['BF_DEBUG']:
|
||||
syslibs += [colladalib+'_d' for colladalib in Split(lenv['BF_OPENCOLLADA_LIB'])]
|
||||
else:
|
||||
syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
|
||||
syslibs.append(lenv['BF_EXPAT_LIB'])
|
||||
|
||||
if not lenv['WITH_BF_STATICLIBSAMPLERATE']:
|
||||
@ -287,6 +290,50 @@ def propose_priorities():
|
||||
print "\t\t",new_priority, v
|
||||
new_priority += 5
|
||||
|
||||
# emits the necessary file objects for creator.c, to be used in creating
|
||||
# the final blender executable
|
||||
def creator(env):
|
||||
sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources
|
||||
|
||||
incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']]
|
||||
|
||||
defs = []
|
||||
if env['WITH_BF_QUICKTIME']:
|
||||
incs.append(env['BF_QUICKTIME_INC'])
|
||||
defs.append('WITH_QUICKTIME')
|
||||
|
||||
if env['WITH_BF_BINRELOC']:
|
||||
incs.append('#/extern/binreloc/include')
|
||||
defs.append('WITH_BINRELOC')
|
||||
|
||||
if env['WITH_BF_OPENEXR']:
|
||||
defs.append('WITH_OPENEXR')
|
||||
|
||||
if env['WITH_BF_TIFF']:
|
||||
defs.append('WITH_TIFF')
|
||||
|
||||
if not env['WITH_BF_SDL']:
|
||||
defs.append('DISABLE_SDL')
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
incs.append('#/source/blender/python')
|
||||
defs.append('WITH_PYTHON')
|
||||
if env['BF_DEBUG']:
|
||||
defs.append('_DEBUG')
|
||||
|
||||
if env['BF_BUILDINFO']:
|
||||
defs.append('BUILD_DATE')
|
||||
defs.append('NAN_BUILDINFO')
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
incs.append(env['BF_PTHREADS_INC'])
|
||||
|
||||
env.Append(CPPDEFINES=defs)
|
||||
env.Append(CPPPATH=incs)
|
||||
obj = [env.Object(root_build_dir+'source/creator/creator/creator', ['#source/creator/creator.c'])]
|
||||
|
||||
return obj
|
||||
|
||||
## TODO: see if this can be made in an emitter
|
||||
def buildinfo(lenv, build_type):
|
||||
"""
|
||||
@ -324,7 +371,7 @@ def buildinfo(lenv, build_type):
|
||||
|
||||
lenv.Append (CPPPATH = [root_build_dir+'source/blender/blenkernel'])
|
||||
|
||||
obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type, [root_build_dir+'source/creator/buildinfo.c'])]
|
||||
obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type, ['#source/creator/buildinfo.c'])]
|
||||
|
||||
return obj
|
||||
|
||||
@ -714,23 +761,19 @@ class BlenderEnvironment(SConsEnvironment):
|
||||
global vcp
|
||||
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
|
||||
lenv = self.Clone()
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'):
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
lenv.Append(LINKFLAGS = ['/FORCE:MULTIPLE'])
|
||||
if lenv['BF_DEBUG']:
|
||||
lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb'])
|
||||
lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb','/NODEFAULTLIB:libcmt'])
|
||||
if lenv['OURPLATFORM']=='linux2':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
if lenv['OURPLATFORM']=='sunos5':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
if lenv['CXX'].endswith('CC'):
|
||||
lenv.Replace(LINK = '$CXX')
|
||||
if lenv['OURPLATFORM']=='darwin':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH "BLENDER" "1" "April 05, 2011" "Blender Blender 2\&.56 (sub 6)"
|
||||
.TH "BLENDER" "1" "June 03, 2011" "Blender Blender 2\&.57 (sub 1)"
|
||||
|
||||
.SH NAME
|
||||
blender \- a 3D modelling and rendering package
|
||||
@ -15,7 +15,7 @@ Use Blender to create TV commercials, to make technical visualizations, business
|
||||
http://www.blender.org
|
||||
.SH OPTIONS
|
||||
|
||||
Blender 2.56 (sub 6)
|
||||
Blender 2.57 (sub 1)
|
||||
Usage: blender [args ...] [file] [args ...]
|
||||
.br
|
||||
.SS "Render Options:"
|
||||
@ -160,6 +160,12 @@ Force opening without borders
|
||||
Open with lower left corner at <sx>, <sy> and width and height as <w>, <h>
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-con or \-\-start\-console
|
||||
.br
|
||||
Start with the console window open (ignored if \-b is set)
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.SS "Game Engine Specific Options:"
|
||||
@ -191,7 +197,7 @@ Turn debugging on
|
||||
.br
|
||||
* Disables mouse grab (to interact with a debugger in some cases)
|
||||
.br
|
||||
* Keeps python sys.stdin rather then setting it to None
|
||||
* Keeps python sys.stdin rather than setting it to None
|
||||
.br
|
||||
|
||||
.TP
|
||||
@ -210,12 +216,6 @@ Skip reading the "startup.blend" in the users home directory
|
||||
|
||||
.IP
|
||||
|
||||
.TP
|
||||
.B \-\-env\-system\-config
|
||||
.br
|
||||
Set the BLENDER_SYSTEM_CONFIG environment variable
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-\-env\-system\-datafiles
|
||||
.br
|
||||
@ -281,7 +281,7 @@ Print this help text and exit
|
||||
.TP
|
||||
.B \-y or \-\-enable\-autoexec
|
||||
.br
|
||||
Enable automatic python script execution (default)
|
||||
Enable automatic python script execution, (default)
|
||||
.br
|
||||
|
||||
.TP
|
||||
@ -376,7 +376,6 @@ Arguments are executed in the order they are given. eg
|
||||
.br
|
||||
.SH "ENVIRONMENT VARIABLES"
|
||||
\fIBLENDER_USER_CONFIG\fR Directory for user configuration files.
|
||||
\fIBLENDER_SYSTEM_CONFIG\fR Directory for system wide configuration files.
|
||||
\fIBLENDER_USER_SCRIPTS\fR Directory for user scripts.
|
||||
\fIBLENDER_SYSTEM_SCRIPTS\fR Directory for system wide scripts.
|
||||
\fIBLENDER_USER_DATAFILES\fR Directory for user data files (icons, translations, ..).
|
||||
|
@ -345,9 +345,9 @@ Utility functions
|
||||
|
||||
.. function:: getAverageFrameRate()
|
||||
|
||||
Gets the estimated average framerate
|
||||
Gets the estimated/average framerate for all the active scenes, not only the current scene.
|
||||
|
||||
:return: The estimed average framerate in frames per second
|
||||
:return: The estimated average framerate in frames per second
|
||||
:rtype: float
|
||||
|
||||
.. function:: getBlendFileList(path = "//")
|
||||
|
@ -710,6 +710,12 @@ Game Engine bge.types Module
|
||||
|
||||
Applies changes to a camera.
|
||||
|
||||
.. attribute:: damping
|
||||
|
||||
strength of of the camera following movement.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: min
|
||||
|
||||
minimum distance to the target object maintained by the actuator.
|
||||
|
8
intern/elbeem/extern/elbeem.h
vendored
8
intern/elbeem/extern/elbeem.h
vendored
@ -77,6 +77,10 @@ typedef struct elbeemSimulationSettings {
|
||||
/* boundary types and settings for domain walls */
|
||||
short domainobsType;
|
||||
float domainobsPartslip;
|
||||
|
||||
/* what surfaces to generate */
|
||||
int mFsSurfGenSetting;
|
||||
|
||||
/* generate speed vectors for vertices (e.g. for image based motion blur)*/
|
||||
short generateVertexVectors;
|
||||
/* strength of surface smoothing */
|
||||
@ -108,10 +112,12 @@ typedef struct elbeemSimulationSettings {
|
||||
#define OB_FLUIDSIM_PARTICLE 64
|
||||
#define OB_FLUIDSIM_CONTROL 128
|
||||
|
||||
// defines for elbeemMesh->obstacleType below
|
||||
// defines for elbeemMesh->obstacleType below (low bits) high bits (>=64) are reserved for mFsSurfGenSetting flags which are defined in solver_class.h
|
||||
#define FLUIDSIM_OBSTACLE_NOSLIP 1
|
||||
#define FLUIDSIM_OBSTACLE_PARTSLIP 2
|
||||
#define FLUIDSIM_OBSTACLE_FREESLIP 3
|
||||
#define FLUIDSIM_FSSG_NOOBS 64
|
||||
|
||||
|
||||
#define OB_VOLUMEINIT_VOLUME 1
|
||||
#define OB_VOLUMEINIT_SHELL 2
|
||||
|
@ -182,6 +182,9 @@ int SimulationObject::initializeLbmSimulation(ntlRenderGlobals *glob)
|
||||
// set initial particles
|
||||
mpParts->setNumInitialParticles(mpElbeemSettings->numTracerParticles);
|
||||
|
||||
// surface generation flag
|
||||
mpLbm->setSurfGenSettings(mpElbeemSettings->mFsSurfGenSetting);
|
||||
|
||||
string dinitType = string("no");
|
||||
if (mpElbeemSettings->domainobsType==FLUIDSIM_OBSTACLE_PARTSLIP) dinitType = string("part");
|
||||
else if(mpElbeemSettings->domainobsType==FLUIDSIM_OBSTACLE_FREESLIP) dinitType = string("free");
|
||||
|
@ -308,6 +308,9 @@ class LbmFsgrSolver :
|
||||
//! for raytracing, preprocess
|
||||
void prepareVisualization( void );
|
||||
|
||||
/* surface generation settings */
|
||||
virtual void setSurfGenSettings(short value);
|
||||
|
||||
protected:
|
||||
|
||||
//! internal quick print function (for debugging)
|
||||
|
@ -538,6 +538,15 @@ void LbmFsgrSolver::parseAttrList()
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* (part of enabling chapter 6 of "Free Surface Flows with Moving and Deforming Objects for LBM")
|
||||
*****************************************************************************/
|
||||
void LbmFsgrSolver::setSurfGenSettings(short value)
|
||||
{
|
||||
mFsSurfGenSetting = value;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Initialize omegas and forces on all levels (for init/timestep change)
|
||||
*****************************************************************************/
|
||||
|
@ -271,6 +271,9 @@ class LbmSolverInterface
|
||||
/*! debug object display */
|
||||
virtual vector<ntlGeometryObject*> getDebugObjects() { vector<ntlGeometryObject*> empty(0); return empty; }
|
||||
|
||||
/* surface generation settings */
|
||||
virtual void setSurfGenSettings(short value) = 0;
|
||||
|
||||
#if LBM_USE_GUI==1
|
||||
/*! show simulation info */
|
||||
virtual void debugDisplay(int) = 0;
|
||||
|
@ -89,7 +89,42 @@ set(SRC
|
||||
intern/GHOST_WindowManager.h
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
if(WITH_HEADLESS)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerNULL.h
|
||||
intern/GHOST_SystemNULL.h
|
||||
intern/GHOST_WindowNULL.h
|
||||
)
|
||||
add_definitions(-DWITH_HEADLESS)
|
||||
|
||||
# ack, this is still system dependant
|
||||
if(APPLE)
|
||||
if(WITH_COCOA)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsCocoa.mm
|
||||
intern/GHOST_SystemPathsCocoa.h
|
||||
)
|
||||
else()
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsCarbon.cpp
|
||||
intern/GHOST_SystemPathsCarbon.h
|
||||
)
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsX11.cpp
|
||||
intern/GHOST_SystemPathsX11.h
|
||||
)
|
||||
elseif(WIN32)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsWin32.cpp
|
||||
|
||||
intern/GHOST_SystemPathsWin32.h
|
||||
)
|
||||
endif()
|
||||
|
||||
elseif(APPLE)
|
||||
if(WITH_COCOA)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerCocoa.mm
|
||||
|
51
intern/ghost/intern/GHOST_DisplayManagerNULL.h
Normal file
51
intern/ghost/intern/GHOST_DisplayManagerNULL.h
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* $Id$
|
||||
* ***** 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.
|
||||
*
|
||||
* Contributor(s): Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file ghost/intern/GHOST_DisplayManagerNULL.h
|
||||
* \ingroup GHOST
|
||||
* Declaration of GHOST_DisplayManagerNULL class.
|
||||
*/
|
||||
|
||||
#ifndef _GHOST_DISPLAY_MANAGER_NULL_H_
|
||||
#define _GHOST_DISPLAY_MANAGER_NULL_H_
|
||||
|
||||
#include "GHOST_DisplayManager.h"
|
||||
#include "GHOST_SystemNULL.h"
|
||||
|
||||
class GHOST_SystemNULL;
|
||||
|
||||
class GHOST_DisplayManagerNULL : public GHOST_DisplayManager
|
||||
{
|
||||
public:
|
||||
GHOST_DisplayManagerNULL( GHOST_SystemNULL *system ) : GHOST_DisplayManager(), m_system(system) { /* nop */ }
|
||||
GHOST_TSuccess getNumDisplays( GHOST_TUns8& numDisplays ) const { return GHOST_kFailure; }
|
||||
GHOST_TSuccess getNumDisplaySettings( GHOST_TUns8 display, GHOST_TInt32& numSettings ) const{ return GHOST_kFailure; }
|
||||
GHOST_TSuccess getDisplaySetting( GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting ) const { return GHOST_kFailure; }
|
||||
GHOST_TSuccess getCurrentDisplaySetting( GHOST_TUns8 display, GHOST_DisplaySetting& setting ) const { return getDisplaySetting(display,GHOST_TInt32(0),setting); }
|
||||
GHOST_TSuccess setCurrentDisplaySetting( GHOST_TUns8 display, const GHOST_DisplaySetting& setting ){ return GHOST_kSuccess; }
|
||||
|
||||
private :
|
||||
GHOST_SystemNULL * m_system;
|
||||
};
|
||||
|
||||
#endif /* _GHOST_DISPLAY_MANAGER_NULL_H_ */
|
@ -41,7 +41,9 @@
|
||||
|
||||
#include "GHOST_ISystem.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef WITH_HEADLESS
|
||||
# include "GHOST_SystemNULL.h"
|
||||
#elif defined(WIN32)
|
||||
# include "GHOST_SystemWin32.h"
|
||||
#else
|
||||
# ifdef __APPLE__
|
||||
@ -63,7 +65,9 @@ GHOST_TSuccess GHOST_ISystem::createSystem()
|
||||
{
|
||||
GHOST_TSuccess success;
|
||||
if (!m_system) {
|
||||
#ifdef WIN32
|
||||
#ifdef WITH_HEADLESS
|
||||
m_system = new GHOST_SystemNULL();
|
||||
#elif defined(WIN32)
|
||||
m_system = new GHOST_SystemWin32 ();
|
||||
#else
|
||||
# ifdef __APPLE__
|
||||
|
@ -81,7 +81,9 @@ GHOST_NDOFManager::deviceOpen(GHOST_IWindow* window,
|
||||
#if 0
|
||||
printf("%i client \n", Pid);
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(WITH_HEADLESS)
|
||||
/* do nothing */
|
||||
#elif defined(_WIN32) || defined(__APPLE__)
|
||||
m_DeviceHandle = ndofDeviceOpen((void *)¤tNdofValues);
|
||||
#else
|
||||
GHOST_SystemX11 *sys;
|
||||
|
93
intern/ghost/intern/GHOST_SystemNULL.h
Normal file
93
intern/ghost/intern/GHOST_SystemNULL.h
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* $Id$
|
||||
* ***** 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.
|
||||
*
|
||||
* Contributor(s): Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file ghost/intern/GHOST_SystemNULL.h
|
||||
* \ingroup GHOST
|
||||
* Declaration of GHOST_SystemNULL class.
|
||||
*/
|
||||
|
||||
#ifndef _GHOST_SYSTEM_NULL_H_
|
||||
#define _GHOST_SYSTEM_NULL_H_
|
||||
|
||||
#include "GHOST_System.h"
|
||||
#include "../GHOST_Types.h"
|
||||
#include "GHOST_DisplayManagerNULL.h"
|
||||
#include "GHOST_WindowNULL.h"
|
||||
|
||||
class GHOST_WindowNULL;
|
||||
|
||||
class GHOST_SystemNULL : public GHOST_System {
|
||||
public:
|
||||
|
||||
GHOST_SystemNULL( ) : GHOST_System() { /* nop */ }
|
||||
~GHOST_SystemNULL() { /* nop */ }
|
||||
bool processEvents(bool waitForEvent) { return false; }
|
||||
int toggleConsole(int action) { return 0; }
|
||||
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys& keys) const { return GHOST_kSuccess; }
|
||||
GHOST_TSuccess getButtons(GHOST_Buttons& buttons) const { return GHOST_kSuccess; }
|
||||
GHOST_TUns8 *getClipboard(bool selection) const { return NULL; }
|
||||
void putClipboard(GHOST_TInt8 *buffer, bool selection) const { /* nop */ }
|
||||
GHOST_TUns64 getMilliSeconds( ) const { return 0; }
|
||||
GHOST_TUns8 getNumDisplays( ) const { return GHOST_TUns8(1); }
|
||||
GHOST_TSuccess getCursorPosition( GHOST_TInt32& x, GHOST_TInt32& y ) const { return GHOST_kFailure; }
|
||||
GHOST_TSuccess setCursorPosition( GHOST_TInt32 x, GHOST_TInt32 y ) { return GHOST_kFailure; }
|
||||
void getMainDisplayDimensions( GHOST_TUns32& width, GHOST_TUns32& height ) const { /* nop */ }
|
||||
|
||||
GHOST_TSuccess init() {
|
||||
GHOST_TSuccess success = GHOST_System::init();
|
||||
|
||||
if (success) {
|
||||
m_displayManager = new GHOST_DisplayManagerNULL(this);
|
||||
|
||||
if (m_displayManager) {
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
GHOST_IWindow* createWindow(
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
bool stereoVisual,
|
||||
const GHOST_TUns16 numOfAASamples,
|
||||
const GHOST_TEmbedderWindowID parentWindow
|
||||
) {
|
||||
return new GHOST_WindowNULL (this, title, left, top, width, height, state, parentWindow, type, stereoVisual, 1);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
96
intern/ghost/intern/GHOST_WindowNULL.h
Normal file
96
intern/ghost/intern/GHOST_WindowNULL.h
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* $Id$
|
||||
* ***** 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.
|
||||
*
|
||||
* Contributor(s): Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file ghost/intern/GHOST_WindowNULL.h
|
||||
* \ingroup GHOST
|
||||
* Declaration of GHOST_WindowNULL class.
|
||||
*/
|
||||
|
||||
#ifndef _GHOST_WINDOWNULL_H_
|
||||
#define _GHOST_WINDOWNULL_H_
|
||||
|
||||
#include "GHOST_Window.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
class STR_String;
|
||||
class GHOST_SystemNULL;
|
||||
|
||||
class GHOST_WindowNULL : public GHOST_Window
|
||||
{
|
||||
public:
|
||||
const GHOST_TabletData* GetTabletData() { return NULL; }
|
||||
|
||||
GHOST_WindowNULL(
|
||||
GHOST_SystemNULL *system,
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
const GHOST_TEmbedderWindowID parentWindow,
|
||||
GHOST_TDrawingContextType type,
|
||||
const bool stereoVisual,
|
||||
const GHOST_TUns16 numOfAASamples
|
||||
) :
|
||||
GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples),
|
||||
m_system (system)
|
||||
{
|
||||
setTitle(title);
|
||||
}
|
||||
|
||||
protected:
|
||||
GHOST_TSuccess installDrawingContext( GHOST_TDrawingContextType type ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess removeDrawingContext( ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setWindowCursorGrab( GHOST_TGrabCursorMode mode ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setWindowCursorShape( GHOST_TStandardCursor shape ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY ) { return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color ){ return GHOST_kSuccess; }
|
||||
|
||||
bool getValid( ) const { return true; }
|
||||
void setTitle( const STR_String& title ){ /* nothing */ }
|
||||
void getTitle( STR_String& title ) const { title= "untitled"; }
|
||||
void getWindowBounds( GHOST_Rect& bounds ) const { getClientBounds(bounds); }
|
||||
void getClientBounds( GHOST_Rect& bounds ) const { /* nothing */ }
|
||||
GHOST_TSuccess setClientWidth( GHOST_TUns32 width ){ return GHOST_kFailure; }
|
||||
GHOST_TSuccess setClientHeight( GHOST_TUns32 height ){ return GHOST_kFailure; }
|
||||
GHOST_TSuccess setClientSize( GHOST_TUns32 width, GHOST_TUns32 height ){ return GHOST_kFailure; }
|
||||
void screenToClient( GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY ) const { outX = inX; outY = inY; }
|
||||
void clientToScreen( GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY ) const { outX = inX; outY = inY; }
|
||||
GHOST_TSuccess swapBuffers( ){ return GHOST_kFailure; }
|
||||
GHOST_TSuccess activateDrawingContext( ){ return GHOST_kFailure; }
|
||||
~GHOST_WindowNULL( ){ /* nothing */ }
|
||||
GHOST_TSuccess setWindowCursorVisibility( bool visible ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setState(GHOST_TWindowState state) { return GHOST_kSuccess; }
|
||||
GHOST_TWindowState getState() const { return GHOST_kWindowStateNormal; }
|
||||
GHOST_TSuccess invalidate() { return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setOrder(GHOST_TWindowOrder order) { return GHOST_kSuccess; }
|
||||
|
||||
|
||||
private :
|
||||
GHOST_SystemNULL * m_system;
|
||||
};
|
||||
|
||||
|
||||
#endif // _GHOST_WINDOWNULL_H_
|
@ -37,6 +37,11 @@ def is_dict(obj):
|
||||
return hasattr(obj, 'keys') and hasattr(getattr(obj, 'keys'), '__call__')
|
||||
|
||||
|
||||
def is_struct_seq(obj):
|
||||
"""Returns whether obj is a structured sequence subclass: sys.float_info"""
|
||||
return isinstance(obj, tuple) and hasattr(obj, 'n_fields')
|
||||
|
||||
|
||||
def complete_names(word, namespace):
|
||||
"""Complete variable names or attributes
|
||||
|
||||
@ -174,7 +179,7 @@ def complete(word, namespace, private=True):
|
||||
if type(obj) in (bool, float, int, str):
|
||||
return []
|
||||
# an extra char '[', '(' or '.' will be added
|
||||
if hasattr(obj, '__getitem__'):
|
||||
if hasattr(obj, '__getitem__') and not is_struct_seq(obj):
|
||||
# list or dictionary
|
||||
matches = complete_indices(word, namespace, obj)
|
||||
elif hasattr(obj, '__call__'):
|
||||
|
@ -120,15 +120,25 @@ def expand(line, cursor, namespace, private=True):
|
||||
from . import complete_calltip
|
||||
matches, word, scrollback = complete_calltip.complete(line,
|
||||
cursor, namespace)
|
||||
prefix = os.path.commonprefix(matches)[len(word):]
|
||||
no_calltip = False
|
||||
else:
|
||||
matches, word = complete(line, cursor, namespace, private)
|
||||
prefix = os.path.commonprefix(matches)[len(word):]
|
||||
if len(matches) == 1:
|
||||
scrollback = ''
|
||||
else:
|
||||
scrollback = ' '.join([m.split('.')[-1] for m in matches])
|
||||
# causes blender bug [#27495] since string keys may contain '.'
|
||||
# scrollback = ' '.join([m.split('.')[-1] for m in matches])
|
||||
word_prefix = word + prefix
|
||||
scrollback = ' '.join(
|
||||
[m[len(word_prefix):]
|
||||
if (word_prefix and m.startswith(word_prefix))
|
||||
else m.split('.')[-1]
|
||||
for m in matches])
|
||||
|
||||
no_calltip = True
|
||||
prefix = os.path.commonprefix(matches)[len(word):]
|
||||
|
||||
if prefix:
|
||||
line = line[:cursor] + prefix + line[cursor:]
|
||||
cursor += len(prefix)
|
||||
|
@ -80,7 +80,7 @@ def get_console(console_id):
|
||||
if console_data:
|
||||
console, stdout, stderr = console_data
|
||||
|
||||
# XXX, bug in python 3.1.2 ? (worked in 3.1.1)
|
||||
# XXX, bug in python 3.1.2, 3.2 ? (worked in 3.1.1)
|
||||
# seems there is no way to clear StringIO objects for writing, have to make new ones each time.
|
||||
import io
|
||||
stdout = io.StringIO()
|
||||
|
@ -22,10 +22,9 @@ from mathutils import Vector
|
||||
import bpy
|
||||
from bpy.props import BoolProperty, EnumProperty, IntProperty, FloatProperty, FloatVectorProperty
|
||||
|
||||
|
||||
class MakeFur(bpy.types.Operator):
|
||||
bl_idname = "object.make_fur"
|
||||
bl_label = "Make Fur"
|
||||
class QuickFur(bpy.types.Operator):
|
||||
bl_idname = "object.quick_fur"
|
||||
bl_label = "Quick Fur"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
density = EnumProperty(items=(
|
||||
@ -79,6 +78,155 @@ class MakeFur(bpy.types.Operator):
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
class QuickExplode(bpy.types.Operator):
|
||||
bl_idname = "object.quick_explode"
|
||||
bl_label = "Quick Explode"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
style = EnumProperty(items=(
|
||||
('EXPLODE', "Explode", ""),
|
||||
('BLEND', "Blend", "")),
|
||||
name="Explode Style",
|
||||
description="",
|
||||
default='EXPLODE')
|
||||
|
||||
amount = IntProperty(name="Amount of pieces",
|
||||
default=100, min=2, max=10000, soft_min=2, soft_max=10000)
|
||||
|
||||
duration = IntProperty(name="Duration",
|
||||
default=50, min=1, max=10000, soft_min=1, soft_max=10000)
|
||||
|
||||
start_frame = IntProperty(name="Start Frame",
|
||||
default=1, min=1, max=10000, soft_min=1, soft_max=10000)
|
||||
|
||||
end_frame = IntProperty(name="End Frame",
|
||||
default=10, min=1, max=10000, soft_min=1, soft_max=10000)
|
||||
|
||||
velocity = FloatProperty(name="Outwards Velocity",
|
||||
default=1, min=0, max=1000, soft_min=0, soft_max=10)
|
||||
|
||||
fade = BoolProperty(name="Fade",
|
||||
description="Fade the pieces over time.",
|
||||
default=True)
|
||||
|
||||
invert_order = BoolProperty(name="Invert Order",
|
||||
description="Blend objects in the opposite direction (only for Blend style explosion).",
|
||||
default=False)
|
||||
|
||||
def execute(self, context):
|
||||
fake_context = bpy.context.copy()
|
||||
mesh_objects = [obj for obj in context.selected_objects if obj.type == 'MESH']
|
||||
|
||||
if self.style == 'BLEND' and len(mesh_objects) != 2:
|
||||
self.report({'ERROR'}, "Select two mesh objects.")
|
||||
return {'CANCELLED'}
|
||||
elif not mesh_objects:
|
||||
self.report({'ERROR'}, "Select at least one mesh object.")
|
||||
return {'CANCELLED'}
|
||||
|
||||
for obj in mesh_objects:
|
||||
if len(obj.particle_systems) > 0:
|
||||
self.report({'ERROR'}, "Selected object's can't have particle systems.")
|
||||
return {'CANCELLED'}
|
||||
|
||||
if self.fade:
|
||||
tex = bpy.data.textures.new("Explode fade", 'BLEND')
|
||||
tex.use_color_ramp = True
|
||||
|
||||
if self.style == 'BLEND':
|
||||
tex.color_ramp.elements[0].position = 0.333
|
||||
tex.color_ramp.elements[1].position = 0.666
|
||||
|
||||
tex.color_ramp.elements[0].color[3] = 1
|
||||
tex.color_ramp.elements[1].color[3] = 0
|
||||
|
||||
if self.style == 'BLEND':
|
||||
if self.invert_order:
|
||||
from_obj = mesh_objects[1]
|
||||
to_obj = mesh_objects[0]
|
||||
else:
|
||||
from_obj = mesh_objects[0]
|
||||
to_obj = mesh_objects[1]
|
||||
|
||||
for obj in mesh_objects:
|
||||
fake_context["object"] = obj
|
||||
bpy.ops.object.particle_system_add(fake_context)
|
||||
|
||||
settings = obj.particle_systems[-1].settings
|
||||
settings.count = self.amount
|
||||
settings.frame_start = self.start_frame
|
||||
settings.frame_end = self.end_frame - self.duration
|
||||
settings.lifetime = self.duration
|
||||
settings.normal_factor = self.velocity
|
||||
settings.render_type = 'NONE'
|
||||
|
||||
bpy.ops.object.modifier_add(fake_context, type='EXPLODE')
|
||||
explode = obj.modifiers[-1]
|
||||
explode.use_edge_cut = True
|
||||
|
||||
if self.fade:
|
||||
explode.show_dead = False
|
||||
bpy.ops.mesh.uv_texture_add(fake_context);
|
||||
uv = obj.data.uv_textures[-1]
|
||||
uv.name = "Explode fade"
|
||||
explode.particle_uv = uv.name
|
||||
|
||||
if len(obj.material_slots) == 0:
|
||||
obj.data.materials.append(bpy.data.materials.new("Explode fade"))
|
||||
|
||||
mat = obj.data.materials[0]
|
||||
mat.use_transparency = True
|
||||
mat.use_transparent_shadows = True
|
||||
mat.alpha = 0
|
||||
mat.specular_alpha = 0
|
||||
|
||||
tex_slot = mat.texture_slots.add()
|
||||
|
||||
tex_slot.texture = tex
|
||||
tex_slot.texture_coords = 'UV'
|
||||
tex_slot.uv_layer = uv.name
|
||||
|
||||
tex_slot.use_map_alpha = True
|
||||
|
||||
if self.style == 'BLEND':
|
||||
if obj == to_obj:
|
||||
tex_slot.alpha_factor = -1
|
||||
elem = tex.color_ramp.elements[1]
|
||||
elem.color[0] = mat.diffuse_color[0]
|
||||
elem.color[1] = mat.diffuse_color[1]
|
||||
elem.color[2] = mat.diffuse_color[2]
|
||||
else:
|
||||
elem = tex.color_ramp.elements[0]
|
||||
elem.color[0] = mat.diffuse_color[0]
|
||||
elem.color[1] = mat.diffuse_color[1]
|
||||
elem.color[2] = mat.diffuse_color[2]
|
||||
else:
|
||||
tex_slot.use_map_color_diffuse = False
|
||||
|
||||
if self.style == 'BLEND':
|
||||
settings.physics_type = 'KEYED'
|
||||
settings.use_emit_random = False
|
||||
settings.rotation_mode = 'NOR'
|
||||
|
||||
psys = obj.particle_systems[-1]
|
||||
|
||||
fake_context["particle_system"] = obj.particle_systems[-1]
|
||||
bpy.ops.particle.new_target(fake_context)
|
||||
bpy.ops.particle.new_target(fake_context)
|
||||
|
||||
if obj == from_obj:
|
||||
psys.targets[1].object = to_obj
|
||||
else:
|
||||
psys.targets[0].object = from_obj
|
||||
settings.normal_factor = -self.velocity
|
||||
explode.show_unborn = False
|
||||
explode.show_dead = True
|
||||
else:
|
||||
settings.factor_random = self.velocity
|
||||
settings.angular_velocity_factor = self.velocity/10
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
def obj_bb_minmax(obj, min_co, max_co):
|
||||
for i in range(0, 8):
|
||||
@ -92,9 +240,9 @@ def obj_bb_minmax(obj, min_co, max_co):
|
||||
max_co[2] = max(bb_vec[2], max_co[2])
|
||||
|
||||
|
||||
class MakeSmoke(bpy.types.Operator):
|
||||
bl_idname = "object.make_smoke"
|
||||
bl_label = "Make Smoke"
|
||||
class QuickSmoke(bpy.types.Operator):
|
||||
bl_idname = "object.quick_smoke"
|
||||
bl_label = "Quick Smoke"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
style = EnumProperty(items=(
|
||||
@ -201,9 +349,9 @@ class MakeSmoke(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class MakeFluid(bpy.types.Operator):
|
||||
bl_idname = "object.make_fluid"
|
||||
bl_label = "Make Fluid"
|
||||
class QuickFluid(bpy.types.Operator):
|
||||
bl_idname = "object.quick_fluid"
|
||||
bl_label = "Quick Fluid"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
style = EnumProperty(items=(
|
||||
|
@ -326,7 +326,7 @@ class AddPresetOperator(AddPresetBase, bpy.types.Operator):
|
||||
|
||||
ret = []
|
||||
for prop_id, prop in operator_rna.properties.items():
|
||||
if (not prop.is_hidden) and prop_id not in properties_blacklist:
|
||||
if (not (prop.is_hidden or prop.is_skip_save)) and prop_id not in properties_blacklist:
|
||||
ret.append("op.%s" % prop_id)
|
||||
|
||||
return ret
|
||||
|
@ -106,7 +106,7 @@ class WM_OT_context_set_boolean(bpy.types.Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_boolean"
|
||||
bl_label = "Context Set Boolean"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = BoolProperty(name="Value",
|
||||
@ -119,7 +119,7 @@ class WM_OT_context_set_int(bpy.types.Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_int"
|
||||
bl_label = "Context Set"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = IntProperty(name="Value", description="Assign value", default=0)
|
||||
@ -132,7 +132,7 @@ class WM_OT_context_scale_int(bpy.types.Operator):
|
||||
'''Scale an int context value.'''
|
||||
bl_idname = "wm.context_scale_int"
|
||||
bl_label = "Context Set"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = FloatProperty(name="Value", description="Assign value", default=1.0)
|
||||
@ -168,7 +168,7 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_float"
|
||||
bl_label = "Context Set Float"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = FloatProperty(name="Value",
|
||||
@ -182,7 +182,7 @@ class WM_OT_context_set_string(bpy.types.Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_string"
|
||||
bl_label = "Context Set String"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = StringProperty(name="Value",
|
||||
@ -195,7 +195,7 @@ class WM_OT_context_set_enum(bpy.types.Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_enum"
|
||||
bl_label = "Context Set Enum"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = StringProperty(name="Value",
|
||||
@ -209,7 +209,7 @@ class WM_OT_context_set_value(bpy.types.Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_value"
|
||||
bl_label = "Context Set Value"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = StringProperty(name="Value",
|
||||
@ -227,7 +227,7 @@ class WM_OT_context_toggle(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_toggle"
|
||||
bl_label = "Context Toggle"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
|
||||
@ -246,7 +246,7 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_toggle_enum"
|
||||
bl_label = "Context Toggle Values"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value_1 = StringProperty(name="Value", \
|
||||
@ -273,7 +273,7 @@ class WM_OT_context_cycle_int(bpy.types.Operator):
|
||||
'''vertex keys, groups' etc.'''
|
||||
bl_idname = "wm.context_cycle_int"
|
||||
bl_label = "Context Int Cycle"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
reverse = rna_reverse_prop
|
||||
@ -307,7 +307,7 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_cycle_enum"
|
||||
bl_label = "Context Enum Cycle"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
reverse = rna_reverse_prop
|
||||
@ -360,7 +360,7 @@ class WM_OT_context_cycle_array(bpy.types.Operator):
|
||||
Useful for cycling the active mesh edit mode.'''
|
||||
bl_idname = "wm.context_cycle_array"
|
||||
bl_label = "Context Array Cycle"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
reverse = rna_reverse_prop
|
||||
@ -406,7 +406,7 @@ class WM_MT_context_menu_enum(bpy.types.Menu):
|
||||
class WM_OT_context_menu_enum(bpy.types.Operator):
|
||||
bl_idname = "wm.context_menu_enum"
|
||||
bl_label = "Context Enum Menu"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
data_path = rna_path_prop
|
||||
|
||||
def execute(self, context):
|
||||
@ -420,7 +420,7 @@ class WM_OT_context_set_id(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_set_id"
|
||||
bl_label = "Set Library ID"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = StringProperty(name="Value",
|
||||
@ -462,6 +462,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
|
||||
'''Adjust arbitrary values with mouse input'''
|
||||
bl_idname = "wm.context_modal_mouse"
|
||||
bl_label = "Context Modal Mouse"
|
||||
bl_options = {'INTERNAL'}
|
||||
|
||||
data_path_iter = StringProperty(description="The data path relative to the context, must point to an iterable.")
|
||||
data_path_item = StringProperty(description="The data path from each iterable to the value (int or float)")
|
||||
|
@ -117,6 +117,10 @@ class DATA_PT_shape_curve(CurveButtonsPanel, bpy.types.Panel):
|
||||
col.prop(curve, "use_uv_as_generated")
|
||||
col.prop(curve, "use_auto_texspace")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(curve, "texspace_location")
|
||||
row.column().prop(curve, "texspace_size")
|
||||
|
||||
|
||||
class DATA_PT_geometry_curve(CurveButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Geometry"
|
||||
|
@ -99,8 +99,9 @@ class DATA_PT_normals(MeshButtonsPanel, bpy.types.Panel):
|
||||
split.prop(mesh, "show_double_sided")
|
||||
|
||||
|
||||
class DATA_PT_settings(MeshButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Settings"
|
||||
class DATA_PT_texture_space(MeshButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Texture Space"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
@ -109,8 +110,13 @@ class DATA_PT_settings(MeshButtonsPanel, bpy.types.Panel):
|
||||
mesh = context.mesh
|
||||
|
||||
layout.prop(mesh, "texture_mesh")
|
||||
layout.prop(mesh, "use_auto_texspace")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(mesh, "use_auto_texspace")
|
||||
row = layout.row()
|
||||
row.column().prop(mesh, "texspace_location", text="Location")
|
||||
row.column().prop(mesh, "texspace_size", text="Size")
|
||||
|
||||
class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Vertex Groups"
|
||||
|
@ -71,6 +71,10 @@ class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
|
||||
layout.label(text="Update:")
|
||||
layout.prop(mball, "update_method", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(mball, "texspace_location")
|
||||
row.column().prop(mball, "texspace_size")
|
||||
|
||||
|
||||
class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Active Element"
|
||||
|
@ -483,11 +483,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
|
||||
col.label(text="Mode:")
|
||||
col.prop(md, "wrap_method", text="")
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
|
||||
col = split.column()
|
||||
|
||||
if md.wrap_method == 'PROJECT':
|
||||
split = layout.split(percentage=0.25)
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Axis:")
|
||||
col.prop(md, "use_project_x")
|
||||
col.prop(md, "use_project_y")
|
||||
@ -499,7 +498,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
|
||||
col.prop(md, "use_positive_direction")
|
||||
|
||||
col = split.column()
|
||||
|
||||
col.label(text="Cull Faces:")
|
||||
col.prop(md, "cull_face", expand=True)
|
||||
|
||||
|
@ -660,17 +660,19 @@ class ConstraintButtonsPanel():
|
||||
row = col.row()
|
||||
row.label(text="Source to Destination Mapping:")
|
||||
|
||||
# note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't
|
||||
# open it. Thus we are using the hardcoded value instead.
|
||||
row = col.row()
|
||||
row.prop(con, "map_to_x_from", expand=False, text="")
|
||||
row.label(text=" -> X")
|
||||
row.label(text=" %s X" % chr(187))
|
||||
|
||||
row = col.row()
|
||||
row.prop(con, "map_to_y_from", expand=False, text="")
|
||||
row.label(text=" -> Y")
|
||||
row.label(text=" %s Y" % chr(187))
|
||||
|
||||
row = col.row()
|
||||
row.prop(con, "map_to_z_from", expand=False, text="")
|
||||
row.label(text=" -> Z")
|
||||
row.label(text=" %s Z" % chr(187))
|
||||
|
||||
split = layout.split()
|
||||
|
||||
|
@ -257,6 +257,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel):
|
||||
col.prop(fluid, "slip_type", text="")
|
||||
if fluid.slip_type == 'PARTIALSLIP':
|
||||
col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
|
||||
col.prop(fluid, "surface_noobs")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Surface:")
|
||||
|
@ -172,8 +172,130 @@ class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel):
|
||||
row.prop(rl, "exclude_refraction", text="")
|
||||
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Dimensions"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
|
||||
row.operator("render.preset_add", text="", icon="ZOOMIN")
|
||||
row.operator("render.preset_add", text="", icon="ZOOMOUT").remove_active = True
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Resolution:")
|
||||
sub.prop(rd, "resolution_x", text="X")
|
||||
sub.prop(rd, "resolution_y", text="Y")
|
||||
sub.prop(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.label(text="Aspect Ratio:")
|
||||
sub.prop(rd, "pixel_aspect_x", text="X")
|
||||
sub.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
row = col.row()
|
||||
row.prop(rd, "use_border", text="Border")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_border
|
||||
sub.prop(rd, "use_crop_to_border", text="Crop")
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Frame Range:")
|
||||
sub.prop(scene, "frame_start", text="Start")
|
||||
sub.prop(scene, "frame_end", text="End")
|
||||
sub.prop(scene, "frame_step", text="Step")
|
||||
|
||||
sub.label(text="Frame Rate:")
|
||||
if rd.fps_base == 1:
|
||||
fps_rate = round(rd.fps / rd.fps_base)
|
||||
else:
|
||||
fps_rate = round(rd.fps / rd.fps_base, 2)
|
||||
|
||||
# TODO: Change the following to iterate over existing presets
|
||||
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
|
||||
|
||||
if custom_framerate == True:
|
||||
fps_label_text = "Custom (" + str(fps_rate) + " fps)"
|
||||
else:
|
||||
fps_label_text = str(fps_rate) + " fps"
|
||||
|
||||
sub.menu("RENDER_MT_framerate_presets", text=fps_label_text)
|
||||
|
||||
if custom_framerate or (bpy.types.RENDER_MT_framerate_presets.bl_label == "Custom"):
|
||||
sub.prop(rd, "fps")
|
||||
sub.prop(rd, "fps_base", text="/")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.label(text="Time Remapping:")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.prop(rd, "frame_map_old", text="Old")
|
||||
subrow.prop(rd, "frame_map_new", text="New")
|
||||
|
||||
|
||||
class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Anti-Aliasing"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_antialiasing", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
layout.active = rd.use_antialiasing
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.row().prop(rd, "antialiasing_samples", expand=True)
|
||||
sub = col.row()
|
||||
sub.enabled = not rd.use_border
|
||||
sub.prop(rd, "use_full_sample")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "pixel_filter_type", text="")
|
||||
col.prop(rd, "filter_size", text="Size")
|
||||
|
||||
|
||||
class RENDER_PT_motion_blur(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Sampled Motion Blur"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
rd = context.scene.render
|
||||
return not rd.use_full_sample and (rd.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_motion_blur", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
layout.active = rd.use_motion_blur
|
||||
|
||||
row = layout.row()
|
||||
row.prop(rd, "motion_blur_samples")
|
||||
row.prop(rd, "motion_blur_shutter")
|
||||
|
||||
|
||||
class RENDER_PT_shading(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Shading"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
@ -254,8 +376,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
|
||||
col.prop(rd, "use_compositing")
|
||||
col.prop(rd, "use_sequencer")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
split.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -276,6 +397,51 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
|
||||
sub.prop(rd, "edge_color", text="")
|
||||
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Stamp"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_stamp", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.active = rd.use_stamp
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_stamp_time", text="Time")
|
||||
col.prop(rd, "use_stamp_date", text="Date")
|
||||
col.prop(rd, "use_stamp_render_time", text="RenderTime")
|
||||
col.prop(rd, "use_stamp_frame", text="Frame")
|
||||
col.prop(rd, "use_stamp_scene", text="Scene")
|
||||
col.prop(rd, "use_stamp_camera", text="Camera")
|
||||
col.prop(rd, "use_stamp_lens", text="Lens")
|
||||
col.prop(rd, "use_stamp_filename", text="Filename")
|
||||
col.prop(rd, "use_stamp_marker", text="Marker")
|
||||
col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
|
||||
|
||||
col = split.column()
|
||||
col.active = rd.use_stamp
|
||||
col.prop(rd, "stamp_foreground", slider=True)
|
||||
col.prop(rd, "stamp_background", slider=True)
|
||||
col.separator()
|
||||
col.prop(rd, "stamp_font_size", text="Font Size")
|
||||
|
||||
row = layout.split(percentage=0.2)
|
||||
row.prop(rd, "use_stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_stamp_note
|
||||
sub.prop(rd, "stamp_note_text", text="")
|
||||
|
||||
|
||||
class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Output"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@ -433,172 +599,6 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
|
||||
split.prop(rd, "ffmpeg_audio_volume", slider=True)
|
||||
|
||||
|
||||
class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Anti-Aliasing"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_antialiasing", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
layout.active = rd.use_antialiasing
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.row().prop(rd, "antialiasing_samples", expand=True)
|
||||
sub = col.row()
|
||||
sub.enabled = not rd.use_border
|
||||
sub.prop(rd, "use_full_sample")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "pixel_filter_type", text="")
|
||||
col.prop(rd, "filter_size", text="Size")
|
||||
|
||||
|
||||
class RENDER_PT_motion_blur(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Sampled Motion Blur"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
rd = context.scene.render
|
||||
return not rd.use_full_sample and (rd.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_motion_blur", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
layout.active = rd.use_motion_blur
|
||||
|
||||
row = layout.row()
|
||||
row.prop(rd, "motion_blur_samples")
|
||||
row.prop(rd, "motion_blur_shutter")
|
||||
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Dimensions"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
|
||||
row.operator("render.preset_add", text="", icon="ZOOMIN")
|
||||
row.operator("render.preset_add", text="", icon="ZOOMOUT").remove_active = True
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Resolution:")
|
||||
sub.prop(rd, "resolution_x", text="X")
|
||||
sub.prop(rd, "resolution_y", text="Y")
|
||||
sub.prop(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.label(text="Aspect Ratio:")
|
||||
sub.prop(rd, "pixel_aspect_x", text="X")
|
||||
sub.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
row = col.row()
|
||||
row.prop(rd, "use_border", text="Border")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_border
|
||||
sub.prop(rd, "use_crop_to_border", text="Crop")
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Frame Range:")
|
||||
sub.prop(scene, "frame_start", text="Start")
|
||||
sub.prop(scene, "frame_end", text="End")
|
||||
sub.prop(scene, "frame_step", text="Step")
|
||||
|
||||
sub.label(text="Frame Rate:")
|
||||
if rd.fps_base == 1:
|
||||
fps_rate = round(rd.fps / rd.fps_base)
|
||||
else:
|
||||
fps_rate = round(rd.fps / rd.fps_base, 2)
|
||||
|
||||
# TODO: Change the following to iterate over existing presets
|
||||
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
|
||||
|
||||
if custom_framerate == True:
|
||||
fps_label_text = "Custom (" + str(fps_rate) + " fps)"
|
||||
else:
|
||||
fps_label_text = str(fps_rate) + " fps"
|
||||
|
||||
sub.menu("RENDER_MT_framerate_presets", text=fps_label_text)
|
||||
|
||||
if custom_framerate or (bpy.types.RENDER_MT_framerate_presets.bl_label == "Custom"):
|
||||
sub.prop(rd, "fps")
|
||||
sub.prop(rd, "fps_base", text="/")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.label(text="Time Remapping:")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.prop(rd, "frame_map_old", text="Old")
|
||||
subrow.prop(rd, "frame_map_new", text="New")
|
||||
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Stamp"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_stamp", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.active = rd.use_stamp
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_stamp_time", text="Time")
|
||||
col.prop(rd, "use_stamp_date", text="Date")
|
||||
col.prop(rd, "use_stamp_render_time", text="RenderTime")
|
||||
col.prop(rd, "use_stamp_frame", text="Frame")
|
||||
col.prop(rd, "use_stamp_scene", text="Scene")
|
||||
col.prop(rd, "use_stamp_camera", text="Camera")
|
||||
col.prop(rd, "use_stamp_lens", text="Lens")
|
||||
col.prop(rd, "use_stamp_filename", text="Filename")
|
||||
col.prop(rd, "use_stamp_marker", text="Marker")
|
||||
col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
|
||||
|
||||
col = split.column()
|
||||
col.active = rd.use_stamp
|
||||
col.prop(rd, "stamp_foreground", slider=True)
|
||||
col.prop(rd, "stamp_background", slider=True)
|
||||
col.separator()
|
||||
col.prop(rd, "stamp_font_size", text="Font Size")
|
||||
|
||||
row = layout.split(percentage=0.2)
|
||||
row.prop(rd, "use_stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_stamp_note
|
||||
sub.prop(rd, "stamp_note_text", text="")
|
||||
|
||||
|
||||
class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Bake"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
@ -613,29 +613,42 @@ class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
|
||||
|
||||
layout.prop(rd, "bake_type")
|
||||
|
||||
if rd.bake_type == 'NORMALS':
|
||||
layout.prop(rd, "bake_normal_space")
|
||||
elif rd.bake_type in {'DISPLACEMENT', 'AO'}:
|
||||
layout.prop(rd, "use_bake_normalize")
|
||||
multires_bake = False
|
||||
if rd.bake_type in ['NORMALS', 'DISPLACEMENT']:
|
||||
layout.prop(rd, 'use_bake_multires')
|
||||
multires_bake = rd.use_bake_multires
|
||||
|
||||
# col.prop(rd, "bake_aa_mode")
|
||||
# col.prop(rd, "use_bake_antialiasing")
|
||||
if not multires_bake:
|
||||
if rd.bake_type == 'NORMALS':
|
||||
layout.prop(rd, "bake_normal_space")
|
||||
elif rd.bake_type in {'DISPLACEMENT', 'AO'}:
|
||||
layout.prop(rd, "use_bake_normalize")
|
||||
|
||||
layout.separator()
|
||||
# col.prop(rd, "bake_aa_mode")
|
||||
# col.prop(rd, "use_bake_antialiasing")
|
||||
|
||||
split = layout.split()
|
||||
layout.separator()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_bake_clear")
|
||||
col.prop(rd, "bake_margin")
|
||||
col.prop(rd, "bake_quad_split", text="Split")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_bake_clear")
|
||||
col.prop(rd, "bake_margin")
|
||||
col.prop(rd, "bake_quad_split", text="Split")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_bake_selected_to_active")
|
||||
sub = col.column()
|
||||
sub.active = rd.use_bake_selected_to_active
|
||||
sub.prop(rd, "bake_distance")
|
||||
sub.prop(rd, "bake_bias")
|
||||
else:
|
||||
if rd.bake_type == 'DISPLACEMENT':
|
||||
layout.prop(rd, "use_bake_lores_mesh")
|
||||
|
||||
layout.prop(rd, "use_bake_clear")
|
||||
layout.prop(rd, "bake_margin")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_bake_selected_to_active")
|
||||
sub = col.column()
|
||||
sub.active = rd.use_bake_selected_to_active
|
||||
sub.prop(rd, "bake_distance")
|
||||
sub.prop(rd, "bake_bias")
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
bpy.utils.register_module(__name__)
|
||||
|
@ -42,7 +42,7 @@ class SEQUENCER_HT_header(bpy.types.Header):
|
||||
sub = row.row(align=True)
|
||||
sub.menu("SEQUENCER_MT_view")
|
||||
|
||||
if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'):
|
||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
sub.menu("SEQUENCER_MT_select")
|
||||
sub.menu("SEQUENCER_MT_marker")
|
||||
sub.menu("SEQUENCER_MT_add")
|
||||
@ -50,17 +50,17 @@ class SEQUENCER_HT_header(bpy.types.Header):
|
||||
|
||||
layout.prop(st, "view_type", expand=True, text="")
|
||||
|
||||
if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'):
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
layout.prop(st, "display_mode", expand=True, text="")
|
||||
|
||||
if (st.view_type == 'SEQUENCER'):
|
||||
if st.view_type == 'SEQUENCER':
|
||||
row = layout.row(align=True)
|
||||
row.operator("sequencer.copy", text="", icon='COPYDOWN')
|
||||
row.operator("sequencer.paste", text="", icon='PASTEDOWN')
|
||||
|
||||
layout.separator()
|
||||
layout.operator("sequencer.refresh_all")
|
||||
elif (st.view_type == 'SEQUENCER_PREVIEW'):
|
||||
elif st.view_type == 'SEQUENCER_PREVIEW':
|
||||
layout.separator()
|
||||
layout.operator("sequencer.refresh_all")
|
||||
layout.prop(st, "display_channel", text="Channel")
|
||||
@ -101,9 +101,9 @@ class SEQUENCER_MT_view(bpy.types.Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'):
|
||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
layout.operator("sequencer.view_all", text='View all Sequences')
|
||||
if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'):
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
layout.operator_context = 'INVOKE_REGION_PREVIEW'
|
||||
layout.operator("sequencer.view_all_preview", text='Fit preview in window')
|
||||
layout.operator("sequencer.view_zoom_ratio", text='Show preview 1:1').ratio = 1.0
|
||||
@ -300,7 +300,7 @@ class SequencerButtonsPanel():
|
||||
|
||||
@staticmethod
|
||||
def has_sequencer(context):
|
||||
return (context.space_data.view_type == 'SEQUENCER') or (context.space_data.view_type == 'SEQUENCER_PREVIEW')
|
||||
return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@ -313,7 +313,7 @@ class SequencerButtonsPanel_Output():
|
||||
|
||||
@staticmethod
|
||||
def has_preview(context):
|
||||
return (context.space_data.view_type == 'PREVIEW') or (context.space_data.view_type == 'SEQUENCER_PREVIEW')
|
||||
return (context.space_data.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'})
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@ -657,11 +657,17 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel):
|
||||
|
||||
layout.template_ID(strip, "scene")
|
||||
|
||||
scene = strip.scene
|
||||
if scene:
|
||||
layout.prop(scene.render, "use_sequencer")
|
||||
|
||||
layout.label(text="Camera Override")
|
||||
layout.template_ID(strip, "scene_camera")
|
||||
|
||||
sce = strip.scene
|
||||
layout.label(text="Original frame range: %d-%d (%d)" % (sce.frame_start, sce.frame_end, sce.frame_end - sce.frame_start + 1))
|
||||
if scene:
|
||||
sta = scene.frame_start
|
||||
end = scene.frame_end
|
||||
layout.label(text="Original frame range: %d-%d (%d)" % (sta, end, end - sta + 1))
|
||||
|
||||
|
||||
class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel):
|
||||
|
@ -42,7 +42,7 @@ class TEXT_HT_header(bpy.types.Header):
|
||||
|
||||
if text and text.is_modified:
|
||||
row = layout.row()
|
||||
# row.color(redalert)
|
||||
row.alert = True
|
||||
row.operator("text.resolve_conflict", text="", icon='HELP')
|
||||
|
||||
layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
|
||||
|
@ -94,7 +94,7 @@ class USERPREF_HT_header(bpy.types.Header):
|
||||
layout.operator("wm.keyconfig_import")
|
||||
elif userpref.active_section == 'ADDONS':
|
||||
layout.operator("wm.addon_install")
|
||||
layout.menu("USERPREF_MT_addons_dev_guides", text=" Addons Developer Guides", icon='INFO')
|
||||
layout.menu("USERPREF_MT_addons_dev_guides")
|
||||
elif userpref.active_section == 'THEMES':
|
||||
layout.operator("ui.reset_default_theme")
|
||||
|
||||
@ -848,17 +848,14 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel):
|
||||
|
||||
|
||||
class USERPREF_MT_addons_dev_guides(bpy.types.Menu):
|
||||
bl_label = "Addons develoment guides"
|
||||
bl_label = "Develoment Guides"
|
||||
|
||||
# menu to open webpages with addons development guides
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator('wm.url_open', text='API Concepts'
|
||||
).url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro'
|
||||
layout.operator('wm.url_open', text='Addons guidelines',
|
||||
).url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons'
|
||||
layout.operator('wm.url_open', text='How to share your addon',
|
||||
).url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing'
|
||||
layout.operator('wm.url_open', text='API Concepts', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro'
|
||||
layout.operator('wm.url_open', text='Addon Guidelines', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons'
|
||||
layout.operator('wm.url_open', text='How to share your addon', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing'
|
||||
|
||||
|
||||
class USERPREF_PT_addons(bpy.types.Panel):
|
||||
|
@ -689,6 +689,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -1053,6 +1054,7 @@ class VIEW3D_MT_paint_weight(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -1133,6 +1135,7 @@ class VIEW3D_MT_particle(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -1186,6 +1189,7 @@ class VIEW3D_MT_pose(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -1377,6 +1381,7 @@ class VIEW3D_MT_edit_mesh(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -1848,6 +1853,7 @@ class VIEW3D_MT_edit_meta(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
@ -89,6 +89,7 @@ extern int BKE_undo_valid(const char *name);
|
||||
extern void BKE_reset_undo(void);
|
||||
extern char *BKE_undo_menu_string(void);
|
||||
extern void BKE_undo_number(struct bContext *C, int nr);
|
||||
extern char *BKE_undo_get_name(int nr, int *active);
|
||||
extern void BKE_undo_save_quit(void);
|
||||
extern struct Main *BKE_undo_get_main(struct Scene **scene);
|
||||
|
||||
|
@ -71,7 +71,7 @@ float brush_curve_strength(struct Brush *br, float p, const float len); /* used
|
||||
/* sampling */
|
||||
void brush_sample_tex(struct Brush *brush, float *xy, float *rgba, const int thread);
|
||||
void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
|
||||
struct ImBuf **imbuf);
|
||||
struct ImBuf **imbuf, int use_color_correction);
|
||||
|
||||
/* painting */
|
||||
struct BrushPainter;
|
||||
@ -82,7 +82,7 @@ BrushPainter *brush_painter_new(struct Brush *brush);
|
||||
void brush_painter_require_imbuf(BrushPainter *painter, short flt,
|
||||
short texonly, int size);
|
||||
int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
|
||||
double time, float pressure, void *user);
|
||||
double time, float pressure, void *user, int use_color_correction);
|
||||
void brush_painter_break_stroke(BrushPainter *painter);
|
||||
void brush_painter_free(BrushPainter *painter);
|
||||
|
||||
|
@ -59,9 +59,9 @@ float defvert_array_find_weight_safe(const struct MDeformVert *dvert, int index
|
||||
|
||||
void defvert_copy(struct MDeformVert *dvert_r, const struct MDeformVert *dvert);
|
||||
void defvert_sync(struct MDeformVert *dvert_r, const struct MDeformVert *dvert, int use_verify);
|
||||
void defvert_sync_mapped(struct MDeformVert *dvert_r, const struct MDeformVert *dvert, int *flip_map, int use_verify);
|
||||
void defvert_sync_mapped(struct MDeformVert *dvert_r, const struct MDeformVert *dvert, const int *flip_map, int use_verify);
|
||||
void defvert_remap (struct MDeformVert *dvert, int *map);
|
||||
void defvert_flip(struct MDeformVert *dvert, int *flip_map);
|
||||
void defvert_flip(struct MDeformVert *dvert, const int *flip_map);
|
||||
void defvert_normalize(struct MDeformVert *dvert);
|
||||
|
||||
/* utility function, note that 32 chars is the maximum string length since its only
|
||||
|
@ -51,22 +51,23 @@ struct GHash;
|
||||
/* **** DAG relation types *** */
|
||||
|
||||
/* scene link to object */
|
||||
#define DAG_RL_SCENE 1
|
||||
#define DAG_RL_SCENE (1<<0)
|
||||
/* object link to data */
|
||||
#define DAG_RL_DATA 2
|
||||
#define DAG_RL_DATA (1<<1)
|
||||
|
||||
/* object changes object (parent, track, constraints) */
|
||||
#define DAG_RL_OB_OB 4
|
||||
#define DAG_RL_OB_OB (1<<2)
|
||||
/* object changes obdata (hooks, constraints) */
|
||||
#define DAG_RL_OB_DATA 8
|
||||
#define DAG_RL_OB_DATA (1<<3)
|
||||
/* data changes object (vertex parent) */
|
||||
#define DAG_RL_DATA_OB 16
|
||||
#define DAG_RL_DATA_OB (1<<4)
|
||||
/* data changes data (deformers) */
|
||||
#define DAG_RL_DATA_DATA 32
|
||||
#define DAG_RL_DATA_DATA (1<<5)
|
||||
|
||||
#define DAG_NO_RELATION 64
|
||||
#define DAG_RL_ALL 63
|
||||
#define DAG_RL_ALL_BUT_DATA 61
|
||||
#define DAG_NO_RELATION (1<<6)
|
||||
|
||||
#define DAG_RL_ALL_BUT_DATA (DAG_RL_SCENE|DAG_RL_OB_OB|DAG_RL_OB_DATA|DAG_RL_DATA_OB|DAG_RL_DATA_DATA)
|
||||
#define DAG_RL_ALL (DAG_RL_ALL_BUT_DATA|DAG_RL_DATA)
|
||||
|
||||
|
||||
typedef void (*graph_action_func)(void * ob, void **data);
|
||||
|
@ -91,6 +91,7 @@ void multires_topology_changed(struct Scene *scene, struct Object *ob);
|
||||
void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v);
|
||||
void mdisp_rot_crn_to_face(const int S, const int corners, const int face_side, const float x, const float y, float *u, float *v);
|
||||
int mdisp_rot_face_to_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y);
|
||||
int mdisp_rot_face_to_quad_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y);
|
||||
void mdisp_apply_weight(const int S, const int corners, int x, int y, const int face_side, float crn_weight[4][2], float *u_r, float *v_r);
|
||||
void mdisp_flip_disp(const int S, const int corners, const float axis_x[2], const float axis_y[2], float disp[3]);
|
||||
void mdisp_join_tris(struct MDisps *dst, struct MDisps *tri1, struct MDisps *tri2);
|
||||
|
@ -300,6 +300,8 @@ void psys_get_pointcache_start_end(struct Scene *scene, ParticleSystem *psys, in
|
||||
|
||||
void psys_check_boid_data(struct ParticleSystem *psys);
|
||||
|
||||
void psys_get_birth_coordinates(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, float dtime, float cfra);
|
||||
|
||||
void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys);
|
||||
|
||||
/* ----------- functions needed only inside particlesystem ------------ */
|
||||
|
@ -180,7 +180,6 @@ static void clean_paths(Main *main)
|
||||
BLI_bpathIterator_free(bpi);
|
||||
|
||||
for(scene= main->scene.first; scene; scene= scene->id.next) {
|
||||
BLI_clean(scene->r.backbuf);
|
||||
BLI_clean(scene->r.pic);
|
||||
}
|
||||
}
|
||||
@ -620,7 +619,7 @@ void BKE_reset_undo(void)
|
||||
/* based on index nr it does a restore */
|
||||
void BKE_undo_number(bContext *C, int nr)
|
||||
{
|
||||
curundo= BLI_findlink(&undobase, nr - 1);
|
||||
curundo= BLI_findlink(&undobase, nr);
|
||||
BKE_undo_step(C, 0);
|
||||
}
|
||||
|
||||
@ -646,6 +645,21 @@ int BKE_undo_valid(const char *name)
|
||||
return undobase.last != undobase.first;
|
||||
}
|
||||
|
||||
/* get name of undo item, return null if no item with this index */
|
||||
/* if active pointer, set it to 1 if true */
|
||||
char *BKE_undo_get_name(int nr, int *active)
|
||||
{
|
||||
UndoElem *uel= BLI_findlink(&undobase, nr);
|
||||
|
||||
if(active) *active= 0;
|
||||
|
||||
if(uel) {
|
||||
if(active && uel==curundo)
|
||||
*active= 1;
|
||||
return uel->name;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *BKE_undo_menu_string(void)
|
||||
{
|
||||
|
@ -521,7 +521,7 @@ void brush_sample_tex(Brush *brush, float *xy, float *rgba, const int thread)
|
||||
}
|
||||
|
||||
|
||||
void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf)
|
||||
void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction)
|
||||
{
|
||||
ImBuf *ibuf;
|
||||
float xy[2], dist, rgba[4], *dstf;
|
||||
@ -529,6 +529,7 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
|
||||
const int radius= brush_size(brush);
|
||||
char *dst, crgb[3];
|
||||
const float alpha= brush_alpha(brush);
|
||||
float brush_rgb[3];
|
||||
|
||||
imbflag= (flt)? IB_rectfloat: IB_rect;
|
||||
xoff = -bufsize/2.0f + 0.5f;
|
||||
@ -541,6 +542,11 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
|
||||
ibuf= IMB_allocImBuf(bufsize, bufsize, 32, imbflag);
|
||||
|
||||
if (flt) {
|
||||
copy_v3_v3(brush_rgb, brush->rgb);
|
||||
if(use_color_correction){
|
||||
srgb_to_linearrgb_v3_v3(brush_rgb, brush_rgb);
|
||||
}
|
||||
|
||||
for (y=0; y < ibuf->y; y++) {
|
||||
dstf = ibuf->rect_float + y*rowbytes;
|
||||
|
||||
@ -551,7 +557,7 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
|
||||
if (texfall == 0) {
|
||||
dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
|
||||
|
||||
VECCOPY(dstf, brush->rgb);
|
||||
VECCOPY(dstf, brush_rgb);
|
||||
dstf[3]= alpha*brush_curve_strength_clamp(brush, dist, radius);
|
||||
}
|
||||
else if (texfall == 1) {
|
||||
@ -561,10 +567,7 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
|
||||
dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
|
||||
|
||||
brush_sample_tex(brush, xy, rgba, 0);
|
||||
|
||||
dstf[0] = rgba[0]*brush->rgb[0];
|
||||
dstf[1] = rgba[1]*brush->rgb[1];
|
||||
dstf[2] = rgba[2]*brush->rgb[2];
|
||||
mul_v3_v3v3(dstf, rgba, brush_rgb);
|
||||
dstf[3] = rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius);
|
||||
}
|
||||
}
|
||||
@ -862,7 +865,7 @@ static void brush_painter_fixed_tex_partial_update(BrushPainter *painter, float
|
||||
brush_painter_do_partial(painter, NULL, x1, y2, x2, ibuf->y, 0, 0, pos);
|
||||
}
|
||||
|
||||
static void brush_painter_refresh_cache(BrushPainter *painter, float *pos)
|
||||
static void brush_painter_refresh_cache(BrushPainter *painter, float *pos, int use_color_correction)
|
||||
{
|
||||
Brush *brush= painter->brush;
|
||||
BrushPainterCache *cache= &painter->cache;
|
||||
@ -889,11 +892,11 @@ static void brush_painter_refresh_cache(BrushPainter *painter, float *pos)
|
||||
size= (cache->size)? cache->size: diameter;
|
||||
|
||||
if (brush->flag & BRUSH_FIXED_TEX) {
|
||||
brush_imbuf_new(brush, flt, 3, size, &cache->maskibuf);
|
||||
brush_imbuf_new(brush, flt, 3, size, &cache->maskibuf, use_color_correction);
|
||||
brush_painter_fixed_tex_partial_update(painter, pos);
|
||||
}
|
||||
else
|
||||
brush_imbuf_new(brush, flt, 2, size, &cache->ibuf);
|
||||
brush_imbuf_new(brush, flt, 2, size, &cache->ibuf, use_color_correction);
|
||||
|
||||
cache->lastsize= diameter;
|
||||
cache->lastalpha= alpha;
|
||||
@ -952,7 +955,7 @@ void brush_jitter_pos(Brush *brush, float *pos, float *jitterpos)
|
||||
}
|
||||
}
|
||||
|
||||
int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user)
|
||||
int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user, int use_color_correction)
|
||||
{
|
||||
Brush *brush= painter->brush;
|
||||
int totpaintops= 0;
|
||||
@ -970,7 +973,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
|
||||
|
||||
brush_apply_pressure(painter, brush, pressure);
|
||||
if (painter->cache.enabled)
|
||||
brush_painter_refresh_cache(painter, pos);
|
||||
brush_painter_refresh_cache(painter, pos, use_color_correction);
|
||||
totpaintops += func(user, painter->cache.ibuf, pos, pos);
|
||||
|
||||
painter->lasttime= time;
|
||||
@ -1043,7 +1046,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
|
||||
brush_jitter_pos(brush, paintpos, finalpos);
|
||||
|
||||
if (painter->cache.enabled)
|
||||
brush_painter_refresh_cache(painter, finalpos);
|
||||
brush_painter_refresh_cache(painter, finalpos, use_color_correction);
|
||||
|
||||
totpaintops +=
|
||||
func(user, painter->cache.ibuf, painter->lastpaintpos, finalpos);
|
||||
@ -1057,7 +1060,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
|
||||
brush_jitter_pos(brush, pos, finalpos);
|
||||
|
||||
if (painter->cache.enabled)
|
||||
brush_painter_refresh_cache(painter, finalpos);
|
||||
brush_painter_refresh_cache(painter, finalpos, use_color_correction);
|
||||
|
||||
totpaintops += func(user, painter->cache.ibuf, pos, finalpos);
|
||||
|
||||
@ -1085,7 +1088,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
|
||||
brush_jitter_pos(brush, pos, finalpos);
|
||||
|
||||
if (painter->cache.enabled)
|
||||
brush_painter_refresh_cache(painter, finalpos);
|
||||
brush_painter_refresh_cache(painter, finalpos, use_color_correction);
|
||||
|
||||
totpaintops +=
|
||||
func(user, painter->cache.ibuf, painter->lastmousepos, finalpos);
|
||||
|
@ -493,7 +493,7 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float *co,
|
||||
|
||||
// NOTE: casts to "float*" here are due to co being "const float*"
|
||||
closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1);
|
||||
dist = len_v3v3(nearest_tmp, (float*)co);
|
||||
dist = len_squared_v3v3(nearest_tmp, (float*)co);
|
||||
|
||||
if(dist < nearest->dist)
|
||||
{
|
||||
|
@ -540,7 +540,7 @@ static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
|
||||
float face_u, face_v, crn_u, crn_v;
|
||||
|
||||
mdisp_apply_weight(S, dst_corners, x, y, st, crn_weight, &face_u, &face_v);
|
||||
crn = mdisp_rot_face_to_crn(src_corners, st, face_u, face_v, &crn_u, &crn_v);
|
||||
crn = mdisp_rot_face_to_quad_crn(src_corners, st, face_u, face_v, &crn_u, &crn_v);
|
||||
|
||||
old_mdisps_bilinear((*out), &s->disps[crn*side*side], side, crn_u, crn_v);
|
||||
mdisp_flip_disp(crn, dst_corners, axis_x, axis_y, *out);
|
||||
|
@ -121,7 +121,7 @@ void defvert_sync (MDeformVert *dvert_r, const MDeformVert *dvert, int use_verif
|
||||
}
|
||||
|
||||
/* be sure all flip_map values are valid */
|
||||
void defvert_sync_mapped (MDeformVert *dvert_r, const MDeformVert *dvert, int *flip_map, int use_verify)
|
||||
void defvert_sync_mapped (MDeformVert *dvert_r, const MDeformVert *dvert, const int *flip_map, int use_verify)
|
||||
{
|
||||
if(dvert->totweight && dvert_r->totweight) {
|
||||
int i;
|
||||
@ -170,7 +170,7 @@ void defvert_normalize (MDeformVert *dvert)
|
||||
}
|
||||
}
|
||||
|
||||
void defvert_flip (MDeformVert *dvert, int *flip_map)
|
||||
void defvert_flip (MDeformVert *dvert, const int *flip_map)
|
||||
{
|
||||
MDeformWeight *dw;
|
||||
int i;
|
||||
|
@ -1020,7 +1020,7 @@ static void old_mdisps_rotate(int S, int UNUSED(newside), int oldside, int x, in
|
||||
|
||||
static void old_mdisps_convert(MFace *mface, MDisps *mdisp)
|
||||
{
|
||||
int newlvl = log(sqrt(mdisp->totdisp)-1)/log(2);
|
||||
int newlvl = log(sqrt(mdisp->totdisp)-1)/M_LN2;
|
||||
int oldlvl = newlvl+1;
|
||||
int oldside = multires_side_tot[oldlvl];
|
||||
int newside = multires_side_tot[newlvl];
|
||||
@ -1997,11 +1997,67 @@ void mdisp_rot_crn_to_face(const int S, const int corners, const int face_side,
|
||||
}
|
||||
}
|
||||
|
||||
/* Find per-corner coordinate with given per-face UV coord */
|
||||
int mdisp_rot_face_to_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y)
|
||||
{
|
||||
const float offset = face_side*0.5f - 0.5f;
|
||||
int S = 0;
|
||||
|
||||
if (corners == 4) {
|
||||
if(u <= offset && v <= offset) S = 0;
|
||||
else if(u > offset && v <= offset) S = 1;
|
||||
else if(u > offset && v > offset) S = 2;
|
||||
else if(u <= offset && v >= offset) S = 3;
|
||||
|
||||
if(S == 0) {
|
||||
*y = offset - u;
|
||||
*x = offset - v;
|
||||
} else if(S == 1) {
|
||||
*x = u - offset;
|
||||
*y = offset - v;
|
||||
} else if(S == 2) {
|
||||
*y = u - offset;
|
||||
*x = v - offset;
|
||||
} else if(S == 3) {
|
||||
*x= offset - u;
|
||||
*y = v - offset;
|
||||
}
|
||||
} else {
|
||||
int grid_size = offset;
|
||||
float w = (face_side - 1) - u - v;
|
||||
float W1, W2;
|
||||
|
||||
if (u >= v && u >= w) {S = 0; W1= w; W2= v;}
|
||||
else if (v >= u && v >= w) {S = 1; W1 = u; W2 = w;}
|
||||
else {S = 2; W1 = v; W2 = u;}
|
||||
|
||||
W1 /= (face_side-1);
|
||||
W2 /= (face_side-1);
|
||||
|
||||
*x = (1-(2*W1)/(1-W2)) * grid_size;
|
||||
*y = (1-(2*W2)/(1-W1)) * grid_size;
|
||||
}
|
||||
|
||||
return S;
|
||||
}
|
||||
|
||||
/* Find per-corner coordinate with given per-face UV coord
|
||||
Practically as the previous funciton but it assumes a bit different coordinate system for triangles
|
||||
which is optimized for MDISP layer interpolation:
|
||||
|
||||
v
|
||||
^
|
||||
| /|
|
||||
| / |
|
||||
| / |
|
||||
|/______|___> u
|
||||
|
||||
*/
|
||||
int mdisp_rot_face_to_quad_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y)
|
||||
{
|
||||
const float offset = face_side*0.5f - 0.5f;
|
||||
int S = 0;
|
||||
|
||||
if (corners == 4) {
|
||||
if(u <= offset && v <= offset) S = 0;
|
||||
else if(u > offset && v <= offset) S = 1;
|
||||
@ -2148,7 +2204,7 @@ void mdisp_join_tris(MDisps *dst, MDisps *tri1, MDisps *tri2)
|
||||
face_v = st - 1 - face_v;
|
||||
} else src = tri1;
|
||||
|
||||
crn = mdisp_rot_face_to_crn(3, st, face_u, face_v, &crn_u, &crn_v);
|
||||
crn = mdisp_rot_face_to_quad_crn(3, st, face_u, face_v, &crn_u, &crn_v);
|
||||
|
||||
old_mdisps_bilinear((*out), &src->disps[crn*side*side], side, crn_u, crn_v);
|
||||
(*out)[0] = 0;
|
||||
|
@ -2387,24 +2387,42 @@ void object_set_dimensions(Object *ob, const float *value)
|
||||
void minmax_object(Object *ob, float *min, float *max)
|
||||
{
|
||||
BoundBox bb;
|
||||
Mesh *me;
|
||||
Curve *cu;
|
||||
float vec[3];
|
||||
int a;
|
||||
short change= FALSE;
|
||||
|
||||
switch(ob->type) {
|
||||
|
||||
case OB_CURVE:
|
||||
case OB_FONT:
|
||||
case OB_SURF:
|
||||
cu= ob->data;
|
||||
{
|
||||
Curve *cu= ob->data;
|
||||
|
||||
if(cu->bb==NULL) tex_space_curve(cu);
|
||||
bb= *(cu->bb);
|
||||
if(cu->bb==NULL) tex_space_curve(cu);
|
||||
bb= *(cu->bb);
|
||||
|
||||
for(a=0; a<8; a++) {
|
||||
mul_m4_v3(ob->obmat, bb.vec[a]);
|
||||
DO_MINMAX(bb.vec[a], min, max);
|
||||
for(a=0; a<8; a++) {
|
||||
mul_m4_v3(ob->obmat, bb.vec[a]);
|
||||
DO_MINMAX(bb.vec[a], min, max);
|
||||
}
|
||||
change= TRUE;
|
||||
}
|
||||
break;
|
||||
case OB_LATTICE:
|
||||
{
|
||||
Lattice *lt= ob->data;
|
||||
BPoint *bp= lt->def;
|
||||
int u, v, w;
|
||||
|
||||
for(w=0; w<lt->pntsw; w++) {
|
||||
for(v=0; v<lt->pntsv; v++) {
|
||||
for(u=0; u<lt->pntsu; u++, bp++) {
|
||||
mul_v3_m4v3(vec, ob->obmat, bp->vec);
|
||||
DO_MINMAX(vec, min, max);
|
||||
}
|
||||
}
|
||||
}
|
||||
change= TRUE;
|
||||
}
|
||||
break;
|
||||
case OB_ARMATURE:
|
||||
@ -2416,25 +2434,27 @@ void minmax_object(Object *ob, float *min, float *max)
|
||||
mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
|
||||
DO_MINMAX(vec, min, max);
|
||||
}
|
||||
break;
|
||||
change= TRUE;
|
||||
}
|
||||
/* no break, get_mesh will give NULL and it passes on to default */
|
||||
break;
|
||||
case OB_MESH:
|
||||
me= get_mesh(ob);
|
||||
{
|
||||
Mesh *me= get_mesh(ob);
|
||||
|
||||
if(me) {
|
||||
bb = *mesh_get_bb(ob);
|
||||
if(me) {
|
||||
bb = *mesh_get_bb(ob);
|
||||
|
||||
for(a=0; a<8; a++) {
|
||||
mul_m4_v3(ob->obmat, bb.vec[a]);
|
||||
DO_MINMAX(bb.vec[a], min, max);
|
||||
for(a=0; a<8; a++) {
|
||||
mul_m4_v3(ob->obmat, bb.vec[a]);
|
||||
DO_MINMAX(bb.vec[a], min, max);
|
||||
}
|
||||
change= TRUE;
|
||||
}
|
||||
}
|
||||
if(min[0] < max[0] ) break;
|
||||
break;
|
||||
}
|
||||
|
||||
/* else here no break!!!, mesh can be zero sized */
|
||||
|
||||
default:
|
||||
if(change == FALSE) {
|
||||
DO_MINMAX(ob->obmat[3], min, max);
|
||||
|
||||
copy_v3_v3(vec, ob->obmat[3]);
|
||||
@ -2444,7 +2464,6 @@ void minmax_object(Object *ob, float *min, float *max)
|
||||
copy_v3_v3(vec, ob->obmat[3]);
|
||||
sub_v3_v3(vec, ob->size);
|
||||
DO_MINMAX(vec, min, max);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1562,8 +1562,7 @@ static void initialize_all_particles(ParticleSimulationData *sim)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* sets particle to the emitter surface with initial velocity & rotation */
|
||||
void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, float cfra)
|
||||
void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, ParticleKey *state, float dtime, float cfra)
|
||||
{
|
||||
Object *ob = sim->ob;
|
||||
ParticleSystem *psys = sim->psys;
|
||||
@ -1576,17 +1575,6 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
||||
int p = pa - psys->particles;
|
||||
part=psys->part;
|
||||
|
||||
/* get precise emitter matrix if particle is born */
|
||||
if(part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
|
||||
/* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */
|
||||
while(ob) {
|
||||
BKE_animsys_evaluate_animdata(&ob->id, ob->adt, pa->time, ADT_RECALC_ANIM);
|
||||
ob = ob->parent;
|
||||
}
|
||||
ob = sim->ob;
|
||||
where_is_object_time(sim->scene, ob, pa->time);
|
||||
}
|
||||
|
||||
/* get birth location from object */
|
||||
if(part->tanfac != 0.f)
|
||||
psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0);
|
||||
@ -1594,7 +1582,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
||||
psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0);
|
||||
|
||||
/* get possible textural influence */
|
||||
psys_get_texture(sim, pa, &ptex, PAMAP_IVEL|PAMAP_LIFE, cfra);
|
||||
psys_get_texture(sim, pa, &ptex, PAMAP_IVEL, cfra);
|
||||
|
||||
/* particles live in global space so */
|
||||
/* let's convert: */
|
||||
@ -1654,37 +1642,27 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
||||
mat4_to_quat(rot,ob->obmat);
|
||||
mul_qt_qtqt(r_rot,r_rot,rot);
|
||||
}
|
||||
#if 0
|
||||
}
|
||||
#endif
|
||||
|
||||
if(part->phystype==PART_PHYS_BOIDS && pa->boid) {
|
||||
BoidParticle *bpa = pa->boid;
|
||||
float dvec[3], q[4], mat[3][3];
|
||||
|
||||
copy_v3_v3(pa->state.co,loc);
|
||||
copy_v3_v3(state->co,loc);
|
||||
|
||||
/* boids don't get any initial velocity */
|
||||
zero_v3(pa->state.vel);
|
||||
zero_v3(state->vel);
|
||||
|
||||
/* boids store direction in ave */
|
||||
if(fabsf(nor[2])==1.0f) {
|
||||
sub_v3_v3v3(pa->state.ave, loc, ob->obmat[3]);
|
||||
normalize_v3(pa->state.ave);
|
||||
sub_v3_v3v3(state->ave, loc, ob->obmat[3]);
|
||||
normalize_v3(state->ave);
|
||||
}
|
||||
else {
|
||||
VECCOPY(pa->state.ave, nor);
|
||||
VECCOPY(state->ave, nor);
|
||||
}
|
||||
/* and gravity in r_ve */
|
||||
bpa->gravity[0] = bpa->gravity[1] = 0.0f;
|
||||
bpa->gravity[2] = -1.0f;
|
||||
if((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY)
|
||||
&& sim->scene->physics_settings.gravity[2]!=0.0f)
|
||||
bpa->gravity[2] = sim->scene->physics_settings.gravity[2];
|
||||
|
||||
/* calculate rotation matrix */
|
||||
project_v3_v3v3(dvec, r_vel, pa->state.ave);
|
||||
sub_v3_v3v3(mat[0], pa->state.ave, dvec);
|
||||
project_v3_v3v3(dvec, r_vel, state->ave);
|
||||
sub_v3_v3v3(mat[0], state->ave, dvec);
|
||||
normalize_v3(mat[0]);
|
||||
negate_v3_v3(mat[2], r_vel);
|
||||
normalize_v3(mat[2]);
|
||||
@ -1692,12 +1670,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
||||
|
||||
/* apply rotation */
|
||||
mat3_to_quat_is_ok( q,mat);
|
||||
copy_qt_qt(pa->state.rot, q);
|
||||
|
||||
bpa->data.health = part->boids->health;
|
||||
bpa->data.mode = eBoidMode_InAir;
|
||||
bpa->data.state_id = ((BoidState*)part->boids->states.first)->id;
|
||||
bpa->data.acc[0]=bpa->data.acc[1]=bpa->data.acc[2]=0.0f;
|
||||
copy_qt_qt(state->rot, q);
|
||||
}
|
||||
else {
|
||||
/* conversion done so now we apply new: */
|
||||
@ -1710,7 +1683,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
||||
|
||||
/* *emitter velocity */
|
||||
if(dtime != 0.f && part->obfac != 0.f){
|
||||
sub_v3_v3v3(vel, loc, pa->state.co);
|
||||
sub_v3_v3v3(vel, loc, state->co);
|
||||
mul_v3_fl(vel, part->obfac/dtime);
|
||||
}
|
||||
|
||||
@ -1747,13 +1720,13 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
||||
if(part->partfac != 0.f)
|
||||
madd_v3_v3fl(vel, p_vel, part->partfac);
|
||||
|
||||
mul_v3_v3fl(pa->state.vel, vel, ptex.ivel);
|
||||
mul_v3_v3fl(state->vel, vel, ptex.ivel);
|
||||
|
||||
/* -location from emitter */
|
||||
copy_v3_v3(pa->state.co,loc);
|
||||
copy_v3_v3(state->co,loc);
|
||||
|
||||
/* -rotation */
|
||||
unit_qt(pa->state.rot);
|
||||
unit_qt(state->rot);
|
||||
|
||||
if(part->rotmode){
|
||||
/* create vector into which rotation is aligned */
|
||||
@ -1793,32 +1766,74 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
||||
axis_angle_to_quat( q_phase,x_vec, phasefac*(float)M_PI);
|
||||
|
||||
/* combine base rotation & phase */
|
||||
mul_qt_qtqt(pa->state.rot, rot, q_phase);
|
||||
mul_qt_qtqt(state->rot, rot, q_phase);
|
||||
}
|
||||
|
||||
/* -angular velocity */
|
||||
|
||||
zero_v3(pa->state.ave);
|
||||
zero_v3(state->ave);
|
||||
|
||||
if(part->avemode){
|
||||
switch(part->avemode){
|
||||
case PART_AVE_SPIN:
|
||||
copy_v3_v3(pa->state.ave, vel);
|
||||
copy_v3_v3(state->ave, vel);
|
||||
break;
|
||||
case PART_AVE_RAND:
|
||||
copy_v3_v3(pa->state.ave, r_ave);
|
||||
copy_v3_v3(state->ave, r_ave);
|
||||
break;
|
||||
}
|
||||
normalize_v3(pa->state.ave);
|
||||
mul_v3_fl(pa->state.ave,part->avefac);
|
||||
normalize_v3(state->ave);
|
||||
mul_v3_fl(state->ave, part->avefac);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* sets particle to the emitter surface with initial velocity & rotation */
|
||||
void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, float cfra)
|
||||
{
|
||||
Object *ob = sim->ob;
|
||||
ParticleSystem *psys = sim->psys;
|
||||
ParticleSettings *part;
|
||||
ParticleTexture ptex;
|
||||
int p = pa - psys->particles;
|
||||
part=psys->part;
|
||||
|
||||
/* get precise emitter matrix if particle is born */
|
||||
if(part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
|
||||
/* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */
|
||||
while(ob) {
|
||||
BKE_animsys_evaluate_animdata(&ob->id, ob->adt, pa->time, ADT_RECALC_ANIM);
|
||||
ob = ob->parent;
|
||||
}
|
||||
ob = sim->ob;
|
||||
where_is_object_time(sim->scene, ob, pa->time);
|
||||
}
|
||||
|
||||
psys_get_birth_coordinates(sim, pa, &pa->state, dtime, cfra);
|
||||
|
||||
if(part->phystype==PART_PHYS_BOIDS && pa->boid) {
|
||||
BoidParticle *bpa = pa->boid;
|
||||
|
||||
/* and gravity in r_ve */
|
||||
bpa->gravity[0] = bpa->gravity[1] = 0.0f;
|
||||
bpa->gravity[2] = -1.0f;
|
||||
if((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY)
|
||||
&& sim->scene->physics_settings.gravity[2]!=0.0f)
|
||||
bpa->gravity[2] = sim->scene->physics_settings.gravity[2];
|
||||
|
||||
bpa->data.health = part->boids->health;
|
||||
bpa->data.mode = eBoidMode_InAir;
|
||||
bpa->data.state_id = ((BoidState*)part->boids->states.first)->id;
|
||||
bpa->data.acc[0]=bpa->data.acc[1]=bpa->data.acc[2]=0.0f;
|
||||
}
|
||||
|
||||
|
||||
if(part->type == PART_HAIR){
|
||||
pa->lifetime = 100.0f;
|
||||
}
|
||||
else{
|
||||
/* get possible textural influence */
|
||||
psys_get_texture(sim, pa, &ptex, PAMAP_LIFE, cfra);
|
||||
|
||||
pa->lifetime = part->lifetime * ptex.life;
|
||||
|
||||
if(part->randlife != 0.0f)
|
||||
@ -1904,6 +1919,7 @@ static void set_keyed_keys(ParticleSimulationData *sim)
|
||||
PARTICLE_P;
|
||||
ParticleKey *key;
|
||||
int totpart = psys->totpart, k, totkeys = psys->totkeyed;
|
||||
int keyed_flag = 0;
|
||||
|
||||
ksim.scene= sim->scene;
|
||||
|
||||
@ -1933,6 +1949,8 @@ static void set_keyed_keys(ParticleSimulationData *sim)
|
||||
for(k=0; k<totkeys; k++) {
|
||||
ksim.ob = pt->ob ? pt->ob : sim->ob;
|
||||
ksim.psys = BLI_findlink(&ksim.ob->particlesystem, pt->psys - 1);
|
||||
keyed_flag = (ksim.psys->flag & PSYS_KEYED);
|
||||
ksim.psys->flag &= ~PSYS_KEYED;
|
||||
|
||||
LOOP_PARTICLES {
|
||||
key = pa->keys + k;
|
||||
@ -1956,6 +1974,8 @@ static void set_keyed_keys(ParticleSimulationData *sim)
|
||||
if(psys->flag & PSYS_KEYED_TIMING && pt->duration!=0.0f)
|
||||
k++;
|
||||
|
||||
ksim.psys->flag |= keyed_flag;
|
||||
|
||||
pt = (pt->next && pt->next->flag & PTARGET_VALID)? pt->next : psys->targets.first;
|
||||
}
|
||||
|
||||
|
@ -430,6 +430,7 @@ void init_actuator(bActuator *act)
|
||||
act->data= MEM_callocN(sizeof(bCameraActuator), "camact");
|
||||
ca = act->data;
|
||||
ca->axis = ACT_CAMERA_X;
|
||||
ca->damping = 1.0/32.0;
|
||||
break;
|
||||
case ACT_EDIT_OBJECT:
|
||||
act->data= MEM_callocN(sizeof(bEditObjectActuator), "editobact");
|
||||
|
@ -476,8 +476,7 @@ Scene *add_scene(const char *name)
|
||||
sce->audio.doppler_factor = 1.0;
|
||||
sce->audio.speed_of_sound = 343.3;
|
||||
|
||||
strcpy(sce->r.backbuf, "//backbuf");
|
||||
strcpy(sce->r.pic, U.renderdir);
|
||||
BLI_strncpy(sce->r.pic, U.renderdir, sizeof(sce->r.pic));
|
||||
|
||||
BLI_init_rctf(&sce->r.safety, 0.1f, 0.9f, 0.1f, 0.9f);
|
||||
sce->r.osa= 8;
|
||||
|
@ -1582,7 +1582,7 @@ typedef struct WipeZone {
|
||||
static void precalc_wipe_zone(WipeZone *wipezone, WipeVars *wipe, int xo, int yo)
|
||||
{
|
||||
wipezone->flip = (wipe->angle < 0);
|
||||
wipezone->angle = pow(fabsf(wipe->angle)/45.0f, log(xo)/log(2.0f));
|
||||
wipezone->angle = pow(fabsf(wipe->angle)/45.0f, log(xo)/M_LN2);
|
||||
wipezone->xo = xo;
|
||||
wipezone->yo = yo;
|
||||
wipezone->width = (int)(wipe->edgeWidth*((xo+yo)/2.0f));
|
||||
@ -3021,10 +3021,15 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
|
||||
/* if not already done, load / initialize data */
|
||||
get_sequence_effect(seq);
|
||||
|
||||
if (!(force || seq->len != v->length || !v->frameMap)) {
|
||||
if ( (force == FALSE) &&
|
||||
(seq->len == v->length) &&
|
||||
(v->frameMap != NULL)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (!seq->seq1) { /* make coverity happy and check for (CID 598)
|
||||
if ( (seq->seq1 == NULL) ||
|
||||
(seq->len < 1)
|
||||
) { /* make coverity happy and check for (CID 598)
|
||||
input strip ... */
|
||||
return;
|
||||
}
|
||||
|
@ -587,8 +587,22 @@ void calc_sequence(Scene *scene, Sequence *seq)
|
||||
if (seq->seq1) {
|
||||
seq->start= seq->startdisp= MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp);
|
||||
seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
|
||||
/* we cant help if strips don't overlap, it wont give useful results.
|
||||
* but at least ensure 'len' is never negative which causes bad bugs elsewhere. */
|
||||
if(seq->enddisp < seq->startdisp) {
|
||||
/* simple start/end swap */
|
||||
seq->start= seq->enddisp;
|
||||
seq->enddisp = seq->startdisp;
|
||||
seq->startdisp= seq->start;
|
||||
seq->flag |= SEQ_INVALID_EFFECT;
|
||||
}
|
||||
else {
|
||||
seq->flag &= ~SEQ_INVALID_EFFECT;
|
||||
}
|
||||
|
||||
seq->len= seq->enddisp - seq->startdisp;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
calc_sequence_disp(scene, seq);
|
||||
}
|
||||
|
||||
|
@ -162,6 +162,9 @@ void barycentric_transform(float pt_tar[3], float const pt_src[3],
|
||||
void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2],
|
||||
const float co[2], float w[3]);
|
||||
|
||||
void resolve_tri_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2]);
|
||||
void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2]);
|
||||
|
||||
/***************************** View & Projection *****************************/
|
||||
|
||||
void lookat_m4(float mat[4][4], float vx, float vy,
|
||||
|
@ -58,6 +58,8 @@ MINLINE void swap_v4_v4(float a[4], float b[4]);
|
||||
|
||||
/********************************* Arithmetic ********************************/
|
||||
|
||||
MINLINE void add_v3_fl(float r[3], float f);
|
||||
MINLINE void add_v4_fl(float r[4], float f);
|
||||
MINLINE void add_v2_v2(float r[2], const float a[2]);
|
||||
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2]);
|
||||
MINLINE void add_v3_v3(float r[3], const float a[3]);
|
||||
|
@ -103,6 +103,12 @@
|
||||
|
||||
#define FTOCHAR(val) ((val)<=0.0f)? 0 : (((val)>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*(val))+0.5f))
|
||||
#define FTOUSHORT(val) ((val >= 1.0f-0.5f/65535)? 65535: (val <= 0.0f)? 0: (unsigned short)(val*65535.0f + 0.5f))
|
||||
#define F3TOCHAR3(v2,v1) (v1)[0]=FTOCHAR((v2[0])); (v1)[1]=FTOCHAR((v2[1])); (v1)[2]=FTOCHAR((v2[2]))
|
||||
#define F3TOCHAR4(v2,v1) { (v1)[0]=FTOCHAR((v2[0])); (v1)[1]=FTOCHAR((v2[1])); (v1)[2]=FTOCHAR((v2[2])); \
|
||||
(v1)[3]=FTOCHAR((v2[3])); (v1)[3] = 255; }
|
||||
#define F4TOCHAR4(v2,v1) { (v1)[0]=FTOCHAR((v2[0])); (v1)[1]=FTOCHAR((v2[1])); (v1)[2]=FTOCHAR((v2[2])); \
|
||||
(v1)[3]=FTOCHAR((v2[3])); (v1)[3]=FTOCHAR((v2[3])); }
|
||||
|
||||
|
||||
#define VECCOPY(v1,v2) {*(v1)= *(v2); *(v1+1)= *(v2+1); *(v1+2)= *(v2+2);}
|
||||
#define VECCOPY2D(v1,v2) {*(v1)= *(v2); *(v1+1)= *(v2+1);}
|
||||
|
@ -114,7 +114,7 @@ MINLINE float shell_angle_to_dist(const float angle)
|
||||
/* used for zoom values*/
|
||||
MINLINE float power_of_2(float val)
|
||||
{
|
||||
return (float)pow(2.0, ceil(log((double)val) / log(2.0)));
|
||||
return (float)pow(2.0, ceil(log((double)val) / M_LN2));
|
||||
}
|
||||
|
||||
MINLINE float minf(float a, float b)
|
||||
|
@ -1809,6 +1809,80 @@ void interp_cubic_v3(float x[3], float v[3], const float x1[3], const float v1[3
|
||||
v[2]= 3*a[2]*t2 + 2*b[2]*t + v1[2];
|
||||
}
|
||||
|
||||
/* unfortunately internal calculations have to be done at double precision to achieve correct/stable results. */
|
||||
|
||||
#define IS_ZERO(x) ((x>(-DBL_EPSILON) && x<DBL_EPSILON) ? 1 : 0)
|
||||
|
||||
/* Barycentric reverse */
|
||||
void resolve_tri_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2])
|
||||
{
|
||||
/* find UV such that
|
||||
t= u*t0 + v*t1 + (1-u-v)*t2
|
||||
u*(t0-t2) + v*(t1-t2)= t-t2 */
|
||||
const double a= st0[0]-st2[0], b= st1[0]-st2[0];
|
||||
const double c= st0[1]-st2[1], d= st1[1]-st2[1];
|
||||
const double det= a*d - c*b;
|
||||
|
||||
if(IS_ZERO(det)==0) { /* det should never be zero since the determinant is the signed ST area of the triangle. */
|
||||
const double x[]= {st[0]-st2[0], st[1]-st2[1]};
|
||||
|
||||
uv[0]= (float)((d*x[0] - b*x[1])/det);
|
||||
uv[1]= (float)(((-c)*x[0] + a*x[1])/det);
|
||||
} else zero_v2(uv);
|
||||
}
|
||||
|
||||
/* bilinear reverse */
|
||||
void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2])
|
||||
{
|
||||
const double signed_area= (st0[0]*st1[1] - st0[1]*st1[0]) + (st1[0]*st2[1] - st1[1]*st2[0]) +
|
||||
(st2[0]*st3[1] - st2[1]*st3[0]) + (st3[0]*st0[1] - st3[1]*st0[0]);
|
||||
|
||||
/* X is 2D cross product (determinant)
|
||||
A= (p0-p) X (p0-p3)*/
|
||||
const double a= (st0[0]-st[0])*(st0[1]-st3[1]) - (st0[1]-st[1])*(st0[0]-st3[0]);
|
||||
|
||||
/* B= ( (p0-p) X (p1-p2) + (p1-p) X (p0-p3) ) / 2 */
|
||||
const double b= 0.5 * ( ((st0[0]-st[0])*(st1[1]-st2[1]) - (st0[1]-st[1])*(st1[0]-st2[0])) +
|
||||
((st1[0]-st[0])*(st0[1]-st3[1]) - (st1[1]-st[1])*(st0[0]-st3[0])) );
|
||||
|
||||
/* C = (p1-p) X (p1-p2) */
|
||||
const double fC= (st1[0]-st[0])*(st1[1]-st2[1]) - (st1[1]-st[1])*(st1[0]-st2[0]);
|
||||
const double denom= a - 2*b + fC;
|
||||
|
||||
// clear outputs
|
||||
zero_v2(uv);
|
||||
|
||||
if(IS_ZERO(denom)!=0) {
|
||||
const double fDen= a-fC;
|
||||
if(IS_ZERO(fDen)==0)
|
||||
uv[0]= (float)(a / fDen);
|
||||
} else {
|
||||
const double desc_sq= b*b - a*fC;
|
||||
const double desc= sqrt(desc_sq<0.0?0.0:desc_sq);
|
||||
const double s= signed_area>0 ? (-1.0) : 1.0;
|
||||
|
||||
uv[0]= (float)(( (a-b) + s * desc ) / denom);
|
||||
}
|
||||
|
||||
/* find UV such that
|
||||
fST = (1-u)(1-v)*ST0 + u*(1-v)*ST1 + u*v*ST2 + (1-u)*v*ST3 */
|
||||
{
|
||||
const double denom_s= (1-uv[0])*(st0[0]-st3[0]) + uv[0]*(st1[0]-st2[0]);
|
||||
const double denom_t= (1-uv[0])*(st0[1]-st3[1]) + uv[0]*(st1[1]-st2[1]);
|
||||
int i= 0; double denom= denom_s;
|
||||
|
||||
if(fabs(denom_s)<fabs(denom_t)) {
|
||||
i= 1;
|
||||
denom=denom_t;
|
||||
}
|
||||
|
||||
if(IS_ZERO(denom)==0)
|
||||
uv[1]= (float) (( (1-uv[0])*(st0[i]-st[i]) + uv[0]*(st1[i]-st[i]) ) / denom);
|
||||
}
|
||||
}
|
||||
|
||||
#undef IS_ZERO
|
||||
|
||||
/***************************** View & Projection *****************************/
|
||||
|
||||
void orthographic_m4(float matrix[][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
|
||||
|
@ -102,6 +102,21 @@ MINLINE void swap_v4_v4(float a[4], float b[4])
|
||||
|
||||
/********************************* Arithmetic ********************************/
|
||||
|
||||
MINLINE void add_v3_fl(float r[3], float f)
|
||||
{
|
||||
r[0] += f;
|
||||
r[1] += f;
|
||||
r[2] += f;
|
||||
}
|
||||
|
||||
MINLINE void add_v4_fl(float r[4], float f)
|
||||
{
|
||||
r[0] += f;
|
||||
r[1] += f;
|
||||
r[2] += f;
|
||||
r[3] += f;
|
||||
}
|
||||
|
||||
MINLINE void add_v2_v2(float *r, const float *a)
|
||||
{
|
||||
r[0] += a[0];
|
||||
|
@ -216,13 +216,13 @@ int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, cons
|
||||
int number;
|
||||
int len= BLI_split_name_num(left, &number, name, delim);
|
||||
do {
|
||||
int newlen= BLI_snprintf(tempname, name_len, "%s%c%03d", left, delim, number);
|
||||
int newlen= BLI_snprintf(tempname, name_len, "%s%c%03d", left, delim, ++number);
|
||||
if(newlen >= name_len) {
|
||||
len -= ((newlen + 1) - name_len);
|
||||
if(len < 0) len= number= 0;
|
||||
left[len]= '\0';
|
||||
}
|
||||
} while(number++, unique_check(arg, tempname));
|
||||
} while(unique_check(arg, tempname));
|
||||
|
||||
BLI_strncpy(name, tempname, name_len);
|
||||
|
||||
|
@ -1723,7 +1723,6 @@ static void lib_link_fcurves(FileData *fd, ID *id, ListBase *list)
|
||||
static void direct_link_fmodifiers(FileData *fd, ListBase *list)
|
||||
{
|
||||
FModifier *fcm;
|
||||
int a;
|
||||
|
||||
for (fcm= list->first; fcm; fcm= fcm->next) {
|
||||
/* relink general data */
|
||||
@ -1739,6 +1738,7 @@ static void direct_link_fmodifiers(FileData *fd, ListBase *list)
|
||||
data->coefficients= newdataadr(fd, data->coefficients);
|
||||
|
||||
if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
|
||||
unsigned int a;
|
||||
for(a = 0; a < data->arraysize; a++)
|
||||
SWITCH_INT(data->coefficients[a]);
|
||||
}
|
||||
@ -3843,26 +3843,10 @@ static void lib_link_object(FileData *fd, Main *main)
|
||||
|
||||
if(smd && smd->type == MOD_SMOKE_TYPE_DOMAIN && smd->domain)
|
||||
{
|
||||
smd->domain->coll_group = newlibadr_us(fd, ob->id.lib, smd->domain->coll_group);
|
||||
smd->domain->eff_group = newlibadr_us(fd, ob->id.lib, smd->domain->eff_group);
|
||||
smd->domain->fluid_group = newlibadr_us(fd, ob->id.lib, smd->domain->fluid_group);
|
||||
|
||||
smd->domain->effector_weights->group = newlibadr(fd, ob->id.lib, smd->domain->effector_weights->group);
|
||||
|
||||
smd->domain->flags |= MOD_SMOKE_FILE_LOAD; /* flag for refreshing the simulation after loading */
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
|
||||
|
||||
if(clmd)
|
||||
{
|
||||
clmd->sim_parms->effector_weights->group = newlibadr(fd, ob->id.lib, clmd->sim_parms->effector_weights->group);
|
||||
clmd->coll_parms->group= newlibadr(fd, ob->id.lib, clmd->coll_parms->group);
|
||||
}
|
||||
}
|
||||
|
||||
/* texture field */
|
||||
if(ob->pd)
|
||||
lib_link_partdeflect(fd, &ob->id, ob->pd);
|
||||
@ -5660,9 +5644,8 @@ static BHead *read_data_into_oldnewmap(FileData *fd, BHead *bhead, const char *a
|
||||
#if 0
|
||||
/* XXX DUMB DEBUGGING OPTION TO GIVE NAMES for guarded malloc errors */
|
||||
short *sp= fd->filesdna->structs[bhead->SDNAnr];
|
||||
char *allocname = fd->filesdna->types[ sp[0] ];
|
||||
char *tmp= malloc(100);
|
||||
|
||||
allocname = fd->filesdna->types[ sp[0] ];
|
||||
strcpy(tmp, allocname);
|
||||
data= read_struct(fd, bhead, tmp);
|
||||
#else
|
||||
@ -6280,7 +6263,7 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb)
|
||||
|
||||
BLI_addtail(lb, ar);
|
||||
ar->regiontype= RGN_TYPE_HEADER;
|
||||
if(sa->headertype==1)
|
||||
if(sa->headertype==HEADERDOWN)
|
||||
ar->alignment= RGN_ALIGN_BOTTOM;
|
||||
else
|
||||
ar->alignment= RGN_ALIGN_TOP;
|
||||
@ -11664,6 +11647,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
/* add default value for behind strength of camera actuator */
|
||||
Object *ob;
|
||||
bActuator *act;
|
||||
for(ob = main->object.first; ob; ob= ob->id.next) {
|
||||
for(act= ob->actuators.first; act; act= act->next) {
|
||||
if (act->type == ACT_CAMERA) {
|
||||
bCameraActuator *ba= act->data;
|
||||
|
||||
ba->damping = 1.0/32.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
|
||||
@ -12723,7 +12721,6 @@ static int object_in_any_scene(Main *mainvar, Object *ob)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* when *lib set, it also does objects that were in the appended group */
|
||||
static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const short idcode, const short is_link)
|
||||
{
|
||||
Object *ob;
|
||||
@ -12758,8 +12755,14 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const
|
||||
/* when appending, make sure any indirectly loaded objects
|
||||
* get a base else they cant be accessed at all [#27437] */
|
||||
if(ob->id.us==1 && is_link==FALSE && ob->id.lib==lib) {
|
||||
if(object_in_any_scene(mainvar, ob)==0) {
|
||||
do_it= 1;
|
||||
|
||||
/* we may be appending from a scene where we already
|
||||
* have a linked object which is not in any scene [#27616] */
|
||||
if((ob->id.flag & LIB_PRE_EXISTING)==0) {
|
||||
|
||||
if(object_in_any_scene(mainvar, ob)==0) {
|
||||
do_it= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12780,7 +12783,6 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const
|
||||
}
|
||||
}
|
||||
|
||||
/* when *lib set, it also does objects that were in the appended group */
|
||||
static void give_base_to_groups(Main *mainvar, Scene *scene)
|
||||
{
|
||||
Group *group;
|
||||
|
@ -959,12 +959,12 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
|
||||
|
||||
if(IS_EQ(linatt, 0.0f) && quadatt > 0.0f) {
|
||||
att2 = quadatt;
|
||||
d = (1.0f/quadatt) * 2;
|
||||
d = sqrt(1.0f/quadatt);
|
||||
}
|
||||
// linear light
|
||||
else if(IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
|
||||
att1 = linatt;
|
||||
d = (1.0f/linatt) * 2;
|
||||
d = (1.0f/linatt);
|
||||
} else if (IS_EQ(constatt, 1.0f)) {
|
||||
att1 = 1.0f;
|
||||
} else {
|
||||
@ -987,9 +987,12 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
|
||||
case COLLADAFW::Light::SPOT_LIGHT:
|
||||
{
|
||||
lamp->type = LA_SPOT;
|
||||
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
|
||||
lamp->att1 = att1;
|
||||
lamp->att2 = att2;
|
||||
if(IS_EQ(att1, 0.0f) && att2 > 0)
|
||||
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
|
||||
if(IS_EQ(att2, 0.0f) && att1 > 0)
|
||||
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
|
||||
lamp->spotsize = light->getFallOffAngle().getValue();
|
||||
lamp->spotblend = light->getFallOffExponent().getValue();
|
||||
}
|
||||
@ -1004,9 +1007,12 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
|
||||
case COLLADAFW::Light::POINT_LIGHT:
|
||||
{
|
||||
lamp->type = LA_LOCAL;
|
||||
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
|
||||
lamp->att1 = att1;
|
||||
lamp->att2 = att2;
|
||||
if(IS_EQ(att1, 0.0f) && att2 > 0)
|
||||
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
|
||||
if(IS_EQ(att2, 0.0f) && att1 > 0)
|
||||
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
|
||||
}
|
||||
break;
|
||||
case COLLADAFW::Light::UNDEFINED:
|
||||
|
@ -273,7 +273,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
|
||||
std::string uvname = strlen(t->uvname) ? t->uvname : active_uv;
|
||||
|
||||
// color
|
||||
if (t->mapto & MAP_COL) {
|
||||
if (t->mapto & MAP_COL | MAP_COLSPEC) {
|
||||
ep.setDiffuse(createTexture(ima, uvname, sampler));
|
||||
}
|
||||
// ambient
|
||||
|
@ -68,20 +68,18 @@ void LightsExporter::operator()(Object *ob)
|
||||
std::string la_name(id_name(la));
|
||||
COLLADASW::Color col(la->r * la->energy, la->g * la->energy, la->b * la->energy);
|
||||
float e, d, constatt, linatt, quadatt;
|
||||
float r;
|
||||
|
||||
d = la->dist;
|
||||
r = d/2.0f;
|
||||
|
||||
constatt = 1.0f;
|
||||
|
||||
if(la->falloff_type==LA_FALLOFF_INVLINEAR) {
|
||||
linatt = 1.0f / r;
|
||||
linatt = 1.0f / d;
|
||||
quadatt = 0.0f;
|
||||
}
|
||||
else {
|
||||
linatt = 0.0f;
|
||||
quadatt = 1.0f / r;
|
||||
quadatt = 1.0f / (d * d);
|
||||
}
|
||||
|
||||
// sun
|
||||
|
@ -1903,6 +1903,7 @@ static void ANIM_OT_channels_select_border(wmOperatorType *ot)
|
||||
ot->invoke= WM_border_select_invoke;
|
||||
ot->exec= animchannels_borderselect_exec;
|
||||
ot->modal= WM_border_select_modal;
|
||||
ot->cancel= WM_border_select_cancel;
|
||||
|
||||
ot->poll= animedit_poll_channels_nla_tweakmode_off;
|
||||
|
||||
|
@ -717,7 +717,7 @@ static void ed_marker_move_apply(wmOperator *op)
|
||||
}
|
||||
|
||||
/* only for modal */
|
||||
static void ed_marker_move_cancel(bContext *C, wmOperator *op)
|
||||
static int ed_marker_move_cancel(bContext *C, wmOperator *op)
|
||||
{
|
||||
RNA_int_set(op->ptr, "frames", 0);
|
||||
ed_marker_move_apply(op);
|
||||
@ -725,6 +725,8 @@ static void ed_marker_move_cancel(bContext *C, wmOperator *op)
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL);
|
||||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
|
||||
@ -886,6 +888,7 @@ static void MARKER_OT_move(wmOperatorType *ot)
|
||||
ot->invoke= ed_marker_move_invoke_wrapper;
|
||||
ot->modal= ed_marker_move_modal;
|
||||
ot->poll= ed_markers_poll_selected_markers;
|
||||
ot->cancel= ed_marker_move_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
|
||||
@ -980,6 +983,7 @@ static void MARKER_OT_duplicate(wmOperatorType *ot)
|
||||
ot->invoke= ed_marker_duplicate_invoke_wrapper;
|
||||
ot->modal= ed_marker_move_modal;
|
||||
ot->poll= ed_markers_poll_selected_markers;
|
||||
ot->cancel= ed_marker_move_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
@ -1185,6 +1189,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot)
|
||||
ot->exec= ed_marker_border_select_exec;
|
||||
ot->invoke= ed_marker_select_border_invoke_wrapper;
|
||||
ot->modal= WM_border_select_modal;
|
||||
ot->cancel= WM_border_select_cancel;
|
||||
|
||||
ot->poll= ed_markers_poll_markers_exist;
|
||||
|
||||
|
@ -199,8 +199,8 @@ static int previewrange_define_exec(bContext *C, wmOperator *op)
|
||||
* - must clamp within allowable limits
|
||||
* - end must not be before start (though this won't occur most of the time)
|
||||
*/
|
||||
if (sfra < 1) sfra = 1.0f;
|
||||
if (efra < 1) efra = 1.0f;
|
||||
FRAMENUMBER_MIN_CLAMP(sfra);
|
||||
FRAMENUMBER_MIN_CLAMP(efra);
|
||||
if (efra < sfra) efra= sfra;
|
||||
|
||||
scene->r.flag |= SCER_PRV_RANGE;
|
||||
@ -224,6 +224,7 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot)
|
||||
ot->invoke= WM_border_select_invoke;
|
||||
ot->exec= previewrange_define_exec;
|
||||
ot->modal= WM_border_select_modal;
|
||||
ot->cancel= WM_border_select_cancel;
|
||||
|
||||
ot->poll= ED_operator_animview_active;
|
||||
|
||||
|
@ -29,41 +29,48 @@ set(INC_SYS
|
||||
|
||||
set(SRC
|
||||
Bfont.c
|
||||
add.png.c
|
||||
bfont.ttf.c
|
||||
blenderbuttons.c
|
||||
blob.png.c
|
||||
blur.png.c
|
||||
bmonofont.ttf.c
|
||||
clay.png.c
|
||||
clone.png.c
|
||||
crease.png.c
|
||||
darken.png.c
|
||||
draw.png.c
|
||||
fill.png.c
|
||||
flatten.png.c
|
||||
grab.png.c
|
||||
inflate.png.c
|
||||
layer.png.c
|
||||
lighten.png.c
|
||||
mix.png.c
|
||||
multiply.png.c
|
||||
nudge.png.c
|
||||
pinch.png.c
|
||||
preview.blend.c
|
||||
prvicons.c
|
||||
scrape.png.c
|
||||
smear.png.c
|
||||
smooth.png.c
|
||||
snake_hook.png.c
|
||||
soften.png.c
|
||||
splash.png.c
|
||||
startup.blend.c
|
||||
subtract.png.c
|
||||
texdraw.png.c
|
||||
thumb.png.c
|
||||
twist.png.c
|
||||
vertexdraw.png.c
|
||||
preview.blend.c
|
||||
)
|
||||
|
||||
if(NOT WITH_HEADLESS)
|
||||
list(APPEND SRC
|
||||
splash.png.c
|
||||
blenderbuttons.c
|
||||
|
||||
# brushes
|
||||
add.png.c
|
||||
blob.png.c
|
||||
blur.png.c
|
||||
clay.png.c
|
||||
clone.png.c
|
||||
crease.png.c
|
||||
darken.png.c
|
||||
draw.png.c
|
||||
fill.png.c
|
||||
flatten.png.c
|
||||
grab.png.c
|
||||
inflate.png.c
|
||||
layer.png.c
|
||||
lighten.png.c
|
||||
mix.png.c
|
||||
multiply.png.c
|
||||
nudge.png.c
|
||||
pinch.png.c
|
||||
prvicons.c
|
||||
scrape.png.c
|
||||
smear.png.c
|
||||
smooth.png.c
|
||||
snake_hook.png.c
|
||||
soften.png.c
|
||||
subtract.png.c
|
||||
texdraw.png.c
|
||||
thumb.png.c
|
||||
twist.png.c
|
||||
vertexdraw.png.c
|
||||
)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_editor_datafiles "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
@ -8854,8 +8854,8 @@ char datatoc_startup_blend[]= {
|
||||
0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255,
|
||||
0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127,
|
||||
0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,
|
||||
241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
|
||||
0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255,204, 0,153,255, 0, 0, 0, 18,255,133, 0, 60,
|
||||
241, 88, 0,255, 0, 0, 0, 40,255,170, 64,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
|
||||
0, 0, 0,255,255,160, 0,255,219, 37, 18,255,32, 255,255,255, 75, 75, 75,255,204, 0,153,255, 0, 0, 0, 18,255,133, 0, 60,
|
||||
255,133, 0,255, 32, 0, 0,255, 0, 32, 0,255, 0, 0,128,255, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
|
||||
80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
|
||||
240,144,160,255,255,255,255,255, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0,255,240,255, 64,255,
|
||||
|
@ -206,10 +206,10 @@ struct bDeformGroup *ED_vgroup_add(struct Object *ob);
|
||||
struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, const char *name);
|
||||
void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup);
|
||||
void ED_vgroup_select_by_name(struct Object *ob, const char *name);
|
||||
void ED_vgroup_data_create(struct ID *id);
|
||||
int ED_vgroup_data_create(struct ID *id);
|
||||
int ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
|
||||
int ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from);
|
||||
void ED_vgroup_mirror(struct Object *ob, int mirror_weights, int flip_vgroups);
|
||||
void ED_vgroup_mirror(struct Object *ob, const short mirror_weights, const short flip_vgroups);
|
||||
|
||||
int ED_vgroup_object_is_edit_mode(struct Object *ob);
|
||||
|
||||
|
@ -71,8 +71,9 @@ void PE_undo_push(struct Scene *scene, const char *str);
|
||||
void PE_undo_step(struct Scene *scene, int step);
|
||||
void PE_undo(struct Scene *scene);
|
||||
void PE_redo(struct Scene *scene);
|
||||
void PE_undo_menu(struct Scene *scene, struct Object *ob);
|
||||
int PE_undo_valid(struct Scene *scene);
|
||||
void PE_undo_number(struct Scene *scene, int nr);
|
||||
char *PE_undo_get_name(struct Scene *scene, int nr, int *active);
|
||||
|
||||
#endif /* ED_PARTICLE_H */
|
||||
|
||||
|
@ -90,6 +90,7 @@ void ED_area_headerprint(ScrArea *sa, const char *str);
|
||||
void ED_area_newspace(struct bContext *C, ScrArea *sa, int type);
|
||||
void ED_area_prevspace(struct bContext *C, ScrArea *sa);
|
||||
void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2);
|
||||
int ED_area_headersize(void);
|
||||
|
||||
/* screens */
|
||||
void ED_screens_initialize(struct wmWindowManager *wm);
|
||||
@ -106,7 +107,7 @@ void ED_screen_set_subwinactive(struct bContext *C, struct wmEvent *event);
|
||||
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
|
||||
void ED_screen_animation_timer(struct bContext *C, int redraws, int refresh, int sync, int enable);
|
||||
void ED_screen_animation_timer_update(struct bScreen *screen, int redraws, int refresh);
|
||||
int ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
|
||||
ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
|
||||
void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa);
|
||||
void ED_screen_full_restore(struct bContext *C, ScrArea *sa);
|
||||
struct ScrArea *ED_screen_full_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa);
|
||||
|
@ -40,10 +40,6 @@
|
||||
#define SELECT 1
|
||||
#define ACTIVE 2
|
||||
|
||||
/* buttons */
|
||||
#define XIC 20
|
||||
#define YIC 20
|
||||
|
||||
/* proposal = put scene pointers on function calls? */
|
||||
// #define BASACT (scene->basact)
|
||||
// #define OBACT (BASACT? BASACT->object: NULL)
|
||||
|
@ -59,6 +59,7 @@ void ED_undo_redo (struct bContext *C);
|
||||
void ED_OT_undo (struct wmOperatorType *ot);
|
||||
void ED_OT_undo_push (struct wmOperatorType *ot);
|
||||
void ED_OT_redo (struct wmOperatorType *ot);
|
||||
void ED_OT_undo_history (struct wmOperatorType *ot);
|
||||
|
||||
int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op);
|
||||
/* convenience since UI callbacks use this mostly*/
|
||||
@ -76,11 +77,7 @@ void undo_editmode_push(struct bContext *C, const char *name,
|
||||
int (*validate_undo)(void *, void *));
|
||||
|
||||
|
||||
void *undo_editmode_get_prev (struct Object *ob);
|
||||
struct uiBlock *editmode_undohistorymenu(struct bContext *C, struct ARegion *ar, void *arg_unused);
|
||||
void undo_editmode_menu (struct bContext *C);
|
||||
void undo_editmode_clear (void);
|
||||
void undo_editmode_step (struct bContext *C, int step);
|
||||
|
||||
/* crazyspace.c */
|
||||
float *crazyspace_get_mapped_editverts(struct Scene *scene, struct Object *obedit);
|
||||
|
@ -265,6 +265,7 @@ struct ARegion *ED_view3d_context_region_unlock(struct bContext *C);
|
||||
int ED_operator_rv3d_unlock_poll(struct bContext *C);
|
||||
|
||||
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d);
|
||||
void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d);
|
||||
|
||||
int ED_view3d_scene_layer_set(int lay, const int *values, int *active);
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
#define UI_INTERFACE_H
|
||||
|
||||
#include "RNA_types.h"
|
||||
#include "DNA_userdef_types.h"
|
||||
|
||||
/* Struct Declarations */
|
||||
|
||||
@ -100,8 +101,8 @@ typedef struct uiLayout uiLayout;
|
||||
#define UI_BLOCK_RET_1 4 /* XXX 2.5 not implemented */
|
||||
#define UI_BLOCK_NUMSELECT 8
|
||||
/*#define UI_BLOCK_ENTER_OK 16*/ /*UNUSED*/
|
||||
/*#define UI_BLOCK_NOSHADOW 32*/ /*UNUSED*/
|
||||
/*#define UI_BLOCK_UNUSED 64*/ /*UNUSED*/
|
||||
#define UI_BLOCK_CLIPBOTTOM 32
|
||||
#define UI_BLOCK_CLIPTOP 64
|
||||
#define UI_BLOCK_MOVEMOUSE_QUIT 128
|
||||
#define UI_BLOCK_KEEP_OPEN 256
|
||||
#define UI_BLOCK_POPUP 512
|
||||
@ -622,8 +623,8 @@ void UI_exit(void);
|
||||
#define UI_LAYOUT_MENU 2
|
||||
#define UI_LAYOUT_TOOLBAR 3
|
||||
|
||||
#define UI_UNIT_X 20
|
||||
#define UI_UNIT_Y 20
|
||||
#define UI_UNIT_X U.widget_unit
|
||||
#define UI_UNIT_Y U.widget_unit
|
||||
|
||||
#define UI_LAYOUT_ALIGN_EXPAND 0
|
||||
#define UI_LAYOUT_ALIGN_LEFT 1
|
||||
|
@ -49,6 +49,10 @@ typedef struct IconFile {
|
||||
|
||||
#define ICON_DEFAULT_HEIGHT 16
|
||||
#define ICON_DEFAULT_WIDTH 16
|
||||
|
||||
#define ICON_DEFAULT_HEIGHT_SCALE (UI_UNIT_Y * 0.8f)
|
||||
#define ICON_DEFAULT_WIDTH_SCALE (UI_UNIT_X * 0.8f)
|
||||
|
||||
#define PREVIEW_DEFAULT_HEIGHT 96
|
||||
|
||||
/*
|
||||
|
@ -63,6 +63,10 @@ if(WITH_INTERNATIONAL)
|
||||
add_definitions(-DINTERNATIONAL)
|
||||
endif()
|
||||
|
||||
if(WITH_HEADLESS)
|
||||
add_definitions(-DWITH_HEADLESS)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
add_definitions(-DWITH_PYTHON)
|
||||
endif()
|
||||
|
@ -74,6 +74,9 @@
|
||||
#define MENU_ITEM_HEIGHT 20
|
||||
#define MENU_SEP_HEIGHT 6
|
||||
|
||||
#define PRECISION_FLOAT_MAX 7
|
||||
#define PRECISION_FLOAT_MAX_POW 10000000 /* pow(10, PRECISION_FLOAT_MAX) */
|
||||
|
||||
/*
|
||||
* a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt
|
||||
*
|
||||
@ -449,6 +452,57 @@ void uiCenteredBoundsBlock(uiBlock *block, int addval)
|
||||
|
||||
/* link line drawing is not part of buttons or theme.. so we stick with it here */
|
||||
|
||||
static int ui_but_float_precision(uiBut *but, double value)
|
||||
{
|
||||
int prec;
|
||||
|
||||
/* first check if prec is 0 and fallback to a simple default */
|
||||
if((prec= (int)but->a2) == 0) {
|
||||
prec= (but->hardmax < 10.001f) ? 3 : 2;
|
||||
}
|
||||
|
||||
/* check on the number of decimal places neede to display
|
||||
* the number, this is so 0.00001 is not displayed as 0.00,
|
||||
* _but_, this is only for small values si 10.0001 will not get
|
||||
* the same treatment */
|
||||
if(value != 0.0 && (value= ABS(value)) < 0.1) {
|
||||
int value_i= (int)((value * PRECISION_FLOAT_MAX_POW) + 0.5);
|
||||
if(value_i != 0) {
|
||||
const int prec_span= 3; /* show: 0.01001, 5 would allow 0.0100001 for eg. */
|
||||
int test_prec;
|
||||
int prec_min= -1;
|
||||
int dec_flag= 0;
|
||||
int i= PRECISION_FLOAT_MAX;
|
||||
while(i && value_i) {
|
||||
if(value_i % 10) {
|
||||
dec_flag |= 1<<i;
|
||||
prec_min= i;
|
||||
}
|
||||
value_i /= 10;
|
||||
i--;
|
||||
}
|
||||
|
||||
/* even though its a small value, if the second last digit is not 0, use it */
|
||||
test_prec = prec_min;
|
||||
|
||||
dec_flag= (dec_flag >> (prec_min + 1)) & ((1 << prec_span) - 1);
|
||||
|
||||
while(dec_flag) {
|
||||
test_prec++;
|
||||
dec_flag = dec_flag >> 1;
|
||||
}
|
||||
|
||||
if(test_prec > prec) {
|
||||
prec= test_prec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CLAMP(prec, 1, PRECISION_FLOAT_MAX);
|
||||
|
||||
return prec;
|
||||
}
|
||||
|
||||
static void ui_draw_linkline(uiLinkLine *line)
|
||||
{
|
||||
rcti rect;
|
||||
@ -892,13 +946,14 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
|
||||
|
||||
/* widgets */
|
||||
for(but= block->buttons.first; but; but= but->next) {
|
||||
ui_but_to_pixelrect(&rect, ar, block, but);
|
||||
if(!(but->flag & (UI_HIDDEN|UI_SCROLLED))) {
|
||||
ui_but_to_pixelrect(&rect, ar, block, but);
|
||||
|
||||
if(!(but->flag & UI_HIDDEN) &&
|
||||
/* XXX: figure out why invalid coordinates happen when closing render window */
|
||||
/* and material preview is redrawn in main window (temp fix for bug #23848) */
|
||||
rect.xmin < rect.xmax && rect.ymin < rect.ymax)
|
||||
ui_draw_but(C, ar, &style, but, &rect);
|
||||
if(rect.xmin < rect.xmax && rect.ymin < rect.ymax)
|
||||
ui_draw_but(C, ar, &style, but, &rect);
|
||||
}
|
||||
}
|
||||
|
||||
/* restore matrix */
|
||||
@ -1444,8 +1499,8 @@ static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double va
|
||||
if(scene->unit.scale_length<0.0001f) scene->unit.scale_length= 1.0f; // XXX do_versions
|
||||
|
||||
/* Sanity checks */
|
||||
if(precision>7) precision= 7;
|
||||
else if(precision==0) precision= 2;
|
||||
if(precision > PRECISION_FLOAT_MAX) precision= PRECISION_FLOAT_MAX;
|
||||
else if(precision==0) precision= 2;
|
||||
|
||||
bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precision, scene->unit.system, unit_type>>16, do_split, pad);
|
||||
}
|
||||
@ -1529,10 +1584,7 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen)
|
||||
ui_get_but_string_unit(but, str, maxlen, value, 0);
|
||||
}
|
||||
else {
|
||||
int prec= (int)but->a2;
|
||||
if(prec==0) prec= 3;
|
||||
else CLAMP(prec, 1, 7);
|
||||
|
||||
const int prec= ui_but_float_precision(but, value);
|
||||
BLI_snprintf(str, maxlen, "%.*f", prec, value);
|
||||
}
|
||||
}
|
||||
@ -1681,7 +1733,7 @@ void ui_set_but_default(bContext *C, short all)
|
||||
static double soft_range_round_up(double value, double max)
|
||||
{
|
||||
/* round up to .., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, .. */
|
||||
double newmax= pow(10.0, ceil(log(value)/log(10.0)));
|
||||
double newmax= pow(10.0, ceil(log(value)/M_LN10));
|
||||
|
||||
if(newmax*0.2 >= max && newmax*0.2 >= value)
|
||||
return newmax*0.2;
|
||||
@ -1694,7 +1746,7 @@ static double soft_range_round_up(double value, double max)
|
||||
static double soft_range_round_down(double value, double max)
|
||||
{
|
||||
/* round down to .., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, .. */
|
||||
double newmax= pow(10.0, floor(log(value)/log(10.0)));
|
||||
double newmax= pow(10.0, floor(log(value)/M_LN10));
|
||||
|
||||
if(newmax*5.0 <= max && newmax*5.0 <= value)
|
||||
return newmax*5.0;
|
||||
@ -2008,10 +2060,7 @@ void ui_check_but(uiBut *but)
|
||||
BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%s", but->str, new_str);
|
||||
}
|
||||
else {
|
||||
int prec= (int)but->a2;
|
||||
if(prec==0) prec= (but->hardmax < 10.001f) ? 3 : 2;
|
||||
else CLAMP(prec, 1, 7);
|
||||
|
||||
const int prec= ui_but_float_precision(but, value);
|
||||
BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%.*f", but->str, prec, value);
|
||||
}
|
||||
}
|
||||
@ -2029,11 +2078,9 @@ void ui_check_but(uiBut *but)
|
||||
|
||||
case LABEL:
|
||||
if(ui_is_but_float(but)) {
|
||||
int prec= (int)but->a2;
|
||||
int prec;
|
||||
value= ui_get_but_val(but);
|
||||
if(prec==0) prec= 3;
|
||||
else CLAMP(prec, 1, 7);
|
||||
|
||||
prec= ui_but_float_precision(but, value);
|
||||
BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%.*f", but->str, prec, value);
|
||||
}
|
||||
else {
|
||||
|
@ -471,6 +471,9 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel)
|
||||
|
||||
void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *UNUSED(wcol), rcti *rect)
|
||||
{
|
||||
#ifdef WITH_HEADLESS
|
||||
(void)rect;
|
||||
#else
|
||||
extern char datatoc_splash_png[];
|
||||
extern int datatoc_splash_png_size;
|
||||
ImBuf *ibuf;
|
||||
@ -507,6 +510,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *
|
||||
*/
|
||||
|
||||
IMB_freeImBuf(ibuf);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -1116,7 +1120,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
|
||||
ColorBand *coba;
|
||||
CBData *cbd;
|
||||
float x1, y1, sizex, sizey;
|
||||
float dx, v3[2], v1[2], v2[2], v1a[2], v2a[2];
|
||||
float v3[2], v1[2], v2[2], v1a[2], v2a[2];
|
||||
int a;
|
||||
float pos, colf[4]= {0,0,0,0}; /* initialize incase the colorband isnt valid */
|
||||
|
||||
@ -1129,15 +1133,14 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
|
||||
sizey= rect->ymax-y1;
|
||||
|
||||
/* first background, to show tranparency */
|
||||
dx= sizex/12.0f;
|
||||
v1[0]= x1;
|
||||
for(a=0; a<12; a++) {
|
||||
if(a & 1) glColor3f(0.3, 0.3, 0.3); else glColor3f(0.8, 0.8, 0.8);
|
||||
glRectf(v1[0], y1, v1[0]+dx, y1+0.5f*sizey);
|
||||
if(a & 1) glColor3f(0.8, 0.8, 0.8); else glColor3f(0.3, 0.3, 0.3);
|
||||
glRectf(v1[0], y1+0.5f*sizey, v1[0]+dx, y1+sizey);
|
||||
v1[0]+= dx;
|
||||
}
|
||||
|
||||
glColor4ub(UI_TRANSP_DARK, UI_TRANSP_DARK, UI_TRANSP_DARK, 255);
|
||||
glRectf(x1, y1, x1+sizex, y1+sizey);
|
||||
glEnable(GL_POLYGON_STIPPLE);
|
||||
glColor4ub(UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, 255);
|
||||
glPolygonStipple(checker_stipple_sml);
|
||||
glRectf(x1, y1, x1+sizex, y1+sizey);
|
||||
glDisable(GL_POLYGON_STIPPLE);
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
glEnable(GL_BLEND);
|
||||
|
@ -81,6 +81,7 @@ static void ui_add_link(bContext *C, uiBut *from, uiBut *to);
|
||||
|
||||
#define BUTTON_TOOLTIP_DELAY 0.500
|
||||
#define BUTTON_FLASH_DELAY 0.020
|
||||
#define MENU_SCROLL_INTERVAL 0.1
|
||||
#define BUTTON_AUTO_OPEN_THRESH 0.3
|
||||
#define BUTTON_MOUSE_TOWARDS_THRESH 1.0
|
||||
|
||||
@ -4743,6 +4744,8 @@ static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y)
|
||||
continue;
|
||||
if(but->flag & UI_HIDDEN)
|
||||
continue;
|
||||
if(but->flag & UI_SCROLLED)
|
||||
continue;
|
||||
if(ui_but_contains_pt(but, mx, my))
|
||||
butover= but;
|
||||
}
|
||||
@ -5572,6 +5575,76 @@ static int ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *men
|
||||
return menu->dotowards;
|
||||
}
|
||||
|
||||
static char ui_menu_scroll_test(uiBlock *block, int my)
|
||||
{
|
||||
if(block->flag & (UI_BLOCK_CLIPTOP|UI_BLOCK_CLIPBOTTOM)) {
|
||||
if(block->flag & UI_BLOCK_CLIPTOP)
|
||||
if(my > block->maxy-14)
|
||||
return 't';
|
||||
if(block->flag & UI_BLOCK_CLIPBOTTOM)
|
||||
if(my < block->miny+14)
|
||||
return 'b';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ui_menu_scroll(ARegion *ar, uiBlock *block, int my)
|
||||
{
|
||||
char test= ui_menu_scroll_test(block, my);
|
||||
|
||||
if(test) {
|
||||
uiBut *b1= block->buttons.first;
|
||||
uiBut *b2= block->buttons.last;
|
||||
uiBut *bnext;
|
||||
uiBut *bprev;
|
||||
int dy= 0;
|
||||
|
||||
/* get first and last visible buttons */
|
||||
while(b1 && ui_but_next(b1) && (b1->flag & UI_SCROLLED))
|
||||
b1= ui_but_next(b1);
|
||||
while(b2 && ui_but_prev(b2) && (b2->flag & UI_SCROLLED))
|
||||
b2= ui_but_prev(b2);
|
||||
/* skips separators */
|
||||
bnext= ui_but_next(b1);
|
||||
bprev= ui_but_prev(b2);
|
||||
|
||||
if(bnext==NULL || bprev==NULL)
|
||||
return 0;
|
||||
|
||||
if(test=='t') {
|
||||
/* bottom button is first button */
|
||||
if(b1->y1 < b2->y1)
|
||||
dy= bnext->y1 - b1->y1;
|
||||
/* bottom button is last button */
|
||||
else
|
||||
dy= bprev->y1 - b2->y1;
|
||||
}
|
||||
else if(test=='b') {
|
||||
/* bottom button is first button */
|
||||
if(b1->y1 < b2->y1)
|
||||
dy= b1->y1 - bnext->y1;
|
||||
/* bottom button is last button */
|
||||
else
|
||||
dy= b2->y1 - bprev->y1;
|
||||
}
|
||||
if(dy) {
|
||||
|
||||
for(b1= block->buttons.first; b1; b1= b1->next) {
|
||||
b1->y1 -= dy;
|
||||
b1->y2 -= dy;
|
||||
}
|
||||
/* set flags again */
|
||||
ui_popup_block_scrolltest(block);
|
||||
|
||||
ED_region_tag_redraw(ar);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, int UNUSED(topmenu))
|
||||
{
|
||||
ARegion *ar;
|
||||
@ -5603,11 +5676,22 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
|
||||
* and don't handle events */
|
||||
ui_mouse_motion_towards_init(menu, mx, my, 1);
|
||||
}
|
||||
else if(event->type != TIMER) {
|
||||
else if(event->type == TIMER) {
|
||||
if(event->customdata == menu->scrolltimer)
|
||||
ui_menu_scroll(ar, block, my);
|
||||
}
|
||||
else {
|
||||
/* for ui_mouse_motion_towards_block */
|
||||
if(event->type == MOUSEMOVE)
|
||||
if(event->type == MOUSEMOVE) {
|
||||
ui_mouse_motion_towards_init(menu, mx, my, 0);
|
||||
|
||||
/* add menu scroll timer, if needed */
|
||||
if(ui_menu_scroll_test(block, my))
|
||||
if(menu->scrolltimer==NULL)
|
||||
menu->scrolltimer=
|
||||
WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, MENU_SCROLL_INTERVAL);
|
||||
}
|
||||
|
||||
/* first block own event func */
|
||||
if(block->block_event_func && block->block_event_func(C, block, event));
|
||||
/* events not for active search menu button */
|
||||
|
@ -461,6 +461,7 @@ static void vicon_move_down_draw(int x, int y, int w, int h, float UNUSED(alpha)
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
}
|
||||
|
||||
#ifndef WITH_HEADLESS
|
||||
static void init_brush_icons(void)
|
||||
{
|
||||
|
||||
@ -588,7 +589,7 @@ static void init_internal_icons(void)
|
||||
|
||||
IMB_freeImBuf(bbuf);
|
||||
}
|
||||
|
||||
#endif // WITH_HEADLESS
|
||||
|
||||
static void init_iconfile_list(struct ListBase *list)
|
||||
{
|
||||
@ -704,6 +705,7 @@ ListBase *UI_iconfile_list(void)
|
||||
|
||||
void UI_icons_free(void)
|
||||
{
|
||||
#ifndef WITH_HEADLESS
|
||||
if(icongltex.id) {
|
||||
glDeleteTextures(1, &icongltex.id);
|
||||
icongltex.id= 0;
|
||||
@ -711,6 +713,7 @@ void UI_icons_free(void)
|
||||
|
||||
free_iconfile_list(&iconfilelist);
|
||||
BKE_icons_free();
|
||||
#endif
|
||||
}
|
||||
|
||||
void UI_icons_free_drawinfo(void *drawinfo)
|
||||
@ -792,10 +795,14 @@ int UI_icon_get_height(int icon_id)
|
||||
|
||||
void UI_icons_init(int first_dyn_id)
|
||||
{
|
||||
#ifdef WITH_HEADLESS
|
||||
(void)first_dyn_id;
|
||||
#else
|
||||
init_iconfile_list(&iconfilelist);
|
||||
BKE_icons_init(first_dyn_id);
|
||||
init_internal_icons();
|
||||
init_brush_icons();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Render size for preview images and icons
|
||||
@ -945,6 +952,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
|
||||
Icon *icon = NULL;
|
||||
DrawInfo *di = NULL;
|
||||
IconImage *iimg;
|
||||
float fdraw_size= UI_DPI_FAC*draw_size;
|
||||
int w, h;
|
||||
|
||||
icon = BKE_icon_get(icon_id);
|
||||
@ -965,8 +973,8 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
|
||||
}
|
||||
|
||||
/* scale width and height according to aspect */
|
||||
w = (int)(draw_size/aspect + 0.5f);
|
||||
h = (int)(draw_size/aspect + 0.5f);
|
||||
w = (int)(fdraw_size/aspect + 0.5f);
|
||||
h = (int)(fdraw_size/aspect + 0.5f);
|
||||
|
||||
if(di->type == ICON_TYPE_VECTOR) {
|
||||
/* vector icons use the uiBlock transformation, they are not drawn
|
||||
|
@ -45,6 +45,7 @@ struct uiHandleButtonData;
|
||||
struct wmEvent;
|
||||
struct wmOperatorType;
|
||||
struct wmWindow;
|
||||
struct wmTimer;
|
||||
struct uiStyle;
|
||||
struct uiWidgetColors;
|
||||
struct uiLayout;
|
||||
@ -107,8 +108,8 @@ typedef enum {
|
||||
#define UI_PANEL_MINY 70
|
||||
|
||||
/* uiBut->flag */
|
||||
#define UI_SELECT 1 /* use when the button is pressed */
|
||||
/*#define UI_MOUSE_OVER 2*/ /*UNUSED, free flag*/
|
||||
#define UI_SELECT 1 /* use when the button is pressed */
|
||||
#define UI_SCROLLED 2 /* temp hidden, scrolled away */
|
||||
#define UI_ACTIVE 4
|
||||
#define UI_HAS_ICON 8
|
||||
#define UI_TEXTINPUT 16
|
||||
@ -116,8 +117,8 @@ typedef enum {
|
||||
/* warn: rest of uiBut->flag in UI_interface.h */
|
||||
|
||||
/* internal panel drawing defines */
|
||||
#define PNL_GRID 4
|
||||
#define PNL_HEADER 20
|
||||
#define PNL_GRID (UI_UNIT_Y / 5) /* 4 default */
|
||||
#define PNL_HEADER UI_UNIT_Y /* 20 default */
|
||||
|
||||
/* panel->flag */
|
||||
#define PNL_SELECT 1
|
||||
@ -396,6 +397,8 @@ struct uiPopupBlockHandle {
|
||||
void (*cancel_func)(void *arg);
|
||||
void *popup_arg;
|
||||
|
||||
struct wmTimer *scrolltimer;
|
||||
|
||||
/* for operator popups */
|
||||
struct wmOperatorType *optype;
|
||||
int opcontext;
|
||||
@ -416,9 +419,11 @@ void ui_block_func_ICONTEXTROW(struct bContext *C, uiLayout *layout, void *arg_b
|
||||
struct ARegion *ui_tooltip_create(struct bContext *C, struct ARegion *butregion, uiBut *but);
|
||||
void ui_tooltip_free(struct bContext *C, struct ARegion *ar);
|
||||
|
||||
uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but);
|
||||
uiBut *ui_popup_menu_memory(struct uiBlock *block, struct uiBut *but);
|
||||
|
||||
float *ui_block_hsv_get(struct uiBlock *block);
|
||||
void ui_popup_block_scrolltest(struct uiBlock *block);
|
||||
|
||||
float *ui_block_hsv_get(uiBlock *block);
|
||||
|
||||
/* searchbox for string button */
|
||||
ARegion *ui_searchbox_create(struct bContext *C, struct ARegion *butregion, uiBut *but);
|
||||
@ -481,6 +486,11 @@ void ui_widget_color_init(struct ThemeUI *tui);
|
||||
void ui_draw_menu_item(struct uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state);
|
||||
void ui_draw_preview_item(struct uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state);
|
||||
|
||||
extern unsigned char checker_stipple_sml[];
|
||||
/* used for transp checkers */
|
||||
#define UI_TRANSP_DARK 100
|
||||
#define UI_TRANSP_LIGHT 160
|
||||
|
||||
/* interface_style.c */
|
||||
void uiStyleInit(void);
|
||||
|
||||
|
@ -651,6 +651,9 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i
|
||||
if (flag & UI_ITEM_R_NO_BG)
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
|
||||
if(layout->redalert)
|
||||
uiButSetFlag(but, UI_BUT_REDALERT);
|
||||
|
||||
/* assign properties */
|
||||
if(properties || (flag & UI_ITEM_O_RETURN_PROPS)) {
|
||||
PointerRNA *opptr= uiButGetOperatorPtrRNA(but);
|
||||
|
@ -334,10 +334,13 @@ static void uiPanelPop(uiBlock *UNUSED(block))
|
||||
void UI_DrawTriIcon(float x, float y, char dir)
|
||||
{
|
||||
if(dir=='h') {
|
||||
ui_draw_anti_tria( x-3,y-5, x-3,y+5, x+7,y );
|
||||
ui_draw_anti_tria( x-3, y-5, x-3, y+5, x+7,y );
|
||||
}
|
||||
else {
|
||||
ui_draw_anti_tria( x-5,y+3, x+5,y+3, x,y-7);
|
||||
else if(dir=='t') {
|
||||
ui_draw_anti_tria( x-5, y-7, x+5, y-7, x, y+3);
|
||||
}
|
||||
else { /* 'v' = vertical, down */
|
||||
ui_draw_anti_tria( x-5, y+3, x+5, y+3, x, y-7);
|
||||
}
|
||||
}
|
||||
|
||||
@ -381,7 +384,7 @@ static void ui_draw_x_icon(float x, float y)
|
||||
|
||||
}
|
||||
|
||||
#define PNL_ICON 20
|
||||
#define PNL_ICON UI_UNIT_X /* could be UI_UNIT_Y too */
|
||||
|
||||
static void ui_draw_panel_scalewidget(rcti *rect)
|
||||
{
|
||||
|
@ -67,7 +67,6 @@
|
||||
|
||||
#include "interface_intern.h"
|
||||
|
||||
#define MENU_BUTTON_HEIGHT 20
|
||||
#define MENU_SEPR_HEIGHT 6
|
||||
#define B_NOP -1
|
||||
#define MENU_SHADOW_SIDE 8
|
||||
@ -675,7 +674,7 @@ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int icon
|
||||
|
||||
int uiSearchBoxhHeight(void)
|
||||
{
|
||||
return SEARCH_ITEMS*MENU_BUTTON_HEIGHT + 2*MENU_TOP;
|
||||
return SEARCH_ITEMS*UI_UNIT_Y + 2*MENU_TOP;
|
||||
}
|
||||
|
||||
/* ar is the search box itself */
|
||||
@ -972,8 +971,6 @@ static void ui_searchbox_region_free_cb(ARegion *ar)
|
||||
ar->regiondata= NULL;
|
||||
}
|
||||
|
||||
static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, uiBlock *block);
|
||||
|
||||
ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
|
||||
{
|
||||
uiStyle *style= U.uistyles.first; // XXX pass on as arg
|
||||
@ -1229,18 +1226,26 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
|
||||
if(but) {
|
||||
int left=0, right=0, top=0, down=0;
|
||||
int winx, winy;
|
||||
int offscreen;
|
||||
// int offscreen;
|
||||
|
||||
wm_window_get_size(window, &winx, &winy);
|
||||
|
||||
if(block->direction & UI_CENTER) center= ysize/2;
|
||||
else center= 0;
|
||||
|
||||
/* check if there's space at all */
|
||||
if( butrct.xmin-xsize > 0.0f) left= 1;
|
||||
if( butrct.xmax+xsize < winx) right= 1;
|
||||
if( butrct.ymin-ysize+center > 0.0f) down= 1;
|
||||
if( butrct.ymax+ysize-center < winy) top= 1;
|
||||
|
||||
if(top==0 && down==0) {
|
||||
if (butrct.ymin-ysize < winy-butrct.ymax-ysize)
|
||||
top= 1;
|
||||
else
|
||||
down= 1;
|
||||
}
|
||||
|
||||
dir1= block->direction & UI_DIRECTION;
|
||||
|
||||
/* secundary directions */
|
||||
@ -1305,7 +1310,7 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
|
||||
if(top==0 && down==0) {
|
||||
if(dir1==UI_LEFT || dir1==UI_RIGHT) {
|
||||
// align with bottom of screen
|
||||
yof= ysize;
|
||||
// yof= ysize; (not with menu scrolls)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1320,15 +1325,16 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
|
||||
// apply requested offset in the block
|
||||
xof += block->xofs/block->aspect;
|
||||
yof += block->yofs/block->aspect;
|
||||
|
||||
#if 0
|
||||
/* clamp to window bounds, could be made into an option if its ever annoying */
|
||||
if( (offscreen= (block->miny+yof)) < 0) yof -= offscreen; /* bottom */
|
||||
else if((offscreen= (block->maxy+yof)-winy) > 0) yof -= offscreen; /* top */
|
||||
if( (offscreen= (block->minx+xof)) < 0) xof -= offscreen; /* left */
|
||||
else if((offscreen= (block->maxx+xof)-winx) > 0) xof -= offscreen; /* right */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* apply */
|
||||
/* apply offset, buttons in window coords */
|
||||
|
||||
for(bt= block->buttons.first; bt; bt= bt->next) {
|
||||
ui_block_to_window_fl(butregion, but->block, &bt->x1, &bt->y1);
|
||||
@ -1402,6 +1408,62 @@ static void ui_block_region_draw(const bContext *C, ARegion *ar)
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
|
||||
{
|
||||
int winx, winy;
|
||||
|
||||
wm_window_get_size(window, &winx, &winy);
|
||||
|
||||
if(block->minx < MENU_SHADOW_SIDE)
|
||||
block->minx= MENU_SHADOW_SIDE;
|
||||
if(block->maxx > winx-MENU_SHADOW_SIDE)
|
||||
block->maxx= winx-MENU_SHADOW_SIDE;
|
||||
|
||||
if(block->miny < MENU_SHADOW_BOTTOM)
|
||||
block->miny= MENU_SHADOW_BOTTOM;
|
||||
if(block->maxy > winy-MENU_TOP)
|
||||
block->maxy= winy-MENU_TOP;
|
||||
}
|
||||
|
||||
void ui_popup_block_scrolltest(uiBlock *block)
|
||||
{
|
||||
uiBut *bt;
|
||||
|
||||
block->flag &= ~(UI_BLOCK_CLIPBOTTOM|UI_BLOCK_CLIPTOP);
|
||||
|
||||
for(bt= block->buttons.first; bt; bt= bt->next)
|
||||
bt->flag &= ~UI_SCROLLED;
|
||||
|
||||
if(block->buttons.first==block->buttons.last)
|
||||
return;
|
||||
|
||||
/* mark buttons that are outside boundary and the ones next to it for arrow(s) */
|
||||
for(bt= block->buttons.first; bt; bt= bt->next) {
|
||||
if(bt->y1 < block->miny) {
|
||||
bt->flag |= UI_SCROLLED;
|
||||
block->flag |= UI_BLOCK_CLIPBOTTOM;
|
||||
/* make space for arrow */
|
||||
if(bt->y2 < block->miny +10) {
|
||||
if(bt->next && bt->next->y1 > bt->y1)
|
||||
bt->next->flag |= UI_SCROLLED;
|
||||
if(bt->prev && bt->prev->y1 > bt->y1)
|
||||
bt->prev->flag |= UI_SCROLLED;
|
||||
}
|
||||
}
|
||||
if(bt->y2 > block->maxy) {
|
||||
bt->flag |= UI_SCROLLED;
|
||||
block->flag |= UI_BLOCK_CLIPTOP;
|
||||
/* make space for arrow */
|
||||
if(bt->y1 > block->maxy -10) {
|
||||
if(bt->next && bt->next->y2 < bt->y2)
|
||||
bt->next->flag |= UI_SCROLLED;
|
||||
if(bt->prev && bt->prev->y2 < bt->y2)
|
||||
bt->prev->flag |= UI_SCROLLED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut *but, uiBlockCreateFunc create_func, uiBlockHandleCreateFunc handle_create_func, void *arg)
|
||||
{
|
||||
wmWindow *window= CTX_wm_window(C);
|
||||
@ -1472,6 +1534,9 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
|
||||
block->flag |= UI_BLOCK_POPUP|UI_BLOCK_NUMSELECT;
|
||||
}
|
||||
|
||||
/* clip block with window boundary */
|
||||
ui_popup_block_clip(window, block);
|
||||
|
||||
/* the block and buttons were positioned in window space as in 2.4x, now
|
||||
* these menu blocks are regions so we bring it back to region space.
|
||||
* additionally we add some padding for the menu shadow or rounded menus */
|
||||
@ -1497,6 +1562,9 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
|
||||
/* adds subwindow */
|
||||
ED_region_init(C, ar);
|
||||
|
||||
/* checks which buttons are visible, sets flags to prevent draw (do after region init) */
|
||||
ui_popup_block_scrolltest(block);
|
||||
|
||||
/* get winmat now that we actually have the subwindow */
|
||||
wmSubWindowSet(window, ar->swinid);
|
||||
|
||||
@ -1511,6 +1579,10 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
|
||||
void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle)
|
||||
{
|
||||
ui_remove_temporary_region(C, CTX_wm_screen(C), handle->region);
|
||||
|
||||
if(handle->scrolltimer)
|
||||
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), handle->scrolltimer);
|
||||
|
||||
MEM_freeN(handle);
|
||||
}
|
||||
|
||||
@ -2171,7 +2243,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
|
||||
the offset is negative because we are inverse moving the
|
||||
block to be under the mouse */
|
||||
offset[0]= -(bt->x1 + 0.8f*(bt->x2 - bt->x1));
|
||||
offset[1]= -(bt->y1 + 0.5f*MENU_BUTTON_HEIGHT);
|
||||
offset[1]= -(bt->y1 + 0.5f*UI_UNIT_Y);
|
||||
}
|
||||
else {
|
||||
/* position mouse at 0.8*width of the button and below the tile
|
||||
@ -2180,7 +2252,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
|
||||
for(bt=block->buttons.first; bt; bt=bt->next)
|
||||
offset[0]= MIN2(offset[0], -(bt->x1 + 0.8f*(bt->x2 - bt->x1)));
|
||||
|
||||
offset[1]= 1.5*MENU_BUTTON_HEIGHT;
|
||||
offset[1]= 1.5*UI_UNIT_Y;
|
||||
}
|
||||
|
||||
block->minbounds= minwidth;
|
||||
@ -2284,10 +2356,10 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
|
||||
|
||||
if(icon) {
|
||||
sprintf(titlestr, " %s", title);
|
||||
uiDefIconTextBut(pup->block, LABEL, 0, icon, titlestr, 0, 0, 200, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefIconTextBut(pup->block, LABEL, 0, icon, titlestr, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
|
||||
}
|
||||
else {
|
||||
but= uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
|
||||
but= uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
|
||||
but->flag= UI_TEXT_LEFT;
|
||||
}
|
||||
}
|
||||
|
@ -751,7 +751,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
|
||||
if ((ob->type==OB_MESH) && modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
|
||||
{
|
||||
/* -- convert to rna ? */
|
||||
but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, 16, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
|
||||
but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
|
||||
if (index < cageIndex)
|
||||
uiButSetFlag(but, UI_BUT_DISABLED);
|
||||
uiButSetFunc(but, modifiers_setOnCage, ob, md);
|
||||
@ -763,7 +763,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
|
||||
if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
|
||||
/* add disabled pre-tesselated button, so users could have
|
||||
message for this modifiers */
|
||||
but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, 16, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "This modifier could be applied on splines' points only");
|
||||
but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "This modifier could be applied on splines' points only");
|
||||
uiButSetFlag(but, UI_BUT_DISABLED);
|
||||
} else if (mti->type != eModifierTypeType_Constructive) {
|
||||
/* constructive modifiers tesselates curve before applying */
|
||||
@ -1281,31 +1281,32 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v)
|
||||
/* offset aligns from bottom, standard width 300, height 115 */
|
||||
static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb)
|
||||
{
|
||||
|
||||
uiBut *bt;
|
||||
uiLayout *row;
|
||||
const int line1_y= yoffs + 65 + UI_UNIT_Y + 2; /* 2 for some space between the buttons */
|
||||
const int line2_y= yoffs + 65;
|
||||
|
||||
if(coba==NULL) return;
|
||||
|
||||
bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,100+yoffs,40,20, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
|
||||
bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
|
||||
uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
|
||||
|
||||
bt= uiDefBut(block, BUT, 0, "Delete", 45+xoffs,100+yoffs,45,20, NULL, 0, 0, 0, 0, "Delete the active position");
|
||||
bt= uiDefBut(block, BUT, 0, "Delete", 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position");
|
||||
uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
|
||||
|
||||
|
||||
/* XXX, todo for later - convert to operator - campbell */
|
||||
bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,100+yoffs,20,20, NULL, 0, 0, 0, 0, "Flip colorband");
|
||||
bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Flip colorband");
|
||||
uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
|
||||
|
||||
uiDefButS(block, NUM, 0, "", 120+xoffs,100+yoffs,80, 20, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop");
|
||||
uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop");
|
||||
|
||||
bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
|
||||
210+xoffs, 100+yoffs, 90, 20, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
|
||||
210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
|
||||
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
bt= uiDefBut(block, BUT_COLORBAND, 0, "", xoffs,65+yoffs,300,30, coba, 0, 0, 0, 0, "");
|
||||
bt= uiDefBut(block, BUT_COLORBAND, 0, "", xoffs,line2_y,300,UI_UNIT_Y, coba, 0, 0, 0, 0, "");
|
||||
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
|
||||
|
||||
|
||||
@ -1330,11 +1331,11 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
|
||||
float xs= butr->xmin;
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
bt= uiDefBut(block, BUT, 0, "Add", xs,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
|
||||
bt= uiDefBut(block, BUT, 0, "Add", xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
|
||||
uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
|
||||
bt= uiDefBut(block, BUT, 0, "Delete", xs+2.0f*unit,butr->ymin+20.0f,1.5f*unit,20, NULL, 0, 0, 0, 0, "Delete the active position");
|
||||
bt= uiDefBut(block, BUT, 0, "Delete", xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position");
|
||||
uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
|
||||
bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+20.0f,0.5f*unit,20, NULL, 0, 0, 0, 0, "Flip the color ramp");
|
||||
bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Flip the color ramp");
|
||||
uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
@ -1346,10 +1347,10 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
|
||||
}
|
||||
|
||||
bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
|
||||
xs+10.0f*unit, butr->ymin+20.0f, unit*4, 20, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
|
||||
xs+10.0f*unit, butr->ymin+UI_UNIT_Y, unit*4, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
|
||||
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
|
||||
|
||||
bt= uiDefBut(block, BUT_COLORBAND, 0, "", xs,butr->ymin,butr->xmax-butr->xmin,20.0f, coba, 0, 0, 0, 0, "");
|
||||
bt= uiDefBut(block, BUT_COLORBAND, 0, "", xs,butr->ymin,butr->xmax-butr->xmin,UI_UNIT_Y, coba, 0, 0, 0, 0, "");
|
||||
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
@ -1422,7 +1423,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
|
||||
|
||||
hist = (Histogram *)cptr.data;
|
||||
|
||||
hist->height= (hist->height<=20)?20:hist->height;
|
||||
hist->height= (hist->height<=UI_UNIT_Y)?UI_UNIT_Y:hist->height;
|
||||
|
||||
bt= uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, hist->height, hist, 0, 0, 0, 0, "");
|
||||
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
|
||||
@ -1459,7 +1460,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
|
||||
block= uiLayoutAbsoluteBlock(layout);
|
||||
|
||||
scopes->wavefrm_height= (scopes->wavefrm_height<=20)?20:scopes->wavefrm_height;
|
||||
scopes->wavefrm_height= (scopes->wavefrm_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->wavefrm_height;
|
||||
|
||||
bt= uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->wavefrm_height, scopes, 0, 0, 0, 0, "");
|
||||
(void)bt; // UNUSED
|
||||
@ -1496,7 +1497,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
|
||||
|
||||
block= uiLayoutAbsoluteBlock(layout);
|
||||
|
||||
scopes->vecscope_height= (scopes->vecscope_height<=20)?20:scopes->vecscope_height;
|
||||
scopes->vecscope_height= (scopes->vecscope_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->vecscope_height;
|
||||
|
||||
bt= uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
|
||||
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
|
||||
@ -1993,7 +1994,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
|
||||
else if(used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, layer))
|
||||
icon = ICON_LAYER_USED;
|
||||
|
||||
but= uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, 10, 10);
|
||||
but= uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X/2, UI_UNIT_Y/2);
|
||||
uiButSetFunc(but, handle_layer_buttons, but, SET_INT_IN_POINTER(layer));
|
||||
but->type= TOG;
|
||||
}
|
||||
|
@ -159,6 +159,18 @@ static float check_tria_vert[6][2]= {
|
||||
static int check_tria_face[4][3]= {
|
||||
{3, 2, 4}, {3, 4, 5}, {1, 0, 3}, {0, 2, 3}};
|
||||
|
||||
GLubyte checker_stipple_sml[32*32/8] =
|
||||
{
|
||||
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
|
||||
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
|
||||
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
|
||||
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
|
||||
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
|
||||
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
|
||||
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
|
||||
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
|
||||
};
|
||||
|
||||
/* ************************************************* */
|
||||
|
||||
void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3)
|
||||
@ -614,22 +626,10 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
|
||||
if(wtb->inner) {
|
||||
if(wcol->shaded==0) {
|
||||
if (wcol->alpha_check) {
|
||||
GLubyte checker_stipple_sml[32*32/8] =
|
||||
{
|
||||
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
|
||||
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
|
||||
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
|
||||
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
|
||||
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
|
||||
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
|
||||
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
|
||||
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
|
||||
};
|
||||
|
||||
float x_mid= 0.0f; /* used for dumb clamping of values */
|
||||
|
||||
/* dark checkers */
|
||||
glColor4ub(100, 100, 100, 255);
|
||||
glColor4ub(UI_TRANSP_DARK, UI_TRANSP_DARK, UI_TRANSP_DARK, 255);
|
||||
glBegin(GL_POLYGON);
|
||||
for(a=0; a<wtb->totvert; a++) {
|
||||
glVertex2fv(wtb->inner_v[a]);
|
||||
@ -638,7 +638,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
|
||||
|
||||
/* light checkers */
|
||||
glEnable(GL_POLYGON_STIPPLE);
|
||||
glColor4ub(160, 160, 160, 255);
|
||||
glColor4ub(UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, 255);
|
||||
glPolygonStipple(checker_stipple_sml);
|
||||
glBegin(GL_POLYGON);
|
||||
for(a=0; a<wtb->totvert; a++) {
|
||||
@ -771,7 +771,7 @@ static void widget_draw_preview(BIFIconID icon, float UNUSED(alpha), rcti *rect)
|
||||
|
||||
|
||||
/* icons have been standardized... and this call draws in untransformed coordinates */
|
||||
#define ICON_HEIGHT 16.0f
|
||||
#define ICON_HEIGHT UI_DPI_FAC*16.0f
|
||||
|
||||
static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect)
|
||||
{
|
||||
@ -2326,39 +2326,43 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
|
||||
wtb.outline= 0;
|
||||
widgetbase_draw(&wtb, wcol);
|
||||
|
||||
/* slider part */
|
||||
VECCOPY(outline, wcol->outline);
|
||||
VECCOPY(wcol->outline, wcol->item);
|
||||
VECCOPY(wcol->inner, wcol->item);
|
||||
/* draw left/right parts only when not in text editing */
|
||||
if(!(state & UI_TEXTINPUT)) {
|
||||
|
||||
if(!(state & UI_SELECT))
|
||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||
/* slider part */
|
||||
VECCOPY(outline, wcol->outline);
|
||||
VECCOPY(wcol->outline, wcol->item);
|
||||
VECCOPY(wcol->inner, wcol->item);
|
||||
|
||||
rect1= *rect;
|
||||
if(!(state & UI_SELECT))
|
||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||
|
||||
value= ui_get_but_val(but);
|
||||
fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin);
|
||||
rect1= *rect;
|
||||
|
||||
/* left part of slider, always rounded */
|
||||
rect1.xmax= rect1.xmin + ceil(offs+1.0f);
|
||||
round_box_edges(&wtb1, roundboxalign & ~6, &rect1, offs);
|
||||
wtb1.outline= 0;
|
||||
widgetbase_draw(&wtb1, wcol);
|
||||
value= ui_get_but_val(but);
|
||||
fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin);
|
||||
|
||||
/* right part of slider, interpolate roundness */
|
||||
rect1.xmax= rect1.xmin + fac + offs;
|
||||
rect1.xmin+= floor(offs-1.0f);
|
||||
if(rect1.xmax + offs > rect->xmax)
|
||||
offs*= (rect1.xmax + offs - rect->xmax)/offs;
|
||||
else
|
||||
offs= 0.0f;
|
||||
round_box_edges(&wtb1, roundboxalign & ~9, &rect1, offs);
|
||||
/* left part of slider, always rounded */
|
||||
rect1.xmax= rect1.xmin + ceil(offs+1.0f);
|
||||
round_box_edges(&wtb1, roundboxalign & ~6, &rect1, offs);
|
||||
wtb1.outline= 0;
|
||||
widgetbase_draw(&wtb1, wcol);
|
||||
|
||||
widgetbase_draw(&wtb1, wcol);
|
||||
VECCOPY(wcol->outline, outline);
|
||||
/* right part of slider, interpolate roundness */
|
||||
rect1.xmax= rect1.xmin + fac + offs;
|
||||
rect1.xmin+= floor(offs-1.0f);
|
||||
if(rect1.xmax + offs > rect->xmax)
|
||||
offs*= (rect1.xmax + offs - rect->xmax)/offs;
|
||||
else
|
||||
offs= 0.0f;
|
||||
round_box_edges(&wtb1, roundboxalign & ~9, &rect1, offs);
|
||||
|
||||
if(!(state & UI_SELECT))
|
||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||
widgetbase_draw(&wtb1, wcol);
|
||||
VECCOPY(wcol->outline, outline);
|
||||
|
||||
if(!(state & UI_SELECT))
|
||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||
}
|
||||
|
||||
/* outline */
|
||||
wtb.outline= 1;
|
||||
@ -2597,6 +2601,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(
|
||||
|
||||
/* store the box bg as gl clearcolor, to retrieve later when drawing semi-transparent rects
|
||||
* over the top to indicate disabled buttons */
|
||||
/* XXX, this doesnt work right since the color applies to buttons outside the box too. */
|
||||
glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0);
|
||||
|
||||
VECCOPY(wcol->inner, old_col);
|
||||
@ -3081,6 +3086,18 @@ void ui_draw_menu_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect)
|
||||
else
|
||||
wt->draw(&wt->wcol, rect, 0, 0);
|
||||
|
||||
if(block) {
|
||||
if(block->flag & UI_BLOCK_CLIPTOP) {
|
||||
/* XXX no scaling for UI here yet */
|
||||
glColor3ubv((unsigned char*)wt->wcol.text);
|
||||
UI_DrawTriIcon((rect->xmax+rect->xmin)/2, rect->ymax-8, 't');
|
||||
}
|
||||
if(block->flag & UI_BLOCK_CLIPBOTTOM) {
|
||||
/* XXX no scaling for UI here yet */
|
||||
glColor3ubv((unsigned char*)wt->wcol.text);
|
||||
UI_DrawTriIcon((rect->xmax+rect->xmin)/2, rect->ymin+10, 'v');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ui_draw_search_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect)
|
||||
|
@ -585,7 +585,7 @@ void ui_theme_init_default(void)
|
||||
SETCOL(btheme->tv3d.wire, 0x0, 0x0, 0x0, 255);
|
||||
SETCOL(btheme->tv3d.lamp, 0, 0, 0, 40);
|
||||
SETCOL(btheme->tv3d.select, 241, 88, 0, 255);
|
||||
SETCOL(btheme->tv3d.active, 255, 140, 25, 255);
|
||||
SETCOL(btheme->tv3d.active, 255, 170, 64, 255);
|
||||
SETCOL(btheme->tv3d.group, 8, 48, 8, 255);
|
||||
SETCOL(btheme->tv3d.group_active, 85, 187, 85, 255);
|
||||
SETCOL(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255);
|
||||
@ -604,7 +604,7 @@ void ui_theme_init_default(void)
|
||||
SETCOL(btheme->tv3d.face_dot, 255, 133, 0, 255);
|
||||
SETCOL(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
|
||||
SETCOLF(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
|
||||
SETCOL(btheme->tv3d.edge_sharp, 255, 32, 32, 255);
|
||||
SETCOL(btheme->tv3d.edge_sharp, 0, 255, 255, 255);
|
||||
SETCOL(btheme->tv3d.header_text, 0, 0, 0, 255);
|
||||
SETCOL(btheme->tv3d.header_text_hi, 255, 255, 255, 255);
|
||||
SETCOL(btheme->tv3d.button_text, 0, 0, 0, 255);
|
||||
@ -1578,6 +1578,8 @@ void init_userdef_do_versions(void)
|
||||
}
|
||||
if (U.dragthreshold == 0 )
|
||||
U.dragthreshold= 5;
|
||||
if (U.widget_unit==0)
|
||||
U.widget_unit= (U.dpi * 20 + 36)/72;
|
||||
|
||||
/* funny name, but it is GE stuff, moves userdef stuff to engine */
|
||||
// XXX space_set_commmandline_options();
|
||||
|
@ -876,6 +876,13 @@ static void view_zoomdrag_exit(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
|
||||
static int view_zoomdrag_cancel(bContext *C, wmOperator *op)
|
||||
{
|
||||
view_zoomdrag_exit(C, op);
|
||||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* for 'redo' only, with no user input */
|
||||
static int view_zoomdrag_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
@ -1065,6 +1072,7 @@ static void VIEW2D_OT_zoom(wmOperatorType *ot)
|
||||
ot->exec= view_zoomdrag_exec;
|
||||
ot->invoke= view_zoomdrag_invoke;
|
||||
ot->modal= view_zoomdrag_modal;
|
||||
ot->cancel= view_zoomdrag_cancel;
|
||||
|
||||
ot->poll= view_zoom_poll;
|
||||
|
||||
@ -1165,6 +1173,7 @@ static void VIEW2D_OT_zoom_border(wmOperatorType *ot)
|
||||
ot->invoke= WM_border_select_invoke;
|
||||
ot->exec= view_borderzoom_exec;
|
||||
ot->modal= WM_border_select_modal;
|
||||
ot->cancel= WM_border_select_cancel;
|
||||
|
||||
ot->poll= view_zoom_poll;
|
||||
|
||||
@ -1354,6 +1363,13 @@ static void scroller_activate_exit(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
|
||||
static int scroller_activate_cancel(bContext *C, wmOperator *op)
|
||||
{
|
||||
scroller_activate_exit(C, op);
|
||||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* apply transform to view (i.e. adjust 'cur' rect) */
|
||||
static void scroller_activate_apply(bContext *C, wmOperator *op)
|
||||
{
|
||||
@ -1561,6 +1577,8 @@ static void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
|
||||
/* api callbacks */
|
||||
ot->invoke= scroller_activate_invoke;
|
||||
ot->modal= scroller_activate_modal;
|
||||
ot->cancel= scroller_activate_cancel;
|
||||
|
||||
ot->poll= view2d_poll;
|
||||
}
|
||||
|
||||
|
@ -716,6 +716,7 @@ void MESH_OT_knife_cut(wmOperatorType *ot)
|
||||
ot->invoke= WM_gesture_lines_invoke;
|
||||
ot->modal= WM_gesture_lines_modal;
|
||||
ot->exec= knife_cut_exec;
|
||||
ot->cancel= WM_gesture_lines_cancel;
|
||||
|
||||
ot->poll= EM_view3d_poll;
|
||||
|
||||
|
@ -2339,7 +2339,7 @@ int mouse_mesh(bContext *C, const int mval[2], short extend)
|
||||
if (efa && efa->mat_nr != vc.obedit->actcol-1) {
|
||||
vc.obedit->actcol= efa->mat_nr+1;
|
||||
vc.em->mat_nr= efa->mat_nr;
|
||||
// BIF_preview_changed(ID_MA);
|
||||
WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, NULL);
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data);
|
||||
|
@ -3967,6 +3967,7 @@ short sharesFace(EditMesh *em, EditEdge* e1, EditEdge* e2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
typedef struct SlideUv {
|
||||
float origuv[2];
|
||||
@ -3980,7 +3981,6 @@ typedef struct SlideVert {
|
||||
EditVert origvert;
|
||||
} SlideVert;
|
||||
|
||||
#if 0
|
||||
int EdgeSlide(EditMesh *em, wmOperator *op, short immediate, float imperc)
|
||||
{
|
||||
return 0;
|
||||
|
@ -174,14 +174,14 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* note: this property gets hidden for add-camera operator */
|
||||
RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view.");
|
||||
RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
|
||||
|
||||
if(do_editmode) {
|
||||
prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object.");
|
||||
prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
}
|
||||
|
||||
RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object.", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", "Rotation for the newly added object", -FLT_MAX, FLT_MAX);
|
||||
|
||||
prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", "");
|
||||
@ -637,7 +637,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
|
||||
else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
|
||||
|
||||
if(obedit==NULL) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Cannot create editmode armature.");
|
||||
BKE_report(op->reports, RPT_ERROR, "Cannot create editmode armature");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@ -1382,7 +1382,7 @@ static int convert_exec(bContext *C, wmOperator *op)
|
||||
void OBJECT_OT_convert(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Convert";
|
||||
ot->name= "Convert to";
|
||||
ot->description = "Convert selected objects to another type";
|
||||
ot->idname= "OBJECT_OT_convert";
|
||||
|
||||
@ -1395,8 +1395,8 @@ void OBJECT_OT_convert(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
ot->prop= RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to.");
|
||||
RNA_def_boolean(ot->srna, "keep_original", 0, "Keep Original", "Keep original objects instead of replacing them.");
|
||||
ot->prop= RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to");
|
||||
RNA_def_boolean(ot->srna, "keep_original", 0, "Keep Original", "Keep original objects instead of replacing them");
|
||||
}
|
||||
|
||||
/**************************** Duplicate ************************/
|
||||
@ -1716,7 +1716,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* to give to transform */
|
||||
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data.");
|
||||
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data");
|
||||
prop= RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
}
|
||||
@ -1786,8 +1786,8 @@ void OBJECT_OT_add_named(wmOperatorType *ot)
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data.");
|
||||
RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add.");
|
||||
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data");
|
||||
RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add");
|
||||
}
|
||||
|
||||
|
||||
@ -1812,11 +1812,11 @@ static int join_exec(bContext *C, wmOperator *op)
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
|
||||
if(scene->obedit) {
|
||||
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode.");
|
||||
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else if(object_data_is_libdata(ob)) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata.");
|
||||
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@ -1865,11 +1865,11 @@ static int join_shapes_exec(bContext *C, wmOperator *op)
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
|
||||
if(scene->obedit) {
|
||||
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode.");
|
||||
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else if(object_data_is_libdata(ob)) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata.");
|
||||
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user