Merged changes in the trunk up to revision 54802.
This commit is contained in:
@@ -124,6 +124,10 @@ mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a secur
|
||||
|
||||
option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
|
||||
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
|
||||
if (APPLE)
|
||||
option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
|
||||
endif()
|
||||
|
||||
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON)
|
||||
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
|
||||
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
||||
@@ -242,6 +246,10 @@ option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the rayt
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
|
||||
option(WITH_STATIC_LIBS "Try to link with static libraries, as much as possible, to make blender more portable across distributions" OFF)
|
||||
if(WITH_STATIC_LIBS)
|
||||
option(WITH_BOOST_ICU "Boost uses ICU library (required for linking with static Boost built with libicu)." OFF)
|
||||
mark_as_advanced(WITH_BOOST_ICU)
|
||||
endif()
|
||||
endif()
|
||||
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
|
||||
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
|
||||
@@ -253,7 +261,7 @@ option(WITH_CYCLES "Enable cycles Render Engine" ON)
|
||||
option(WITH_CYCLES_TEST "Build cycles test application" OFF)
|
||||
option(WITH_CYCLES_OSL "Build Cycles with OSL support" OFF)
|
||||
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_13 sm_20 sm_21 sm_30 CACHE STRING "CUDA architectures to build binaries for")
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
|
||||
@@ -682,7 +690,7 @@ if(UNIX AND NOT APPLE)
|
||||
list(APPEND __boost_packages locale)
|
||||
endif()
|
||||
find_package(Boost 1.48 COMPONENTS ${__boost_packages})
|
||||
if(Boost_USE_STATIC_LIBS AND Boost_USE_ICU)
|
||||
if(Boost_USE_STATIC_LIBS AND WITH_BOOST_ICU)
|
||||
find_package(IcuLinux)
|
||||
endif()
|
||||
mark_as_advanced(Boost_DIR) # why doesnt boost do this?
|
||||
@@ -1460,11 +1468,10 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
# we use precompiled libraries for py 3.3 and up by default
|
||||
|
||||
# normally cached but not since we include them with blender
|
||||
set(PYTHON_VERSION 3.3)
|
||||
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
|
||||
# normally cached but not since we include them with blender
|
||||
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
|
||||
# set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
|
||||
set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
|
||||
@@ -1472,9 +1479,6 @@ elseif(APPLE)
|
||||
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
||||
else()
|
||||
# module must be compiled against Python framework
|
||||
|
||||
# normally cached but not since we include them with blender
|
||||
set(PYTHON_VERSION 3.3)
|
||||
set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
|
||||
set(PYTHON_BINARY "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
|
||||
#set(PYTHON_LIBRARY python${PYTHON_VERSION})
|
||||
@@ -1576,8 +1580,8 @@ elseif(APPLE)
|
||||
set(WITH_INPUT_NDOF OFF) # unsupported
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON_MODULE)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/python")# force cmake to link right framework
|
||||
if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/Python")# force cmake to link right framework
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
@@ -2185,6 +2189,9 @@ if(FIRST_RUN)
|
||||
info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
|
||||
info_cfg_option(WITH_PYTHON_MODULE)
|
||||
info_cfg_option(WITH_PYTHON_SAFETY)
|
||||
if(APPLE)
|
||||
info_cfg_option(WITH_PYTHON_FRAMEWORK)
|
||||
endif()
|
||||
|
||||
info_cfg_text("Modifiers:")
|
||||
info_cfg_option(WITH_MOD_BOOLEAN)
|
||||
|
@@ -188,7 +188,7 @@ OCIO_VERSION_MIN="1.0"
|
||||
OCIO_FORCE_REBUILD=false
|
||||
OCIO_SKIP=false
|
||||
|
||||
OIIO_VERSION="1.1.1"
|
||||
OIIO_VERSION="1.1.7"
|
||||
OIIO_SOURCE="https://github.com/OpenImageIO/oiio/tarball/Release-$OIIO_VERSION"
|
||||
OIIO_VERSION_MIN="1.1"
|
||||
OIIO_FORCE_REBUILD=false
|
||||
@@ -203,8 +203,8 @@ LLVM_FORCE_REBUILD=false
|
||||
LLVM_SKIP=false
|
||||
|
||||
# OSL needs to be compiled for now!
|
||||
OSL_VERSION="1.2.0"
|
||||
OSL_SOURCE="https://github.com/mont29/OpenShadingLanguage/archive/blender-fixes.tar.gz"
|
||||
OSL_VERSION="1.3.0"
|
||||
OSL_SOURCE="https://github.com/imageworks/OpenShadingLanguage/archive/Release-1.3.0.tar.gz"
|
||||
OSL_FORCE_REBUILD=false
|
||||
OSL_SKIP=false
|
||||
|
||||
@@ -780,27 +780,6 @@ compile_OIIO() {
|
||||
tar -C $SRC --transform "s,(.*/?)OpenImageIO-oiio[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" \
|
||||
-xf $_src.tar.gz
|
||||
|
||||
cd $_src
|
||||
|
||||
# XXX Ugly patching hack!
|
||||
cat << EOF | patch -p1
|
||||
diff --git a/src/libutil/SHA1.cpp b/src/libutil/SHA1.cpp
|
||||
index b9e6c8b..c761185 100644
|
||||
--- a/src/libutil/SHA1.cpp
|
||||
+++ b/src/libutil/SHA1.cpp
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
// If compiling with MFC, you might want to add #include "StdAfx.h"
|
||||
|
||||
+#include "SHA1.h"
|
||||
#include "hash.h"
|
||||
#include "dassert.h"
|
||||
-#include "SHA1.h"
|
||||
|
||||
#ifdef SHA1_UTILITY_FUNCTIONS
|
||||
#define SHA1_MAX_FILE_BUFFER 8000
|
||||
EOF
|
||||
|
||||
cd $CWD
|
||||
|
||||
fi
|
||||
@@ -1991,7 +1970,7 @@ print_info() {
|
||||
INFO " $_2"
|
||||
_buildargs="$_buildargs $_1 $_2"
|
||||
elif $ALL_STATIC; then
|
||||
_1="-D Boost_USE_ICU=ON"
|
||||
_1="-D WITH_BOOST_ICU=ON"
|
||||
INFO " $_1"
|
||||
_buildargs="$_buildargs $_1"
|
||||
fi
|
||||
@@ -2054,6 +2033,10 @@ print_info() {
|
||||
INFO "BF_OIIO = '$INST/oiio'"
|
||||
fi
|
||||
|
||||
if [ -d $INST/osl ]; then
|
||||
INFO "BF_OSL = '$INST/osl'"
|
||||
fi
|
||||
|
||||
if [ -d $INST/boost ]; then
|
||||
INFO "BF_BOOST = '$INST/boost'"
|
||||
INFO "WITH_BF_BOOST = True"
|
||||
|
@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
|
||||
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
|
||||
BF_NUMJOBS = 1
|
||||
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
|
@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64'
|
||||
BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64'
|
||||
BF_NUMJOBS = 1
|
||||
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
|
@@ -315,7 +315,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
@@ -209,7 +209,7 @@ WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
|
@@ -174,7 +174,7 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
@@ -189,7 +189,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
|
@@ -146,7 +146,7 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
|
||||
WITH_BF_CYCLES = True
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = LIBDIR + '/openimageio'
|
||||
|
@@ -185,7 +185,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
|
@@ -35,7 +35,7 @@ Eric Van Hensbergen
|
||||
Christian Reichlin
|
||||
brian moore
|
||||
Anthony Walker
|
||||
Carsten H<EFBFBD>fer
|
||||
Carsten Höfer
|
||||
Raymond Fordham
|
||||
David Megginson
|
||||
Jason Schmidt
|
||||
@@ -78,7 +78,7 @@ Ken Payne
|
||||
DEBEUX Sylvain
|
||||
Douglas Philips
|
||||
Lai Che Hung
|
||||
Johan Bolmsj<EFBFBD>
|
||||
Johan Bolmsjö
|
||||
Aaron Mitchell
|
||||
Teinye Horsfall
|
||||
Martin Marbach
|
||||
@@ -98,7 +98,7 @@ lukas schroeder
|
||||
Dan Lyke
|
||||
Mark Thorpe
|
||||
A.D. Arul Nirai Selvan
|
||||
Herbert P<EFBFBD>tzl
|
||||
Herbert Pötzl
|
||||
Andy Payne
|
||||
LAFFITTE Benoit (KenjForce)
|
||||
James Ertle
|
||||
@@ -148,7 +148,7 @@ Kendall Dugger
|
||||
Brice Due
|
||||
Simon Vogl
|
||||
Bernd Koestler
|
||||
cl<EFBFBD>ment CORDIER
|
||||
clément CORDIER
|
||||
CreationAnimation.com
|
||||
Pete Carss
|
||||
HERSEN Antoine
|
||||
@@ -197,9 +197,9 @@ cadic jean-yves
|
||||
Ralf Pietersz
|
||||
KAZY
|
||||
serge Jadot
|
||||
Herv<EFBFBD> LOUINET
|
||||
Hervé LOUINET
|
||||
Tom Houtman
|
||||
Magnus K<EFBFBD><EFBFBD>hler
|
||||
Magnus Kööhler
|
||||
Martin Sinnaeve
|
||||
Kevin Yank
|
||||
Tomoichi Iriyama
|
||||
@@ -221,12 +221,12 @@ Gianluigi Belli
|
||||
Naoki Abe
|
||||
NOTTE Jean-Pierre
|
||||
Jack Way
|
||||
Bj<EFBFBD>rn Westlin
|
||||
Björn Westlin
|
||||
Mitch Magee
|
||||
wizoptic
|
||||
Jake Edge
|
||||
David Hoover
|
||||
Xabier Go<EFBFBD>i
|
||||
Xabier Goñi
|
||||
Daniel Fort
|
||||
Erik Noteboom
|
||||
Pavel Vostatek
|
||||
@@ -234,7 +234,7 @@ Javier Belanche Alonso
|
||||
Jeffrey Blank
|
||||
Nathan Ryan
|
||||
Peter Wrangell
|
||||
Josef Sie<EFBFBD>
|
||||
Josef Sieß
|
||||
Timm Krumnack
|
||||
Steve Martin
|
||||
Shigeru Matsumoto
|
||||
@@ -261,7 +261,7 @@ Colin Foster
|
||||
Sascha Adler
|
||||
Stuart Duncan
|
||||
Brendon Smith
|
||||
S<EFBFBD>bastien COLLETTE
|
||||
Sébastien COLLETTE
|
||||
Clemens Auer
|
||||
Kay Fricke
|
||||
Fabian Fagerholm
|
||||
@@ -282,7 +282,7 @@ STEMax
|
||||
Jeff Cox
|
||||
Trevor Ratliff
|
||||
Matt Henley
|
||||
Fran<EFBFBD>ois VALETTE
|
||||
François VALETTE
|
||||
Rob Saunders
|
||||
Mike Luethi
|
||||
Rami Aubourg-Kaires
|
||||
@@ -290,9 +290,9 @@ Matthew Thomas
|
||||
Allan Jacobsen
|
||||
Adam Lowe
|
||||
David Hostetler
|
||||
Lo<EFBFBD>c Vigneras
|
||||
Loïc Vigneras
|
||||
Dan Reiland
|
||||
Pedro D<EFBFBD>az del Arco
|
||||
Pedro Díaz del Arco
|
||||
Pierre Beyssac
|
||||
Chris Davey
|
||||
YOSHIAKI Nishino
|
||||
@@ -385,7 +385,7 @@ Kiernan Holland
|
||||
Holger Malessa
|
||||
Masanori Okuda
|
||||
Andrea Maracci
|
||||
Kai-Peter B<EFBFBD>ckman
|
||||
Kai-Peter Bäckman
|
||||
Gregg Patton
|
||||
Luis M Ibarra
|
||||
Julian Green
|
||||
@@ -394,7 +394,7 @@ Mark Winkelman
|
||||
Ebbe L. Nielsen
|
||||
Carlos Orozco
|
||||
magnetHead
|
||||
Kr<EFBFBD>ckel Oliver
|
||||
Krückel Oliver
|
||||
Thomas Ingham
|
||||
Wes Devauld
|
||||
Uwe Steinmann
|
||||
@@ -417,7 +417,7 @@ Steve Mackay
|
||||
NDNWarrior
|
||||
Christopher Gray
|
||||
Darius Clarke (Socinian)
|
||||
Jean-S<EFBFBD>bastien SEVESTRE
|
||||
Jean-Sébastien SEVESTRE
|
||||
Douglas Fellows
|
||||
Craig Symons
|
||||
Quincin Gonjon
|
||||
@@ -447,7 +447,7 @@ Markus Q. Roberts
|
||||
Christoher Bartak
|
||||
Peter Truog
|
||||
Eric Dynowski
|
||||
Philipp G<EFBFBD>hring
|
||||
Philipp Gühring
|
||||
Pierre-Yves RANNO
|
||||
Jason Nollan (Cluh)
|
||||
Launay Jean-Claude
|
||||
@@ -465,7 +465,7 @@ TROJANI Cedric
|
||||
David Polston
|
||||
Patrick Mullen
|
||||
Tetsuya Okuno
|
||||
Bodo J<EFBFBD>ger
|
||||
Bodo Jäger
|
||||
Leon Brooks
|
||||
Cedric Adjih
|
||||
Michael L. Fisher
|
||||
@@ -521,7 +521,7 @@ Vincent Stoessel
|
||||
Adrian Virnig
|
||||
Chris Dixon
|
||||
Travis Cole
|
||||
M<EFBFBD>rten M<EFBFBD>rtensson
|
||||
Mårten Mårtensson
|
||||
Evan Scott
|
||||
Mark Coletti
|
||||
Ken Burke
|
||||
@@ -541,7 +541,7 @@ Iain Russell
|
||||
Thomas Bleicher
|
||||
Anthony Zishka
|
||||
Jefferson Dubrule
|
||||
Esa Piiril<EFBFBD>
|
||||
Esa Piirilä
|
||||
Bill Thiede
|
||||
William Anderson
|
||||
Alexander Kittel
|
||||
@@ -561,7 +561,7 @@ John DiLauro
|
||||
John Miller
|
||||
Frederic Crozat
|
||||
Matt Welland
|
||||
Paul Calc<EFBFBD>
|
||||
Paul Calcé
|
||||
Joe Prochilo
|
||||
Justin Shafer
|
||||
Joe Croft
|
||||
@@ -571,7 +571,7 @@ Alain Gallo
|
||||
Phuoc Ngo
|
||||
Krabat
|
||||
Derek Harmison
|
||||
S<EFBFBD>bastien Devine
|
||||
Sébastien Devine
|
||||
Kenneth P. Stox
|
||||
Wade Felde
|
||||
Kai Groshert
|
||||
@@ -603,7 +603,7 @@ Martin Forisch
|
||||
Guillermina Manon
|
||||
Randal D. Adams
|
||||
Kevin Reagh (kevin3D)
|
||||
Wolfgang K<EFBFBD>hn
|
||||
Wolfgang Kühn
|
||||
BEAUSOLEIL Arnaud
|
||||
Stan Jakubek
|
||||
Klaus Brand
|
||||
@@ -628,7 +628,7 @@ Samuel Seay
|
||||
Mike Schaudies
|
||||
Robert Sherwood
|
||||
Fernando Villalon Panzano
|
||||
J<EFBFBD>rg Roschke
|
||||
Jörg Roschke
|
||||
Carl Symons
|
||||
Peter Pichler
|
||||
Alan Heckart
|
||||
@@ -714,7 +714,7 @@ Rau, Bernhard
|
||||
Stephen Uithoven
|
||||
Ken Beyer
|
||||
Matjaz Jakopec
|
||||
Eckhard M. J<EFBFBD>ger
|
||||
Eckhard M. Jäger
|
||||
Mike Siebach
|
||||
John Harger
|
||||
Justin W. Carper
|
||||
@@ -747,7 +747,7 @@ Karl Bartel
|
||||
Ralph Howes
|
||||
Matthew J. Stott
|
||||
Omar Priego
|
||||
<EFBFBD>ke Westerstr<EFBFBD>m
|
||||
Åke Westerström
|
||||
Imago Viva
|
||||
James E Hill
|
||||
Rune Myrland
|
||||
@@ -785,7 +785,7 @@ Claude Bilat
|
||||
Mario Palomo
|
||||
Neipi
|
||||
Grethus Bode
|
||||
Jan M<EFBFBD>ller
|
||||
Jan Müller
|
||||
Mark Pearson
|
||||
Stanislav Osicka
|
||||
DataCare Solutions AG
|
||||
@@ -804,9 +804,9 @@ Aaron Bredon
|
||||
Hideki Suzuki
|
||||
josef radinger
|
||||
Robert Friemer
|
||||
J<EFBFBD>rg Zastrau
|
||||
Jörg Zastrau
|
||||
Burton Bicksler
|
||||
Kimmo M<EFBFBD>s<EFBFBD>
|
||||
Kimmo Mösö
|
||||
Robert F Johnson
|
||||
Mark Johnson
|
||||
Avi Bercovich
|
||||
@@ -821,21 +821,21 @@ Duffaud
|
||||
Marco Ardito
|
||||
Simon Suter
|
||||
Tobias Huelsdau
|
||||
Winfried Engl<EFBFBD>nder
|
||||
Winfried Engländer
|
||||
Stephen Groundwater
|
||||
Joel Ray Holveck
|
||||
Mag. Tibor Rudas
|
||||
Hartmut Wolf
|
||||
Douglas Jones
|
||||
brett hartshorn
|
||||
Beat M<EFBFBD>gert
|
||||
Beat Mägert
|
||||
Javon Prince
|
||||
bri
|
||||
James Klicman
|
||||
Harvey Fong
|
||||
jeroen v.d. Meulen
|
||||
Wim Vandersmissen
|
||||
Carlos Moreno Rodr<EFBFBD>guez
|
||||
Carlos Moreno Rodríguez
|
||||
Trausti Kristjansson
|
||||
Larry Snyder
|
||||
olivier
|
||||
@@ -887,7 +887,7 @@ Fred Roberts
|
||||
Njin-Zu Chen
|
||||
GUILLON Marc
|
||||
Felix Klock
|
||||
Ernesto Salas Rodr<EFBFBD>guez
|
||||
Ernesto Salas Rodríguez
|
||||
Pavel Roskin
|
||||
Jaap
|
||||
Stefan Maass
|
||||
@@ -911,7 +911,7 @@ delerue
|
||||
Dirk Behrens
|
||||
Doc Holiday
|
||||
Wouter Kerkhoven
|
||||
Andreas B<EFBFBD>ttner
|
||||
Andreas Büttner
|
||||
James Black
|
||||
Nicholas Ward
|
||||
David Oberbeck
|
||||
@@ -940,7 +940,7 @@ Ian Whitworth
|
||||
Ruud H.G. van Tol
|
||||
Pierre Lo Cicero
|
||||
Srinivas Digumarty
|
||||
digitalvelocity<EFBFBD>
|
||||
digitalvelocity®
|
||||
Alan J Booth
|
||||
Tony OBrien
|
||||
Douglas Toltzman
|
||||
@@ -957,12 +957,12 @@ Craig Spitzer
|
||||
Jeffrey Van Ness
|
||||
Lucas Vergnettes
|
||||
Wolfgang Michaelis
|
||||
Luis Jim<EFBFBD>nez Linares
|
||||
Luis Jiménez Linares
|
||||
Julian Eden
|
||||
Ms Lilo von Hanffstengel
|
||||
Kurt B. Kaiser
|
||||
Mark Ping
|
||||
Comb<EFBFBD>e
|
||||
Combée
|
||||
Diego Matho
|
||||
MELIN Philippe
|
||||
Damian Sobieralski
|
||||
@@ -1028,7 +1028,7 @@ evolutie
|
||||
Stephane Portha
|
||||
Robert Gentner
|
||||
David B. Camhy
|
||||
Ren<EFBFBD> Foucart
|
||||
René Foucart
|
||||
Coyok Drio
|
||||
Mark Ng
|
||||
klein michael
|
||||
@@ -1094,14 +1094,14 @@ Stuart MacKinnon
|
||||
Dietrich Dietz - the IMaGiNation project (IMGN)
|
||||
Tina Hirsch
|
||||
John R Thorp
|
||||
Fr<EFBFBD>d<EFBFBD>ric Bouvier
|
||||
Frédéric Bouvier
|
||||
LINETTE
|
||||
Felix Rabe
|
||||
Chay Adamou
|
||||
nick harron
|
||||
stephen john ford
|
||||
Kino
|
||||
Daniel Sj<EFBFBD>lie
|
||||
Daniel Sjölie
|
||||
Matthias Derer
|
||||
Alain VALLETON
|
||||
Kervin Pierre
|
||||
@@ -1142,13 +1142,13 @@ Satoshi Yamasaki
|
||||
Rolf-Dieter Klein
|
||||
J. Deetman
|
||||
Helge Walter
|
||||
Roland Str<EFBFBD>lberg
|
||||
Roland Strålberg
|
||||
Nicolas Morenas (Caronte)
|
||||
Simon Clarke
|
||||
Maigrot Michel
|
||||
Rod Robinson
|
||||
Kevin Cozens
|
||||
Germ<EFBFBD>n Alonso (taz)
|
||||
Germán Alonso (taz)
|
||||
Martin Stegeman
|
||||
Henrik Jordfald Olsen
|
||||
Mitchell Skinner
|
||||
@@ -1157,7 +1157,7 @@ Spiridon G. Kontarakis
|
||||
Bas Denissen
|
||||
Loic Dachary
|
||||
Michael Rutter
|
||||
Thorsten Schl<EFBFBD>ter
|
||||
Thorsten Schlüter
|
||||
hijothema
|
||||
Andreas Hauser
|
||||
Holger Haase
|
||||
@@ -1232,9 +1232,9 @@ Starr Kline
|
||||
John Lullie
|
||||
Chiffi Cosimo
|
||||
Morgan McMillian
|
||||
Stefan H<EFBFBD>bner
|
||||
Stefan Hübner
|
||||
Loic de MONTAIGNAC
|
||||
Andr<EFBFBD>s Castillo
|
||||
Andrés Castillo
|
||||
Francesco Anselmo
|
||||
Ingo Guenther
|
||||
James C. Davis, Jr.
|
||||
@@ -1314,7 +1314,7 @@ Luke Titley
|
||||
marinus meijers
|
||||
Henry Kaminski
|
||||
Alistair Riddoch
|
||||
Daniel N<EFBFBD>mm
|
||||
Daniel Nümm
|
||||
Matthew Meadows
|
||||
Bjoern Paschen
|
||||
Paul Fredrickson
|
||||
@@ -1325,7 +1325,7 @@ Thomas Muldowney
|
||||
Cheyenne Cloud, LLC
|
||||
Helmut A. Goettl
|
||||
Martin A. Boegelund
|
||||
Beno<EFBFBD>t Cousson
|
||||
Benoît Cousson
|
||||
Scott Brooks
|
||||
Ferlet Patrice
|
||||
Aaron Porterfield
|
||||
@@ -1335,13 +1335,13 @@ Rui Paulo Sanguinheira Diogo
|
||||
Jason Saville
|
||||
Active-Websight GbR
|
||||
Bryon Roche
|
||||
Gustavo Mu<EFBFBD>oz
|
||||
Gustavo Muñoz
|
||||
Christopher Gillanders
|
||||
Phil Frost Tate
|
||||
Gilles Gonon
|
||||
Kay
|
||||
James C. Franklin
|
||||
Luis Enrique Caama<EFBFBD>o Navas
|
||||
Luis Enrique Caamaño Navas
|
||||
Alexander "estartu" Felder
|
||||
Marc Ledermann
|
||||
vrijschrift.org
|
||||
@@ -1371,7 +1371,7 @@ Maurizio Sibaud
|
||||
Ron Bolger
|
||||
Nathan Parton
|
||||
Andrew Fry
|
||||
VINCENT St<EFBFBD>phane
|
||||
VINCENT Stéphane
|
||||
Yan Yan
|
||||
Justin L Graham
|
||||
Wade Beasley
|
||||
|
@@ -1491,7 +1491,9 @@ def write_sphinx_conf_py(basepath):
|
||||
|
||||
def execfile(filepath):
|
||||
global_namespace = {"__file__": filepath, "__name__": "__main__"}
|
||||
exec(compile(open(filepath).read(), filepath, 'exec'), global_namespace)
|
||||
file_handle = open(filepath)
|
||||
exec(compile(file_handle.read(), filepath, 'exec'), global_namespace)
|
||||
file_handle.close()
|
||||
|
||||
|
||||
def write_rst_contents(basepath):
|
||||
|
@@ -32,8 +32,7 @@ blender_version_char=$(grep BLENDER_VERSION_CHAR $blender_srcdir/source/blender/
|
||||
blender_version_cycle=$(grep BLENDER_VERSION_CYCLE $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
||||
blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
||||
|
||||
if [ "$blender_version_cycle" == "release" ]
|
||||
then
|
||||
if [ "$blender_version_cycle" == "release" ] ; then
|
||||
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
|
||||
else
|
||||
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
|
||||
@@ -109,6 +108,11 @@ if $DO_UPLOAD ; then
|
||||
# better redirect
|
||||
ssh $SSH_USER@emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html'
|
||||
|
||||
# redirect for release only so wiki can point here
|
||||
if [ "$blender_version_cycle" == "release" ] ; then
|
||||
ssh $SSH_USER@emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/blender_python_api/index.html'
|
||||
fi
|
||||
|
||||
if $DO_OUT_PDF ; then
|
||||
# rename so local PDF has matching name.
|
||||
rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
|
||||
|
8
extern/libmv/CMakeLists.txt
vendored
8
extern/libmv/CMakeLists.txt
vendored
@@ -191,14 +191,6 @@ if(WIN32)
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(MSVC_OFLAGS O1 O2 Ox)
|
||||
foreach(FLAG ${MSVC_OFLAGS})
|
||||
string(REPLACE "${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(REPLACE "${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
endforeach()
|
||||
endif()
|
||||
else()
|
||||
list(APPEND SRC
|
||||
third_party/glog/src/demangle.cc
|
||||
|
23
extern/libmv/SConscript
vendored
23
extern/libmv/SConscript
vendored
@@ -11,10 +11,6 @@ Import('env')
|
||||
|
||||
defs = []
|
||||
|
||||
cflags_libmv = Split(env['CFLAGS'])
|
||||
ccflags_libmv = Split(env['CCFLAGS'])
|
||||
cxxflags_libmv = Split(env['CXXFLAGS'])
|
||||
|
||||
defs.append('V3DLIB_ENABLE_SUITESPARSE')
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
|
||||
@@ -41,29 +37,12 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', '
|
||||
|
||||
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
src += ['./third_party/glog/src/windows/port.cc']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
cflags_libmv.append('/Od')
|
||||
ccflags_libmv.append('/Od')
|
||||
cxxflags_libmv.append('/Od')
|
||||
|
||||
if not env['BF_DEBUG']:
|
||||
defs.append('NDEBUG')
|
||||
else:
|
||||
if not env['BF_DEBUG']:
|
||||
cflags_libmv += Split(env['REL_CFLAGS'])
|
||||
ccflags_libmv += Split(env['REL_CCFLAGS'])
|
||||
cxxflags_libmv += Split(env['REL_CXXFLAGS'])
|
||||
else:
|
||||
src += env.Glob("third_party/glog/src/*.cc")
|
||||
incs += ' ./third_party/glog/src'
|
||||
if not env['BF_DEBUG']:
|
||||
cflags_libmv += Split(env['REL_CFLAGS'])
|
||||
ccflags_libmv += Split(env['REL_CCFLAGS'])
|
||||
cxxflags_libmv += Split(env['REL_CXXFLAGS'])
|
||||
|
||||
incs += ' ./third_party/ssba ./third_party/ldl/Include ../colamd/Include'
|
||||
|
||||
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137], compileflags=cflags_libmv, cc_compileflags=ccflags_libmv, cxx_compileflags=cxxflags_libmv )
|
||||
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
|
||||
|
||||
SConscript(['third_party/SConscript'])
|
||||
|
31
extern/libmv/bundle.sh
vendored
31
extern/libmv/bundle.sh
vendored
@@ -184,14 +184,6 @@ if(WIN32)
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(MSVC_OFLAGS O1 O2 Ox)
|
||||
foreach(FLAG \${MSVC_OFLAGS})
|
||||
string(REPLACE "\${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "\${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(REPLACE "\${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "\${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
endforeach()
|
||||
endif()
|
||||
else()
|
||||
list(APPEND SRC
|
||||
${third_glog_sources}
|
||||
@@ -228,10 +220,6 @@ Import('env')
|
||||
|
||||
defs = []
|
||||
|
||||
cflags_libmv = Split(env['CFLAGS'])
|
||||
ccflags_libmv = Split(env['CCFLAGS'])
|
||||
cxxflags_libmv = Split(env['CXXFLAGS'])
|
||||
|
||||
defs.append('V3DLIB_ENABLE_SUITESPARSE')
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
|
||||
@@ -249,30 +237,13 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', '
|
||||
${win_src}
|
||||
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
src += ['./third_party/glog/src/windows/port.cc']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
cflags_libmv.append('/Od')
|
||||
ccflags_libmv.append('/Od')
|
||||
cxxflags_libmv.append('/Od')
|
||||
|
||||
if not env['BF_DEBUG']:
|
||||
defs.append('NDEBUG')
|
||||
else:
|
||||
if not env['BF_DEBUG']:
|
||||
cflags_libmv += Split(env['REL_CFLAGS'])
|
||||
ccflags_libmv += Split(env['REL_CCFLAGS'])
|
||||
cxxflags_libmv += Split(env['REL_CXXFLAGS'])
|
||||
else:
|
||||
src += env.Glob("third_party/glog/src/*.cc")
|
||||
incs += ' ./third_party/glog/src'
|
||||
if not env['BF_DEBUG']:
|
||||
cflags_libmv += Split(env['REL_CFLAGS'])
|
||||
ccflags_libmv += Split(env['REL_CCFLAGS'])
|
||||
cxxflags_libmv += Split(env['REL_CXXFLAGS'])
|
||||
|
||||
incs += ' ./third_party/ssba ./third_party/ldl/Include ../colamd/Include'
|
||||
|
||||
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137], compileflags=cflags_libmv, cc_compileflags=ccflags_libmv, cxx_compileflags=cxxflags_libmv )
|
||||
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
|
||||
|
||||
SConscript(['third_party/SConscript'])
|
||||
EOF
|
||||
|
@@ -31,6 +31,7 @@ set(INC
|
||||
include
|
||||
internal
|
||||
../gflags
|
||||
../../
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
1
extern/libmv/third_party/ceres/bundle.sh
vendored
1
extern/libmv/third_party/ceres/bundle.sh
vendored
@@ -120,6 +120,7 @@ set(INC
|
||||
include
|
||||
internal
|
||||
../gflags
|
||||
../..
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
@@ -21,7 +21,7 @@
|
||||
bl_info = {
|
||||
"name": "Cycles Render Engine",
|
||||
"author": "",
|
||||
"blender": (2, 60, 5),
|
||||
"blender": (2, 66, 0),
|
||||
"location": "Info header, render engine menu",
|
||||
"description": "Cycles Render Engine integration",
|
||||
"warning": "",
|
||||
|
@@ -1123,13 +1123,9 @@ class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel):
|
||||
|
||||
layout.active = rd.use_simplify
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "simplify_subdivision", text="Subdivision")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "simplify_child_particles", text="Child Particles")
|
||||
row = layout.row()
|
||||
row.prop(rd, "simplify_subdivision", text="Subdivision")
|
||||
row.prop(rd, "simplify_child_particles", text="Child Particles")
|
||||
|
||||
|
||||
def draw_device(self, context):
|
||||
|
@@ -67,11 +67,6 @@ public:
|
||||
task_pool.stop();
|
||||
}
|
||||
|
||||
bool support_advanced_shading()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void mem_alloc(device_memory& mem, MemoryType type)
|
||||
{
|
||||
mem.device_pointer = mem.data_pointer;
|
||||
|
@@ -209,8 +209,8 @@ public:
|
||||
int major, minor;
|
||||
cuDeviceComputeCapability(&major, &minor, cuDevId);
|
||||
|
||||
if(major <= 1 && minor <= 2) {
|
||||
cuda_error_message(string_printf("CUDA device supported only with compute capability 1.3 or up, found %d.%d.", major, minor));
|
||||
if(major <= 1 && minor <= 3) {
|
||||
cuda_error_message(string_printf("CUDA device supported only with compute capability 2.0 or up, found %d.%d.", major, minor));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -242,8 +242,8 @@ public:
|
||||
|
||||
#ifdef _WIN32
|
||||
if(cuHavePrecompiledKernels()) {
|
||||
if(major <= 1 && minor <= 2)
|
||||
cuda_error_message(string_printf("CUDA device requires compute capability 1.3 or up, found %d.%d. Your GPU is not supported.", major, minor));
|
||||
if(major <= 1 && minor <= 3)
|
||||
cuda_error_message(string_printf("CUDA device requires compute capability 2.0 or up, found %d.%d. Your GPU is not supported.", major, minor));
|
||||
else
|
||||
cuda_error_message(string_printf("CUDA binary kernel for this graphics card compute capability (%d.%d) not found.", major, minor));
|
||||
return "";
|
||||
|
@@ -222,11 +222,6 @@ public:
|
||||
RPCSend snd(socket, "task_cancel");
|
||||
snd.write();
|
||||
}
|
||||
|
||||
bool support_advanced_shading()
|
||||
{
|
||||
return true; /* todo: get this info from device */
|
||||
}
|
||||
};
|
||||
|
||||
Device *device_network_create(DeviceInfo& info, Stats &stats, const char *address)
|
||||
@@ -242,6 +237,8 @@ void device_network_info(vector<DeviceInfo>& devices)
|
||||
info.description = "Network Device";
|
||||
info.id = "NETWORK";
|
||||
info.num = 0;
|
||||
info.advanced_shading = true; /* todo: get this info from device */
|
||||
info.pack_images = false;
|
||||
|
||||
devices.push_back(info);
|
||||
}
|
||||
|
@@ -28,11 +28,7 @@
|
||||
#include "kernel_curve.h"
|
||||
#include "kernel_primitive.h"
|
||||
#include "kernel_projection.h"
|
||||
#ifdef __QBVH__
|
||||
#include "kernel_qbvh.h"
|
||||
#else
|
||||
#include "kernel_bvh.h"
|
||||
#endif
|
||||
#include "kernel_accumulate.h"
|
||||
#include "kernel_camera.h"
|
||||
#include "kernel_shader.h"
|
||||
|
@@ -360,11 +360,11 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
|
||||
|
||||
/* bit of an ugly hack to compensate for emitting triangles influencing
|
||||
* amount of samples we get for this pass */
|
||||
if(scene->integrator->progressive && kintegrator->pdf_triangles != 0.0f)
|
||||
kfilm->pass_shadow_scale = 0.5f;
|
||||
else
|
||||
kfilm->pass_shadow_scale = 1.0f;
|
||||
|
||||
if(kintegrator->pdf_triangles != 0.0f)
|
||||
kfilm->pass_shadow_scale *= 0.5f;
|
||||
|
||||
if(num_background_lights < num_lights)
|
||||
kfilm->pass_shadow_scale *= (float)(num_lights - num_background_lights)/(float)num_lights;
|
||||
|
||||
|
@@ -206,7 +206,8 @@ typedef enum CUjit_target_enum
|
||||
CU_TARGET_COMPUTE_13,
|
||||
CU_TARGET_COMPUTE_20,
|
||||
CU_TARGET_COMPUTE_21,
|
||||
CU_TARGET_COMPUTE_30
|
||||
CU_TARGET_COMPUTE_30,
|
||||
CU_TARGET_COMPUTE_35
|
||||
} CUjit_target;
|
||||
|
||||
typedef enum CUjit_fallback_enum
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
|
@@ -39,7 +39,7 @@ GHOST_DisplayManagerSDL::GHOST_DisplayManagerSDL(GHOST_SystemSDL *system)
|
||||
GHOST_DisplayManager(),
|
||||
m_system(system)
|
||||
{
|
||||
memset(&m_mode, 0, sizeof m_mode);
|
||||
memset(&m_mode, 0, sizeof(m_mode));
|
||||
}
|
||||
|
||||
GHOST_TSuccess
|
||||
|
@@ -40,7 +40,6 @@
|
||||
#include "GHOST_SystemX11.h"
|
||||
|
||||
|
||||
|
||||
GHOST_DisplayManagerX11::
|
||||
GHOST_DisplayManagerX11(
|
||||
GHOST_SystemX11 *system
|
||||
@@ -82,9 +81,9 @@ getNumDisplaySettings(
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
/* The X11 man page says vidmodes needs to be freed, but doing so causes a
|
||||
* segfault. - z0r */
|
||||
XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &numSettings, &vidmodes);
|
||||
if (XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &numSettings, &vidmodes)) {
|
||||
XFree(vidmodes);
|
||||
}
|
||||
|
||||
#else
|
||||
/* We only have one X11 setting at the moment. */
|
||||
@@ -95,6 +94,17 @@ getNumDisplaySettings(
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
/* from SDL2 */
|
||||
#ifdef WITH_X11_XF86VMODE
|
||||
static int
|
||||
calculate_rate(XF86VidModeModeInfo *info)
|
||||
{
|
||||
return (info->htotal
|
||||
&& info->vtotal) ? (1000 * info->dotclock / (info->htotal *
|
||||
info->vtotal)) : 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_DisplayManagerX11::
|
||||
getDisplaySetting(
|
||||
@@ -102,51 +112,46 @@ getDisplaySetting(
|
||||
GHOST_TInt32 index,
|
||||
GHOST_DisplaySetting& setting) const
|
||||
{
|
||||
|
||||
#ifdef WITH_X11_XF86VMODE
|
||||
int majorVersion, minorVersion;
|
||||
XF86VidModeModeInfo **vidmodes;
|
||||
Display *dpy = m_system->getXDisplay();
|
||||
int numSettings;
|
||||
|
||||
GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
|
||||
|
||||
if (dpy == NULL)
|
||||
return GHOST_kFailure;
|
||||
|
||||
majorVersion = minorVersion = 0;
|
||||
if (!XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion)) {
|
||||
fprintf(stderr, "Error: XF86VidMode extension missing!\n");
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
#ifdef WITH_X11_XF86VMODE
|
||||
int majorVersion, minorVersion;
|
||||
|
||||
/* The X11 man page says vidmodes needs to be freed, but doing so causes a
|
||||
* segfault. - z0r */
|
||||
XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &numSettings, &vidmodes);
|
||||
GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
|
||||
|
||||
majorVersion = minorVersion = 0;
|
||||
if (XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion)) {
|
||||
XF86VidModeModeInfo **vidmodes;
|
||||
int numSettings;
|
||||
|
||||
if (XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &numSettings, &vidmodes)) {
|
||||
GHOST_ASSERT(index < numSettings, "Requested setting outside of valid range.\n");
|
||||
|
||||
setting.xPixels = vidmodes[index]->hdisplay;
|
||||
setting.yPixels = vidmodes[index]->vdisplay;
|
||||
setting.bpp = DefaultDepth(dpy, DefaultScreen(dpy));
|
||||
setting.frequency = calculate_rate(vidmodes[index]);
|
||||
XFree(vidmodes);
|
||||
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Warning: XF86VidMode extension missing!\n");
|
||||
/* fallback to non xf86vmode below */
|
||||
}
|
||||
#endif /* WITH_X11_XF86VMODE */
|
||||
|
||||
#else
|
||||
GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
|
||||
GHOST_ASSERT(index < 1, "Requested setting outside of valid range.\n");
|
||||
|
||||
Display *x_display = m_system->getXDisplay();
|
||||
|
||||
if (x_display == NULL) {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
setting.xPixels = DisplayWidth(x_display, DefaultScreen(x_display));
|
||||
setting.yPixels = DisplayHeight(x_display, DefaultScreen(x_display));
|
||||
setting.bpp = DefaultDepth(x_display, DefaultScreen(x_display));
|
||||
#endif
|
||||
|
||||
/* Don't think it's possible to get this value from X!
|
||||
* So let's guess!! */
|
||||
setting.frequency = 60;
|
||||
setting.xPixels = DisplayWidth(dpy, DefaultScreen(dpy));
|
||||
setting.yPixels = DisplayHeight(dpy, DefaultScreen(dpy));
|
||||
setting.bpp = DefaultDepth(dpy, DefaultScreen(dpy));
|
||||
setting.frequency = 60.0f;
|
||||
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
@@ -171,15 +176,13 @@ setCurrentDisplaySetting(
|
||||
const GHOST_DisplaySetting& setting)
|
||||
{
|
||||
#ifdef WITH_X11_XF86VMODE
|
||||
/* Mode switching code ported from Quake 2:
|
||||
* ftp: ftp.idsoftware.com/idstuff/source/q2source-3.21.zip
|
||||
* See linux/gl_glx.c:GLimp_SetMode
|
||||
/* Mode switching code ported from SDL:
|
||||
* See: src/video/x11/SDL_x11modes.c:set_best_resolution
|
||||
*/
|
||||
int majorVersion, minorVersion;
|
||||
XF86VidModeModeInfo **vidmodes;
|
||||
Display *dpy = m_system->getXDisplay();
|
||||
int scrnum, num_vidmodes;
|
||||
int best_fit, best_dist, dist, x, y;
|
||||
|
||||
if (dpy == NULL)
|
||||
return GHOST_kFailure;
|
||||
@@ -197,35 +200,53 @@ setCurrentDisplaySetting(
|
||||
majorVersion, minorVersion);
|
||||
# endif
|
||||
|
||||
/* The X11 man page says vidmodes needs to be freed, but doing so causes a
|
||||
* segfault. - z0r */
|
||||
XF86VidModeGetAllModeLines(dpy, scrnum, &num_vidmodes, &vidmodes);
|
||||
|
||||
best_dist = 9999999;
|
||||
best_fit = -1;
|
||||
if (XF86VidModeGetAllModeLines(dpy, scrnum, &num_vidmodes, &vidmodes)) {
|
||||
int best_fit = -1;
|
||||
|
||||
for (int i = 0; i < num_vidmodes; i++) {
|
||||
if (setting.xPixels > vidmodes[i]->hdisplay ||
|
||||
setting.yPixels > vidmodes[i]->vdisplay)
|
||||
if (vidmodes[i]->hdisplay < setting.xPixels ||
|
||||
vidmodes[i]->vdisplay < setting.yPixels)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
x = setting.xPixels - vidmodes[i]->hdisplay;
|
||||
y = setting.yPixels - vidmodes[i]->vdisplay;
|
||||
dist = (x * x) + (y * y);
|
||||
if (dist < best_dist) {
|
||||
best_dist = dist;
|
||||
if (best_fit == -1 ||
|
||||
(vidmodes[i]->hdisplay < vidmodes[best_fit]->hdisplay) ||
|
||||
(vidmodes[i]->hdisplay == vidmodes[best_fit]->hdisplay &&
|
||||
vidmodes[i]->vdisplay < vidmodes[best_fit]->vdisplay))
|
||||
{
|
||||
best_fit = i;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((vidmodes[i]->hdisplay == vidmodes[best_fit]->hdisplay) &&
|
||||
(vidmodes[i]->vdisplay == vidmodes[best_fit]->vdisplay))
|
||||
{
|
||||
if (!setting.frequency) {
|
||||
/* Higher is better, right? */
|
||||
if (calculate_rate(vidmodes[i]) >
|
||||
calculate_rate(vidmodes[best_fit]))
|
||||
{
|
||||
best_fit = i;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (abs(calculate_rate(vidmodes[i]) - (int)setting.frequency) <
|
||||
abs(calculate_rate(vidmodes[best_fit]) - (int)setting.frequency))
|
||||
{
|
||||
best_fit = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (best_fit != -1) {
|
||||
# ifdef _DEBUG
|
||||
int actualWidth, actualHeight;
|
||||
actualWidth = vidmodes[best_fit]->hdisplay;
|
||||
actualHeight = vidmodes[best_fit]->vdisplay;
|
||||
printf("Switching to video mode %dx%d\n",
|
||||
actualWidth, actualHeight);
|
||||
# endif
|
||||
# ifdef _DEBUG
|
||||
printf("Switching to video mode %dx%d %dx%d %d\n",
|
||||
vidmodes[best_fit]->hdisplay, vidmodes[best_fit]->vdisplay,
|
||||
vidmodes[best_fit]->htotal, vidmodes[best_fit]->vtotal,
|
||||
calculate_rate(vidmodes[best_fit]));
|
||||
# endif
|
||||
|
||||
/* change to the mode */
|
||||
XF86VidModeSwitchToMode(dpy, scrnum, vidmodes[best_fit]);
|
||||
@@ -233,6 +254,9 @@ setCurrentDisplaySetting(
|
||||
/* Move the viewport to top left */
|
||||
XF86VidModeSetViewPort(dpy, scrnum, 0, 0);
|
||||
}
|
||||
|
||||
XFree(vidmodes);
|
||||
}
|
||||
else {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
@@ -245,7 +269,3 @@ setCurrentDisplaySetting(
|
||||
return GHOST_kSuccess;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_DropTargetWin32.h"
|
||||
#include <ShellApi.h>
|
||||
#include <shellapi.h>
|
||||
|
||||
#include "utf_winfunc.h"
|
||||
#include "utfconv.h"
|
||||
|
@@ -296,6 +296,9 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
|
||||
|
||||
// Process all the events waiting for us
|
||||
while (::PeekMessageW(&msg, 0, 0, 0, PM_REMOVE) != 0) {
|
||||
// TranslateMessage doesn't alter the message, and doesn't change our raw keyboard data.
|
||||
// Needed for MapVirtualKey or if we ever need to get chars from wm_ime_char or similar.
|
||||
::TranslateMessage(&msg);
|
||||
::DispatchMessageW(&msg);
|
||||
anyProcessed = true;
|
||||
}
|
||||
@@ -729,7 +732,10 @@ GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
|
||||
int r;
|
||||
GetKeyboardState((PBYTE)state);
|
||||
|
||||
if ((r = ToUnicodeEx(vk, 0, state, utf16, 2, 0, system->m_keylayout))) {
|
||||
// don't call ToUnicodeEx on dead keys as it clears the buffer and so won't allow diacritical composition.
|
||||
if (MapVirtualKeyW(vk,2) != 0) {
|
||||
// todo: ToUnicodeEx can respond with up to 4 utf16 chars (only 2 here). Could be up to 24 utf8 bytes.
|
||||
if ((r = ToUnicodeEx(vk, raw.data.keyboard.MakeCode, state, utf16, 2, 0, system->m_keylayout))) {
|
||||
if ((r > 0 && r < 3)) {
|
||||
utf16[r] = 0;
|
||||
conv_utf_16_to_8(utf16, utf8_char, 6);
|
||||
@@ -738,6 +744,7 @@ GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
|
||||
utf8_char[0] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!keyDown) {
|
||||
utf8_char[0] = '\0';
|
||||
|
@@ -470,38 +470,22 @@ void GHOST_WindowWin32::getWindowBounds(GHOST_Rect& bounds) const
|
||||
void GHOST_WindowWin32::getClientBounds(GHOST_Rect& bounds) const
|
||||
{
|
||||
RECT rect;
|
||||
GHOST_TWindowState state = this->getState();
|
||||
LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
|
||||
int sm_cysizeframe = GetSystemMetrics(SM_CYSIZEFRAME);
|
||||
::GetWindowRect(m_hWnd, &rect);
|
||||
POINT coord;
|
||||
::GetClientRect(m_hWnd, &rect);
|
||||
|
||||
if ((result & (WS_POPUP | WS_MAXIMIZE)) != (WS_POPUP | WS_MAXIMIZE)) {
|
||||
if (state == GHOST_kWindowStateMaximized) {
|
||||
// in maximized state we don't have borders on the window
|
||||
bounds.m_b = rect.bottom - GetSystemMetrics(SM_CYCAPTION) - sm_cysizeframe * 2;
|
||||
bounds.m_l = rect.left + sm_cysizeframe;
|
||||
bounds.m_r = rect.right - sm_cysizeframe;
|
||||
bounds.m_t = rect.top;
|
||||
}
|
||||
else if (state == GHOST_kWindowStateEmbedded) {
|
||||
bounds.m_b = rect.bottom;
|
||||
bounds.m_l = rect.left;
|
||||
bounds.m_r = rect.right;
|
||||
bounds.m_t = rect.top;
|
||||
}
|
||||
else {
|
||||
bounds.m_b = rect.bottom - GetSystemMetrics(SM_CYCAPTION) - sm_cysizeframe * 2;
|
||||
bounds.m_l = rect.left;
|
||||
bounds.m_r = rect.right - sm_cysizeframe * 2;
|
||||
bounds.m_t = rect.top;
|
||||
}
|
||||
}
|
||||
else {
|
||||
bounds.m_b = rect.bottom;
|
||||
bounds.m_l = rect.left;
|
||||
bounds.m_r = rect.right;
|
||||
bounds.m_t = rect.top;
|
||||
}
|
||||
coord.x = rect.left;
|
||||
coord.y = rect.top;
|
||||
::ClientToScreen(m_hWnd, &coord);
|
||||
|
||||
bounds.m_l = coord.x;
|
||||
bounds.m_t = coord.y;
|
||||
|
||||
coord.x = rect.right;
|
||||
coord.y = rect.bottom;
|
||||
::ClientToScreen(m_hWnd, &coord);
|
||||
|
||||
bounds.m_r = coord.x;
|
||||
bounds.m_b = coord.y;
|
||||
}
|
||||
|
||||
|
||||
@@ -712,6 +696,7 @@ GHOST_TSuccess GHOST_WindowWin32::initMultisample(PIXELFORMATDESCRIPTOR pfd)
|
||||
WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
|
||||
WGL_COLOR_BITS_ARB, pfd.cColorBits,
|
||||
WGL_DEPTH_BITS_ARB, pfd.cDepthBits,
|
||||
WGL_ALPHA_BITS_ARB, pfd.cAlphaBits,
|
||||
WGL_STENCIL_BITS_ARB, pfd.cStencilBits,
|
||||
WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
|
||||
WGL_SAMPLE_BUFFERS_ARB, GL_TRUE,
|
||||
@@ -1321,6 +1306,9 @@ static int WeightPixelFormat(PIXELFORMATDESCRIPTOR& pfd)
|
||||
|
||||
weight += pfd.cColorBits - 8;
|
||||
|
||||
if (pfd.cAlphaBits > 0)
|
||||
weight ++;
|
||||
|
||||
/* want swap copy capability -- it matters a lot */
|
||||
if (pfd.dwFlags & PFD_SWAP_COPY) weight += 16;
|
||||
|
||||
|
@@ -213,6 +213,7 @@ GHOST_WindowX11(
|
||||
attributes[i++] = GLX_BLUE_SIZE; attributes[i++] = 1;
|
||||
attributes[i++] = GLX_GREEN_SIZE; attributes[i++] = 1;
|
||||
attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = 1;
|
||||
attributes[i++] = GLX_ALPHA_SIZE; attributes[i++] = 1;
|
||||
/* GLX >= 1.4 required for multi-sample */
|
||||
if (samples && (glxVersionMajor >= 1) && (glxVersionMinor >= 4)) {
|
||||
attributes[i++] = GLX_SAMPLE_BUFFERS; attributes[i++] = 1;
|
||||
|
@@ -257,6 +257,7 @@ extern rbConstraint *RB_constraint_new_slider(float pivot[3], float orn[4], rbRi
|
||||
extern rbConstraint *RB_constraint_new_piston(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
|
||||
extern rbConstraint *RB_constraint_new_6dof(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
|
||||
extern rbConstraint *RB_constraint_new_6dof_spring(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
|
||||
extern rbConstraint *RB_constraint_new_motor(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2);
|
||||
|
||||
/* ............ */
|
||||
|
||||
@@ -292,6 +293,11 @@ extern void RB_constraint_set_damping_6dof_spring(rbConstraint *con, int axis, f
|
||||
extern void RB_constraint_set_spring_6dof_spring(rbConstraint *con, int axis, int enable);
|
||||
extern void RB_constraint_set_equilibrium_6dof_spring(rbConstraint *con);
|
||||
|
||||
/* motors */
|
||||
extern void RB_constraint_set_enable_motor(rbConstraint *con, int enable_lin, int enable_ang);
|
||||
extern void RB_constraint_set_max_impulse_motor(rbConstraint *con, float max_impulse_lin, float max_impulse_ang);
|
||||
extern void RB_constraint_set_target_velocity_motor(rbConstraint *con, float velocity_lin, float velocity_ang);
|
||||
|
||||
/* Set number of constraint solver iterations made per step, this overrided world setting
|
||||
* To use default set it to -1 */
|
||||
extern void RB_constraint_set_solver_iterations(rbConstraint *con, int num_solver_iterations);
|
||||
|
@@ -850,6 +850,27 @@ rbConstraint *RB_constraint_new_6dof_spring(float pivot[3], float orn[4], rbRigi
|
||||
return (rbConstraint *)con;
|
||||
}
|
||||
|
||||
rbConstraint *RB_constraint_new_motor(float pivot[3], float orn[4], rbRigidBody *rb1, rbRigidBody *rb2)
|
||||
{
|
||||
btRigidBody *body1 = rb1->body;
|
||||
btRigidBody *body2 = rb2->body;
|
||||
btTransform transform1;
|
||||
btTransform transform2;
|
||||
|
||||
make_constraint_transforms(transform1, transform2, body1, body2, pivot, orn);
|
||||
|
||||
btGeneric6DofConstraint *con = new btGeneric6DofConstraint(*body1, *body2, transform1, transform2, true);
|
||||
|
||||
/* unlock constraint axes */
|
||||
for (int i = 0; i < 6; i++) {
|
||||
con->setLimit(i, 0.0f, -1.0f);
|
||||
}
|
||||
/* unlock motor axes */
|
||||
con->getTranslationalLimitMotor()->m_upperLimit.setValue(-1.0f, -1.0f, -1.0f);
|
||||
|
||||
return (rbConstraint*)con;
|
||||
}
|
||||
|
||||
/* Cleanup ----------------------------- */
|
||||
|
||||
void RB_constraint_delete(rbConstraint *con)
|
||||
@@ -947,4 +968,28 @@ void RB_constraint_set_breaking_threshold(rbConstraint *con, float threshold)
|
||||
constraint->setBreakingImpulseThreshold(threshold);
|
||||
}
|
||||
|
||||
void RB_constraint_set_enable_motor(rbConstraint *con, int enable_lin, int enable_ang)
|
||||
{
|
||||
btGeneric6DofConstraint *constraint = reinterpret_cast<btGeneric6DofConstraint*>(con);
|
||||
|
||||
constraint->getTranslationalLimitMotor()->m_enableMotor[0] = enable_lin;
|
||||
constraint->getRotationalLimitMotor(0)->m_enableMotor = enable_ang;
|
||||
}
|
||||
|
||||
void RB_constraint_set_max_impulse_motor(rbConstraint *con, float max_impulse_lin, float max_impulse_ang)
|
||||
{
|
||||
btGeneric6DofConstraint *constraint = reinterpret_cast<btGeneric6DofConstraint*>(con);
|
||||
|
||||
constraint->getTranslationalLimitMotor()->m_maxMotorForce.setX(max_impulse_lin);
|
||||
constraint->getRotationalLimitMotor(0)->m_maxMotorForce = max_impulse_ang;
|
||||
}
|
||||
|
||||
void RB_constraint_set_target_velocity_motor(rbConstraint *con, float velocity_lin, float velocity_ang)
|
||||
{
|
||||
btGeneric6DofConstraint *constraint = reinterpret_cast<btGeneric6DofConstraint*>(con);
|
||||
|
||||
constraint->getTranslationalLimitMotor()->m_targetVelocity.setX(velocity_lin);
|
||||
constraint->getRotationalLimitMotor(0)->m_targetVelocity = velocity_ang;
|
||||
}
|
||||
|
||||
/* ********************************** */
|
||||
|
@@ -45,6 +45,8 @@
|
||||
|
||||
#include <MERSENNETWISTER.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <float.h>
|
||||
#define isnan _isnan
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "utf_winfunc.h"
|
||||
#include <io.h>
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <wchar.h>
|
||||
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 323 KiB After Width: | Height: | Size: 126 KiB |
@@ -435,41 +435,71 @@ def dump_py_messages_from_files(messages, check_ctxt, files):
|
||||
# -------------------------------------------------------------------------
|
||||
# Gather function names
|
||||
|
||||
# so far only 'text' keywords, but we may want others translated later
|
||||
translate_kw = ("text", )
|
||||
# In addition of UI func, also parse pgettext ones...
|
||||
# Tuples of (module name, (short names, ...)).
|
||||
pgettext_variants = (
|
||||
("pgettext", ("_",)),
|
||||
("pgettext_iface", ("iface_",)),
|
||||
("pgettext_tip", ("tip_",))
|
||||
)
|
||||
pgettext_variants_args = {"msgid": (0, {"msgctxt": 1})}
|
||||
|
||||
# key: func_id
|
||||
# val: [(arg_kw, arg_pos), (arg_kw, arg_pos), ...]
|
||||
# key: msgid keywords.
|
||||
# val: tuples of ((keywords,), context_getter_func) to get a context for that msgid.
|
||||
# Note: order is important, first one wins!
|
||||
translate_kw = {
|
||||
"text": ((("text_ctxt",), _ctxt_to_ctxt),
|
||||
(("operator",), _op_to_ctxt),
|
||||
),
|
||||
"msgid": ((("msgctxt",), _ctxt_to_ctxt),
|
||||
),
|
||||
}
|
||||
|
||||
context_kw_set = {}
|
||||
for k, ctxts in translate_kw.items():
|
||||
s = set()
|
||||
for c, _ in ctxts:
|
||||
s |= set(c)
|
||||
context_kw_set[k] = s
|
||||
|
||||
# {func_id: {msgid: (arg_pos,
|
||||
# {msgctxt: arg_pos,
|
||||
# ...
|
||||
# }
|
||||
# ),
|
||||
# ...
|
||||
# },
|
||||
# ...
|
||||
# }
|
||||
func_translate_args = {}
|
||||
|
||||
# as we only have one translate keyword, no need for complex context extraction setup for now...
|
||||
# And it's already enough complex like that!
|
||||
# Note: order is important, first one wins!
|
||||
context_kw = ((("text_ctxt",), _ctxt_to_ctxt),
|
||||
(("operator",), _op_to_ctxt),
|
||||
)
|
||||
context_kw_set = set()
|
||||
for c, _ in context_kw:
|
||||
context_kw_set |= set(c)
|
||||
|
||||
# Like func_translate_args.
|
||||
func_context_args = {}
|
||||
# First, functions from UILayout
|
||||
# First loop is for msgid args, second one is for msgctxt args.
|
||||
for func_id, func in bpy.types.UILayout.bl_rna.functions.items():
|
||||
# check it has one or more arguments as defined in translate_kw
|
||||
for arg_pos, (arg_kw, arg) in enumerate(func.parameters.items()):
|
||||
if ((arg_kw in translate_kw) and (not arg.is_output) and (arg.type == 'STRING')):
|
||||
func_translate_args.setdefault(func_id, {})[arg_kw] = (arg_pos, {})
|
||||
for func_id, func in bpy.types.UILayout.bl_rna.functions.items():
|
||||
if func_id not in func_translate_args:
|
||||
continue
|
||||
for arg_pos, (arg_kw, arg) in enumerate(func.parameters.items()):
|
||||
if (not arg.is_output) and (arg.type == 'STRING'):
|
||||
for msgid, msgctxts in context_kw_set.items():
|
||||
if arg_kw in msgctxts:
|
||||
func_translate_args[func_id][msgid][1][arg_kw] = arg_pos
|
||||
# We manually add funcs from bpy.app.translations
|
||||
for func_id, func_ids in pgettext_variants:
|
||||
func_translate_args[func_id] = pgettext_variants_args
|
||||
for func_id in func_ids:
|
||||
func_translate_args[func_id] = pgettext_variants_args
|
||||
#print(func_translate_args)
|
||||
|
||||
# Break recursive nodes look up on some kind of nodes.
|
||||
# E.g. we don’t want to get strings inside subscripts (blah["foo"])!
|
||||
stopper_nodes = {ast.Subscript, }
|
||||
stopper_nodes = {ast.Subscript}
|
||||
# Consider strings separate: ("a" if test else "b")
|
||||
separate_nodes = {ast.IfExp, }
|
||||
|
||||
# For now only consider functions from UILayout...
|
||||
for func_id, func in bpy.types.UILayout.bl_rna.functions.items():
|
||||
# check it has one or more arguments as defined in translate_kw
|
||||
for (arg_pos, (arg_kw, arg)) in enumerate(func.parameters.items()):
|
||||
if ((arg_kw in translate_kw) and (not arg.is_output) and (arg.type == 'STRING')):
|
||||
func_translate_args.setdefault(func_id, []).append((arg_kw, arg_pos))
|
||||
elif ((arg_kw in context_kw_set) and (not arg.is_output) and (arg.type == 'STRING')):
|
||||
func_context_args.setdefault(func_id, []).append((arg_kw, arg_pos))
|
||||
#print(func_context_args)
|
||||
separate_nodes = {ast.IfExp}
|
||||
|
||||
check_ctxt_py = None
|
||||
if check_ctxt:
|
||||
@@ -489,19 +519,22 @@ def dump_py_messages_from_files(messages, check_ctxt, files):
|
||||
# print("found function at")
|
||||
# print("%s:%d" % (fp, node.lineno))
|
||||
|
||||
# lambda's
|
||||
# We can't skip such situations! from blah import foo\nfoo("bar") would also be an ast.Name func!
|
||||
if type(node.func) == ast.Name:
|
||||
func_id = node.func.id
|
||||
elif hasattr(node.func, "attr"):
|
||||
func_id = node.func.attr
|
||||
# Ugly things like getattr(self, con.type)(context, box, con)
|
||||
else:
|
||||
continue
|
||||
|
||||
# getattr(self, con.type)(context, box, con)
|
||||
if not hasattr(node.func, "attr"):
|
||||
continue
|
||||
func_args = func_translate_args.get(func_id, {})
|
||||
|
||||
# First try to get i18n context.
|
||||
context_args = func_context_args.get(node.func.attr, ())
|
||||
context = ""
|
||||
# First try to get i18n contexts, for every possible msgid id.
|
||||
contexts = dict.fromkeys(func_args.keys(), "")
|
||||
for msgid, (_, context_args) in func_args.items():
|
||||
context_elements = {}
|
||||
for arg_kw, arg_pos in context_args:
|
||||
for arg_kw, arg_pos in context_args.items():
|
||||
if arg_pos < len(node.args):
|
||||
context_elements[arg_kw] = node.args[arg_pos]
|
||||
else:
|
||||
@@ -510,19 +543,18 @@ def dump_py_messages_from_files(messages, check_ctxt, files):
|
||||
context_elements[arg_kw] = kw.value
|
||||
break
|
||||
#print(context_elements)
|
||||
for kws, proc in context_kw:
|
||||
for kws, proc in translate_kw[msgid]:
|
||||
if set(kws) <= context_elements.keys():
|
||||
args = tuple(context_elements[k] for k in kws)
|
||||
#print("running ", proc, " with ", args)
|
||||
ctxt = proc(*args)
|
||||
if ctxt:
|
||||
context = ctxt
|
||||
contexts[msgid] = ctxt
|
||||
break
|
||||
|
||||
translate_args = func_translate_args.get(node.func.attr, ())
|
||||
#print(translate_args)
|
||||
# do nothing if not found
|
||||
for arg_kw, arg_pos in translate_args:
|
||||
for arg_kw, (arg_pos, _) in func_args.items():
|
||||
estr_lst = [(None, ())]
|
||||
if arg_pos < len(node.args):
|
||||
estr_lst = extract_strings_split(node.args[arg_pos])
|
||||
@@ -535,7 +567,7 @@ def dump_py_messages_from_files(messages, check_ctxt, files):
|
||||
#print(estr, nds)
|
||||
for estr, nds in estr_lst:
|
||||
if estr:
|
||||
key = (context, estr)
|
||||
key = (contexts[arg_kw], estr)
|
||||
if nds:
|
||||
msgsrc = ["{}:{}".format(fp_rel, sorted({nd.lineno for nd in nds})[0])]
|
||||
else:
|
||||
|
@@ -94,7 +94,7 @@ LANGUAGES_FILE = "languages"
|
||||
IMPORT_MIN_LEVEL = -1
|
||||
|
||||
# Languages in /branches we do not want to import in /trunk currently...
|
||||
IMPORT_LANGUAGES_SKIP = {'am', 'bg', 'fi', 'el', 'et', 'hi', 'ne', 'pl', 'ro', 'uz', 'uz@cyrillic'}
|
||||
IMPORT_LANGUAGES_SKIP = {'am', 'bg', 'fi', 'el', 'et', 'ne', 'pl', 'ro', 'uz', 'uz@cyrillic'}
|
||||
|
||||
# The comment prefix used in generated messages.txt file.
|
||||
MSG_COMMENT_PREFIX = "#~ "
|
||||
@@ -227,9 +227,10 @@ PYGETTEXT_KEYWORDS = (() +
|
||||
for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_N_")) +
|
||||
|
||||
tuple(("{}\\((?:[^\"',]+,){{1,2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
|
||||
for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf")) +
|
||||
for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf",
|
||||
"CTX_wm_operator_poll_msg_set")) +
|
||||
|
||||
tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*,").format(it)
|
||||
tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*\)").format(it)
|
||||
for it in ("BMO_error_raise",)) +
|
||||
|
||||
tuple(("{}\\((?:[^\"',]+,)\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
|
||||
|
@@ -220,7 +220,7 @@ dict_uimsgs = {
|
||||
"grless",
|
||||
"http",
|
||||
"init",
|
||||
"kbit",
|
||||
"kbit", "kb",
|
||||
"lensdist",
|
||||
"loc", "rot", "pos",
|
||||
"lorem",
|
||||
|
@@ -152,10 +152,13 @@ def edge_face_count_dict(mesh):
|
||||
faces using each edge.
|
||||
:rtype: dict
|
||||
"""
|
||||
face_edge_keys = [face.edge_keys for face in mesh.tessfaces]
|
||||
|
||||
face_edge_count = {}
|
||||
for face_keys in face_edge_keys:
|
||||
for key in face_keys:
|
||||
loops = mesh.loops
|
||||
edges = mesh.edges
|
||||
for poly in mesh.polygons:
|
||||
for i in poly.loop_indices:
|
||||
key = edges[loops[i].edge_index].key
|
||||
try:
|
||||
face_edge_count[key] += 1
|
||||
except:
|
||||
|
@@ -124,6 +124,7 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
|
||||
else:
|
||||
base.layers = [True if i == scene.active_layer
|
||||
else False for i in range(len(scene.layers))]
|
||||
else:
|
||||
if v3d:
|
||||
base.layers_from_view(context.space_data)
|
||||
|
||||
|
@@ -800,7 +800,8 @@
|
||||
line_input="#cecece"
|
||||
line_info="#00aa00"
|
||||
line_error="#dc6060"
|
||||
cursor="#dc6060">
|
||||
cursor="#dc6060"
|
||||
select="#ffffff30">
|
||||
<space>
|
||||
<ThemeSpaceGeneric back="#0f0f0f"
|
||||
title="#5d5d5d"
|
||||
|
@@ -800,7 +800,8 @@
|
||||
line_input="#ffffff"
|
||||
line_info="#00aa00"
|
||||
line_error="#dc6060"
|
||||
cursor="#dc6060">
|
||||
cursor="#dc6060"
|
||||
select="#c6777799">
|
||||
<space>
|
||||
<ThemeSpaceGeneric back="#b4b4b4"
|
||||
title="#000000"
|
||||
|
@@ -800,7 +800,8 @@
|
||||
line_input="#ffffff"
|
||||
line_info="#00aa00"
|
||||
line_error="#dc6060"
|
||||
cursor="#dc6060">
|
||||
cursor="#dc6060"
|
||||
select="#4e4e8f80">
|
||||
<space>
|
||||
<ThemeSpaceGeneric back="#202020"
|
||||
title="#000000"
|
||||
|
@@ -800,7 +800,8 @@
|
||||
line_input="#ffffff"
|
||||
line_info="#00aa00"
|
||||
line_error="#dc0606"
|
||||
cursor="#dc6060">
|
||||
cursor="#dc6060"
|
||||
select="#ffffff30">
|
||||
<space>
|
||||
<ThemeSpaceGeneric back="#7c7e88"
|
||||
title="#000000"
|
||||
|
@@ -800,7 +800,8 @@
|
||||
line_input="#19b6ee"
|
||||
line_info="#f47421"
|
||||
line_error="#ff0000"
|
||||
cursor="#f47421">
|
||||
cursor="#f47421"
|
||||
select="#641f4480">
|
||||
<space>
|
||||
<ThemeSpaceGeneric back="#131311"
|
||||
title="#000000"
|
||||
|
@@ -109,7 +109,8 @@ class BakeToKeyframes(Operator):
|
||||
objects = []
|
||||
scene = context.scene
|
||||
frame_orig = scene.frame_current
|
||||
frames = list(range(self.frame_start, self.frame_end + 1, self.step))
|
||||
frames_step = range(self.frame_start, self.frame_end + 1, self.step)
|
||||
frames_full = range(self.frame_start, self.frame_end + 1)
|
||||
|
||||
# filter objects selection
|
||||
for obj in context.selected_objects:
|
||||
@@ -120,16 +121,17 @@ class BakeToKeyframes(Operator):
|
||||
|
||||
if objects:
|
||||
# store transformation data
|
||||
for f in list(range(self.frame_start, self.frame_end + 1)):
|
||||
# need to start at scene start frame so simulation is run from the beginning
|
||||
for f in frames_full:
|
||||
scene.frame_set(f)
|
||||
if f in frames:
|
||||
if f in frames_step:
|
||||
mat = {}
|
||||
for i, obj in enumerate(objects):
|
||||
mat[i] = obj.matrix_world.copy()
|
||||
bake.append(mat)
|
||||
|
||||
# apply transformations as keyframes
|
||||
for i, f in enumerate(frames):
|
||||
for i, f in enumerate(frames_step):
|
||||
scene.frame_set(f)
|
||||
obj_prev = objects[0]
|
||||
for j, obj in enumerate(objects):
|
||||
@@ -190,8 +192,7 @@ class BakeToKeyframes(Operator):
|
||||
|
||||
|
||||
class ConnectRigidBodies(Operator):
|
||||
"""Create rigid body constraints between """ \
|
||||
"""selected and active rigid bodies"""
|
||||
'''Create rigid body constraints between selected rigid bodies'''
|
||||
bl_idname = "rigidbody.connect"
|
||||
bl_label = "Connect Rigid Bodies"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
@@ -212,41 +213,73 @@ class ConnectRigidBodies(Operator):
|
||||
('SELECTED', "Selected", "Pivot location is at the selected object position")),
|
||||
default='CENTER',)
|
||||
|
||||
connection_pattern = EnumProperty(
|
||||
name="Connection Pattern",
|
||||
description="Pattern used to connect objects",
|
||||
items=(('SELECTED_TO_ACTIVE', "Selected to Active", "Connects selected objects to the active object"),
|
||||
('CHAIN_DISTANCE', "Chain by Distance", "Connects objects as a chain based on distance, starting at the active object")),
|
||||
default='SELECTED_TO_ACTIVE',)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
obj = context.object
|
||||
return (obj and obj.rigid_body)
|
||||
|
||||
def execute(self, context):
|
||||
def _add_constraint(self, context, object1, object2):
|
||||
if object1 == object2:
|
||||
return
|
||||
|
||||
scene = context.scene
|
||||
objects = context.selected_objects
|
||||
obj_act = context.active_object
|
||||
change = False
|
||||
|
||||
for obj in objects:
|
||||
if obj == obj_act:
|
||||
continue
|
||||
if self.pivot_type == 'ACTIVE':
|
||||
loc = obj_act.location
|
||||
loc = object1.location
|
||||
elif self.pivot_type == 'SELECTED':
|
||||
loc = obj.location
|
||||
loc = object2.location
|
||||
else:
|
||||
loc = (obj_act.location + obj.location) / 2.0
|
||||
# TODO: use bpy.data.objects.new(...)
|
||||
bpy.ops.object.add(type='EMPTY',
|
||||
view_align=False,
|
||||
enter_editmode=False,
|
||||
location=loc)
|
||||
loc = (object1.location + object2.location) / 2.0
|
||||
|
||||
ob = bpy.data.objects.new("Constraint", object_data=None)
|
||||
ob.location = loc
|
||||
context.scene.objects.link(ob)
|
||||
context.scene.objects.active = ob
|
||||
ob.select = True
|
||||
|
||||
bpy.ops.rigidbody.constraint_add()
|
||||
con_obj = context.active_object
|
||||
con_obj.empty_draw_type = 'ARROWS'
|
||||
con = con_obj.rigid_body_constraint
|
||||
con.type = self.con_type
|
||||
con.object1 = obj_act
|
||||
con.object2 = obj
|
||||
|
||||
con.object1 = object1
|
||||
con.object2 = object2
|
||||
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
objects = context.selected_objects
|
||||
obj_act = context.active_object
|
||||
change = False
|
||||
|
||||
if self.connection_pattern == 'CHAIN_DISTANCE':
|
||||
objs_sorted = [obj_act]
|
||||
objects_tmp = context.selected_objects
|
||||
if obj_act.select:
|
||||
objects_tmp.remove(obj_act)
|
||||
objects_tmp.sort(key=lambda o: (obj_act.location - o.location).length)
|
||||
last_obj = obj_act
|
||||
|
||||
while (len(objects_tmp)):
|
||||
objects_tmp.sort(key=lambda o: (last_obj.location - o.location).length)
|
||||
objs_sorted.append(objects_tmp[0])
|
||||
last_obj = objects_tmp[0]
|
||||
objects_tmp.remove(objects_tmp[0])
|
||||
|
||||
for i in range(1, len(objs_sorted)):
|
||||
self._add_constraint(context, objs_sorted[i-1], objs_sorted[i])
|
||||
change = True
|
||||
|
||||
else: # SELECTED_TO_ACTIVE
|
||||
for obj in objects:
|
||||
self._add_constraint(context, obj_act, obj)
|
||||
change = True;
|
||||
|
||||
if change:
|
||||
# restore selection
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
|
@@ -138,6 +138,7 @@ def unregister():
|
||||
|
||||
|
||||
# Define a default UIList, when a list does not need any custom drawing...
|
||||
# Keep in sync with its #defined name in UI_interface.h
|
||||
class UI_UL_list(bpy.types.UIList):
|
||||
pass
|
||||
|
||||
|
@@ -184,7 +184,8 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
|
||||
if poselib:
|
||||
# list of poses in pose library
|
||||
row = layout.row()
|
||||
row.template_list("UI_UL_list", "", poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5)
|
||||
row.template_list("UI_UL_list", "pose_markers", poselib, "pose_markers",
|
||||
poselib.pose_markers, "active_index", rows=5)
|
||||
|
||||
# column of operators for active pose
|
||||
# - goes beside list
|
||||
|
@@ -124,20 +124,17 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
split.prop(md, "width")
|
||||
split.prop(md, "use_only_vertices")
|
||||
|
||||
# -- new modifier only, this may be reverted in favor of 2.62 mod.
|
||||
'''
|
||||
split = layout.split()
|
||||
split.prop(md, "use_even_offset")
|
||||
split.prop(md, "use_distance_offset")
|
||||
'''
|
||||
# -- end
|
||||
layout.prop(md, "segments")
|
||||
|
||||
layout.label(text="Limit Method:")
|
||||
layout.row().prop(md, "limit_method", expand=True)
|
||||
if md.limit_method == 'ANGLE':
|
||||
layout.prop(md, "angle_limit")
|
||||
elif md.limit_method == 'WEIGHT':
|
||||
layout.row().prop(md, "edge_weight_method", expand=True)
|
||||
elif md.limit_method == 'VGROUP':
|
||||
layout.label(text="Vertex Group:")
|
||||
layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
|
||||
# elif md.limit_method == 'WEIGHT':
|
||||
# layout.row().prop(md, "edge_weight_method", expand=True)
|
||||
|
||||
def BOOLEAN(self, layout, ob, md):
|
||||
split = layout.split()
|
||||
|
@@ -84,8 +84,6 @@ class MATERIAL_UL_matslots(UIList):
|
||||
layout.label(text=iface_("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
|
||||
elif ma.use_nodes:
|
||||
layout.label(text="Node <none>")
|
||||
else:
|
||||
layout.label(text="")
|
||||
elif self.layout_type in {'GRID'}:
|
||||
layout.alignment = 'CENTER'
|
||||
layout.label(text="", icon_value=icon)
|
||||
@@ -566,7 +564,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, Panel):
|
||||
row.prop(halo, toggle, text="")
|
||||
sub = row.column()
|
||||
sub.active = getattr(halo, toggle)
|
||||
sub.prop(halo, number, text=name)
|
||||
sub.prop(halo, number, text=name, translate=False)
|
||||
if not color == "":
|
||||
sub.prop(mat, color, text="")
|
||||
|
||||
@@ -593,9 +591,9 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, Panel):
|
||||
col.prop(halo, "use_soft")
|
||||
|
||||
col = split.column()
|
||||
number_but(col, "use_ring", "ring_count", "Rings", "mirror_color")
|
||||
number_but(col, "use_lines", "line_count", "Lines", "specular_color")
|
||||
number_but(col, "use_star", "star_tip_count", "Star tips", "")
|
||||
number_but(col, "use_ring", "ring_count", iface_("Rings"), "mirror_color")
|
||||
number_but(col, "use_lines", "line_count", iface_("Lines"), "specular_color")
|
||||
number_but(col, "use_star", "star_tip_count", iface_("Star Tips"), "")
|
||||
|
||||
|
||||
class MATERIAL_PT_flare(MaterialButtonsPanel, Panel):
|
||||
|
@@ -97,7 +97,8 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
|
||||
if ob:
|
||||
row = layout.row()
|
||||
|
||||
row.template_list("UI_UL_list", "", ob, "particle_systems", ob.particle_systems, "active_index", rows=2)
|
||||
row.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
|
||||
ob.particle_systems, "active_index", rows=2)
|
||||
|
||||
col = row.column(align=True)
|
||||
col.operator("object.particle_system_add", icon='ZOOMIN', text="")
|
||||
@@ -637,7 +638,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
|
||||
layout.label(text="Fluid interaction:")
|
||||
|
||||
row = layout.row()
|
||||
row.template_list("UI_UL_list", "", psys, "targets", psys, "active_particle_target_index")
|
||||
row.template_list("UI_UL_list", "particle_targets", psys, "targets", psys, "active_particle_target_index")
|
||||
|
||||
col = row.column()
|
||||
sub = col.row()
|
||||
@@ -703,7 +704,8 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
|
||||
|
||||
# Currently boids can only use the first state so these are commented out for now.
|
||||
#row = layout.row()
|
||||
#row.template_list("UI_UL_list", "", boids, "states", boids, "active_boid_state_index", compact="True")
|
||||
#row.template_list("UI_UL_list", "particle_boids", boids, "states",
|
||||
# boids, "active_boid_state_index", compact="True")
|
||||
#col = row.row()
|
||||
#sub = col.row(align=True)
|
||||
#sub.operator("boid.state_add", icon='ZOOMIN', text="")
|
||||
@@ -724,7 +726,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
|
||||
row.label(text="")
|
||||
|
||||
row = layout.row()
|
||||
row.template_list("UI_UL_list", "", state, "rules", state, "active_boid_rule_index")
|
||||
row.template_list("UI_UL_list", "particle_boids_rules", state, "rules", state, "active_boid_rule_index")
|
||||
|
||||
col = row.column()
|
||||
sub = col.row()
|
||||
@@ -887,7 +889,8 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
|
||||
|
||||
if part.use_group_count and not part.use_whole_group:
|
||||
row = layout.row()
|
||||
row.template_list("UI_UL_list", "", part, "dupli_weights", part, "active_dupliweight_index")
|
||||
row.template_list("UI_UL_list", "particle_dupli_weights", part, "dupli_weights",
|
||||
part, "active_dupliweight_index")
|
||||
|
||||
col = row.column()
|
||||
sub = col.row()
|
||||
|
@@ -108,7 +108,8 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
|
||||
|
||||
if not cachetype == 'RIGID_BODY':
|
||||
row = layout.row()
|
||||
row.template_list("UI_UL_list", "", cache, "point_caches", cache.point_caches, "active_index", rows=2)
|
||||
row.template_list("UI_UL_list", "point_caches", cache, "point_caches",
|
||||
cache.point_caches, "active_index", rows=2)
|
||||
col = row.column(align=True)
|
||||
col.operator("ptcache.add", icon='ZOOMIN', text="")
|
||||
col.operator("ptcache.remove", icon='ZOOMOUT', text="")
|
||||
|
@@ -36,12 +36,6 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
|
||||
return (obj and obj.rigid_body and
|
||||
(not context.scene.render.use_game_engine))
|
||||
|
||||
def draw_header(self, context):
|
||||
obj = context.object
|
||||
rbo = obj.rigid_body
|
||||
if rbo is not None:
|
||||
self.layout.prop(rbo, "enabled", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -50,7 +44,10 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
|
||||
|
||||
if rbo is not None:
|
||||
layout.prop(rbo, "type", text="Type")
|
||||
layout.prop(rbo, "kinematic", text="Animated")
|
||||
row = layout.row()
|
||||
if rbo.type == 'ACTIVE':
|
||||
row.prop(rbo, "enabled", text="Dynamic")
|
||||
row.prop(rbo, "kinematic", text="Animated")
|
||||
|
||||
if rbo.type == 'ACTIVE':
|
||||
layout.prop(rbo, "mass")
|
||||
|
@@ -51,6 +51,7 @@ class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Pa
|
||||
layout.prop(rbc, "object1")
|
||||
layout.prop(rbc, "object2")
|
||||
|
||||
if rbc.type != 'MOTOR':
|
||||
row = layout.row()
|
||||
row.prop(rbc, "use_breaking")
|
||||
sub = row.row()
|
||||
@@ -113,6 +114,30 @@ class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Pa
|
||||
sub.prop(rbc, "limit_ang_x_lower", text="Lower")
|
||||
sub.prop(rbc, "limit_ang_x_upper", text="Upper")
|
||||
|
||||
elif rbc.type == 'MOTOR':
|
||||
col = layout.column(align=True)
|
||||
col.label("Linear motor:")
|
||||
|
||||
row = col.row()
|
||||
sub = row.row()
|
||||
sub.scale_x = 0.5
|
||||
sub.prop(rbc, "use_motor_lin", toggle=True, text="Enable")
|
||||
sub = row.row()
|
||||
sub.active = rbc.use_motor_lin
|
||||
sub.prop(rbc, "motor_lin_target_velocity", text="Target Velocity")
|
||||
sub.prop(rbc, "motor_lin_max_impulse", text="Max Impulse")
|
||||
|
||||
col.label("Angular motor:")
|
||||
|
||||
row = col.row()
|
||||
sub = row.row()
|
||||
sub.scale_x = 0.5
|
||||
sub.prop(rbc, "use_motor_ang", toggle=True, text="Enable")
|
||||
sub = row.row()
|
||||
sub.active = rbc.use_motor_ang
|
||||
sub.prop(rbc, "motor_ang_target_velocity", text="Target Velocity")
|
||||
sub.prop(rbc, "motor_ang_max_impulse", text="Max Impulse")
|
||||
|
||||
elif rbc.type in {'GENERIC', 'GENERIC_SPRING'}:
|
||||
col = layout.column(align=True)
|
||||
col.label("Limits:")
|
||||
|
@@ -94,7 +94,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.template_list("UI_UL_list", "", scene, "keying_sets", scene.keying_sets, "active_index", rows=2)
|
||||
col.template_list("UI_UL_list", "keying_sets", scene, "keying_sets", scene.keying_sets, "active_index", rows=2)
|
||||
|
||||
col = row.column(align=True)
|
||||
col.operator("anim.keying_set_add", icon='ZOOMIN', text="")
|
||||
|
@@ -746,7 +746,7 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
|
||||
layout.active = stab.use_2d_stabilization
|
||||
|
||||
row = layout.row()
|
||||
row.template_list("UI_UL_list", "", stab, "tracks",
|
||||
row.template_list("UI_UL_list", "stabilization_tracks", stab, "tracks",
|
||||
stab, "active_track_index", rows=3)
|
||||
|
||||
sub = row.column(align=True)
|
||||
|
@@ -240,6 +240,10 @@ class DOPESHEET_MT_channel(Menu):
|
||||
|
||||
layout.operator("anim.channels_delete")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_group")
|
||||
layout.operator("anim.channels_ungroup")
|
||||
|
||||
layout.separator()
|
||||
layout.operator_menu_enum("anim.channels_setting_toggle", "type")
|
||||
layout.operator_menu_enum("anim.channels_setting_enable", "type")
|
||||
|
@@ -160,6 +160,10 @@ class GRAPH_MT_channel(Menu):
|
||||
|
||||
layout.operator("anim.channels_delete")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_group")
|
||||
layout.operator("anim.channels_ungroup")
|
||||
|
||||
layout.separator()
|
||||
layout.operator_menu_enum("anim.channels_setting_toggle", "type")
|
||||
layout.operator_menu_enum("anim.channels_setting_enable", "type")
|
||||
|
@@ -252,6 +252,7 @@ class NODE_PT_quality(bpy.types.Panel):
|
||||
|
||||
col = layout.column()
|
||||
col.prop(tree, "use_opencl")
|
||||
col.prop(tree, "use_groupnode_buffer")
|
||||
col.prop(tree, "two_pass")
|
||||
col.prop(snode, "show_highlight")
|
||||
col.prop(snode, "use_hidden_preview")
|
||||
|
@@ -264,6 +264,8 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
|
||||
col.operator("curve.cyclic_toggle")
|
||||
col.operator("curve.switch_direction")
|
||||
col.operator("curve.spline_type_set")
|
||||
col.operator("curve.radius_set")
|
||||
col.operator("curve.smooth_radius")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Handles:")
|
||||
@@ -278,6 +280,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
|
||||
col.label(text="Modeling:")
|
||||
col.operator("curve.extrude_move", text="Extrude")
|
||||
col.operator("curve.subdivide")
|
||||
col.operator("curve.smooth")
|
||||
|
||||
draw_repeat_tools(context, layout)
|
||||
|
||||
@@ -1054,6 +1057,11 @@ class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
|
||||
|
||||
col.prop(wpaint, "input_samples")
|
||||
|
||||
col.label("Show Zero Weights:")
|
||||
rowsub = col.row()
|
||||
rowsub.active = (not tool_settings.use_multipaint)
|
||||
rowsub.prop(tool_settings, "vertex_group_user", expand=True)
|
||||
|
||||
self.unified_paint_settings(col, context)
|
||||
|
||||
# Commented out because the Apply button isn't an operator yet, making these settings useless
|
||||
@@ -1222,7 +1230,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
|
||||
if pe.type == 'PARTICLES':
|
||||
if ob.particle_systems:
|
||||
if len(ob.particle_systems) > 1:
|
||||
layout.template_list("UI_UL_list", "", ob, "particle_systems",
|
||||
layout.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
|
||||
ob.particle_systems, "active_index", rows=2, maxrows=3)
|
||||
|
||||
ptcache = ob.particle_systems.active.point_cache
|
||||
@@ -1232,8 +1240,8 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
|
||||
ptcache = md.point_cache
|
||||
|
||||
if ptcache and len(ptcache.point_caches) > 1:
|
||||
layout.template_list("UI_UL_list", "", ptcache, "point_caches", ptcache.point_caches, "active_index",
|
||||
rows=2, maxrows=3)
|
||||
layout.template_list("UI_UL_list", "particles_point_caches", ptcache, "point_caches",
|
||||
ptcache.point_caches, "active_index", rows=2, maxrows=3)
|
||||
|
||||
if not pe.is_editable:
|
||||
layout.label(text="Point cache must be baked")
|
||||
|
@@ -14,7 +14,7 @@ class ModalTimerOperator(bpy.types.Operator):
|
||||
|
||||
if event.type == 'TIMER':
|
||||
# change theme color, silly!
|
||||
color = context.user_preferences.themes[0].view_3d.space.back
|
||||
color = context.user_preferences.themes[0].view_3d.space.gradients.high_gradient
|
||||
color.s = 1.0
|
||||
color.h += 0.01
|
||||
|
||||
|
@@ -112,7 +112,7 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
|
||||
|
||||
/* Default, void context.
|
||||
* WARNING! The "" context is not the same as no (NULL) context at mo/boost::locale level!
|
||||
* NOTE: We translate BLF_I18NCONTEXT_DEFAULT as BLF_I18NCONTEXT_DEFAULT_BPY in Python, as we can’t use "natural"
|
||||
* NOTE: We translate BLF_I18NCONTEXT_DEFAULT as BLF_I18NCONTEXT_DEFAULT_BPY in Python, as we can't use "natural"
|
||||
* None value in rna string properties... :/
|
||||
* For perf reason, we only use the first char to detect this context, so other contexts should never start
|
||||
* with the same char!
|
||||
|
@@ -43,6 +43,8 @@
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_vec_types.h"
|
||||
|
||||
#include "BLI_math.h"
|
||||
|
||||
#include "BIF_gl.h"
|
||||
#include "BLF_api.h"
|
||||
|
||||
@@ -516,8 +518,8 @@ static void blf_draw__start(FontBLF *font, GLint *mode, GLint *param)
|
||||
if (font->flags & BLF_ASPECT)
|
||||
glScalef(font->aspect[0], font->aspect[1], font->aspect[2]);
|
||||
|
||||
if (font->flags & BLF_ROTATION)
|
||||
glRotatef(font->angle, 0.0f, 0.0f, 1.0f);
|
||||
if (font->flags & BLF_ROTATION) /* radians -> degrees */
|
||||
glRotatef(font->angle * (float)(180.0 / M_PI), 0.0f, 0.0f, 1.0f);
|
||||
|
||||
if (font->shadow || font->blur)
|
||||
glGetFloatv(GL_CURRENT_COLOR, font->orig_col);
|
||||
|
@@ -166,7 +166,7 @@ typedef struct FontBLF {
|
||||
/* initial position for draw the text. */
|
||||
float pos[3];
|
||||
|
||||
/* angle in degrees. */
|
||||
/* angle in radians. */
|
||||
float angle;
|
||||
|
||||
/* blur: 3 or 5 large kernel */
|
||||
|
@@ -95,7 +95,7 @@ struct BMEditMesh;
|
||||
struct ListBase;
|
||||
struct PBVH;
|
||||
|
||||
#define DM_OMP_LIMIT 0 /* setting zero so we can catch bugs in OpenMP/BMesh */
|
||||
#define DM_OMP_LIMIT 10000 /* setting zero so we can catch bugs in OpenMP/BMesh */
|
||||
|
||||
/* number of sub-elements each mesh element has (for interpolation) */
|
||||
#define SUB_ELEMS_VERT 0
|
||||
|
@@ -41,8 +41,8 @@ extern "C" {
|
||||
/* these lines are grep'd, watch out for our not-so-awesome regex
|
||||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 265
|
||||
#define BLENDER_SUBVERSION 10
|
||||
#define BLENDER_VERSION 266
|
||||
#define BLENDER_SUBVERSION 0
|
||||
|
||||
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
|
||||
#define BLENDER_MINVERSION 262
|
||||
@@ -50,9 +50,9 @@ extern "C" {
|
||||
|
||||
/* used by packaging tools */
|
||||
/* can be left blank, otherwise a,b,c... etc with no quotes */
|
||||
#define BLENDER_VERSION_CHAR a
|
||||
#define BLENDER_VERSION_CHAR
|
||||
/* alpha/beta/rc/release, docs use this */
|
||||
#define BLENDER_VERSION_CYCLE beta
|
||||
#define BLENDER_VERSION_CYCLE alpha
|
||||
|
||||
extern char versionstr[]; /* from blender.c */
|
||||
|
||||
|
@@ -38,7 +38,7 @@
|
||||
/*NOTE: this is the bmesh 1.0 code. it's completely outdated.*/
|
||||
|
||||
/* uncomment to use the new bevel operator as a modifier */
|
||||
// #define USE_BM_BEVEL_OP_AS_MOD
|
||||
#define USE_BM_BEVEL_OP_AS_MOD
|
||||
|
||||
/* bevel tool defines */
|
||||
/* element flags */
|
||||
@@ -53,6 +53,7 @@
|
||||
#define BME_BEVEL_RADIUS (1 << 2)
|
||||
#define BME_BEVEL_ANGLE (1 << 3)
|
||||
#define BME_BEVEL_WEIGHT (1 << 4)
|
||||
#define BME_BEVEL_VGROUP (1 << 5)
|
||||
//~ #define BME_BEVEL_EWEIGHT (1<<4)
|
||||
//~ #define BME_BEVEL_VWEIGHT (1<<5)
|
||||
#define BME_BEVEL_PERCENT (1 << 6)
|
||||
|
@@ -55,6 +55,7 @@ void defvert_add_index_notest(struct MDeformVert *dv, int de
|
||||
void defvert_remove_group(struct MDeformVert *dvert, struct MDeformWeight *dw);
|
||||
void defvert_clear(struct MDeformVert *dvert);
|
||||
int defvert_find_shared(const struct MDeformVert *dvert_a, const struct MDeformVert *dvert_b);
|
||||
bool defvert_is_weight_zero(const struct MDeformVert *dvert, const int defgroup_tot);
|
||||
|
||||
void BKE_defvert_array_free_elems(struct MDeformVert *dvert, int totvert);
|
||||
void BKE_defvert_array_free(struct MDeformVert *dvert, int totvert);
|
||||
|
@@ -99,8 +99,16 @@ int is_acyclic(struct DagForest *dag);
|
||||
/* ********** API *************** */
|
||||
/* Note that the DAG never executes changes in Objects, only sets flags in Objects */
|
||||
|
||||
/* (re)-create dependency graph for scene */
|
||||
void DAG_scene_sort(struct Main *bmain, struct Scene *sce);
|
||||
/* clear all dependency graphs, call this when changing relations between objects.
|
||||
* the dependency graphs will be rebuilt just before they are used to avoid them
|
||||
* getting rebuild many times during operators */
|
||||
void DAG_relations_tag_update(struct Main *bmain);
|
||||
|
||||
/* (re)-create the dependency graph before using it */
|
||||
void DAG_scene_relations_update(struct Main *bmain, struct Scene *sce);
|
||||
|
||||
/* force an immediate rebuild of the dependency graph, only needed in rare cases */
|
||||
void DAG_scene_relations_rebuild(struct Main *bmain, struct Scene *scene);
|
||||
|
||||
/* flag all objects that need recalc because they're animated */
|
||||
void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time);
|
||||
@@ -109,10 +117,8 @@ void DAG_scene_flush_update(struct Main *bmain, struct Scene *sce, unsigned i
|
||||
/* tag objects for update on file load */
|
||||
void DAG_on_visible_update(struct Main *bmain, const short do_time);
|
||||
|
||||
/* when setting manual RECALC flags, call this afterwards */
|
||||
void DAG_ids_flush_update(struct Main *bmain, int time);
|
||||
|
||||
/* tag datablock to get updated for the next redraw */
|
||||
void DAG_id_tag_update_ex(struct Main *bmain, struct ID *id, short flag);
|
||||
void DAG_id_tag_update(struct ID *id, short flag);
|
||||
/* flush all tagged updates */
|
||||
void DAG_ids_flush_tagged(struct Main *bmain);
|
||||
|
@@ -152,6 +152,9 @@ void BKE_image_pool_free(struct ImagePool *pool);
|
||||
struct ImBuf *BKE_image_pool_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, struct ImagePool *pool);
|
||||
void BKE_image_pool_release_ibuf(struct Image *ima, struct ImBuf *ibuf, struct ImagePool *pool);
|
||||
|
||||
/* set an alpha mode based on file extension */
|
||||
void BKE_image_alpha_mode_from_extension(struct Image *image);
|
||||
|
||||
/* returns a new image or NULL if it can't load */
|
||||
struct Image *BKE_image_load(struct Main *bmain, const char *filepath);
|
||||
/* returns existing Image when filename/type is same (frame optional) */
|
||||
|
@@ -261,6 +261,12 @@ typedef struct bNodeType {
|
||||
#define SOCK_IN 1
|
||||
#define SOCK_OUT 2
|
||||
|
||||
typedef enum eNodeSizePreset {
|
||||
NODE_SIZE_DEFAULT,
|
||||
NODE_SIZE_SMALL,
|
||||
NODE_SIZE_LARGE
|
||||
} eNodeSizePreset;
|
||||
|
||||
struct bNodeTreeExec;
|
||||
|
||||
typedef void (*bNodeTreeCallback)(void *calldata, struct ID *owner_id, struct bNodeTree *ntree);
|
||||
@@ -419,6 +425,7 @@ void node_type_base(struct bNodeTreeType *ttype, struct bNodeType *nt
|
||||
const char *name, short nclass, short flag);
|
||||
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs);
|
||||
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth);
|
||||
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size);
|
||||
void node_type_init(struct bNodeType *ntype, void (*initfunc)(struct bNodeTree *ntree, struct bNode *node, struct bNodeTemplate *ntemp));
|
||||
void node_type_valid(struct bNodeType *ntype, int (*validfunc)(struct bNodeTree *ntree, struct bNodeTemplate *ntemp));
|
||||
void node_type_storage(struct bNodeType *ntype,
|
||||
|
@@ -103,7 +103,8 @@ struct Object *BKE_object_pose_armature_get(struct Object *ob);
|
||||
void BKE_object_where_is_calc(struct Scene *scene, struct Object *ob);
|
||||
void BKE_object_where_is_calc_ex(struct Scene *scene, struct RigidBodyWorld *rbw, struct Object *ob);
|
||||
void BKE_object_where_is_calc_time(struct Scene *scene, struct Object *ob, float ctime);
|
||||
void BKE_object_where_is_calc_time_ex(struct Scene *scene, struct RigidBodyWorld *rbw, struct Object *ob, float ctime);
|
||||
void BKE_object_where_is_calc_time_ex(struct Scene *scene, struct Object *ob, float ctime,
|
||||
struct RigidBodyWorld *rbw);
|
||||
void BKE_object_where_is_calc_simul(struct Scene *scene, struct Object *ob);
|
||||
void BKE_object_where_is_calc_mat4(struct Scene *scene, struct Object *ob, float obmat[4][4]);
|
||||
|
||||
@@ -149,7 +150,8 @@ void BKE_object_tfm_protected_restore(struct Object *ob,
|
||||
const short protectflag);
|
||||
|
||||
void BKE_object_handle_update(struct Scene *scene, struct Object *ob);
|
||||
void BKE_object_handle_update_ex(struct Scene *scene, struct RigidBodyWorld *rbw, struct Object *ob);
|
||||
void BKE_object_handle_update_ex(struct Scene *scene, struct Object *ob,
|
||||
struct RigidBodyWorld *rbw);
|
||||
void BKE_object_sculpt_modifiers_changed(struct Object *ob);
|
||||
|
||||
int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot);
|
||||
|
@@ -220,7 +220,10 @@ typedef struct ParticleCollision {
|
||||
|
||||
ParticleCollisionElement pce;
|
||||
|
||||
float total_time, inv_timestep;
|
||||
/* total_time is the amount of time in this subframe
|
||||
* inv_total_time is the opposite
|
||||
* inv_timestep is the inverse of the amount of time in this frame */
|
||||
float total_time, inv_total_time, inv_timestep;
|
||||
|
||||
float radius;
|
||||
float co1[3], co2[3];
|
||||
|
@@ -356,6 +356,8 @@ typedef struct SeqLoadInfo {
|
||||
typedef struct Sequence *(*SeqLoadFunc)(struct bContext *, ListBase *, struct SeqLoadInfo *);
|
||||
|
||||
struct Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine);
|
||||
|
||||
void BKE_sequence_alpha_mode_from_extension(struct Sequence *seq);
|
||||
void BKE_sequence_init_colorspace(struct Sequence *seq);
|
||||
|
||||
struct Sequence *BKE_sequencer_add_image_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
|
||||
|
@@ -109,6 +109,10 @@ int text_check_identifier_nodigit(const char ch);
|
||||
int text_check_whitespace(const char ch);
|
||||
int text_find_identifier_start(const char *str, int i);
|
||||
|
||||
/* defined in bpy_interface.c */
|
||||
extern int text_check_identifier_unicode(const unsigned int ch);
|
||||
extern int text_check_identifier_nodigit_unicode(const unsigned int ch);
|
||||
|
||||
enum {
|
||||
TXT_MOVE_LINE_UP = -1,
|
||||
TXT_MOVE_LINE_DOWN = 1
|
||||
|
@@ -46,6 +46,7 @@ struct MovieDistortion;
|
||||
struct Camera;
|
||||
struct Object;
|
||||
struct Scene;
|
||||
struct rcti;
|
||||
|
||||
/* **** Common functions **** */
|
||||
|
||||
@@ -156,6 +157,8 @@ struct ImBuf *BKE_tracking_undistort_frame(struct MovieTracking *tracking, struc
|
||||
struct ImBuf *BKE_tracking_distort_frame(struct MovieTracking *tracking, struct ImBuf *ibuf,
|
||||
int calibration_width, int calibration_height, float overscan);
|
||||
|
||||
void BKE_tracking_max_undistortion_delta_across_bound(struct MovieTracking *tracking, struct rcti *rect, float delta[2]);
|
||||
|
||||
/* **** Image sampling **** */
|
||||
struct ImBuf *BKE_tracking_sample_pattern(int frame_width, int frame_height,
|
||||
struct ImBuf *struct_ibuf, struct MovieTrackingTrack *track,
|
||||
|
@@ -1017,8 +1017,12 @@ void weight_to_rgb(float r_rgb[3], const float weight)
|
||||
|
||||
/* draw_flag's for calc_weightpaint_vert_color */
|
||||
enum {
|
||||
CALC_WP_MULTIPAINT = (1 << 0),
|
||||
CALC_WP_AUTO_NORMALIZE = (1 << 1)
|
||||
/* only one of these should be set, keep first (for easy bit-shifting) */
|
||||
CALC_WP_GROUP_USER_ACTIVE = (1 << 1),
|
||||
CALC_WP_GROUP_USER_ALL = (1 << 2),
|
||||
|
||||
CALC_WP_MULTIPAINT = (1 << 3),
|
||||
CALC_WP_AUTO_NORMALIZE = (1 << 4)
|
||||
};
|
||||
|
||||
static void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const float input)
|
||||
@@ -1050,7 +1054,7 @@ static void calc_weightpaint_vert_color(
|
||||
{
|
||||
float input = 0.0f;
|
||||
|
||||
int make_black = FALSE;
|
||||
bool make_black = false;
|
||||
|
||||
if ((defbase_sel_tot > 1) && (draw_flag & CALC_WP_MULTIPAINT)) {
|
||||
int was_a_nonzero = FALSE;
|
||||
@@ -1072,7 +1076,7 @@ static void calc_weightpaint_vert_color(
|
||||
|
||||
/* make it black if the selected groups have no weight on a vertex */
|
||||
if (was_a_nonzero == FALSE) {
|
||||
make_black = TRUE;
|
||||
make_black = true;
|
||||
}
|
||||
else if ((draw_flag & CALC_WP_AUTO_NORMALIZE) == FALSE) {
|
||||
input /= defbase_sel_tot; /* get the average */
|
||||
@@ -1081,6 +1085,17 @@ static void calc_weightpaint_vert_color(
|
||||
else {
|
||||
/* default, non tricky behavior */
|
||||
input = defvert_find_weight(dv, defbase_act);
|
||||
|
||||
if (draw_flag & CALC_WP_GROUP_USER_ACTIVE) {
|
||||
if (input == 0.0f) {
|
||||
make_black = true;
|
||||
}
|
||||
}
|
||||
else if (draw_flag & CALC_WP_GROUP_USER_ALL) {
|
||||
if (input == 0.0f) {
|
||||
make_black = defvert_is_weight_zero(dv, defbase_tot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (make_black) { /* TODO, theme color */
|
||||
@@ -1138,7 +1153,12 @@ static unsigned char *calc_weightpaint_vert_array(Object *ob, DerivedMesh *dm, i
|
||||
}
|
||||
else {
|
||||
int col_i;
|
||||
if (draw_flag & (CALC_WP_GROUP_USER_ACTIVE | CALC_WP_GROUP_USER_ALL)) {
|
||||
col_i = 0;
|
||||
}
|
||||
else {
|
||||
weightpaint_color((unsigned char *)&col_i, coba, 0.0f);
|
||||
}
|
||||
fill_vn_i((int *)wtcol_v, numVerts, col_i);
|
||||
}
|
||||
|
||||
@@ -1354,8 +1374,11 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
|
||||
int sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt;
|
||||
int sculpt_dyntopo = (sculpt_mode && ob->sculpt->bm);
|
||||
|
||||
const int draw_flag = ((scene->toolsettings->multipaint ? CALC_WP_MULTIPAINT : 0) |
|
||||
const int draw_flag = ((scene->toolsettings->multipaint ? CALC_WP_MULTIPAINT :
|
||||
/* CALC_WP_GROUP_USER_ACTIVE or CALC_WP_GROUP_USER_ALL*/
|
||||
(1 << scene->toolsettings->weightuser)) |
|
||||
(scene->toolsettings->auto_normalize ? CALC_WP_AUTO_NORMALIZE : 0));
|
||||
|
||||
/* Generic preview only in object mode! */
|
||||
const int do_mod_mcol = (ob->mode == OB_MODE_OBJECT);
|
||||
#if 0 /* XXX Will re-enable this when we have global mod stack options. */
|
||||
@@ -2720,7 +2743,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
|
||||
a = attribs->tottface++;
|
||||
|
||||
attribs->tface[a].array = tfdata->layers[layer].data;
|
||||
attribs->tface[a].em_offset = tfdata->layers[layer].offset;
|
||||
attribs->tface[a].em_offset = ldata->layers[layer].offset;
|
||||
attribs->tface[a].gl_index = gattribs->layer[b].glindex;
|
||||
attribs->tface[a].gl_texco = gattribs->layer[b].gltexco;
|
||||
}
|
||||
@@ -2757,7 +2780,8 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
|
||||
a = attribs->totmcol++;
|
||||
|
||||
attribs->mcol[a].array = tfdata->layers[layer].data;
|
||||
attribs->mcol[a].em_offset = tfdata->layers[layer].offset;
|
||||
/* odd, store the offset for a different layer type here, but editmode draw code expects it */
|
||||
attribs->mcol[a].em_offset = ldata->layers[layer].offset;
|
||||
attribs->mcol[a].gl_index = gattribs->layer[b].glindex;
|
||||
}
|
||||
}
|
||||
@@ -2773,6 +2797,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
|
||||
a = attribs->totmcol++;
|
||||
|
||||
attribs->mcol[a].array = tfdata->layers[layer].data;
|
||||
/* odd, store the offset for a different layer type here, but editmode draw code expects it */
|
||||
attribs->mcol[a].em_offset = tfdata->layers[layer].offset;
|
||||
attribs->mcol[a].gl_index = gattribs->layer[b].glindex;
|
||||
}
|
||||
|
@@ -69,7 +69,6 @@
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_anim.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_rigidbody.h"
|
||||
|
||||
|
||||
// XXX bad level call...
|
||||
@@ -320,15 +319,21 @@ static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets)
|
||||
}
|
||||
|
||||
/* "brew me a list that's sorted a bit faster now depsy" */
|
||||
DAG_scene_sort(G.main, scene);
|
||||
DAG_scene_relations_rebuild(G.main, scene);
|
||||
}
|
||||
|
||||
/* update scene for current frame */
|
||||
static void motionpaths_calc_update_scene(Scene *scene)
|
||||
{
|
||||
#if 1 // 'production' optimizations always on
|
||||
|
||||
/* rigid body simulation needs complete update to work correctly for now */
|
||||
/* RB_TODO investigate if we could avoid updating everything */
|
||||
if (BKE_scene_check_rigidbody_active(scene)) {
|
||||
BKE_scene_update_for_newframe(G.main, scene, scene->lay);
|
||||
}
|
||||
else { /* otherwise we can optimize by restricting updates */
|
||||
Base *base, *last = NULL;
|
||||
float ctime = BKE_scene_frame_get(scene);
|
||||
|
||||
/* only stuff that moves or needs display still */
|
||||
DAG_scene_update_flags(G.main, scene, scene->lay, TRUE);
|
||||
@@ -342,14 +347,6 @@ static void motionpaths_calc_update_scene(Scene *scene)
|
||||
last = base;
|
||||
}
|
||||
|
||||
/* run rigidbody sim
|
||||
* NOTE: keep in sync with BKE_scene_update_for_newframe() in scene.c
|
||||
*/
|
||||
// XXX: this position may still change, objects not being updated correctly before simulation is run
|
||||
// NOTE: current position is so that rigidbody sim affects other objects
|
||||
if (BKE_scene_check_rigidbody_active(scene))
|
||||
BKE_rigidbody_do_simulation(scene, ctime);
|
||||
|
||||
/* perform updates for tagged objects */
|
||||
/* XXX: this will break if rigs depend on scene or other data that
|
||||
* is animated but not attached to/updatable from objects */
|
||||
@@ -361,6 +358,7 @@ static void motionpaths_calc_update_scene(Scene *scene)
|
||||
if (base == last)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else // original, 'always correct' version
|
||||
/* do all updates
|
||||
* - if this is too slow, resort to using a more efficient way
|
||||
|
@@ -1000,8 +1000,7 @@ int BKE_copybuffer_paste(bContext *C, char *libname, ReportList *reports)
|
||||
flag_all_listbases_ids(LIB_PRE_EXISTING, 0);
|
||||
|
||||
/* recreate dependency graph to include new objects */
|
||||
DAG_scene_sort(bmain, scene);
|
||||
DAG_ids_flush_update(bmain, 0);
|
||||
DAG_relations_tag_update(bmain);
|
||||
|
||||
BLO_blendhandle_close(bh);
|
||||
/* remove library... */
|
||||
|
@@ -4261,7 +4261,7 @@ static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isRe
|
||||
|
||||
/* Free data of a specific constraint if it has any info.
|
||||
* be sure to run BIK_clear_data() when freeing an IK constraint,
|
||||
* unless DAG_scene_sort is called.
|
||||
* unless DAG_relations_tag_update is called.
|
||||
*/
|
||||
void BKE_free_constraint_data(bConstraint *con)
|
||||
{
|
||||
|
@@ -48,6 +48,8 @@
|
||||
#include "BLI_threads.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLF_translation.h"
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_screen.h"
|
||||
@@ -851,7 +853,7 @@ void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
|
||||
|
||||
const char *CTX_wm_operator_poll_msg_get(bContext *C)
|
||||
{
|
||||
return C->wm.operator_poll_msg;
|
||||
return IFACE_(C->wm.operator_poll_msg);
|
||||
}
|
||||
|
||||
/* data context */
|
||||
|
@@ -2202,6 +2202,70 @@ static void make_bevel_list_segment_3D(BevList *bl)
|
||||
copy_qt_qt(bevp2->quat, bevp1->quat);
|
||||
}
|
||||
|
||||
/* only for 2 points */
|
||||
static void make_bevel_list_segment_2D(BevList *bl)
|
||||
{
|
||||
BevPoint *bevp2 = (BevPoint *)(bl + 1);
|
||||
BevPoint *bevp1 = bevp2 + 1;
|
||||
|
||||
const float x1 = bevp1->vec[0] - bevp2->vec[0];
|
||||
const float y1 = bevp1->vec[1] - bevp2->vec[1];
|
||||
|
||||
calc_bevel_sin_cos(x1, y1, -x1, -y1, &(bevp1->sina), &(bevp1->cosa));
|
||||
bevp2->sina = bevp1->sina;
|
||||
bevp2->cosa = bevp1->cosa;
|
||||
|
||||
/* fill in dir & quat */
|
||||
make_bevel_list_segment_3D(bl);
|
||||
}
|
||||
|
||||
static void make_bevel_list_2D(BevList *bl)
|
||||
{
|
||||
/* note: bevp->dir and bevp->quat are not needed for beveling but are
|
||||
* used when making a path from a 2D curve, therefor they need to be set - Campbell */
|
||||
|
||||
BevPoint *bevp2 = (BevPoint *)(bl + 1);
|
||||
BevPoint *bevp1 = bevp2 + (bl->nr - 1);
|
||||
BevPoint *bevp0 = bevp1 - 1;
|
||||
int nr;
|
||||
|
||||
nr = bl->nr;
|
||||
while (nr--) {
|
||||
const float x1 = bevp1->vec[0] - bevp0->vec[0];
|
||||
const float x2 = bevp1->vec[0] - bevp2->vec[0];
|
||||
const float y1 = bevp1->vec[1] - bevp0->vec[1];
|
||||
const float y2 = bevp1->vec[1] - bevp2->vec[1];
|
||||
|
||||
calc_bevel_sin_cos(x1, y1, x2, y2, &(bevp1->sina), &(bevp1->cosa));
|
||||
|
||||
/* from: make_bevel_list_3D_zup, could call but avoid a second loop.
|
||||
* no need for tricky tilt calculation as with 3D curves */
|
||||
bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
|
||||
vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
|
||||
/* done with inline make_bevel_list_3D_zup */
|
||||
|
||||
bevp0 = bevp1;
|
||||
bevp1 = bevp2;
|
||||
bevp2++;
|
||||
}
|
||||
|
||||
/* correct non-cyclic cases */
|
||||
if (bl->poly == -1) {
|
||||
BevPoint *bevp = (BevPoint *)(bl + 1);
|
||||
bevp1 = bevp + 1;
|
||||
bevp->sina = bevp1->sina;
|
||||
bevp->cosa = bevp1->cosa;
|
||||
bevp = (BevPoint *)(bl + 1);
|
||||
bevp += (bl->nr - 1);
|
||||
bevp1 = bevp - 1;
|
||||
bevp->sina = bevp1->sina;
|
||||
bevp->cosa = bevp1->cosa;
|
||||
|
||||
/* correct for the dir/quat, see above why its needed */
|
||||
bevel_list_cyclic_fix_3D(bl);
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_curve_bevelList_make(Object *ob)
|
||||
{
|
||||
/*
|
||||
@@ -2216,7 +2280,7 @@ void BKE_curve_bevelList_make(Object *ob)
|
||||
BPoint *bp;
|
||||
BevList *bl, *blnew, *blnext;
|
||||
BevPoint *bevp, *bevp2, *bevp1 = NULL, *bevp0;
|
||||
float min, inp, x1, x2, y1, y2;
|
||||
float min, inp;
|
||||
struct bevelsort *sortdata, *sd, *sd1;
|
||||
int a, b, nr, poly, resolu = 0, len = 0;
|
||||
int do_tilt, do_radius, do_weight;
|
||||
@@ -2534,76 +2598,22 @@ void BKE_curve_bevelList_make(Object *ob)
|
||||
|
||||
/* STEP 4: 2D-COSINES or 3D ORIENTATION */
|
||||
if ((cu->flag & CU_3D) == 0) {
|
||||
/* note: bevp->dir and bevp->quat are not needed for beveling but are
|
||||
* used when making a path from a 2D curve, therefor they need to be set - Campbell */
|
||||
bl = cu->bev.first;
|
||||
while (bl) {
|
||||
|
||||
/* 2D Curves */
|
||||
for (bl = cu->bev.first; bl; bl = bl->next) {
|
||||
if (bl->nr < 2) {
|
||||
/* do nothing */
|
||||
}
|
||||
else if (bl->nr == 2) { /* 2 pnt, treat separate */
|
||||
bevp2 = (BevPoint *)(bl + 1);
|
||||
bevp1 = bevp2 + 1;
|
||||
|
||||
x1 = bevp1->vec[0] - bevp2->vec[0];
|
||||
y1 = bevp1->vec[1] - bevp2->vec[1];
|
||||
|
||||
calc_bevel_sin_cos(x1, y1, -x1, -y1, &(bevp1->sina), &(bevp1->cosa));
|
||||
bevp2->sina = bevp1->sina;
|
||||
bevp2->cosa = bevp1->cosa;
|
||||
|
||||
/* fill in dir & quat */
|
||||
make_bevel_list_segment_3D(bl);
|
||||
make_bevel_list_segment_2D(bl);
|
||||
}
|
||||
else {
|
||||
bevp2 = (BevPoint *)(bl + 1);
|
||||
bevp1 = bevp2 + (bl->nr - 1);
|
||||
bevp0 = bevp1 - 1;
|
||||
|
||||
nr = bl->nr;
|
||||
while (nr--) {
|
||||
x1 = bevp1->vec[0] - bevp0->vec[0];
|
||||
x2 = bevp1->vec[0] - bevp2->vec[0];
|
||||
y1 = bevp1->vec[1] - bevp0->vec[1];
|
||||
y2 = bevp1->vec[1] - bevp2->vec[1];
|
||||
|
||||
calc_bevel_sin_cos(x1, y1, x2, y2, &(bevp1->sina), &(bevp1->cosa));
|
||||
|
||||
/* from: make_bevel_list_3D_zup, could call but avoid a second loop.
|
||||
* no need for tricky tilt calculation as with 3D curves */
|
||||
bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
|
||||
vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
|
||||
/* done with inline make_bevel_list_3D_zup */
|
||||
|
||||
bevp0 = bevp1;
|
||||
bevp1 = bevp2;
|
||||
bevp2++;
|
||||
}
|
||||
|
||||
/* correct non-cyclic cases */
|
||||
if (bl->poly == -1) {
|
||||
bevp = (BevPoint *)(bl + 1);
|
||||
bevp1 = bevp + 1;
|
||||
bevp->sina = bevp1->sina;
|
||||
bevp->cosa = bevp1->cosa;
|
||||
bevp = (BevPoint *)(bl + 1);
|
||||
bevp += (bl->nr - 1);
|
||||
bevp1 = bevp - 1;
|
||||
bevp->sina = bevp1->sina;
|
||||
bevp->cosa = bevp1->cosa;
|
||||
|
||||
/* correct for the dir/quat, see above why its needed */
|
||||
bevel_list_cyclic_fix_3D(bl);
|
||||
make_bevel_list_2D(bl);
|
||||
}
|
||||
}
|
||||
bl = bl->next;
|
||||
}
|
||||
}
|
||||
else { /* 3D Curves */
|
||||
bl = cu->bev.first;
|
||||
while (bl) {
|
||||
|
||||
else {
|
||||
/* 3D Curves */
|
||||
for (bl = cu->bev.first; bl; bl = bl->next) {
|
||||
if (bl->nr < 2) {
|
||||
/* do nothing */
|
||||
}
|
||||
@@ -2613,7 +2623,6 @@ void BKE_curve_bevelList_make(Object *ob)
|
||||
else {
|
||||
make_bevel_list_3D(bl, (int)(resolu * cu->twist_smooth), cu->twist_mode);
|
||||
}
|
||||
bl = bl->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "BKE_deform.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_path_util.h"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_deform.h" /* own include */
|
||||
|
||||
void defgroup_copy_list(ListBase *outbase, ListBase *inbase)
|
||||
{
|
||||
@@ -787,6 +786,24 @@ int defvert_find_shared(const MDeformVert *dvert_a, const MDeformVert *dvert_b)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* return true if has no weights
|
||||
*/
|
||||
bool defvert_is_weight_zero(const struct MDeformVert *dvert, const int defgroup_tot)
|
||||
{
|
||||
MDeformWeight *dw = dvert->dw;
|
||||
unsigned int i;
|
||||
for (i = dvert->totweight; i != 0; i--, dw++) {
|
||||
if (dw->weight != 0.0f) {
|
||||
/* check the group is in-range, happens on rare situations */
|
||||
if (LIKELY(dw->def_nr < defgroup_tot)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Defvert Array functions */
|
||||
|
||||
|
@@ -837,7 +837,6 @@ DagForest *build_dag(Main *bmain, Scene *sce, short mask)
|
||||
DagAdjList *itA;
|
||||
|
||||
dag = sce->theDag;
|
||||
sce->dagisvalid = 1;
|
||||
if (dag)
|
||||
free_forest(dag);
|
||||
else {
|
||||
@@ -1846,8 +1845,18 @@ static void scene_sort_groups(Main *bmain, Scene *sce)
|
||||
}
|
||||
}
|
||||
|
||||
/* free the depency graph */
|
||||
static void dag_scene_free(Scene *sce)
|
||||
{
|
||||
if (sce->theDag) {
|
||||
free_forest(sce->theDag);
|
||||
MEM_freeN(sce->theDag);
|
||||
sce->theDag = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* sort the base list on dependency order */
|
||||
void DAG_scene_sort(Main *bmain, Scene *sce)
|
||||
static void dag_scene_build(Main *bmain, Scene *sce)
|
||||
{
|
||||
DagNode *node, *rootnode;
|
||||
DagNodeQueue *nqueue;
|
||||
@@ -1936,10 +1945,34 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
|
||||
printf(" %s\n", base->object->id.name);
|
||||
}
|
||||
}
|
||||
|
||||
/* temporal...? */
|
||||
sce->recalc |= SCE_PRV_CHANGED; /* test for 3d preview */
|
||||
}
|
||||
|
||||
/* clear all dependency graphs */
|
||||
void DAG_relations_tag_update(Main *bmain)
|
||||
{
|
||||
Scene *sce;
|
||||
|
||||
for (sce = bmain->scene.first; sce; sce = sce->id.next)
|
||||
dag_scene_free(sce);
|
||||
}
|
||||
|
||||
/* rebuild dependency graph only for a given scene */
|
||||
void DAG_scene_relations_rebuild(Main *bmain, Scene *sce)
|
||||
{
|
||||
dag_scene_free(sce);
|
||||
DAG_scene_relations_update(bmain, sce);
|
||||
}
|
||||
|
||||
/* create dependency graph if it was cleared or didn't exist yet */
|
||||
void DAG_scene_relations_update(Main *bmain, Scene *sce)
|
||||
{
|
||||
if (!sce->theDag)
|
||||
dag_scene_build(bmain, sce);
|
||||
}
|
||||
|
||||
static void lib_id_recalc_tag(Main *bmain, ID *id)
|
||||
{
|
||||
id->flag |= LIB_ID_RECALC;
|
||||
@@ -2177,7 +2210,7 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
|
||||
|
||||
if (sce->theDag == NULL) {
|
||||
printf("DAG zero... not allowed to happen!\n");
|
||||
DAG_scene_sort(bmain, sce);
|
||||
DAG_scene_relations_update(bmain, sce);
|
||||
}
|
||||
|
||||
firstnode = sce->theDag->DagNode.first; /* always scene node */
|
||||
@@ -2545,20 +2578,6 @@ static void dag_current_scene_layers(Main *bmain, ListBase *lb)
|
||||
}
|
||||
}
|
||||
|
||||
void DAG_ids_flush_update(Main *bmain, int time)
|
||||
{
|
||||
ListBase listbase;
|
||||
DagSceneLayer *dsl;
|
||||
|
||||
/* get list of visible scenes and layers */
|
||||
dag_current_scene_layers(bmain, &listbase);
|
||||
|
||||
for (dsl = listbase.first; dsl; dsl = dsl->next)
|
||||
DAG_scene_flush_update(bmain, dsl->scene, dsl->layer, time);
|
||||
|
||||
BLI_freelistN(&listbase);
|
||||
}
|
||||
|
||||
void DAG_on_visible_update(Main *bmain, const short do_time)
|
||||
{
|
||||
ListBase listbase;
|
||||
@@ -2895,10 +2914,8 @@ void DAG_ids_clear_recalc(Main *bmain)
|
||||
memset(bmain->id_tag_update, 0, sizeof(bmain->id_tag_update));
|
||||
}
|
||||
|
||||
void DAG_id_tag_update(ID *id, short flag)
|
||||
void DAG_id_tag_update_ex(Main *bmain, ID *id, short flag)
|
||||
{
|
||||
Main *bmain = G.main;
|
||||
|
||||
if (id == NULL) return;
|
||||
|
||||
/* tag ID for update */
|
||||
@@ -2955,6 +2972,11 @@ void DAG_id_tag_update(ID *id, short flag)
|
||||
}
|
||||
}
|
||||
|
||||
void DAG_id_tag_update(ID *id, short flag)
|
||||
{
|
||||
DAG_id_tag_update_ex(G.main, id, flag);
|
||||
}
|
||||
|
||||
void DAG_id_type_tag(Main *bmain, short idtype)
|
||||
{
|
||||
if (idtype == ID_NT) {
|
||||
@@ -3169,7 +3191,7 @@ void DAG_print_dependencies(Main *bmain, Scene *scene, Object *ob)
|
||||
}
|
||||
else {
|
||||
printf("\nDEPENDENCY RELATIONS for %s\n\n", scene->id.name + 2);
|
||||
DAG_scene_sort(bmain, scene);
|
||||
DAG_scene_relations_rebuild(bmain, scene);
|
||||
}
|
||||
|
||||
dag_print_dependencies = 0;
|
||||
|
@@ -997,6 +997,43 @@ static void emDM_drawMappedFacesTex(DerivedMesh *dm,
|
||||
emDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData);
|
||||
}
|
||||
|
||||
/**
|
||||
* \note
|
||||
*
|
||||
* For UV's:
|
||||
* const MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(loop, attribs->tface[i].em_offset);
|
||||
*
|
||||
* This is intentionally different to calling:
|
||||
* CustomData_bmesh_get_n(&bm->ldata, loop->head.data, CD_MLOOPUV, i);
|
||||
*
|
||||
* ... because the material may use layer names to select different UV's
|
||||
* see: [#34378]
|
||||
*/
|
||||
static void emdm_pass_attrib_vertex_glsl(DMVertexAttribs *attribs, BMLoop *loop, int index_in_face)
|
||||
{
|
||||
BMVert *eve = loop->v;
|
||||
int i;
|
||||
|
||||
if (attribs->totorco) {
|
||||
const float *orco = attribs->orco.array[BM_elem_index_get(eve)];
|
||||
glVertexAttrib3fvARB(attribs->orco.gl_index, orco);
|
||||
}
|
||||
for (i = 0; i < attribs->tottface; i++) {
|
||||
const MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(loop, attribs->tface[i].em_offset);
|
||||
glVertexAttrib2fvARB(attribs->tface[i].gl_index, luv->uv);
|
||||
}
|
||||
for (i = 0; i < attribs->totmcol; i++) {
|
||||
const MLoopCol *cp = BM_ELEM_CD_GET_VOID_P(loop, attribs->mcol[i].em_offset);
|
||||
GLubyte col[4];
|
||||
col[0] = cp->b; col[1] = cp->g; col[2] = cp->r; col[3] = cp->a;
|
||||
glVertexAttrib4ubvARB(attribs->mcol[i].gl_index, col);
|
||||
}
|
||||
if (attribs->tottang) {
|
||||
const float *tang = attribs->tang.array[i * 4 + index_in_face];
|
||||
glVertexAttrib3fvARB(attribs->tang.gl_index, tang);
|
||||
}
|
||||
}
|
||||
|
||||
static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
|
||||
DMSetMaterial setMaterial,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
@@ -1012,7 +1049,7 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
|
||||
DMVertexAttribs attribs;
|
||||
GPUVertexAttribs gattribs;
|
||||
|
||||
int i, b, matnr, new_matnr, do_draw;
|
||||
int i, matnr, new_matnr, do_draw;
|
||||
|
||||
do_draw = FALSE;
|
||||
matnr = -1;
|
||||
@@ -1023,30 +1060,6 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
|
||||
glShadeModel(GL_SMOOTH);
|
||||
BM_mesh_elem_index_ensure(bm, BM_VERT | BM_FACE);
|
||||
|
||||
#define PASSATTRIB(loop, eve, vert) { \
|
||||
if (attribs.totorco) { \
|
||||
float *orco = attribs.orco.array[BM_elem_index_get(eve)]; \
|
||||
glVertexAttrib3fvARB(attribs.orco.gl_index, orco); \
|
||||
} \
|
||||
for (b = 0; b < attribs.tottface; b++) { \
|
||||
MLoopUV *_luv = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, \
|
||||
CD_MLOOPUV, b); \
|
||||
glVertexAttrib2fvARB(attribs.tface[b].gl_index, _luv->uv); \
|
||||
} \
|
||||
for (b = 0; b < attribs.totmcol; b++) { \
|
||||
MLoopCol *_cp = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, \
|
||||
CD_MLOOPCOL, b); \
|
||||
GLubyte _col[4]; \
|
||||
_col[0] = _cp->b; _col[1] = _cp->g; _col[2] = _cp->r; _col[3] = _cp->a; \
|
||||
glVertexAttrib4ubvARB(attribs.mcol[b].gl_index, _col); \
|
||||
} \
|
||||
if (attribs.tottang) { \
|
||||
float *tang = attribs.tang.array[i * 4 + vert]; \
|
||||
glVertexAttrib3fvARB(attribs.tang.gl_index, tang); \
|
||||
} \
|
||||
} (void)0
|
||||
|
||||
|
||||
for (i = 0, ltri = em->looptris[0]; i < em->tottri; i++, ltri += 3) {
|
||||
int drawSmooth;
|
||||
|
||||
@@ -1069,20 +1082,20 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
|
||||
if (vertexCos) glNormal3fv(bmdm->polyNos[BM_elem_index_get(efa)]);
|
||||
else glNormal3fv(efa->no);
|
||||
|
||||
PASSATTRIB(ltri[0], ltri[0]->v, 0);
|
||||
emdm_pass_attrib_vertex_glsl(&attribs, ltri[0], 0);
|
||||
if (vertexCos) glVertex3fv(vertexCos[BM_elem_index_get(ltri[0]->v)]);
|
||||
else glVertex3fv(ltri[0]->v->co);
|
||||
|
||||
PASSATTRIB(ltri[1], ltri[1]->v, 1);
|
||||
emdm_pass_attrib_vertex_glsl(&attribs, ltri[1], 1);
|
||||
if (vertexCos) glVertex3fv(vertexCos[BM_elem_index_get(ltri[1]->v)]);
|
||||
else glVertex3fv(ltri[1]->v->co);
|
||||
|
||||
PASSATTRIB(ltri[2], ltri[2]->v, 2);
|
||||
emdm_pass_attrib_vertex_glsl(&attribs, ltri[2], 2);
|
||||
if (vertexCos) glVertex3fv(vertexCos[BM_elem_index_get(ltri[2]->v)]);
|
||||
else glVertex3fv(ltri[2]->v->co);
|
||||
}
|
||||
else {
|
||||
PASSATTRIB(ltri[0], ltri[0]->v, 0);
|
||||
emdm_pass_attrib_vertex_glsl(&attribs, ltri[0], 0);
|
||||
if (vertexCos) {
|
||||
glNormal3fv(vertexNos[BM_elem_index_get(ltri[0]->v)]);
|
||||
glVertex3fv(vertexCos[BM_elem_index_get(ltri[0]->v)]);
|
||||
@@ -1092,7 +1105,7 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
|
||||
glVertex3fv(ltri[0]->v->co);
|
||||
}
|
||||
|
||||
PASSATTRIB(ltri[1], ltri[1]->v, 1);
|
||||
emdm_pass_attrib_vertex_glsl(&attribs, ltri[1], 1);
|
||||
if (vertexCos) {
|
||||
glNormal3fv(vertexNos[BM_elem_index_get(ltri[1]->v)]);
|
||||
glVertex3fv(vertexCos[BM_elem_index_get(ltri[1]->v)]);
|
||||
@@ -1102,7 +1115,7 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
|
||||
glVertex3fv(ltri[1]->v->co);
|
||||
}
|
||||
|
||||
PASSATTRIB(ltri[2], ltri[2]->v, 2);
|
||||
emdm_pass_attrib_vertex_glsl(&attribs, ltri[2], 2);
|
||||
if (vertexCos) {
|
||||
glNormal3fv(vertexNos[BM_elem_index_get(ltri[2]->v)]);
|
||||
glVertex3fv(vertexCos[BM_elem_index_get(ltri[2]->v)]);
|
||||
@@ -1115,7 +1128,6 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
#undef PASSATTRIB
|
||||
}
|
||||
|
||||
static void emDM_drawFacesGLSL(DerivedMesh *dm,
|
||||
@@ -1124,6 +1136,38 @@ static void emDM_drawFacesGLSL(DerivedMesh *dm,
|
||||
dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
|
||||
}
|
||||
|
||||
/* emdm_pass_attrib_vertex_glsl's note about em_offset use applies here */
|
||||
static void emdm_pass_attrib_vertex_mat(DMVertexAttribs *attribs, BMLoop *loop, int index_in_face)
|
||||
{
|
||||
BMVert *eve = loop->v;
|
||||
int i;
|
||||
|
||||
if (attribs->totorco) {
|
||||
float *orco = attribs->orco.array[BM_elem_index_get(eve)];
|
||||
if (attribs->orco.gl_texco)
|
||||
glTexCoord3fv(orco);
|
||||
else
|
||||
glVertexAttrib3fvARB(attribs->orco.gl_index, orco);
|
||||
}
|
||||
for (i = 0; i < attribs->tottface; i++) {
|
||||
const MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(loop, attribs->tface[i].em_offset);
|
||||
if (attribs->tface[i].gl_texco)
|
||||
glTexCoord2fv(luv->uv);
|
||||
else
|
||||
glVertexAttrib2fvARB(attribs->tface[i].gl_index, luv->uv);
|
||||
}
|
||||
for (i = 0; i < attribs->totmcol; i++) {
|
||||
const MLoopCol *cp = BM_ELEM_CD_GET_VOID_P(loop, attribs->mcol[i].em_offset);
|
||||
GLubyte col[4];
|
||||
col[0] = cp->b; col[1] = cp->g; col[2] = cp->r; col[3] = cp->a;
|
||||
glVertexAttrib4ubvARB(attribs->mcol[i].gl_index, col);
|
||||
}
|
||||
if (attribs->tottang) {
|
||||
float *tang = attribs->tang.array[i * 4 + index_in_face];
|
||||
glVertexAttrib4fvARB(attribs->tang.gl_index, tang);
|
||||
}
|
||||
}
|
||||
|
||||
static void emDM_drawMappedFacesMat(DerivedMesh *dm,
|
||||
void (*setMaterial)(void *userData, int, void *attribs),
|
||||
int (*setFace)(void *userData, int index), void *userData)
|
||||
@@ -1137,7 +1181,7 @@ static void emDM_drawMappedFacesMat(DerivedMesh *dm,
|
||||
BMLoop **ltri;
|
||||
DMVertexAttribs attribs = {{{0}}};
|
||||
GPUVertexAttribs gattribs;
|
||||
int i, b, matnr, new_matnr;
|
||||
int i, matnr, new_matnr;
|
||||
|
||||
matnr = -1;
|
||||
|
||||
@@ -1146,35 +1190,6 @@ static void emDM_drawMappedFacesMat(DerivedMesh *dm,
|
||||
|
||||
BM_mesh_elem_index_ensure(bm, BM_VERT | BM_FACE);
|
||||
|
||||
#define PASSATTRIB(loop, eve, vert) { \
|
||||
if (attribs.totorco) { \
|
||||
float *orco = attribs.orco.array[BM_elem_index_get(eve)]; \
|
||||
if (attribs.orco.gl_texco) \
|
||||
glTexCoord3fv(orco); \
|
||||
else \
|
||||
glVertexAttrib3fvARB(attribs.orco.gl_index, orco); \
|
||||
} \
|
||||
for (b = 0; b < attribs.tottface; b++) { \
|
||||
MLoopUV *_luv = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, \
|
||||
CD_MLOOPUV, b); \
|
||||
if (attribs.tface[b].gl_texco) \
|
||||
glTexCoord2fv(_luv->uv); \
|
||||
else \
|
||||
glVertexAttrib2fvARB(attribs.tface[b].gl_index, _luv->uv); \
|
||||
} \
|
||||
for (b = 0; b < attribs.totmcol; b++) { \
|
||||
MLoopCol *_cp = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, \
|
||||
CD_MLOOPCOL, b); \
|
||||
GLubyte _col[4]; \
|
||||
_col[0] = _cp->b; _col[1] = _cp->g; _col[2] = _cp->r; _col[3] = _cp->a; \
|
||||
glVertexAttrib4ubvARB(attribs.mcol[b].gl_index, _col); \
|
||||
} \
|
||||
if (attribs.tottang) { \
|
||||
float *tang = attribs.tang.array[i * 4 + vert]; \
|
||||
glVertexAttrib4fvARB(attribs.tang.gl_index, tang); \
|
||||
} \
|
||||
} (void)0
|
||||
|
||||
for (i = 0, ltri = em->looptris[0]; i < em->tottri; i++, ltri += 3) {
|
||||
int drawSmooth;
|
||||
|
||||
@@ -1198,21 +1213,21 @@ static void emDM_drawMappedFacesMat(DerivedMesh *dm,
|
||||
if (vertexCos) glNormal3fv(bmdm->polyNos[BM_elem_index_get(efa)]);
|
||||
else glNormal3fv(efa->no);
|
||||
|
||||
PASSATTRIB(ltri[0], ltri[0]->v, 0);
|
||||
emdm_pass_attrib_vertex_mat(&attribs, ltri[0], 0);
|
||||
if (vertexCos) glVertex3fv(vertexCos[BM_elem_index_get(ltri[0]->v)]);
|
||||
else glVertex3fv(ltri[0]->v->co);
|
||||
|
||||
PASSATTRIB(ltri[1], ltri[1]->v, 1);
|
||||
emdm_pass_attrib_vertex_mat(&attribs, ltri[1], 1);
|
||||
if (vertexCos) glVertex3fv(vertexCos[BM_elem_index_get(ltri[1]->v)]);
|
||||
else glVertex3fv(ltri[1]->v->co);
|
||||
|
||||
PASSATTRIB(ltri[2], ltri[2]->v, 2);
|
||||
emdm_pass_attrib_vertex_mat(&attribs, ltri[2], 2);
|
||||
if (vertexCos) glVertex3fv(vertexCos[BM_elem_index_get(ltri[2]->v)]);
|
||||
else glVertex3fv(ltri[2]->v->co);
|
||||
|
||||
}
|
||||
else {
|
||||
PASSATTRIB(ltri[0], ltri[0]->v, 0);
|
||||
emdm_pass_attrib_vertex_mat(&attribs, ltri[0], 0);
|
||||
if (vertexCos) {
|
||||
glNormal3fv(vertexNos[BM_elem_index_get(ltri[0]->v)]);
|
||||
glVertex3fv(vertexCos[BM_elem_index_get(ltri[0]->v)]);
|
||||
@@ -1222,7 +1237,7 @@ static void emDM_drawMappedFacesMat(DerivedMesh *dm,
|
||||
glVertex3fv(ltri[0]->v->co);
|
||||
}
|
||||
|
||||
PASSATTRIB(ltri[1], ltri[1]->v, 1);
|
||||
emdm_pass_attrib_vertex_mat(&attribs, ltri[1], 1);
|
||||
if (vertexCos) {
|
||||
glNormal3fv(vertexNos[BM_elem_index_get(ltri[1]->v)]);
|
||||
glVertex3fv(vertexCos[BM_elem_index_get(ltri[1]->v)]);
|
||||
@@ -1232,7 +1247,7 @@ static void emDM_drawMappedFacesMat(DerivedMesh *dm,
|
||||
glVertex3fv(ltri[1]->v->co);
|
||||
}
|
||||
|
||||
PASSATTRIB(ltri[2], ltri[2]->v, 2);
|
||||
emdm_pass_attrib_vertex_mat(&attribs, ltri[2], 2);
|
||||
if (vertexCos) {
|
||||
glNormal3fv(vertexNos[BM_elem_index_get(ltri[2]->v)]);
|
||||
glVertex3fv(vertexCos[BM_elem_index_get(ltri[2]->v)]);
|
||||
@@ -1244,7 +1259,6 @@ static void emDM_drawMappedFacesMat(DerivedMesh *dm,
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
#undef PASSATTRIB
|
||||
}
|
||||
|
||||
static void emDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3])
|
||||
|
@@ -454,7 +454,7 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src)
|
||||
if (strcmp(loop->name, prop->name) == 0) {
|
||||
IDProperty *copy = IDP_CopyProperty(prop);
|
||||
|
||||
BLI_insertlink(&dest->data.group, loop, copy);
|
||||
BLI_insertlinkafter(&dest->data.group, loop, copy);
|
||||
|
||||
BLI_remlink(&dest->data.group, loop);
|
||||
IDP_FreeProperty(loop);
|
||||
@@ -479,7 +479,7 @@ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
|
||||
{
|
||||
IDProperty *loop;
|
||||
if ((loop = IDP_GetPropertyFromGroup(group, prop->name))) {
|
||||
BLI_insertlink(&group->data.group, loop, prop);
|
||||
BLI_insertlinkafter(&group->data.group, loop, prop);
|
||||
|
||||
BLI_remlink(&group->data.group, loop);
|
||||
IDP_FreeProperty(loop);
|
||||
@@ -532,7 +532,7 @@ int IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew)
|
||||
{
|
||||
if (IDP_GetPropertyFromGroup(group, pnew->name) == NULL) {
|
||||
group->len++;
|
||||
BLI_insertlink(&group->data.group, previous, pnew);
|
||||
BLI_insertlinkafter(&group->data.group, previous, pnew);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -571,6 +571,20 @@ static void image_init_color_management(Image *ima)
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_image_alpha_mode_from_extension(Image *image)
|
||||
{
|
||||
if (BLI_testextensie(image->name, ".exr") ||
|
||||
BLI_testextensie(image->name, ".cin") ||
|
||||
BLI_testextensie(image->name, ".dpx") ||
|
||||
BLI_testextensie(image->name, ".hdr"))
|
||||
{
|
||||
image->alpha_mode = IMA_ALPHA_PREMUL;
|
||||
}
|
||||
else {
|
||||
image->alpha_mode = IMA_ALPHA_STRAIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
Image *BKE_image_load(Main *bmain, const char *filepath)
|
||||
{
|
||||
Image *ima;
|
||||
|
@@ -246,7 +246,7 @@ void BKE_key_sort(Key *key)
|
||||
/* find the right location and insert before */
|
||||
for (kb2 = key->block.first; kb2; kb2 = kb2->next) {
|
||||
if (kb2->pos > kb->pos) {
|
||||
BLI_insertlink(&key->block, kb2->prev, kb);
|
||||
BLI_insertlinkafter(&key->block, kb2->prev, kb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -216,7 +216,7 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user,
|
||||
colorspace = clip->colorspace_settings.name;
|
||||
}
|
||||
|
||||
loadflag = IB_rect | IB_multilayer;
|
||||
loadflag = IB_rect | IB_multilayer | IB_alphamode_detect;
|
||||
|
||||
/* read ibuf */
|
||||
ibuf = IMB_loadiffname(name, loadflag, colorspace);
|
||||
|
@@ -2028,9 +2028,8 @@ void node_type_base(bNodeTreeType *ttype, bNodeType *ntype, int type, const char
|
||||
ntype->update_internal_links = ttype->update_internal_links;
|
||||
|
||||
/* default size values */
|
||||
ntype->width = 140;
|
||||
ntype->minwidth = 100;
|
||||
ntype->maxwidth = 320;
|
||||
node_type_size_preset(ntype, NODE_SIZE_DEFAULT);
|
||||
|
||||
ntype->height = 100;
|
||||
ntype->minheight = 30;
|
||||
ntype->maxheight = FLT_MAX;
|
||||
@@ -2062,6 +2061,21 @@ void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwid
|
||||
ntype->maxwidth = maxwidth;
|
||||
}
|
||||
|
||||
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size)
|
||||
{
|
||||
switch (size) {
|
||||
case NODE_SIZE_DEFAULT:
|
||||
node_type_size(ntype, 140, 100, 320);
|
||||
break;
|
||||
case NODE_SIZE_SMALL:
|
||||
node_type_size(ntype, 100, 80, 320);
|
||||
break;
|
||||
case NODE_SIZE_LARGE:
|
||||
node_type_size(ntype, 140, 120, 500);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void node_type_storage(bNodeType *ntype, const char *storagename, void (*freestoragefunc)(struct bNode *), void (*copystoragefunc)(struct bNode *, struct bNode *))
|
||||
{
|
||||
if (storagename)
|
||||
|
@@ -74,6 +74,7 @@
|
||||
#include "BKE_bullet.h"
|
||||
#include "BKE_colortools.h"
|
||||
#include "BKE_deform.h"
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_DerivedMesh.h"
|
||||
#include "BKE_animsys.h"
|
||||
#include "BKE_anim.h"
|
||||
@@ -410,7 +411,8 @@ static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Objec
|
||||
|
||||
if (*obpoin == unlinkOb) {
|
||||
*obpoin = NULL;
|
||||
ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; // XXX: should this just be OB_RECALC_DATA?
|
||||
// XXX: should this just be OB_RECALC_DATA?
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,14 +446,14 @@ void BKE_object_unlink(Object *ob)
|
||||
obt->proxy = NULL;
|
||||
if (obt->proxy_from == ob) {
|
||||
obt->proxy_from = NULL;
|
||||
obt->recalc |= OB_RECALC_OB;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_OB);
|
||||
}
|
||||
if (obt->proxy_group == ob)
|
||||
obt->proxy_group = NULL;
|
||||
|
||||
if (obt->parent == ob) {
|
||||
obt->parent = NULL;
|
||||
obt->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
}
|
||||
|
||||
modifiers_foreachObjectLink(obt, unlink_object__unlinkModifierLinks, ob);
|
||||
@@ -461,15 +463,15 @@ void BKE_object_unlink(Object *ob)
|
||||
|
||||
if (cu->bevobj == ob) {
|
||||
cu->bevobj = NULL;
|
||||
obt->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
}
|
||||
if (cu->taperobj == ob) {
|
||||
cu->taperobj = NULL;
|
||||
obt->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
}
|
||||
if (cu->textoncurve == ob) {
|
||||
cu->textoncurve = NULL;
|
||||
obt->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
}
|
||||
}
|
||||
else if (obt->type == OB_ARMATURE && obt->pose) {
|
||||
@@ -487,7 +489,7 @@ void BKE_object_unlink(Object *ob)
|
||||
if (ct->tar == ob) {
|
||||
ct->tar = NULL;
|
||||
ct->subtarget[0] = '\0';
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_DATA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,7 +503,7 @@ void BKE_object_unlink(Object *ob)
|
||||
}
|
||||
else if (ELEM(OB_MBALL, ob->type, obt->type)) {
|
||||
if (BKE_mball_is_basis_for(obt, ob))
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
sca_remove_ob_poin(obt, ob);
|
||||
@@ -518,7 +520,7 @@ void BKE_object_unlink(Object *ob)
|
||||
if (ct->tar == ob) {
|
||||
ct->tar = NULL;
|
||||
ct->subtarget[0] = '\0';
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_DATA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,12 +532,12 @@ void BKE_object_unlink(Object *ob)
|
||||
/* object is deflector or field */
|
||||
if (ob->pd) {
|
||||
if (obt->soft)
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_DATA);
|
||||
|
||||
/* cloth */
|
||||
for (md = obt->modifiers.first; md; md = md->next)
|
||||
if (md->type == eModifierType_Cloth)
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
/* strips */
|
||||
@@ -564,14 +566,14 @@ void BKE_object_unlink(Object *ob)
|
||||
for (; pt; pt = pt->next) {
|
||||
if (pt->ob == ob) {
|
||||
pt->ob = NULL;
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_DATA);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tpsys->target_ob == ob) {
|
||||
tpsys->target_ob = NULL;
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
if (tpsys->part->dup_ob == ob)
|
||||
@@ -606,7 +608,7 @@ void BKE_object_unlink(Object *ob)
|
||||
}
|
||||
}
|
||||
if (ob->pd)
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
DAG_id_tag_update(&obt->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
obt = obt->id.next;
|
||||
@@ -984,7 +986,7 @@ Object *BKE_object_add(struct Scene *scene, int type)
|
||||
base = BKE_scene_base_add(scene, ob);
|
||||
BKE_scene_base_deselect_all(scene);
|
||||
BKE_scene_base_select(scene, base);
|
||||
ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
|
||||
return ob;
|
||||
}
|
||||
@@ -1494,7 +1496,8 @@ void BKE_object_make_proxy(Object *ob, Object *target, Object *gob)
|
||||
ob->proxy_group = gob;
|
||||
id_lib_extern(&target->id);
|
||||
|
||||
ob->recalc = target->recalc = OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
DAG_id_tag_update(&target->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
|
||||
/* copy transform
|
||||
* - gob means this proxy comes from a group, just apply the matrix
|
||||
@@ -2132,7 +2135,8 @@ static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[
|
||||
}
|
||||
|
||||
/* note, scene is the active scene while actual_scene is the scene the object resides in */
|
||||
void BKE_object_where_is_calc_time_ex(Scene *scene, RigidBodyWorld *rbw, Object *ob, float ctime)
|
||||
void BKE_object_where_is_calc_time_ex(Scene *scene, Object *ob, float ctime,
|
||||
RigidBodyWorld *rbw)
|
||||
{
|
||||
if (ob == NULL) return;
|
||||
|
||||
@@ -2158,6 +2162,8 @@ void BKE_object_where_is_calc_time_ex(Scene *scene, RigidBodyWorld *rbw, Object
|
||||
BKE_object_to_mat4(ob, ob->obmat);
|
||||
}
|
||||
|
||||
/* try to fall back to the scene rigid body world if none given */
|
||||
rbw = rbw ? rbw : scene->rigidbody_world;
|
||||
/* read values pushed into RBO from sim/cache... */
|
||||
BKE_rigidbody_sync_transforms(rbw, ob, ctime);
|
||||
|
||||
@@ -2177,7 +2183,7 @@ void BKE_object_where_is_calc_time_ex(Scene *scene, RigidBodyWorld *rbw, Object
|
||||
|
||||
void BKE_object_where_is_calc_time(Scene *scene, Object *ob, float ctime)
|
||||
{
|
||||
BKE_object_where_is_calc_time_ex(scene, NULL, ob, ctime);
|
||||
BKE_object_where_is_calc_time_ex(scene, ob, ctime, NULL);
|
||||
}
|
||||
|
||||
/* get object transformation matrix without recalculating dependencies and
|
||||
@@ -2203,17 +2209,17 @@ void BKE_object_where_is_calc_mat4(Scene *scene, Object *ob, float obmat[4][4])
|
||||
|
||||
void BKE_object_where_is_calc_ex(Scene *scene, RigidBodyWorld *rbw, Object *ob)
|
||||
{
|
||||
BKE_object_where_is_calc_time_ex(scene, rbw, ob, BKE_scene_frame_get(scene));
|
||||
BKE_object_where_is_calc_time_ex(scene, ob, BKE_scene_frame_get(scene), rbw);
|
||||
}
|
||||
void BKE_object_where_is_calc(Scene *scene, Object *ob)
|
||||
{
|
||||
BKE_object_where_is_calc_time_ex(scene, NULL, ob, BKE_scene_frame_get(scene));
|
||||
BKE_object_where_is_calc_time_ex(scene, ob, BKE_scene_frame_get(scene), NULL);
|
||||
}
|
||||
|
||||
void BKE_object_where_is_calc_simul(Scene *scene, Object *ob)
|
||||
/* was written for the old game engine (until 2.04) */
|
||||
/* It seems that this function is only called
|
||||
* for a lamp that is the child of another object */
|
||||
void BKE_object_where_is_calc_simul(Scene *scene, Object *ob)
|
||||
{
|
||||
Object *par;
|
||||
float *fp1, *fp2;
|
||||
@@ -2644,7 +2650,8 @@ int BKE_object_parent_loop_check(const Object *par, const Object *ob)
|
||||
/* the main object update call, for object matrix, constraints, keys and displist (modifiers) */
|
||||
/* requires flags to be set! */
|
||||
/* Ideally we shouldn't have to pass the rigid body world, but need bigger restructuring to avoid id */
|
||||
void BKE_object_handle_update_ex(Scene *scene, RigidBodyWorld *rbw, Object *ob)
|
||||
void BKE_object_handle_update_ex(Scene *scene, Object *ob,
|
||||
RigidBodyWorld *rbw)
|
||||
{
|
||||
if (ob->recalc & OB_RECALC_ALL) {
|
||||
/* speed optimization for animation lookups */
|
||||
@@ -2846,7 +2853,7 @@ void BKE_object_handle_update_ex(Scene *scene, RigidBodyWorld *rbw, Object *ob)
|
||||
*/
|
||||
void BKE_object_handle_update(Scene *scene, Object *ob)
|
||||
{
|
||||
BKE_object_handle_update_ex(scene, NULL, ob);
|
||||
BKE_object_handle_update_ex(scene, ob, NULL);
|
||||
}
|
||||
|
||||
void BKE_object_sculpt_modifiers_changed(Object *ob)
|
||||
|
@@ -3509,12 +3509,12 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n
|
||||
psys->flag = PSYS_ENABLED | PSYS_CURRENT;
|
||||
psys->cfra = BKE_scene_frame_get_from_ctime(scene, CFRA + 1);
|
||||
|
||||
DAG_scene_sort(G.main, scene);
|
||||
DAG_relations_tag_update(G.main);
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
|
||||
return md;
|
||||
}
|
||||
void object_remove_particle_system(Scene *scene, Object *ob)
|
||||
void object_remove_particle_system(Scene *UNUSED(scene), Object *ob)
|
||||
{
|
||||
ParticleSystem *psys = psys_get_current(ob);
|
||||
ParticleSystemModifierData *psmd;
|
||||
@@ -3552,7 +3552,7 @@ void object_remove_particle_system(Scene *scene, Object *ob)
|
||||
else
|
||||
ob->mode &= ~OB_MODE_PARTICLE_EDIT;
|
||||
|
||||
DAG_scene_sort(G.main, scene);
|
||||
DAG_relations_tag_update(G.main);
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
}
|
||||
static void default_particle_settings(ParticleSettings *part)
|
||||
|
@@ -3028,13 +3028,20 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
|
||||
normalize_qt(pa->state.rot);
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/* Collisions */
|
||||
/************************************************/
|
||||
/************************************************
|
||||
* Collisions
|
||||
*
|
||||
* The algorithm is roughly:
|
||||
* 1. Use a BVH tree to search for faces that a particle may collide with.
|
||||
* 2. Use Newton's method to find the exact time at which the collision occurs.
|
||||
* http://en.wikipedia.org/wiki/Newton's_method
|
||||
*
|
||||
************************************************/
|
||||
#define COLLISION_MAX_COLLISIONS 10
|
||||
#define COLLISION_MIN_RADIUS 0.001f
|
||||
#define COLLISION_MIN_DISTANCE 0.0001f
|
||||
#define COLLISION_ZERO 0.00001f
|
||||
#define COLLISION_INIT_STEP 0.00008f
|
||||
typedef float (*NRDistanceFunc)(float *p, float radius, ParticleCollisionElement *pce, float *nor);
|
||||
static float nr_signed_distance_to_plane(float *p, float radius, ParticleCollisionElement *pce, float *nor)
|
||||
{
|
||||
@@ -3189,16 +3196,20 @@ static void collision_point_on_surface(float p[3], ParticleCollisionElement *pce
|
||||
/* find first root in range [0-1] starting from 0 */
|
||||
static float collision_newton_rhapson(ParticleCollision *col, float radius, ParticleCollisionElement *pce, NRDistanceFunc distance_func)
|
||||
{
|
||||
float t0, t1, d0, d1, dd, n[3];
|
||||
float t0, t1, dt_init, d0, d1, dd, n[3];
|
||||
int iter;
|
||||
|
||||
pce->inv_nor = -1;
|
||||
|
||||
/* Initial step size should be small, but not too small or floating point
|
||||
* precision errors will appear. - z0r */
|
||||
dt_init = COLLISION_INIT_STEP * col->inv_total_time;
|
||||
|
||||
/* start from the beginning */
|
||||
t0 = 0.f;
|
||||
collision_interpolate_element(pce, t0, col->f, col);
|
||||
d0 = distance_func(col->co1, radius, pce, n);
|
||||
t1 = 0.001f;
|
||||
t1 = dt_init;
|
||||
d1 = 0.f;
|
||||
|
||||
for (iter=0; iter<10; iter++) {//, itersum++) {
|
||||
@@ -3208,11 +3219,6 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
|
||||
|
||||
d1 = distance_func(pce->p, radius, pce, n);
|
||||
|
||||
/* no movement, so no collision */
|
||||
if (d1 == d0) {
|
||||
return -1.f;
|
||||
}
|
||||
|
||||
/* particle already inside face, so report collision */
|
||||
if (iter == 0 && d0 < 0.f && d0 > -radius) {
|
||||
copy_v3_v3(pce->p, col->co1);
|
||||
@@ -3221,6 +3227,23 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
/* Zero gradient (no movement relative to element). Can't step from
|
||||
* here. */
|
||||
if (d1 == d0) {
|
||||
/* If first iteration, try from other end where the gradient may be
|
||||
* greater. Note: code duplicated below. */
|
||||
if (iter == 0) {
|
||||
t0 = 1.f;
|
||||
collision_interpolate_element(pce, t0, col->f, col);
|
||||
d0 = distance_func(col->co2, radius, pce, n);
|
||||
t1 = 1.0f - dt_init;
|
||||
d1 = 0.f;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
return -1.f;
|
||||
}
|
||||
|
||||
dd = (t1-t0)/(d1-d0);
|
||||
|
||||
t0 = t1;
|
||||
@@ -3228,14 +3251,14 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
|
||||
|
||||
t1 -= d1*dd;
|
||||
|
||||
/* particle movin away from plane could also mean a strangely rotating face, so check from end */
|
||||
/* Particle moving away from plane could also mean a strangely rotating
|
||||
* face, so check from end. Note: code duplicated above. */
|
||||
if (iter == 0 && t1 < 0.f) {
|
||||
t0 = 1.f;
|
||||
collision_interpolate_element(pce, t0, col->f, col);
|
||||
d0 = distance_func(col->co2, radius, pce, n);
|
||||
t1 = 0.999f;
|
||||
t1 = 1.0f - dt_init;
|
||||
d1 = 0.f;
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (iter == 1 && (t1 < -COLLISION_ZERO || t1 > 1.f))
|
||||
@@ -3683,6 +3706,7 @@ static void collision_check(ParticleSimulationData *sim, int p, float dfra, floa
|
||||
memset(&col, 0, sizeof(ParticleCollision));
|
||||
|
||||
col.total_time = timestep * dfra;
|
||||
col.inv_total_time = 1.0f/col.total_time;
|
||||
col.inv_timestep = 1.0f/timestep;
|
||||
|
||||
col.cfra = cfra;
|
||||
|
@@ -52,6 +52,8 @@
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLF_translation.h"
|
||||
|
||||
#include "PIL_time.h"
|
||||
|
||||
#include "WM_api.h"
|
||||
@@ -3505,11 +3507,11 @@ void BKE_ptcache_update_info(PTCacheID *pid)
|
||||
|
||||
/* smoke doesn't use frame 0 as info frame so can't check based on totpoint */
|
||||
if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN && totframes)
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), "%i frames found!", totframes);
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("%i frames found!"), totframes);
|
||||
else if (totframes && cache->totpoint)
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), "%i points found!", cache->totpoint);
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("%i points found!"), cache->totpoint);
|
||||
else
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), "No valid data to read!");
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("No valid data to read!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3518,9 +3520,9 @@ void BKE_ptcache_update_info(PTCacheID *pid)
|
||||
int totpoint = pid->totpoint(pid->calldata, 0);
|
||||
|
||||
if (cache->totpoint > totpoint)
|
||||
BLI_snprintf(mem_info, sizeof(mem_info), "%i cells + High Resolution cached", totpoint);
|
||||
BLI_snprintf(mem_info, sizeof(mem_info), IFACE_("%i cells + High Resolution cached"), totpoint);
|
||||
else
|
||||
BLI_snprintf(mem_info, sizeof(mem_info), "%i cells cached", totpoint);
|
||||
BLI_snprintf(mem_info, sizeof(mem_info), IFACE_("%i cells cached"), totpoint);
|
||||
}
|
||||
else {
|
||||
int cfra = cache->startframe;
|
||||
@@ -3530,7 +3532,7 @@ void BKE_ptcache_update_info(PTCacheID *pid)
|
||||
totframes++;
|
||||
}
|
||||
|
||||
BLI_snprintf(mem_info, sizeof(mem_info), "%i frames on disk", totframes);
|
||||
BLI_snprintf(mem_info, sizeof(mem_info), IFACE_("%i frames on disk"), totframes);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -3554,17 +3556,18 @@ void BKE_ptcache_update_info(PTCacheID *pid)
|
||||
|
||||
mb = (bytes > 1024.0f * 1024.0f);
|
||||
|
||||
BLI_snprintf(mem_info, sizeof(mem_info), "%i frames in memory (%.1f %s)",
|
||||
BLI_snprintf(mem_info, sizeof(mem_info), IFACE_("%i frames in memory (%.1f %s)"),
|
||||
totframes,
|
||||
bytes / (mb ? 1024.0f * 1024.0f : 1024.0f),
|
||||
mb ? "Mb" : "kb");
|
||||
mb ? IFACE_("Mb") : IFACE_("kb"));
|
||||
}
|
||||
|
||||
if (cache->flag & PTCACHE_OUTDATED) {
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), "%s, cache is outdated!", mem_info);
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("%s, cache is outdated!"), mem_info);
|
||||
}
|
||||
else if (cache->flag & PTCACHE_FRAMES_SKIPPED) {
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), "%s, not exact since frame %i.", mem_info, cache->last_exact);
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), IFACE_("%s, not exact since frame %i."),
|
||||
mem_info, cache->last_exact);
|
||||
}
|
||||
else {
|
||||
BLI_snprintf(cache->info, sizeof(cache->info), "%s.", mem_info);
|
||||
@@ -3586,4 +3589,3 @@ void BKE_ptcache_invalidate(PointCache *cache)
|
||||
cache->last_exact = MIN2(cache->startframe, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -633,8 +633,18 @@ void BKE_rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, shor
|
||||
else
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Z, 0.0f, -1.0f);
|
||||
break;
|
||||
case RBC_TYPE_MOTOR:
|
||||
rbc->physics_constraint = RB_constraint_new_motor(loc, rot, rb1, rb2);
|
||||
|
||||
RB_constraint_set_enable_motor(rbc->physics_constraint, rbc->flag & RBC_FLAG_USE_MOTOR_LIN, rbc->flag & RBC_FLAG_USE_MOTOR_ANG);
|
||||
RB_constraint_set_max_impulse_motor(rbc->physics_constraint, rbc->motor_lin_max_impulse, rbc->motor_ang_max_impulse);
|
||||
RB_constraint_set_target_velocity_motor(rbc->physics_constraint, rbc->motor_lin_target_velocity, rbc->motor_ang_target_velocity);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else { /* can't create constraint without both rigid bodies */
|
||||
return;
|
||||
}
|
||||
|
||||
RB_constraint_set_enabled(rbc->physics_constraint, rbc->flag & RBC_FLAG_ENABLED);
|
||||
|
||||
@@ -813,6 +823,11 @@ RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short ty
|
||||
rbc->spring_stiffness_y = 10.0f;
|
||||
rbc->spring_stiffness_z = 10.0f;
|
||||
|
||||
rbc->motor_lin_max_impulse = 1.0f;
|
||||
rbc->motor_lin_target_velocity = 1.0f;
|
||||
rbc->motor_ang_max_impulse = 1.0f;
|
||||
rbc->motor_ang_target_velocity = 1.0f;
|
||||
|
||||
/* flag cache as outdated */
|
||||
BKE_rigidbody_cache_reset(rbw);
|
||||
|
||||
@@ -1259,7 +1274,7 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
|
||||
}
|
||||
|
||||
/* advance simulation, we can only step one frame forward */
|
||||
if (ctime == rbw->ltime + 1) {
|
||||
if (ctime == rbw->ltime + 1 && !(cache->flag & PTCACHE_BAKED)) {
|
||||
/* write cache for first frame when on second frame */
|
||||
if (rbw->ltime == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) {
|
||||
BKE_ptcache_write(&pid, startframe);
|
||||
@@ -1308,7 +1323,7 @@ struct RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, s
|
||||
struct RigidBodyWorld *BKE_rigidbody_get_world(Scene *scene) { return NULL; }
|
||||
void BKE_rigidbody_remove_object(Scene *scene, Object *ob) {}
|
||||
void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob) {}
|
||||
void BKE_rigidbody_sync_transforms(Scene *scene, Object *ob, float ctime) {}
|
||||
void BKE_rigidbody_sync_transforms(RigidBodyWorld *rbw, Object *ob, float ctime) {}
|
||||
void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle) {}
|
||||
void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw) {}
|
||||
void BKE_rigidbody_do_simulation(Scene *scene, float ctime) {}
|
||||
|
@@ -734,7 +734,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
|
||||
}
|
||||
if (tmp) {
|
||||
BLI_remlink(&ob->sensors, sens);
|
||||
BLI_insertlink(&ob->sensors, tmp, sens);
|
||||
BLI_insertlinkafter(&ob->sensors, tmp, sens);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -778,7 +778,7 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
|
||||
tmp = tmp->next;
|
||||
}
|
||||
BLI_remlink(&ob->controllers, cont);
|
||||
BLI_insertlink(&ob->controllers, tmp, cont);
|
||||
BLI_insertlinkafter(&ob->controllers, tmp, cont);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,7 +818,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
|
||||
}
|
||||
if (tmp) {
|
||||
BLI_remlink(&ob->actuators, act);
|
||||
BLI_insertlink(&ob->actuators, tmp, act);
|
||||
BLI_insertlinkafter(&ob->actuators, tmp, act);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -177,6 +177,7 @@ Scene *BKE_scene_copy(Scene *sce, int type)
|
||||
scen->obedit = NULL;
|
||||
scen->stats = NULL;
|
||||
scen->fps_info = NULL;
|
||||
scen->rigidbody_world = NULL; /* RB_TODO figure out a way of copying the rigid body world */
|
||||
|
||||
BLI_duplicatelist(&(scen->markers), &(sce->markers));
|
||||
BLI_duplicatelist(&(scen->transform_spaces), &(sce->transform_spaces));
|
||||
@@ -404,7 +405,7 @@ void BKE_scene_free(Scene *sce)
|
||||
BKE_color_managed_view_settings_free(&sce->view_settings);
|
||||
}
|
||||
|
||||
static Scene *scene_add(Main *bmain, const char *name)
|
||||
Scene *BKE_scene_add(Main *bmain, const char *name)
|
||||
{
|
||||
Scene *sce;
|
||||
ParticleEditSettings *pset;
|
||||
@@ -639,11 +640,6 @@ static Scene *scene_add(Main *bmain, const char *name)
|
||||
return sce;
|
||||
}
|
||||
|
||||
Scene *BKE_scene_add(Main *bmain, const char *name)
|
||||
{
|
||||
return scene_add(bmain, name);
|
||||
}
|
||||
|
||||
Base *BKE_scene_base_find(Scene *scene, Object *ob)
|
||||
{
|
||||
return BLI_findptr(&scene->base, ob, offsetof(Base, object));
|
||||
@@ -679,12 +675,11 @@ void BKE_scene_set_background(Main *bmain, Scene *scene)
|
||||
}
|
||||
|
||||
/* sort baselist */
|
||||
DAG_scene_sort(bmain, scene);
|
||||
DAG_scene_relations_rebuild(bmain, scene);
|
||||
|
||||
/* ensure dags are built for sets */
|
||||
for (sce = scene->set; sce; sce = sce->set)
|
||||
if (sce->theDag == NULL)
|
||||
DAG_scene_sort(bmain, sce);
|
||||
for (sce = scene; sce; sce = sce->set)
|
||||
DAG_scene_relations_update(bmain, sce);
|
||||
|
||||
/* copy layers and flags from bases to objects */
|
||||
for (base = scene->base.first; base; base = base->next) {
|
||||
@@ -1155,7 +1150,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
|
||||
for (base = scene->base.first; base; base = base->next) {
|
||||
Object *ob = base->object;
|
||||
|
||||
BKE_object_handle_update_ex(scene_parent, scene->rigidbody_world, ob);
|
||||
BKE_object_handle_update_ex(scene_parent, ob, scene->rigidbody_world);
|
||||
|
||||
if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
|
||||
group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
|
||||
@@ -1180,9 +1175,15 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
|
||||
/* this is called in main loop, doing tagged updates before redraw */
|
||||
void BKE_scene_update_tagged(Main *bmain, Scene *scene)
|
||||
{
|
||||
Scene *sce_iter;
|
||||
|
||||
/* keep this first */
|
||||
BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
|
||||
|
||||
/* (re-)build dependency graph if needed */
|
||||
for (sce_iter = scene; sce_iter; sce_iter = sce_iter->set)
|
||||
DAG_scene_relations_update(bmain, sce_iter);
|
||||
|
||||
/* flush recalc flags to dependencies */
|
||||
DAG_ids_flush_tagged(bmain);
|
||||
|
||||
@@ -1233,10 +1234,8 @@ void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
|
||||
/* clear animation overrides */
|
||||
/* XXX TODO... */
|
||||
|
||||
for (sce_iter = sce; sce_iter; sce_iter = sce_iter->set) {
|
||||
if (sce_iter->theDag == NULL)
|
||||
DAG_scene_sort(bmain, sce_iter);
|
||||
}
|
||||
for (sce_iter = sce; sce_iter; sce_iter = sce_iter->set)
|
||||
DAG_scene_relations_update(bmain, sce_iter);
|
||||
|
||||
/* flush recalc flags to dependencies, if we were only changing a frame
|
||||
* this would not be necessary, but if a user or a script has modified
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user