Compare commits
1 Commits
temp-keyma
...
temp-keyma
Author | SHA1 | Date | |
---|---|---|---|
3edc6ece77 |
@@ -523,7 +523,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
-fsanitize=enum \
|
||||
-fsanitize=float-cast-overflow \
|
||||
-fsanitize=float-divide-by-zero \
|
||||
-fsanitize=leak \
|
||||
-fsanitize=nonnull-attribute \
|
||||
-fsanitize=object-size \
|
||||
-fsanitize=returns-nonnull-attribute \
|
||||
-fsanitize=signed-integer-overflow \
|
||||
-fsanitize=undefined \
|
||||
@@ -531,9 +533,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
-fno-sanitize=alignment \
|
||||
")
|
||||
|
||||
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
|
||||
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
|
||||
endif()
|
||||
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
|
||||
mark_as_advanced(COMPILER_ASAN_CFLAGS)
|
||||
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
|
||||
@@ -541,15 +540,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
unset(_asan_defaults)
|
||||
|
||||
if(NOT MSVC)
|
||||
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
else()
|
||||
find_library( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
|
||||
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
|
||||
)
|
||||
endif()
|
||||
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -823,12 +816,8 @@ if(WITH_COMPILER_ASAN)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
if(MSVC)
|
||||
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
|
||||
endif()
|
||||
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
|
||||
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY}")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@@ -39,6 +39,5 @@ if(BUILD_MODE STREQUAL Release)
|
||||
PREFIX ${BUILD_DIR}/openal
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/openal
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openal/src/external_openal < ${PATCH_DIR}/openal.diff
|
||||
)
|
||||
endif()
|
||||
|
@@ -56,27 +56,24 @@ if(WIN32)
|
||||
# For OIIO and OSL
|
||||
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
|
||||
|
||||
if(MSVC_VERSION GREATER 1909)
|
||||
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
|
||||
# TODO FIXME highly MSVC specific
|
||||
if(WITH_OPTIMIZED_DEBUG)
|
||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
else()
|
||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
endif()
|
||||
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
|
||||
if(WITH_OPTIMIZED_DEBUG)
|
||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
else()
|
||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
endif()
|
||||
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
|
||||
if(WITH_OPTIMIZED_DEBUG)
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
else()
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
endif()
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
|
||||
set(PLATFORM_FLAGS)
|
||||
set(PLATFORM_CXX_FLAGS)
|
||||
|
@@ -1,13 +0,0 @@
|
||||
diff -Naur external_openal_original/CMakeLists.txt external_openal/CMakeLists.txt
|
||||
--- external_openal_original/CMakeLists.txt 2016-01-24 20:12:39 -0700
|
||||
+++ external_openal/CMakeLists.txt 2018-06-02 12:16:52 -0600
|
||||
@@ -885,7 +885,8 @@
|
||||
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
|
||||
IF(HAVE_WINDOWS_H)
|
||||
# Check MMSystem backend
|
||||
- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
|
||||
+ set(CMAKE_REQUIRED_FLAGS "-D_WIN32_WINNT=0x0502")
|
||||
+ CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H)
|
||||
IF(HAVE_MMSYSTEM_H)
|
||||
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
|
||||
IF(HAVE_LIBWINMM)
|
@@ -10,8 +10,8 @@ diff -Naur osl/src/external_osl/src/cmake/flexbison.cmake osl_bak/src/external_o
|
||||
MAIN_DEPENDENCY ${flexsrc}
|
||||
DEPENDS ${${compiler_headers}}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
--- osl/src/external_osl/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
|
||||
+++ osl/src/external_osl/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
|
||||
--- a/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
|
||||
+++ b/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
|
||||
@@ -44,12 +44,18 @@
|
||||
// same if another packages is compiling against OSL and using these headers
|
||||
// (OSL may be C++11 but the client package may be older, or vice versa --
|
||||
|
@@ -14,18 +14,10 @@ if NOT "%1" == "" (
|
||||
set BuildDir=VS14
|
||||
goto par2
|
||||
)
|
||||
if "%1" == "2017" (
|
||||
echo "Building for VS2017"
|
||||
set VSVER=15.0
|
||||
set VSVER_SHORT=15
|
||||
set BuildDir=VS15
|
||||
goto par2
|
||||
)
|
||||
|
||||
)
|
||||
:usage
|
||||
|
||||
Echo Usage build_deps 2013/2015/2017 x64/x86
|
||||
Echo Usage build_deps 2013/2015 x64/x86
|
||||
goto exit
|
||||
:par2
|
||||
if NOT "%2" == "" (
|
||||
@@ -39,10 +31,6 @@ if NOT "%2" == "" (
|
||||
if "%1" == "2015" (
|
||||
set CMAKE_BUILDER=Visual Studio 14 2015
|
||||
)
|
||||
if "%1" == "2017" (
|
||||
set CMAKE_BUILDER=Visual Studio 15 2017
|
||||
)
|
||||
|
||||
goto start
|
||||
)
|
||||
if "%2" == "x64" (
|
||||
@@ -55,10 +43,6 @@ if NOT "%2" == "" (
|
||||
if "%1" == "2015" (
|
||||
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
|
||||
)
|
||||
if "%1" == "2017" (
|
||||
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
|
||||
)
|
||||
|
||||
goto start
|
||||
)
|
||||
)
|
||||
|
@@ -32,7 +32,6 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
|
||||
${EXTRA_LIBS}
|
||||
${PLATFORM_LINKLIBS}
|
||||
bf_testing_main
|
||||
bf_intern_eigen
|
||||
bf_intern_guardedalloc
|
||||
extern_gtest
|
||||
extern_gmock
|
||||
|
@@ -352,11 +352,6 @@ function(SETUP_LIBDIRS)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(setup_platform_linker_flags)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||
endmacro()
|
||||
|
||||
function(setup_liblinks
|
||||
target
|
||||
)
|
||||
|
@@ -31,8 +31,7 @@ endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(MSVC_CLANG On)
|
||||
set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
|
||||
set(MSVC_REDIST_DIR ${VC_TOOLS_DIR})
|
||||
set(MSVC_REDIST_DIR $ENV{VCToolsRedistDir})
|
||||
if (DEFINED MSVC_REDIST_DIR)
|
||||
file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR)
|
||||
else()
|
||||
@@ -150,7 +149,7 @@ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
|
||||
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
||||
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
|
||||
|
||||
# Ignore meaningless for us linker warnings.
|
||||
@@ -163,7 +162,7 @@ else()
|
||||
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
||||
endif()
|
||||
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
||||
|
||||
if(NOT DEFINED LIBDIR)
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS%
|
||||
|
||||
if "%BUILD_ARCH%"=="x64" (
|
||||
set MSBUILD_PLATFORM=x64
|
||||
) else if "%BUILD_ARCH%"=="x86" (
|
||||
@@ -9,17 +11,8 @@ if "%BUILD_ARCH%"=="x64" (
|
||||
)
|
||||
|
||||
if "%WITH_CLANG%"=="1" (
|
||||
set CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -T"LLVM-vs2017"
|
||||
)
|
||||
) else (
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
echo ASAN is only supported with clang.
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS%
|
||||
|
||||
if NOT EXIST %BUILD_DIR%\nul (
|
||||
mkdir %BUILD_DIR%
|
||||
|
@@ -1,9 +1,3 @@
|
||||
ninja --version 1>NUL 2>&1
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo "Ninja not detected in the path"
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
|
||||
|
||||
if "%WITH_CLANG%" == "1" (
|
||||
@@ -33,16 +27,6 @@ set LLVM_DIR=
|
||||
rem build and tested against 2017 15.7
|
||||
set CFLAGS=-m64 -fmsc-version=1914
|
||||
set CXXFLAGS=-m64 -fmsc-version=1914
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
|
||||
)
|
||||
)
|
||||
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
if "%WITH_CLANG%" == "" (
|
||||
echo ASAN is only supported with clang.
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
if NOT "%verbose%" == "" (
|
||||
|
@@ -12,11 +12,6 @@ if not exist "%vs_where%" (
|
||||
goto FAIL
|
||||
)
|
||||
)
|
||||
|
||||
if NOT "%verbose%" == "" (
|
||||
echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
|
||||
)
|
||||
|
||||
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
|
||||
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
|
||||
)
|
||||
|
@@ -42,8 +42,6 @@ if NOT "%1" == "" (
|
||||
) else if "%1" == "release" (
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
|
||||
set TARGET=Release
|
||||
) else if "%1" == "asan" (
|
||||
set WITH_ASAN=1
|
||||
) else if "%1" == "x86" (
|
||||
set BUILD_ARCH=x86
|
||||
) else if "%1" == "x64" (
|
||||
@@ -53,10 +51,6 @@ if NOT "%1" == "" (
|
||||
) else if "%1" == "2017pre" (
|
||||
set BUILD_VS_YEAR=2017
|
||||
set VSWHERE_ARGS=-prerelease
|
||||
set BUILD_VS_YEAR=2017
|
||||
) else if "%1" == "2017b" (
|
||||
set BUILD_VS_YEAR=2017
|
||||
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
||||
) else if "%1" == "2015" (
|
||||
set BUILD_VS_YEAR=2015
|
||||
) else if "%1" == "2013" (
|
||||
|
@@ -22,6 +22,3 @@ set BUILD_SHOW_HASHES=
|
||||
set SHOW_HELP=
|
||||
set BUILD_WITH_NINJA=
|
||||
set WITH_CLANG=
|
||||
set WITH_ASAN=
|
||||
set CLANG_CMAKE_ARGS=
|
||||
set ASAN_CMAKE_ARGS=
|
||||
|
@@ -23,13 +23,7 @@ echo - buildir [newdir] ^(override default build folder^)
|
||||
echo - x86 ^(override host auto-detect and build 32 bit code^)
|
||||
echo - x64 ^(override host auto-detect and build 64 bit code^)
|
||||
echo - 2013 ^(build with visual studio 2013^)
|
||||
echo.
|
||||
echo Experimental options
|
||||
echo - 2015 ^(build with visual studio 2015^)
|
||||
echo - 2017 ^(build with visual studio 2017^)
|
||||
echo - 2017pre ^(build with visual studio 2017 pre-release^)
|
||||
echo - 2017b ^(build with visual studio 2017 Build Tools^)
|
||||
echo - clang ^(enable building with clang^)
|
||||
echo - asan ^(enable asan when building with clang^)
|
||||
echo - ninja ^(enable building with ninja instead of msbuild^)
|
||||
echo - 2015 ^(build with visual studio 2015^) [EXPERIMENTAL]
|
||||
echo - 2017 ^(build with visual studio 2017^) [EXPERIMENTAL]
|
||||
echo - 2017pre ^(build with visual studio 2017 pre-release^) [EXPERIMENTAL]
|
||||
echo.
|
||||
|
@@ -78,7 +78,7 @@ class CyclesRender(bpy.types.RenderEngine):
|
||||
|
||||
engine.reset(self, data, depsgraph)
|
||||
|
||||
def render(self, depsgraph):
|
||||
def render_to_image(self, depsgraph):
|
||||
engine.render(self, depsgraph)
|
||||
|
||||
def bake(self, depsgraph, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
|
||||
@@ -93,7 +93,7 @@ class CyclesRender(bpy.types.RenderEngine):
|
||||
engine.reset(self, context.blend_data, context.depsgraph)
|
||||
engine.sync(self, context.depsgraph, context.blend_data)
|
||||
|
||||
def view_draw(self, context):
|
||||
def render_to_view(self, context):
|
||||
engine.draw(self, context.depsgraph, context.region, context.space_data, context.region_data)
|
||||
|
||||
def update_script_node(self, node):
|
||||
|
@@ -1154,7 +1154,7 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
||||
default='THICK',
|
||||
)
|
||||
cls.cull_backfacing = BoolProperty(
|
||||
name="Cull Back-faces",
|
||||
name="Cull back-faces",
|
||||
description="Do not test the back-face of each strand",
|
||||
default=True,
|
||||
)
|
||||
@@ -1330,6 +1330,49 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||
del bpy.types.ViewLayer.cycles
|
||||
|
||||
|
||||
class CyclesCurveSettings(bpy.types.PropertyGroup):
|
||||
@classmethod
|
||||
def register(cls):
|
||||
bpy.types.ParticleSettings.cycles = PointerProperty(
|
||||
name="Cycles Hair Settings",
|
||||
description="Cycles hair settings",
|
||||
type=cls,
|
||||
)
|
||||
cls.radius_scale = FloatProperty(
|
||||
name="Radius Scaling",
|
||||
description="Multiplier of width properties",
|
||||
min=0.0, max=1000.0,
|
||||
default=0.01,
|
||||
)
|
||||
cls.root_width = FloatProperty(
|
||||
name="Root Size",
|
||||
description="Strand's width at root",
|
||||
min=0.0, max=1000.0,
|
||||
default=1.0,
|
||||
)
|
||||
cls.tip_width = FloatProperty(
|
||||
name="Tip Multiplier",
|
||||
description="Strand's width at tip",
|
||||
min=0.0, max=1000.0,
|
||||
default=0.0,
|
||||
)
|
||||
cls.shape = FloatProperty(
|
||||
name="Strand Shape",
|
||||
description="Strand shape parameter",
|
||||
min=-1.0, max=1.0,
|
||||
default=0.0,
|
||||
)
|
||||
cls.use_closetip = BoolProperty(
|
||||
name="Close tip",
|
||||
description="Set tip radius to zero",
|
||||
default=True,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def unregister(cls):
|
||||
del bpy.types.ParticleSettings.cycles
|
||||
|
||||
|
||||
class CyclesDeviceSettings(bpy.types.PropertyGroup):
|
||||
@classmethod
|
||||
def register(cls):
|
||||
@@ -1460,6 +1503,7 @@ def register():
|
||||
bpy.utils.register_class(CyclesMeshSettings)
|
||||
bpy.utils.register_class(CyclesObjectSettings)
|
||||
bpy.utils.register_class(CyclesCurveRenderSettings)
|
||||
bpy.utils.register_class(CyclesCurveSettings)
|
||||
bpy.utils.register_class(CyclesDeviceSettings)
|
||||
bpy.utils.register_class(CyclesPreferences)
|
||||
bpy.utils.register_class(CyclesRenderLayerSettings)
|
||||
@@ -1475,6 +1519,7 @@ def unregister():
|
||||
bpy.utils.unregister_class(CyclesObjectSettings)
|
||||
bpy.utils.unregister_class(CyclesVisibilitySettings)
|
||||
bpy.utils.unregister_class(CyclesCurveRenderSettings)
|
||||
bpy.utils.unregister_class(CyclesCurveSettings)
|
||||
bpy.utils.unregister_class(CyclesDeviceSettings)
|
||||
bpy.utils.unregister_class(CyclesPreferences)
|
||||
bpy.utils.unregister_class(CyclesRenderLayerSettings)
|
||||
|
@@ -433,14 +433,3 @@ def do_versions(self):
|
||||
(bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 4)):
|
||||
# Switch to squared roughness convention
|
||||
square_roughness_nodes_insert()
|
||||
|
||||
if bpy.data.version <= (2, 80, 15):
|
||||
# Copy cycles hair settings to internal settings
|
||||
for part in bpy.data.particles:
|
||||
cpart = part.get("cycles", None)
|
||||
if cpart:
|
||||
part.shape = cpart.get("shape", 0.0)
|
||||
part.root_radius = cpart.get("root_width", 1.0)
|
||||
part.tip_radius = cpart.get("tip_width", 0.0)
|
||||
part.radius_scale = cpart.get("radius_scale", 0.01)
|
||||
part.use_close_tip = cpart.get("use_closetip", True)
|
||||
|
@@ -149,16 +149,18 @@ static bool ObtainCacheParticleData(Mesh *mesh,
|
||||
if(b_part.kink() == BL::ParticleSettings::kink_SPIRAL)
|
||||
ren_step += b_part.kink_extra_steps();
|
||||
|
||||
PointerRNA cpsys = RNA_pointer_get(&b_part.ptr, "cycles");
|
||||
|
||||
CData->psys_firstcurve.push_back_slow(curvenum);
|
||||
CData->psys_curvenum.push_back_slow(totcurves);
|
||||
CData->psys_shader.push_back_slow(shader);
|
||||
|
||||
float radius = b_part.radius_scale() * 0.5f;
|
||||
float radius = get_float(cpsys, "radius_scale") * 0.5f;
|
||||
|
||||
CData->psys_rootradius.push_back_slow(radius * b_part.root_radius());
|
||||
CData->psys_tipradius.push_back_slow(radius * b_part.tip_radius());
|
||||
CData->psys_shape.push_back_slow(b_part.shape());
|
||||
CData->psys_closetip.push_back_slow(b_part.use_close_tip());
|
||||
CData->psys_rootradius.push_back_slow(radius * get_float(cpsys, "root_width"));
|
||||
CData->psys_tipradius.push_back_slow(radius * get_float(cpsys, "tip_width"));
|
||||
CData->psys_shape.push_back_slow(get_float(cpsys, "shape"));
|
||||
CData->psys_closetip.push_back_slow(get_boolean(cpsys, "use_closetip"));
|
||||
|
||||
int pa_no = 0;
|
||||
if(!(b_part.child_type() == 0) && totchild != 0)
|
||||
|
@@ -1173,7 +1173,7 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph,
|
||||
* freed data from the blender side.
|
||||
*/
|
||||
if(preview && b_ob.type() != BL::Object::type_MESH)
|
||||
b_ob.update_from_editmode(b_data);
|
||||
b_ob.update_from_editmode();
|
||||
|
||||
bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
|
||||
|
||||
|
@@ -278,25 +278,25 @@ void BlenderSync::sync_background_light(bool use_portal)
|
||||
/* Object */
|
||||
|
||||
Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
BL::Depsgraph::duplis_iterator& b_dupli_iter,
|
||||
uint layer_flag,
|
||||
float motion_time,
|
||||
bool hide_tris,
|
||||
BlenderObjectCulling& culling,
|
||||
bool *use_portal)
|
||||
{
|
||||
const bool is_instance = b_instance.is_instance();
|
||||
BL::Object b_ob = b_instance.object();
|
||||
BL::Object b_parent = is_instance ? b_instance.parent()
|
||||
: b_instance.object();
|
||||
BL::Object b_ob_instance = is_instance ? b_instance.instance_object()
|
||||
const bool is_instance = b_dupli_iter->is_instance();
|
||||
BL::Object b_ob = b_dupli_iter->object();
|
||||
BL::Object b_parent = is_instance ? b_dupli_iter->parent()
|
||||
: b_dupli_iter->object();
|
||||
BL::Object b_ob_instance = is_instance ? b_dupli_iter->instance_object()
|
||||
: b_ob;
|
||||
const bool motion = motion_time != 0.0f;
|
||||
/*const*/ Transform tfm = get_transform(b_ob.matrix_world());
|
||||
int *persistent_id = NULL;
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id_array;
|
||||
if(is_instance) {
|
||||
persistent_id_array = b_instance.persistent_id();
|
||||
persistent_id_array = b_dupli_iter->persistent_id();
|
||||
persistent_id = persistent_id_array.data;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
persistent_id,
|
||||
b_ob,
|
||||
b_ob_instance,
|
||||
is_instance ? b_instance.random_id() : 0,
|
||||
is_instance ? b_dupli_iter->random_id() : 0,
|
||||
tfm,
|
||||
use_portal);
|
||||
}
|
||||
@@ -448,12 +448,12 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
|
||||
/* dupli texture coordinates and random_id */
|
||||
if(is_instance) {
|
||||
object->dupli_generated = 0.5f*get_float3(b_instance.orco()) - make_float3(0.5f, 0.5f, 0.5f);
|
||||
object->dupli_uv = get_float2(b_instance.uv());
|
||||
object->random_id = b_instance.random_id();
|
||||
object->dupli_generated = 0.5f*get_float3(b_dupli_iter->orco()) - make_float3(0.5f, 0.5f, 0.5f);
|
||||
object->dupli_uv = get_float2(b_dupli_iter->uv());
|
||||
object->random_id = b_dupli_iter->random_id();
|
||||
|
||||
/* Sync possible particle data. */
|
||||
sync_dupli_particle(b_ob, b_instance, object);
|
||||
sync_dupli_particle(b_ob, *b_dupli_iter, object);
|
||||
}
|
||||
else {
|
||||
object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f);
|
||||
@@ -482,8 +482,7 @@ static bool object_render_hide_original(BL::Object::type_enum ob_type,
|
||||
static bool object_render_hide(BL::Object& b_ob,
|
||||
bool top_level,
|
||||
bool parent_hide,
|
||||
bool& hide_triangles,
|
||||
BL::Depsgraph::mode_enum depsgraph_mode)
|
||||
bool& hide_triangles)
|
||||
{
|
||||
/* check if we should render or hide particle emitter */
|
||||
BL::Object::particle_systems_iterator b_psys;
|
||||
@@ -502,16 +501,11 @@ static bool object_render_hide(BL::Object& b_ob,
|
||||
has_particles = true;
|
||||
}
|
||||
|
||||
/* Both mode_PREVIEW and mode_VIEWPORT are treated the same here.*/
|
||||
const bool show_duplicator = depsgraph_mode == BL::Depsgraph::mode_RENDER
|
||||
? b_ob.show_duplicator_for_render()
|
||||
: b_ob.show_duplicator_for_viewport();
|
||||
|
||||
if(has_particles) {
|
||||
show_emitter = show_duplicator;
|
||||
show_emitter = b_ob.show_duplicator_for_render();
|
||||
hide_emitter = !show_emitter;
|
||||
} else if(b_ob.is_duplicator()) {
|
||||
if(top_level || show_duplicator) {
|
||||
if(top_level || b_ob.show_duplicator_for_render()) {
|
||||
hide_as_dupli_parent = true;
|
||||
}
|
||||
}
|
||||
@@ -569,15 +563,12 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
|
||||
bool cancel = false;
|
||||
bool use_portal = false;
|
||||
|
||||
BL::Depsgraph::mode_enum depsgraph_mode = b_depsgraph.mode();
|
||||
|
||||
BL::Depsgraph::object_instances_iterator b_instance_iter;
|
||||
for(b_depsgraph.object_instances.begin(b_instance_iter);
|
||||
b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
|
||||
++b_instance_iter)
|
||||
BL::Depsgraph::duplis_iterator b_dupli_iter;
|
||||
for(b_depsgraph.duplis.begin(b_dupli_iter);
|
||||
b_dupli_iter != b_depsgraph.duplis.end() && !cancel;
|
||||
++b_dupli_iter)
|
||||
{
|
||||
BL::DepsgraphObjectInstance b_instance = *b_instance_iter;
|
||||
BL::Object b_ob = b_instance.object();
|
||||
BL::Object b_ob = b_dupli_iter->object();
|
||||
if(!b_ob.is_visible()) {
|
||||
continue;
|
||||
}
|
||||
@@ -590,10 +581,10 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
|
||||
/* test if object needs to be hidden */
|
||||
bool hide_tris;
|
||||
|
||||
if(!object_render_hide(b_ob, true, true, hide_tris, depsgraph_mode)) {
|
||||
if(!object_render_hide(b_ob, true, true, hide_tris)) {
|
||||
/* object itself */
|
||||
sync_object(b_depsgraph,
|
||||
b_instance,
|
||||
b_dupli_iter,
|
||||
~(0), /* until we get rid of layers */
|
||||
motion_time,
|
||||
hide_tris,
|
||||
|
@@ -28,11 +28,11 @@ CCL_NAMESPACE_BEGIN
|
||||
/* Utilities */
|
||||
|
||||
bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
BL::DepsgraphIter& b_dup,
|
||||
Object *object)
|
||||
{
|
||||
/* test if this dupli was generated from a particle sytem */
|
||||
BL::ParticleSystem b_psys = b_instance.particle_system();
|
||||
BL::ParticleSystem b_psys = b_dup.particle_system();
|
||||
if(!b_psys)
|
||||
return false;
|
||||
|
||||
@@ -43,7 +43,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
return false;
|
||||
|
||||
/* don't handle child particles yet */
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_instance.persistent_id();
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_dup.persistent_id();
|
||||
|
||||
if(persistent_id[0] >= b_psys.particles.length())
|
||||
return false;
|
||||
@@ -53,7 +53,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
ParticleSystem *psys;
|
||||
|
||||
bool first_use = !particle_system_map.is_used(key);
|
||||
bool need_update = particle_system_map.sync(&psys, b_ob, b_instance.object(), key);
|
||||
bool need_update = particle_system_map.sync(&psys, b_ob, b_dup.object(), key);
|
||||
|
||||
/* no update needed? */
|
||||
if(!need_update && !object->mesh->need_update && !scene->object_manager->need_update)
|
||||
|
@@ -773,7 +773,7 @@ void BlenderSession::synchronize(BL::Depsgraph& b_depsgraph_)
|
||||
|
||||
/* copy recalc flags, outside of mutex so we can decide to do the real
|
||||
* synchronization at a later time to not block on running updates */
|
||||
sync->sync_recalc(b_depsgraph_);
|
||||
sync->sync_recalc();
|
||||
|
||||
/* don't do synchronization if on pause */
|
||||
if(session_pause) {
|
||||
|
@@ -659,9 +659,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
image->animated = b_image_node.image_user().use_auto_refresh();
|
||||
image->use_alpha = b_image.use_alpha();
|
||||
|
||||
/* TODO: restore */
|
||||
/* TODO(sergey): Does not work properly when we change builtin type. */
|
||||
#if 0
|
||||
if(b_image.is_updated()) {
|
||||
scene->image_manager->tag_reload_image(
|
||||
image->filename.string(),
|
||||
@@ -670,7 +668,6 @@ static ShaderNode *add_node(Scene *scene,
|
||||
get_image_extension(b_image_node),
|
||||
image->use_alpha);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
image->color_space = (NodeImageColorSpace)b_image_node.color_space();
|
||||
image->projection = (NodeImageProjection)b_image_node.projection();
|
||||
@@ -710,9 +707,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
env->animated = b_env_node.image_user().use_auto_refresh();
|
||||
env->use_alpha = b_image.use_alpha();
|
||||
|
||||
/* TODO: restore */
|
||||
/* TODO(sergey): Does not work properly when we change builtin type. */
|
||||
#if 0
|
||||
if(b_image.is_updated()) {
|
||||
scene->image_manager->tag_reload_image(
|
||||
env->filename.string(),
|
||||
@@ -721,7 +716,6 @@ static ShaderNode *add_node(Scene *scene,
|
||||
EXTENSION_REPEAT,
|
||||
env->use_alpha);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
env->color_space = (NodeImageColorSpace)b_env_node.color_space();
|
||||
env->interpolation = get_image_interpolation(b_env_node);
|
||||
@@ -1244,32 +1238,33 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
TaskPool pool;
|
||||
set<Shader*> updated_shaders;
|
||||
|
||||
BL::Depsgraph::ids_iterator b_id;
|
||||
for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) {
|
||||
if (!b_id->is_a(&RNA_Material)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
BL::Material b_mat(*b_id);
|
||||
/* material loop */
|
||||
BL::BlendData::materials_iterator b_mat_orig;
|
||||
for(b_data.materials.begin(b_mat_orig);
|
||||
b_mat_orig != b_data.materials.end();
|
||||
++b_mat_orig)
|
||||
{
|
||||
/* TODO(sergey): Iterate over evaluated data rather than using mapping. */
|
||||
BL::Material b_mat_(b_depsgraph.id_eval_get(*b_mat_orig));
|
||||
BL::Material *b_mat = &b_mat_;
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if(shader_map.sync(&shader, b_mat) || shader->need_sync_object || update_all) {
|
||||
if(shader_map.sync(&shader, *b_mat) || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
shader->name = b_mat.name().c_str();
|
||||
shader->pass_id = b_mat.pass_index();
|
||||
shader->need_sync_object = false;
|
||||
shader->name = b_mat->name().c_str();
|
||||
shader->pass_id = b_mat->pass_index();
|
||||
|
||||
/* create nodes */
|
||||
if(b_mat.use_nodes() && b_mat.node_tree()) {
|
||||
BL::ShaderNodeTree b_ntree(b_mat.node_tree());
|
||||
if(b_mat->use_nodes() && b_mat->node_tree()) {
|
||||
BL::ShaderNodeTree b_ntree(b_mat->node_tree());
|
||||
|
||||
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
DiffuseBsdfNode *diffuse = new DiffuseBsdfNode();
|
||||
diffuse->color = get_float3(b_mat.diffuse_color());
|
||||
diffuse->color = get_float3(b_mat->diffuse_color());
|
||||
graph->add(diffuse);
|
||||
|
||||
ShaderNode *out = graph->output();
|
||||
@@ -1277,7 +1272,7 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
}
|
||||
|
||||
/* settings */
|
||||
PointerRNA cmat = RNA_pointer_get(&b_mat.ptr, "cycles");
|
||||
PointerRNA cmat = RNA_pointer_get(&b_mat->ptr, "cycles");
|
||||
shader->use_mis = get_boolean(cmat, "sample_as_light");
|
||||
shader->use_transparent_shadow = get_boolean(cmat, "use_transparent_shadow");
|
||||
shader->heterogeneous_volume = !get_boolean(cmat, "homogeneous_volume");
|
||||
@@ -1417,39 +1412,41 @@ void BlenderSync::sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
{
|
||||
shader_map.set_default(scene->default_light);
|
||||
|
||||
BL::Depsgraph::ids_iterator b_id;
|
||||
for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) {
|
||||
if (!b_id->is_a(&RNA_Lamp)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
BL::Lamp b_lamp(*b_id);
|
||||
/* lamp loop */
|
||||
BL::BlendData::lamps_iterator b_lamp_orig;
|
||||
for(b_data.lamps.begin(b_lamp_orig);
|
||||
b_lamp_orig != b_data.lamps.end();
|
||||
++b_lamp_orig)
|
||||
{
|
||||
/* TODO(sergey): Iterate over evaluated data rather than using mapping. */
|
||||
BL::Lamp b_lamp_(b_depsgraph.id_eval_get(*b_lamp_orig));
|
||||
BL::Lamp *b_lamp = &b_lamp_;
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if(shader_map.sync(&shader, b_lamp) || update_all) {
|
||||
if(shader_map.sync(&shader, *b_lamp) || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
/* create nodes */
|
||||
if(b_lamp.use_nodes() && b_lamp.node_tree()) {
|
||||
shader->name = b_lamp.name().c_str();
|
||||
if(b_lamp->use_nodes() && b_lamp->node_tree()) {
|
||||
shader->name = b_lamp->name().c_str();
|
||||
|
||||
BL::ShaderNodeTree b_ntree(b_lamp.node_tree());
|
||||
BL::ShaderNodeTree b_ntree(b_lamp->node_tree());
|
||||
|
||||
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
float strength = 1.0f;
|
||||
|
||||
if(b_lamp.type() == BL::Lamp::type_POINT ||
|
||||
b_lamp.type() == BL::Lamp::type_SPOT ||
|
||||
b_lamp.type() == BL::Lamp::type_AREA)
|
||||
if(b_lamp->type() == BL::Lamp::type_POINT ||
|
||||
b_lamp->type() == BL::Lamp::type_SPOT ||
|
||||
b_lamp->type() == BL::Lamp::type_AREA)
|
||||
{
|
||||
strength = 100.0f;
|
||||
}
|
||||
|
||||
EmissionNode *emission = new EmissionNode();
|
||||
emission->color = get_float3(b_lamp.color());
|
||||
emission->color = get_float3(b_lamp->color());
|
||||
emission->strength = strength;
|
||||
graph->add(emission);
|
||||
|
||||
|
@@ -76,12 +76,31 @@ BlenderSync::~BlenderSync()
|
||||
|
||||
/* Sync */
|
||||
|
||||
void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph)
|
||||
bool BlenderSync::sync_recalc()
|
||||
{
|
||||
/* Sync recalc flags from blender to cycles. Actual update is done separate,
|
||||
* so we can do it later on if doing it immediate is not suitable. */
|
||||
/* sync recalc flags from blender to cycles. actual update is done separate,
|
||||
* so we can do it later on if doing it immediate is not suitable */
|
||||
|
||||
BL::BlendData::materials_iterator b_mat;
|
||||
bool has_updated_objects = b_data.objects.is_updated();
|
||||
for(b_data.materials.begin(b_mat); b_mat != b_data.materials.end(); ++b_mat) {
|
||||
if(b_mat->is_updated() || (b_mat->node_tree() && b_mat->node_tree().is_updated())) {
|
||||
shader_map.set_recalc(*b_mat);
|
||||
}
|
||||
else {
|
||||
Shader *shader = shader_map.find(*b_mat);
|
||||
if(has_updated_objects && shader != NULL && shader->has_object_dependency) {
|
||||
shader_map.set_recalc(*b_mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::lamps_iterator b_lamp;
|
||||
|
||||
for(b_data.lamps.begin(b_lamp); b_lamp != b_data.lamps.end(); ++b_lamp)
|
||||
if(b_lamp->is_updated() || (b_lamp->node_tree() && b_lamp->node_tree().is_updated()))
|
||||
shader_map.set_recalc(*b_lamp);
|
||||
|
||||
bool has_updated_objects = b_depsgraph.id_type_updated(BL::DriverTarget::id_type_OBJECT);
|
||||
bool dicing_prop_changed = false;
|
||||
|
||||
if(experimental) {
|
||||
@@ -103,77 +122,70 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph)
|
||||
}
|
||||
}
|
||||
|
||||
/* Iterate over all IDs in this depsgraph. */
|
||||
BL::Depsgraph::updates_iterator b_update;
|
||||
for(b_depsgraph.updates.begin(b_update); b_update != b_depsgraph.updates.end(); ++b_update) {
|
||||
BL::ID b_id(b_update->id());
|
||||
BL::BlendData::objects_iterator b_ob;
|
||||
|
||||
/* Material */
|
||||
if (b_id.is_a(&RNA_Material)) {
|
||||
BL::Material b_mat(b_id);
|
||||
shader_map.set_recalc(b_mat);
|
||||
}
|
||||
/* Lamp */
|
||||
else if (b_id.is_a(&RNA_Lamp)) {
|
||||
BL::Lamp b_lamp(b_id);
|
||||
shader_map.set_recalc(b_lamp);
|
||||
}
|
||||
/* Object */
|
||||
else if (b_id.is_a(&RNA_Object)) {
|
||||
BL::Object b_ob(b_id);
|
||||
const bool updated_geometry = b_update->updated_geometry();
|
||||
|
||||
if (b_update->updated_transform()) {
|
||||
object_map.set_recalc(b_ob);
|
||||
light_map.set_recalc(b_ob);
|
||||
for(b_data.objects.begin(b_ob); b_ob != b_data.objects.end(); ++b_ob) {
|
||||
if(b_ob->is_updated()) {
|
||||
object_map.set_recalc(*b_ob);
|
||||
light_map.set_recalc(*b_ob);
|
||||
}
|
||||
|
||||
if(object_is_mesh(b_ob)) {
|
||||
if(updated_geometry ||
|
||||
(dicing_prop_changed && object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
|
||||
if(object_is_mesh(*b_ob)) {
|
||||
if(b_ob->is_updated_data() || b_ob->data().is_updated() ||
|
||||
(dicing_prop_changed && object_subdivision_type(*b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
|
||||
{
|
||||
BL::ID key = BKE_object_is_modified(b_ob)? b_ob: b_ob.data();
|
||||
BL::ID key = BKE_object_is_modified(*b_ob)? *b_ob: b_ob->data();
|
||||
mesh_map.set_recalc(key);
|
||||
}
|
||||
}
|
||||
else if(object_is_light(b_ob)) {
|
||||
if(updated_geometry) {
|
||||
light_map.set_recalc(b_ob);
|
||||
}
|
||||
else if(object_is_light(*b_ob)) {
|
||||
if(b_ob->is_updated_data() || b_ob->data().is_updated())
|
||||
light_map.set_recalc(*b_ob);
|
||||
}
|
||||
|
||||
if(updated_geometry) {
|
||||
if(b_ob->is_updated_data()) {
|
||||
BL::Object::particle_systems_iterator b_psys;
|
||||
for(b_ob.particle_systems.begin(b_psys); b_psys != b_ob.particle_systems.end(); ++b_psys)
|
||||
particle_system_map.set_recalc(b_ob);
|
||||
for(b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys)
|
||||
particle_system_map.set_recalc(*b_ob);
|
||||
}
|
||||
}
|
||||
/* Mesh */
|
||||
else if (b_id.is_a(&RNA_Mesh)) {
|
||||
BL::Mesh b_mesh(b_id);
|
||||
mesh_map.set_recalc(b_mesh);
|
||||
|
||||
BL::BlendData::meshes_iterator b_mesh;
|
||||
|
||||
for(b_data.meshes.begin(b_mesh); b_mesh != b_data.meshes.end(); ++b_mesh) {
|
||||
if(b_mesh->is_updated()) {
|
||||
mesh_map.set_recalc(*b_mesh);
|
||||
}
|
||||
/* World */
|
||||
else if (b_id.is_a(&RNA_World)) {
|
||||
BL::World b_world(b_id);
|
||||
if(world_map == b_world.ptr.data) {
|
||||
}
|
||||
|
||||
BL::BlendData::worlds_iterator b_world;
|
||||
|
||||
for(b_data.worlds.begin(b_world); b_world != b_data.worlds.end(); ++b_world) {
|
||||
if(world_map == b_world->ptr.data) {
|
||||
if(b_world->is_updated() ||
|
||||
(b_world->node_tree() && b_world->node_tree().is_updated()))
|
||||
{
|
||||
world_recalc = true;
|
||||
}
|
||||
else if(b_world->node_tree() && b_world->use_nodes()) {
|
||||
Shader *shader = scene->default_background;
|
||||
if(has_updated_objects && shader->has_object_dependency) {
|
||||
world_recalc = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Updates shader with object dependency if objects changed. */
|
||||
if (has_updated_objects) {
|
||||
if(scene->default_background->has_object_dependency) {
|
||||
world_recalc = true;
|
||||
}
|
||||
|
||||
foreach(Shader *shader, scene->shaders) {
|
||||
if (shader->has_object_dependency) {
|
||||
shader->need_sync_object = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
bool recalc =
|
||||
shader_map.has_recalc() ||
|
||||
object_map.has_recalc() ||
|
||||
light_map.has_recalc() ||
|
||||
mesh_map.has_recalc() ||
|
||||
particle_system_map.has_recalc() ||
|
||||
BlendDataObjects_is_updated_get(&b_data.ptr) ||
|
||||
world_recalc;
|
||||
|
||||
return recalc;
|
||||
}
|
||||
|
||||
void BlenderSync::sync_data(BL::RenderSettings& b_render,
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
~BlenderSync();
|
||||
|
||||
/* sync */
|
||||
void sync_recalc(BL::Depsgraph& b_depsgraph);
|
||||
bool sync_recalc();
|
||||
void sync_data(BL::RenderSettings& b_render,
|
||||
BL::Depsgraph& b_depsgraph,
|
||||
BL::SpaceView3D& b_v3d,
|
||||
@@ -126,7 +126,7 @@ private:
|
||||
bool motion,
|
||||
int motion_step = 0);
|
||||
Object *sync_object(BL::Depsgraph& b_depsgraph,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
BL::Depsgraph::duplis_iterator& b_dupli_iter,
|
||||
uint layer_flag,
|
||||
float motion_time,
|
||||
bool hide_tris,
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
|
||||
/* particles */
|
||||
bool sync_dupli_particle(BL::Object& b_ob,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
BL::DepsgraphIter& b_dup,
|
||||
Object *object);
|
||||
|
||||
/* Images. */
|
||||
|
@@ -59,15 +59,12 @@ ccl_device_inline void kernel_split_path_end(KernelGlobals *kg, int ray_index)
|
||||
ccl_global char *ray_state = kernel_split_state.ray_state;
|
||||
|
||||
#ifdef __BRANCHED_PATH__
|
||||
# ifdef __SUBSURFACE__
|
||||
ccl_addr_space SubsurfaceIndirectRays *ss_indirect = &kernel_split_state.ss_rays[ray_index];
|
||||
|
||||
if(ss_indirect->num_rays) {
|
||||
ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER);
|
||||
}
|
||||
else
|
||||
# endif /* __SUBSURFACE__ */
|
||||
if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) {
|
||||
else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) {
|
||||
int orig_ray = kernel_split_state.branched_state[ray_index].original_ray;
|
||||
|
||||
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];
|
||||
|
@@ -202,7 +202,6 @@ Shader::Shader()
|
||||
|
||||
need_update = true;
|
||||
need_update_mesh = true;
|
||||
need_sync_object = false;
|
||||
}
|
||||
|
||||
Shader::~Shader()
|
||||
|
@@ -99,7 +99,6 @@ public:
|
||||
/* synchronization */
|
||||
bool need_update;
|
||||
bool need_update_mesh;
|
||||
bool need_sync_object;
|
||||
|
||||
/* If the shader has only volume components, the surface is assumed to
|
||||
* be transparent.
|
||||
|
@@ -36,12 +36,10 @@ set(SRC
|
||||
|
||||
intern/eigenvalues.cc
|
||||
intern/linear_solver.cc
|
||||
intern/matrix.cc
|
||||
intern/svd.cc
|
||||
|
||||
intern/eigenvalues.h
|
||||
intern/linear_solver.h
|
||||
intern/matrix.h
|
||||
intern/svd.h
|
||||
)
|
||||
|
||||
|
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "intern/eigenvalues.h"
|
||||
#include "intern/linear_solver.h"
|
||||
#include "intern/matrix.h"
|
||||
#include "intern/svd.h"
|
||||
|
||||
#endif /* __EIGEN_C_API_H__ */
|
||||
|
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2018 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_MATRIX_C_API_CC__
|
||||
#define __EIGEN3_MATRIX_C_API_CC__
|
||||
|
||||
/* Eigen gives annoying huge amount of warnings here, silence them! */
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
# pragma GCC diagnostic ignored "-Wlogical-op"
|
||||
#endif
|
||||
|
||||
#ifdef __EIGEN3_MATRIX_C_API_CC__ /* quiet warning */
|
||||
#endif
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
#include "matrix.h"
|
||||
|
||||
using Eigen::Map;
|
||||
using Eigen::Matrix4f;
|
||||
|
||||
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4])
|
||||
{
|
||||
Map<Matrix4f> M = Map<Matrix4f>((float*)matrix);
|
||||
Matrix4f R;
|
||||
bool invertible = true;
|
||||
M.computeInverseWithCheck(R, invertible, 0.0f);
|
||||
memcpy(inverse, R.data(), sizeof(float)*4*4);
|
||||
return invertible;
|
||||
}
|
||||
|
||||
#endif /* __EIGEN3_MATRIX_C_API_CC__ */
|
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_MATRIX_C_API_H__
|
||||
#define __EIGEN3_MATRIX_C_API_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __EIGEN3_MATRIX_C_API_H__ */
|
@@ -37,7 +37,6 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/SVD>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
#include "svd.h"
|
||||
|
||||
@@ -52,8 +51,6 @@ using Eigen::MatrixXf;
|
||||
using Eigen::VectorXf;
|
||||
using Eigen::Map;
|
||||
|
||||
using Eigen::Matrix4f;
|
||||
|
||||
void EIG_svd_square_matrix(const int size, const float *matrix, float *r_U, float *r_S, float *r_V)
|
||||
{
|
||||
/* Since our matrix is squared, we can use thinU/V. */
|
||||
|
@@ -59,19 +59,13 @@ using namespace OCIO_NAMESPACE;
|
||||
#include "ocio_impl.h"
|
||||
|
||||
static const int LUT3D_EDGE_SIZE = 64;
|
||||
static const int SHADER_CACHE_SIZE = 4;
|
||||
|
||||
extern "C" char datatoc_gpu_shader_display_transform_glsl[];
|
||||
extern "C" char datatoc_gpu_shader_display_transform_vertex_glsl[];
|
||||
|
||||
/* **** OpenGL drawing routines using GLSL for color space transform ***** */
|
||||
|
||||
typedef struct OCIO_GLSLShader {
|
||||
/* Cache ID */
|
||||
std::string lut3dCacheID;
|
||||
std::string shaderCacheID;
|
||||
|
||||
/* LUT */
|
||||
typedef struct OCIO_GLSLDrawState {
|
||||
bool lut3d_texture_allocated; /* boolean flag indicating whether
|
||||
* lut texture is allocated
|
||||
*/
|
||||
@@ -81,29 +75,25 @@ typedef struct OCIO_GLSLShader {
|
||||
|
||||
float *lut3d; /* 3D LUT table */
|
||||
|
||||
/* Dither */
|
||||
bool use_dither;
|
||||
bool dither_used;
|
||||
|
||||
/* Curve Mapping */
|
||||
bool use_curve_mapping;
|
||||
bool curve_mapping_used;
|
||||
bool curve_mapping_texture_allocated;
|
||||
bool curve_mapping_texture_valid;
|
||||
GLuint curve_mapping_texture;
|
||||
size_t curve_mapping_cache_id;
|
||||
|
||||
/* Alpha Predivide */
|
||||
bool use_predivide;
|
||||
bool predivide_used;
|
||||
|
||||
/* Cache */
|
||||
std::string lut3dcacheid;
|
||||
std::string shadercacheid;
|
||||
|
||||
/* GLSL stuff */
|
||||
GLuint ocio_shader;
|
||||
GLuint vert_shader;
|
||||
GLuint program;
|
||||
Gwn_ShaderInterface *shader_interface;
|
||||
} GLSLDrawState;
|
||||
|
||||
typedef struct OCIO_GLSLDrawState {
|
||||
/* Shader Cache */
|
||||
OCIO_GLSLShader *shader_cache[SHADER_CACHE_SIZE];
|
||||
|
||||
/* Previous OpenGL state. */
|
||||
GLint last_texture, last_texture_unit;
|
||||
@@ -160,24 +150,33 @@ static GLuint linkShaders(GLuint ocio_shader, GLuint vert_shader)
|
||||
|
||||
static OCIO_GLSLDrawState *allocateOpenGLState(void)
|
||||
{
|
||||
return (OCIO_GLSLDrawState *) MEM_callocN(sizeof(OCIO_GLSLDrawState),
|
||||
OCIO_GLSLDrawState *state;
|
||||
|
||||
/* Allocate memory for state. */
|
||||
state = (OCIO_GLSLDrawState *) MEM_callocN(sizeof(OCIO_GLSLDrawState),
|
||||
"OCIO OpenGL State struct");
|
||||
|
||||
/* Call constructors on new memory. */
|
||||
new (&state->lut3dcacheid) std::string("");
|
||||
new (&state->shadercacheid) std::string("");
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
/* Ensure LUT texture and array are allocated */
|
||||
static bool ensureLUT3DAllocated(OCIO_GLSLShader *shader)
|
||||
static bool ensureLUT3DAllocated(OCIO_GLSLDrawState *state)
|
||||
{
|
||||
int num_3d_entries = 3 * LUT3D_EDGE_SIZE * LUT3D_EDGE_SIZE * LUT3D_EDGE_SIZE;
|
||||
|
||||
if (shader->lut3d_texture_allocated)
|
||||
return shader->lut3d_texture_valid;
|
||||
if (state->lut3d_texture_allocated)
|
||||
return state->lut3d_texture_valid;
|
||||
|
||||
glGenTextures(1, &shader->lut3d_texture);
|
||||
glGenTextures(1, &state->lut3d_texture);
|
||||
|
||||
shader->lut3d = (float *) MEM_callocN(sizeof(float) * num_3d_entries, "OCIO GPU 3D LUT");
|
||||
state->lut3d = (float *) MEM_callocN(sizeof(float) * num_3d_entries, "OCIO GPU 3D LUT");
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -189,27 +188,27 @@ static bool ensureLUT3DAllocated(OCIO_GLSLShader *shader)
|
||||
|
||||
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16F_ARB,
|
||||
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
|
||||
0, GL_RGB, GL_FLOAT, shader->lut3d);
|
||||
0, GL_RGB, GL_FLOAT, state->lut3d);
|
||||
|
||||
shader->lut3d_texture_allocated = true;
|
||||
state->lut3d_texture_allocated = true;
|
||||
|
||||
/* GL_RGB16F_ARB could be not supported at some drivers
|
||||
* in this case we could not use GLSL display
|
||||
*/
|
||||
shader->lut3d_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
state->lut3d_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
|
||||
return shader->lut3d_texture_valid;
|
||||
return state->lut3d_texture_valid;
|
||||
}
|
||||
|
||||
static bool ensureCurveMappingAllocated(OCIO_GLSLShader *shader, OCIO_CurveMappingSettings *curve_mapping_settings)
|
||||
static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMappingSettings *curve_mapping_settings)
|
||||
{
|
||||
if (shader->curve_mapping_texture_allocated)
|
||||
return shader->curve_mapping_texture_valid;
|
||||
if (state->curve_mapping_texture_allocated)
|
||||
return state->curve_mapping_texture_valid;
|
||||
|
||||
glGenTextures(1, &shader->curve_mapping_texture);
|
||||
glGenTextures(1, &state->curve_mapping_texture);
|
||||
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -222,51 +221,16 @@ static bool ensureCurveMappingAllocated(OCIO_GLSLShader *shader, OCIO_CurveMappi
|
||||
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16F, curve_mapping_settings->lut_size,
|
||||
0, GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
|
||||
|
||||
shader->curve_mapping_texture_allocated = true;
|
||||
state->curve_mapping_texture_allocated = true;
|
||||
|
||||
/* GL_RGB16F_ARB could be not supported at some drivers
|
||||
* in this case we could not use GLSL display
|
||||
*/
|
||||
shader->curve_mapping_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
state->curve_mapping_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
|
||||
return shader->curve_mapping_texture_valid;
|
||||
return state->curve_mapping_texture_valid;
|
||||
}
|
||||
|
||||
static void freeGLSLShader(OCIO_GLSLShader *shader)
|
||||
{
|
||||
if (shader->curve_mapping_texture_allocated) {
|
||||
glDeleteTextures(1, &shader->curve_mapping_texture);
|
||||
}
|
||||
|
||||
if (shader->lut3d_texture_allocated) {
|
||||
glDeleteTextures(1, &shader->lut3d_texture);
|
||||
}
|
||||
|
||||
if (shader->lut3d) {
|
||||
MEM_freeN(shader->lut3d);
|
||||
}
|
||||
|
||||
if (shader->program) {
|
||||
glDeleteProgram(shader->program);
|
||||
}
|
||||
|
||||
if (shader->shader_interface) {
|
||||
GWN_shaderinterface_discard(shader->shader_interface);
|
||||
}
|
||||
|
||||
if (shader->ocio_shader) {
|
||||
glDeleteShader(shader->ocio_shader);
|
||||
}
|
||||
|
||||
using std::string;
|
||||
shader->lut3dCacheID.~string();
|
||||
shader->shaderCacheID.~string();
|
||||
|
||||
MEM_freeN(shader);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Detect if we can support GLSL drawing */
|
||||
bool OCIOImpl::supportGLSLDraw()
|
||||
{
|
||||
@@ -301,95 +265,85 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &state->last_texture);
|
||||
glGetIntegerv(GL_ACTIVE_TEXTURE, &state->last_texture_unit);
|
||||
|
||||
/* Compute cache IDs. */
|
||||
if (!ensureLUT3DAllocated(state)) {
|
||||
glActiveTexture(state->last_texture_unit);
|
||||
glBindTexture(GL_TEXTURE_2D, state->last_texture);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (use_curve_mapping) {
|
||||
if (!ensureCurveMappingAllocated(state, curve_mapping_settings)) {
|
||||
glActiveTexture(state->last_texture_unit);
|
||||
glBindTexture(GL_TEXTURE_2D, state->last_texture);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state->curve_mapping_texture_allocated) {
|
||||
glDeleteTextures(1, &state->curve_mapping_texture);
|
||||
state->curve_mapping_texture_allocated = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 1: Create a GPU Shader Description */
|
||||
GpuShaderDesc shaderDesc;
|
||||
shaderDesc.setLanguage(GPU_LANGUAGE_GLSL_1_3);
|
||||
shaderDesc.setFunctionName("OCIODisplay");
|
||||
shaderDesc.setLut3DEdgeLen(LUT3D_EDGE_SIZE);
|
||||
|
||||
if (use_curve_mapping) {
|
||||
if (state->curve_mapping_cache_id != curve_mapping_settings->cache_id) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, curve_mapping_settings->lut_size,
|
||||
GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 2: Compute the 3D LUT */
|
||||
std::string lut3dCacheID = ocio_processor->getGpuLut3DCacheID(shaderDesc);
|
||||
std::string shaderCacheID = ocio_processor->getGpuShaderTextCacheID(shaderDesc);
|
||||
|
||||
/* Find matching cached shader. */
|
||||
OCIO_GLSLShader *shader = NULL;
|
||||
for (int i = 0; i < SHADER_CACHE_SIZE; i++) {
|
||||
OCIO_GLSLShader *cached_shader = state->shader_cache[i];
|
||||
if (cached_shader == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cached_shader->lut3dCacheID == lut3dCacheID &&
|
||||
cached_shader->shaderCacheID == shaderCacheID &&
|
||||
cached_shader->use_predivide == use_predivide &&
|
||||
cached_shader->use_curve_mapping == use_curve_mapping &&
|
||||
cached_shader->use_dither == use_dither)
|
||||
{
|
||||
/* LRU cache, so move to front. */
|
||||
for (int j = i; j > 0; j--) {
|
||||
state->shader_cache[j] = state->shader_cache[j - 1];
|
||||
}
|
||||
state->shader_cache[0] = cached_shader;
|
||||
|
||||
shader = cached_shader;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (shader == NULL) {
|
||||
/* LRU cache, shift other items back so we can insert at the front. */
|
||||
OCIO_GLSLShader *last_shader = state->shader_cache[SHADER_CACHE_SIZE - 1];
|
||||
if (last_shader) {
|
||||
freeGLSLShader(last_shader);
|
||||
}
|
||||
for (int j = SHADER_CACHE_SIZE - 1; j > 0; j--) {
|
||||
state->shader_cache[j] = state->shader_cache[j - 1];
|
||||
}
|
||||
|
||||
/* Allocate memory for shader. */
|
||||
shader = (OCIO_GLSLShader *) MEM_callocN(sizeof(OCIO_GLSLShader),
|
||||
"OCIO GLSL Shader");
|
||||
state->shader_cache[0] = shader;
|
||||
|
||||
new (&shader->lut3dCacheID) std::string();
|
||||
new (&shader->shaderCacheID) std::string();
|
||||
|
||||
shader->lut3dCacheID = lut3dCacheID;
|
||||
shader->shaderCacheID = shaderCacheID;
|
||||
shader->use_curve_mapping = use_curve_mapping;
|
||||
shader->use_dither = use_dither;
|
||||
shader->use_predivide = use_predivide;
|
||||
|
||||
bool valid = true;
|
||||
|
||||
/* Compute 3D LUT. */
|
||||
if (valid && ensureLUT3DAllocated(shader)) {
|
||||
ocio_processor->getGpuLut3D(shader->lut3d, shaderDesc);
|
||||
if (lut3dCacheID != state->lut3dcacheid) {
|
||||
state->lut3dcacheid = lut3dCacheID;
|
||||
ocio_processor->getGpuLut3D(state->lut3d, shaderDesc);
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0,
|
||||
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
|
||||
GL_RGB, GL_FLOAT, shader->lut3d);
|
||||
}
|
||||
else {
|
||||
valid = false;
|
||||
GL_RGB, GL_FLOAT, state->lut3d);
|
||||
}
|
||||
|
||||
/* Allocate curve mapping texture. */
|
||||
if (valid && use_curve_mapping) {
|
||||
if (!ensureCurveMappingAllocated(shader, curve_mapping_settings)) {
|
||||
valid = false;
|
||||
}
|
||||
/* Step 3: Compute the Shader */
|
||||
std::string shaderCacheID = ocio_processor->getGpuShaderTextCacheID(shaderDesc);
|
||||
if (state->program == 0 ||
|
||||
shaderCacheID != state->shadercacheid ||
|
||||
use_predivide != state->predivide_used ||
|
||||
use_curve_mapping != state->curve_mapping_used ||
|
||||
use_dither != state->dither_used)
|
||||
{
|
||||
state->shadercacheid = shaderCacheID;
|
||||
|
||||
if (state->program) {
|
||||
glDeleteProgram(state->program);
|
||||
}
|
||||
|
||||
if (state->ocio_shader) {
|
||||
glDeleteShader(state->ocio_shader);
|
||||
}
|
||||
|
||||
if (state->vert_shader) {
|
||||
glDeleteShader(state->vert_shader);
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
/* Vertex shader */
|
||||
std::ostringstream osv;
|
||||
|
||||
osv << "#version 330\n";
|
||||
osv << datatoc_gpu_shader_display_transform_vertex_glsl;
|
||||
|
||||
shader->vert_shader = compileShaderText(GL_VERTEX_SHADER, osv.str().c_str());
|
||||
state->vert_shader = compileShaderText(GL_VERTEX_SHADER, osv.str().c_str());
|
||||
|
||||
/* Fragment shader */
|
||||
std::ostringstream os;
|
||||
@@ -415,40 +369,31 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
|
||||
os << ocio_processor->getGpuShaderText(shaderDesc) << "\n";
|
||||
os << datatoc_gpu_shader_display_transform_glsl;
|
||||
|
||||
shader->ocio_shader = compileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
|
||||
state->ocio_shader = compileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
|
||||
|
||||
/* Program */
|
||||
if (shader->ocio_shader && shader->vert_shader) {
|
||||
shader->program = linkShaders(shader->ocio_shader, shader->vert_shader);
|
||||
if (state->ocio_shader && state->vert_shader) {
|
||||
state->program = linkShaders(state->ocio_shader, state->vert_shader);
|
||||
}
|
||||
|
||||
if (shader->program) {
|
||||
if (shader->shader_interface) {
|
||||
GWN_shaderinterface_discard(shader->shader_interface);
|
||||
}
|
||||
shader->shader_interface = GWN_shaderinterface_create(shader->program);
|
||||
}
|
||||
if (state->program) {
|
||||
if (state->shader_interface) {
|
||||
GWN_shaderinterface_discard(state->shader_interface);
|
||||
}
|
||||
state->shader_interface = GWN_shaderinterface_create(state->program);
|
||||
}
|
||||
|
||||
/* Update curve mapping texture. */
|
||||
if (use_curve_mapping && shader->curve_mapping_texture_allocated) {
|
||||
if (shader->curve_mapping_cache_id != curve_mapping_settings->cache_id) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, curve_mapping_settings->lut_size,
|
||||
GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
|
||||
}
|
||||
state->curve_mapping_used = use_curve_mapping;
|
||||
state->dither_used = use_dither;
|
||||
state->predivide_used = use_predivide;
|
||||
}
|
||||
|
||||
/* Bind Shader. */
|
||||
if (shader->program) {
|
||||
if (state->program) {
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
|
||||
if (use_curve_mapping) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
}
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
@@ -464,7 +409,7 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
|
||||
Gwn_VertFormat *format = immVertexFormat();
|
||||
GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
immBindProgram(shader->program, shader->shader_interface);
|
||||
immBindProgram(state->program, state->shader_interface);
|
||||
|
||||
immUniform1i("image_texture", 0);
|
||||
immUniform1i("lut3d_texture", 1);
|
||||
@@ -508,13 +453,27 @@ void OCIOImpl::finishGLSLDraw(OCIO_GLSLDrawState *state)
|
||||
immUnbindProgram();
|
||||
}
|
||||
|
||||
void OCIOImpl::freeGLState(OCIO_GLSLDrawState *state)
|
||||
void OCIOImpl::freeGLState(struct OCIO_GLSLDrawState *state)
|
||||
{
|
||||
for (int i = 0; i < SHADER_CACHE_SIZE; i++) {
|
||||
if (state->shader_cache[i]) {
|
||||
freeGLSLShader(state->shader_cache[i]);
|
||||
}
|
||||
}
|
||||
using std::string;
|
||||
|
||||
if (state->lut3d_texture_allocated)
|
||||
glDeleteTextures(1, &state->lut3d_texture);
|
||||
|
||||
if (state->lut3d)
|
||||
MEM_freeN(state->lut3d);
|
||||
|
||||
if (state->program)
|
||||
glDeleteProgram(state->program);
|
||||
|
||||
if (state->shader_interface)
|
||||
GWN_shaderinterface_discard(state->shader_interface);
|
||||
|
||||
if (state->ocio_shader)
|
||||
glDeleteShader(state->ocio_shader);
|
||||
|
||||
state->lut3dcacheid.~string();
|
||||
state->shadercacheid.~string();
|
||||
|
||||
MEM_freeN(state);
|
||||
}
|
||||
|
@@ -1,3 +0,0 @@
|
||||
These matcap images are licensed as GNU GPL 2 or later, like the rest of Blender's code.
|
||||
|
||||
Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork and David Silverman for making the pictures.
|
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 14 KiB |
@@ -326,7 +326,7 @@ def keyconfig_export(wm, kc, filepath):
|
||||
keymaps = []
|
||||
edited_kc = FakeKeyConfig()
|
||||
for km in wm.keyconfigs.user.keymaps:
|
||||
if km.is_user_modified:
|
||||
if km.is_user_modified or (True and not km.is_modal):
|
||||
edited_kc.keymaps.append(km)
|
||||
# merge edited keymaps with non-default keyconfig, if it exists
|
||||
if kc != wm.keyconfigs.default:
|
||||
|
@@ -153,10 +153,8 @@ def get_transform_generators_base_info(data):
|
||||
# no path in this case
|
||||
path = ""
|
||||
|
||||
# transform data on ID-blocks directly should get grouped under a
|
||||
# hardcoded label ("Object Transforms") so that they get grouped
|
||||
# consistently when keyframed directly
|
||||
grouping = "Object Transforms"
|
||||
# data on ID-blocks directly should get grouped by the KeyingSet
|
||||
grouping = None
|
||||
else:
|
||||
# get the path to the ID-block
|
||||
path = data.path_from_id()
|
||||
|
@@ -160,8 +160,8 @@
|
||||
</ThemeWidgetColors>
|
||||
</wcol_menu>
|
||||
<wcol_pulldown>
|
||||
<ThemeWidgetColors outline="#29282e"
|
||||
inner="#29282e99"
|
||||
<ThemeWidgetColors outline="#000000"
|
||||
inner="#29282eff"
|
||||
inner_sel="#505158ff"
|
||||
item="#ffffffff"
|
||||
text="#eeeeee"
|
||||
@@ -936,18 +936,18 @@
|
||||
</ThemeUserPreferences>
|
||||
</user_preferences>
|
||||
<console>
|
||||
<ThemeConsole line_output="#b3c2ff"
|
||||
<ThemeConsole line_output="#6080ff"
|
||||
line_input="#ffffff"
|
||||
line_info="#47b347"
|
||||
line_error="#de6f6f"
|
||||
cursor="#de5959"
|
||||
line_info="#00aa00"
|
||||
line_error="#dc6060"
|
||||
cursor="#dc6060"
|
||||
select="#ffffff30">
|
||||
<space>
|
||||
<ThemeSpaceGeneric back="#2f3035"
|
||||
title="#ffffff"
|
||||
text="#ffffff"
|
||||
text_hi="#ffffff"
|
||||
header="#2f3035ff"
|
||||
header="#29282eff"
|
||||
header_text="#eeeeee"
|
||||
header_text_hi="#ffffff"
|
||||
button="#2f303599"
|
||||
|
@@ -161,7 +161,7 @@
|
||||
</wcol_menu>
|
||||
<wcol_pulldown>
|
||||
<ThemeWidgetColors outline="#000000"
|
||||
inner="#e6e6e699"
|
||||
inner="#3f3f3fff"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#ffffffff"
|
||||
text="#000000"
|
||||
@@ -169,7 +169,7 @@
|
||||
show_shaded="FALSE"
|
||||
shadetop="25"
|
||||
shadedown="-20"
|
||||
roundness="0.3">
|
||||
roundness="0.4">
|
||||
</ThemeWidgetColors>
|
||||
</wcol_pulldown>
|
||||
<wcol_menu_back>
|
||||
|
@@ -865,7 +865,7 @@ class TransformsToDeltasAnim(Operator):
|
||||
|
||||
|
||||
class DupliOffsetFromCursor(Operator):
|
||||
"""Set offset used for collection instances based on cursor position"""
|
||||
"""Set offset used for DupliGroup based on cursor position"""
|
||||
bl_idname = "object.dupli_offset_from_cursor"
|
||||
bl_label = "Set Offset From Cursor"
|
||||
bl_options = {'INTERNAL', 'UNDO'}
|
||||
@@ -876,9 +876,9 @@ class DupliOffsetFromCursor(Operator):
|
||||
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
collection = context.collection
|
||||
group = context.group
|
||||
|
||||
collection.dupli_offset = scene.cursor_location
|
||||
group.dupli_offset = scene.cursor_location
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@@ -19,10 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
from bpy.types import (
|
||||
Operator,
|
||||
Menu,
|
||||
)
|
||||
from bpy.types import Operator
|
||||
from bpy.props import (
|
||||
BoolProperty,
|
||||
EnumProperty,
|
||||
@@ -58,15 +55,6 @@ rna_relative_prop = BoolProperty(
|
||||
default=False,
|
||||
)
|
||||
|
||||
rna_space_type_prop = EnumProperty(
|
||||
name="Type",
|
||||
items=tuple(
|
||||
(e.identifier, e.name, "", e. value)
|
||||
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
|
||||
),
|
||||
default='EMPTY',
|
||||
)
|
||||
|
||||
|
||||
def context_path_validate(context, data_path):
|
||||
try:
|
||||
@@ -2347,29 +2335,21 @@ class WM_OT_tool_set_by_name(Operator):
|
||||
name="Text",
|
||||
description="Display name of the tool",
|
||||
)
|
||||
|
||||
cycle = BoolProperty(
|
||||
name="Cycle",
|
||||
description="Cycle through tools in this group",
|
||||
default=False,
|
||||
options={'SKIP_SAVE'},
|
||||
space_type = EnumProperty(
|
||||
name="Type",
|
||||
items=tuple(
|
||||
(e.identifier, e.name, "", e. value)
|
||||
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
|
||||
),
|
||||
default='EMPTY',
|
||||
)
|
||||
|
||||
space_type = rna_space_type_prop
|
||||
|
||||
def execute(self, context):
|
||||
from bl_ui.space_toolsystem_common import (
|
||||
activate_by_name,
|
||||
activate_by_name_or_cycle,
|
||||
)
|
||||
|
||||
if self.properties.is_property_set("space_type"):
|
||||
from bl_ui.space_toolsystem_common import activate_by_name
|
||||
space_type = self.space_type
|
||||
else:
|
||||
if space_type == 'EMPTY':
|
||||
space_type = context.space_data.type
|
||||
|
||||
fn = activate_by_name_or_cycle if self.cycle else activate_by_name
|
||||
if fn(context, space_type, self.name):
|
||||
if activate_by_name(context, space_type, self.name):
|
||||
return {'FINISHED'}
|
||||
else:
|
||||
self.report({'WARNING'}, f"Tool {self.name!r} not found.")
|
||||
@@ -2389,7 +2369,9 @@ class WM_OT_toolbar(Operator):
|
||||
|
||||
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
||||
if cls is None:
|
||||
self.report({'WARNING'}, f"Toolbar not found for {space_type!r}")
|
||||
# self.report({'WARNING'}, f"Toolbar not found for {space_type!r}")
|
||||
# Passthrough to running search directly.
|
||||
bpy.ops.wm.search_menu('INVOKE_DEFAULT')
|
||||
return {'CANCELLED'}
|
||||
|
||||
wm = context.window_manager
|
||||
@@ -2397,7 +2379,10 @@ class WM_OT_toolbar(Operator):
|
||||
|
||||
def draw_menu(popover, context):
|
||||
layout = popover.layout
|
||||
cls.draw_cls(layout, context, detect_layout=False, scale_y=1.0)
|
||||
cls.draw_cls(layout, context, detect_layout=False)
|
||||
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
layout.operator("wm.search_menu")
|
||||
|
||||
wm.popover(draw_menu, keymap=keymap)
|
||||
return {'FINISHED'}
|
||||
|
@@ -167,8 +167,6 @@ 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):
|
||||
# These are common filtering or ordering operations (same as the default C ones!).
|
||||
@staticmethod
|
||||
|
@@ -37,26 +37,27 @@ class MotionPathButtonsPanel:
|
||||
mps = avs.motion_path
|
||||
|
||||
# Display Range
|
||||
layout.use_property_split = True
|
||||
layout.row().prop(mps, "type")
|
||||
layout.row().prop(mps, "type", expand=True)
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Display Range:")
|
||||
sub = col.column(align=True)
|
||||
if mps.type == 'CURRENT_FRAME':
|
||||
sub.prop(mps, "frame_before", text="Frame Range Before")
|
||||
sub.prop(mps, "frame_before", text="Before")
|
||||
sub.prop(mps, "frame_after", text="After")
|
||||
elif mps.type == 'RANGE':
|
||||
sub.prop(mps, "frame_start", text="Frame Range Start")
|
||||
sub.prop(mps, "frame_start", text="Start")
|
||||
sub.prop(mps, "frame_end", text="End")
|
||||
|
||||
sub.prop(mps, "frame_step", text="Step")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col = split.column()
|
||||
if bones:
|
||||
col.label(text="Cache for Bone:")
|
||||
else:
|
||||
col.label(text="Cache")
|
||||
col.label(text="Cache:")
|
||||
|
||||
if mpath:
|
||||
sub = col.column(align=True)
|
||||
@@ -80,15 +81,17 @@ class MotionPathButtonsPanel:
|
||||
sub.operator("object.paths_calculate", text="Calculate...", icon='OBJECT_DATA')
|
||||
|
||||
# Display Settings
|
||||
split = layout.split()
|
||||
|
||||
layout.label(text="Display")
|
||||
|
||||
col = layout.column()
|
||||
col = split.column()
|
||||
col.label(text="Show:")
|
||||
col.prop(mps, "show_frame_numbers", text="Frame Numbers")
|
||||
if mpath is not None:
|
||||
col.prop(mpath, "lines", text="Lines")
|
||||
col.prop(mpath, "line_thickness", text="Thickness")
|
||||
|
||||
col = split.column()
|
||||
col.label("")
|
||||
col.prop(mps, "show_keyframe_highlight", text="Keyframes")
|
||||
sub = col.column()
|
||||
sub.enabled = mps.show_keyframe_highlight
|
||||
@@ -98,11 +101,11 @@ class MotionPathButtonsPanel:
|
||||
|
||||
# Customize path
|
||||
if mpath is not None:
|
||||
|
||||
col.prop(mpath, "use_custom_color", text="Custom Color")
|
||||
sub = col.column()
|
||||
row = layout.row(align=True)
|
||||
row.prop(mpath, "use_custom_color", text="", toggle=True, icon='COLOR')
|
||||
sub = row.row(align=True)
|
||||
sub.enabled = mpath.use_custom_color
|
||||
sub.prop(mpath, "color")
|
||||
sub.prop(mpath, "color", text="")
|
||||
|
||||
|
||||
# FIXME: this panel still needs to be ported so that it will work correctly with animviz
|
||||
|
@@ -941,7 +941,6 @@ class BONE_PT_constraints(ConstraintButtonsPanel, Panel):
|
||||
for con in context.pose_bone.constraints:
|
||||
self.draw_constraint(context, con)
|
||||
|
||||
|
||||
classes = (
|
||||
OBJECT_PT_constraints,
|
||||
BONE_PT_constraints,
|
||||
|
@@ -77,13 +77,15 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(arm, "draw_type", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
split = layout.split()
|
||||
|
||||
col = layout.column()
|
||||
col = split.column()
|
||||
col.prop(arm, "show_names", text="Names")
|
||||
col.prop(arm, "show_axes", text="Axes")
|
||||
col.prop(arm, "show_bone_custom_shapes", text="Shapes")
|
||||
col.prop(arm, "show_group_colors", text="Group Colors")
|
||||
|
||||
col = split.column()
|
||||
col.prop(arm, "show_group_colors", text="Colors")
|
||||
if ob:
|
||||
col.prop(ob, "show_x_ray", text="X-Ray")
|
||||
col.prop(arm, "use_deform_delay", text="Delay Refresh")
|
||||
@@ -147,8 +149,7 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
|
||||
|
||||
sub = row.row(align=True)
|
||||
sub.operator("pose.group_assign", text="Assign")
|
||||
# row.operator("pose.bone_group_remove_from", text="Remove")
|
||||
sub.operator("pose.group_unassign", text="Remove")
|
||||
sub.operator("pose.group_unassign", text="Remove") # row.operator("pose.bone_group_remove_from", text="Remove")
|
||||
|
||||
sub = row.row(align=True)
|
||||
sub.operator("pose.group_select", text="Select")
|
||||
@@ -195,11 +196,7 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
|
||||
|
||||
if pose_marker_active is not None:
|
||||
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="")
|
||||
col.operator(
|
||||
"poselib.apply_pose",
|
||||
icon='ZOOM_SELECTED',
|
||||
text="",
|
||||
).pose_index = poselib.pose_markers.active_index
|
||||
col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
|
||||
|
||||
col.operator("poselib.action_sanitize", icon='HELP', text="") # XXX: put in menu?
|
||||
|
||||
@@ -219,19 +216,21 @@ class DATA_PT_ghost(ArmatureButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(arm, "ghost_type", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
split = layout.split()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col = split.column(align=True)
|
||||
|
||||
if arm.ghost_type == 'RANGE':
|
||||
col.prop(arm, "ghost_frame_start", text="Frame Start")
|
||||
col.prop(arm, "ghost_frame_start", text="Start")
|
||||
col.prop(arm, "ghost_frame_end", text="End")
|
||||
col.prop(arm, "ghost_size", text="Step")
|
||||
elif arm.ghost_type == 'CURRENT_FRAME':
|
||||
col.prop(arm, "ghost_step", text="Frame Range")
|
||||
col.prop(arm, "ghost_step", text="Range")
|
||||
col.prop(arm, "ghost_size", text="Step")
|
||||
|
||||
col.prop(arm, "show_only_ghost_selected", text="Display Selected Only")
|
||||
col = split.column()
|
||||
col.label(text="Display:")
|
||||
col.prop(arm, "show_only_ghost_selected", text="Selected Only")
|
||||
|
||||
|
||||
class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
@@ -245,7 +244,6 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
itasc = ob.pose.ik_param
|
||||
@@ -253,37 +251,34 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
layout.prop(ob.pose, "ik_solver")
|
||||
|
||||
if itasc:
|
||||
layout.use_property_split = False
|
||||
layout.row().prop(itasc, "mode", expand=True)
|
||||
layout.use_property_split = True
|
||||
simulation = (itasc.mode == 'SIMULATION')
|
||||
if simulation:
|
||||
layout.prop(itasc, "reiteration_method", expand=False)
|
||||
layout.label(text="Reiteration:")
|
||||
layout.row().prop(itasc, "reiteration_method", expand=True)
|
||||
|
||||
col = layout.column()
|
||||
col.active = not simulation or itasc.reiteration_method != 'NEVER'
|
||||
col.prop(itasc, "precision")
|
||||
col.prop(itasc, "iterations")
|
||||
row = layout.row()
|
||||
row.active = not simulation or itasc.reiteration_method != 'NEVER'
|
||||
row.prop(itasc, "precision")
|
||||
row.prop(itasc, "iterations")
|
||||
|
||||
if simulation:
|
||||
layout.prop(itasc, "use_auto_step")
|
||||
col = layout.column(align=True)
|
||||
row = layout.row()
|
||||
if itasc.use_auto_step:
|
||||
col.prop(itasc, "step_min", text="Steps Min")
|
||||
col.prop(itasc, "step_max", text="Max")
|
||||
row.prop(itasc, "step_min", text="Min")
|
||||
row.prop(itasc, "step_max", text="Max")
|
||||
else:
|
||||
col.prop(itasc, "step_count", text="Steps")
|
||||
row.prop(itasc, "step_count")
|
||||
|
||||
layout.prop(itasc, "solver")
|
||||
if simulation:
|
||||
layout.prop(itasc, "feedback")
|
||||
layout.prop(itasc, "velocity_max")
|
||||
if itasc.solver == 'DLS':
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
col.prop(itasc, "damping_max", text="Damping Max", slider=True)
|
||||
col.prop(itasc, "damping_epsilon", text="Damping Epsilon", slider=True)
|
||||
|
||||
row = layout.row()
|
||||
row.prop(itasc, "damping_max", text="Damp", slider=True)
|
||||
row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
|
||||
|
||||
from .properties_animviz import (
|
||||
MotionPathButtonsPanel,
|
||||
|
@@ -62,63 +62,88 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
|
||||
col = layout.column()
|
||||
|
||||
if bone and ob:
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.prop(pchan, "location")
|
||||
col.active = not (bone.parent and bone.use_connect)
|
||||
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "location")
|
||||
sub.prop(pchan, "lock_location", text="")
|
||||
|
||||
col = layout.column()
|
||||
col = row.column()
|
||||
if pchan.rotation_mode == 'QUATERNION':
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_quaternion", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(pchan, "lock_rotation_w", text="")
|
||||
subsub.prop(pchan, "lock_rotation", text="")
|
||||
col.prop(pchan, "rotation_quaternion", text="Rotation")
|
||||
elif pchan.rotation_mode == 'AXIS_ANGLE':
|
||||
#col.label(text="Rotation")
|
||||
#col.prop(pchan, "rotation_angle", text="Angle")
|
||||
#col.prop(pchan, "rotation_axis", text="Axis")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_axis_angle", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(pchan, "lock_rotation_w", text="")
|
||||
subsub.prop(pchan, "lock_rotation", text="")
|
||||
col.prop(pchan, "rotation_axis_angle", text="Rotation")
|
||||
else:
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_euler", text="Rotation")
|
||||
sub.prop(pchan, "lock_rotation", text="")
|
||||
col.prop(pchan, "rotation_euler", text="Rotation")
|
||||
|
||||
col = layout.column()
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "scale")
|
||||
sub.prop(pchan, "lock_scale", text="")
|
||||
row.column().prop(pchan, "scale")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(pchan, "rotation_mode")
|
||||
layout.prop(pchan, "rotation_mode")
|
||||
|
||||
elif context.edit_bone:
|
||||
bone = context.edit_bone
|
||||
col = layout.column()
|
||||
col.prop(bone, "head")
|
||||
col.prop(bone, "tail")
|
||||
row = layout.row()
|
||||
row.column().prop(bone, "head")
|
||||
row.column().prop(bone, "tail")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(bone, "roll")
|
||||
col.prop(bone, "lock")
|
||||
col = row.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Roll:")
|
||||
sub.prop(bone, "roll", text="")
|
||||
sub.label()
|
||||
sub.prop(bone, "lock")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(bone, "tail_radius")
|
||||
col.prop(bone, "envelope_distance")
|
||||
|
||||
class BONE_PT_transform_locks(BoneButtonsPanel, Panel):
|
||||
bl_label = "Transform Locks"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
return ob and ob.mode == 'POSE' and context.bone
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
split = layout.split(percentage=0.1)
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="")
|
||||
col.label(text="X:")
|
||||
col.label(text="Y:")
|
||||
col.label(text="Z:")
|
||||
|
||||
col = split.column()
|
||||
col.active = not (bone.parent and bone.use_connect)
|
||||
col.prop(pchan, "lock_location", text="Location")
|
||||
|
||||
col = split.column()
|
||||
col.prop(pchan, "lock_rotation", text="Rotation")
|
||||
|
||||
col = split.column()
|
||||
col.prop(pchan, "lock_scale", text="Scale")
|
||||
|
||||
if pchan.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
|
||||
row = layout.row()
|
||||
row.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
|
||||
|
||||
sub = row.row()
|
||||
sub.active = pchan.lock_rotations_4d
|
||||
sub.prop(pchan, "lock_rotation_w", text="W")
|
||||
|
||||
|
||||
class BONE_PT_curved(BoneButtonsPanel, Panel):
|
||||
@@ -141,52 +166,54 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
|
||||
bbone = bone
|
||||
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
layout.prop(bone, "bbone_segments", text="Segments")
|
||||
|
||||
col = layout.column()
|
||||
col.active = bone.bbone_segments > 1
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_curveinx", text="Curve In X")
|
||||
col.prop(bbone, "bbone_curveiny", text="In Y")
|
||||
row = col.row()
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Curve XY Offsets:")
|
||||
sub.prop(bbone, "bbone_curveinx", text="In X")
|
||||
sub.prop(bbone, "bbone_curveoutx", text="Out X")
|
||||
sub.prop(bbone, "bbone_curveiny", text="In Y")
|
||||
sub.prop(bbone, "bbone_curveouty", text="Out Y")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_curveoutx", text="Curve Out X")
|
||||
col.prop(bbone, "bbone_curveouty", text="Out Y")
|
||||
sub = row.column(align=True)
|
||||
sub.label("Roll:")
|
||||
sub.prop(bbone, "bbone_rollin", text="In")
|
||||
sub.prop(bbone, "bbone_rollout", text="Out")
|
||||
sub.prop(bone, "use_endroll_as_inroll")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_rollin", text="Roll In")
|
||||
col.prop(bbone, "bbone_rollout", text="Out")
|
||||
col.prop(bone, "use_endroll_as_inroll")
|
||||
row = col.row()
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Scale:")
|
||||
sub.prop(bbone, "bbone_scalein", text="In")
|
||||
sub.prop(bbone, "bbone_scaleout", text="Out")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_scalein", text="Scale In")
|
||||
col.prop(bbone, "bbone_scaleout", text="Out")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_easein", text="Ease In")
|
||||
col.prop(bbone, "bbone_easeout", text="Out")
|
||||
sub = row.column(align=True)
|
||||
sub.label("Easing:")
|
||||
sub.prop(bbone, "bbone_easein", text="In")
|
||||
sub.prop(bbone, "bbone_easeout", text="Out")
|
||||
|
||||
if pchan:
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.use_property_split = False
|
||||
col.prop(pchan, "use_bbone_custom_handles")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.active = pchan.use_bbone_custom_handles
|
||||
col.use_property_split = True
|
||||
row = col.row()
|
||||
row.active = pchan.use_bbone_custom_handles
|
||||
|
||||
sub = col.column()
|
||||
sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="Custom Handle Start")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="End")
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="In:")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="")
|
||||
sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative Handle Start")
|
||||
sub.prop(pchan, "use_bbone_relative_end_handle", text="End")
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Out:")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="")
|
||||
sub.prop(pchan, "use_bbone_relative_end_handle", text="Relative")
|
||||
|
||||
|
||||
class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
@@ -194,7 +221,6 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
@@ -206,22 +232,26 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
elif bone is None:
|
||||
bone = context.edit_bone
|
||||
|
||||
col = layout.column()
|
||||
col.use_property_split = False
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Layers:")
|
||||
col.prop(bone, "layers", text="")
|
||||
col.use_property_split = True
|
||||
col = layout.column()
|
||||
|
||||
col.separator()
|
||||
|
||||
if context.bone:
|
||||
col.prop(bone, "parent")
|
||||
else:
|
||||
col.prop_search(bone, "parent", arm, "edit_bones")
|
||||
|
||||
if ob and pchan:
|
||||
col.label(text="Bone Group:")
|
||||
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="")
|
||||
col.label(text="Object Children:")
|
||||
col.prop(bone, "use_relative_parent")
|
||||
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="Bone Group")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Parent:")
|
||||
if context.bone:
|
||||
col.prop(bone, "parent", text="")
|
||||
else:
|
||||
col.prop_search(bone, "parent", arm, "edit_bones", text="")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (bone.parent is not None)
|
||||
@@ -244,7 +274,6 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
|
||||
# note. this works ok in edit-mode but isn't
|
||||
# all that useful so disabling for now.
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
@@ -256,20 +285,23 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
|
||||
bone = context.edit_bone
|
||||
|
||||
if bone:
|
||||
split = layout.split()
|
||||
|
||||
col = layout.column()
|
||||
col = split.column()
|
||||
col.prop(bone, "hide", text="Hide")
|
||||
sub = col.column()
|
||||
sub.active = bool(pchan and pchan.custom_shape)
|
||||
sub.prop(bone, "show_wire", text="Wireframe")
|
||||
|
||||
if pchan:
|
||||
col = layout.column()
|
||||
col.prop(pchan, "custom_shape")
|
||||
col = split.column()
|
||||
|
||||
col.label(text="Custom Shape:")
|
||||
col.prop(pchan, "custom_shape", text="")
|
||||
if pchan.custom_shape:
|
||||
col.prop(pchan, "use_custom_shape_bone_size", text="Bone Size")
|
||||
col.prop(pchan, "custom_shape_scale", text="Scale")
|
||||
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones")
|
||||
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
|
||||
|
||||
|
||||
class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
@@ -283,82 +315,80 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
row = layout.row()
|
||||
|
||||
active = pchan.is_in_ik_chain
|
||||
|
||||
col = layout.column()
|
||||
col.prop(pchan, "ik_stretch", slider=True)
|
||||
col.active = active
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_x", text="X")
|
||||
split.active = active
|
||||
row = split.row()
|
||||
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
|
||||
row.active = pchan.lock_ik_x is False and active
|
||||
|
||||
layout.separator()
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.prop(pchan, "lock_ik_x", text="Lock IK X")
|
||||
col.prop(pchan, "lock_ik_y", text="Y")
|
||||
col.prop(pchan, "lock_ik_z", text="Z")
|
||||
|
||||
col = layout.column(align=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(pchan, "use_ik_limit_x", text="Limit")
|
||||
sub.active = pchan.lock_ik_x is False and active
|
||||
sub.prop(pchan, "ik_stiffness_x", text="Stiffness X", slider=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_y is False and active
|
||||
sub.prop(pchan, "ik_stiffness_y", text="Y", slider=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub.prop(pchan, "ik_stiffness_z", text="Z", slider=True)
|
||||
|
||||
col = layout.column(align=True)
|
||||
|
||||
sub = col.column()
|
||||
sub.active = pchan.lock_ik_x is False and active
|
||||
sub.prop(pchan, "use_ik_limit_x", text="Limit X")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_x", text="")
|
||||
sub.prop(pchan, "ik_max_x", text="")
|
||||
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
|
||||
sub.prop(pchan, "ik_min_x", text="Min")
|
||||
sub.prop(pchan, "ik_max_x", text="Max")
|
||||
|
||||
col.separator()
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_y", text="Y")
|
||||
split.active = active
|
||||
row = split.row()
|
||||
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
|
||||
row.active = pchan.lock_ik_y is False and active
|
||||
|
||||
sub = col.column()
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
|
||||
sub.prop(pchan, "use_ik_limit_y", text="Limit")
|
||||
sub.active = pchan.lock_ik_y is False and active
|
||||
sub.prop(pchan, "use_ik_limit_y", text="Limit Y")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_y", text="")
|
||||
sub.prop(pchan, "ik_max_y", text="")
|
||||
sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active
|
||||
sub.prop(pchan, "ik_min_y", text="Min")
|
||||
sub.prop(pchan, "ik_max_y", text="Max")
|
||||
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_z", text="Z")
|
||||
split.active = active
|
||||
sub = split.row()
|
||||
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub.prop(pchan, "use_ik_limit_z", text="Limit Z")
|
||||
|
||||
sub = col.column(align=True)
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
|
||||
sub.prop(pchan, "use_ik_limit_z", text="Limit")
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_z", text="")
|
||||
sub.prop(pchan, "ik_max_z", text="")
|
||||
sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and active
|
||||
sub.prop(pchan, "ik_min_z", text="Min")
|
||||
sub.prop(pchan, "ik_max_z", text="Max")
|
||||
|
||||
col.separator()
|
||||
split = layout.split(percentage=0.25)
|
||||
split.label(text="Stretch:")
|
||||
sub = split.row()
|
||||
sub.prop(pchan, "ik_stretch", text="", slider=True)
|
||||
sub.active = active
|
||||
|
||||
if ob.pose.ik_solver == 'ITASC':
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.prop(pchan, "use_ik_rotation_control", text="Control Rotation")
|
||||
col.active = active
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(pchan, "ik_rotation_weight", text="IK Rotation Weight", slider=True)
|
||||
col = split.column()
|
||||
col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True)
|
||||
col.active = active
|
||||
# not supported yet
|
||||
#row = layout.row()
|
||||
@@ -380,7 +410,6 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
bone = context.bone
|
||||
|
||||
@@ -389,15 +418,17 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
|
||||
|
||||
layout.active = bone.use_deform
|
||||
|
||||
col = layout.column()
|
||||
col.prop(bone, "envelope_distance", text="Envelope Distance")
|
||||
col.prop(bone, "envelope_weight", text="Envelope Weight")
|
||||
col.prop(bone, "use_envelope_multiply", text="Envelope Multiply")
|
||||
row = layout.row()
|
||||
|
||||
col.separator()
|
||||
col = row.column(align=True)
|
||||
col.label(text="Envelope:")
|
||||
col.prop(bone, "envelope_distance", text="Distance")
|
||||
col.prop(bone, "envelope_weight", text="Weight")
|
||||
col.prop(bone, "use_envelope_multiply", text="Multiply")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(bone, "head_radius", text="Radius Head")
|
||||
col = row.column(align=True)
|
||||
col.label(text="Envelope Radius:")
|
||||
col.prop(bone, "head_radius", text="Head")
|
||||
col.prop(bone, "tail_radius", text="Tail")
|
||||
|
||||
|
||||
@@ -417,6 +448,7 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
|
||||
classes = (
|
||||
BONE_PT_context_bone,
|
||||
BONE_PT_transform,
|
||||
BONE_PT_transform_locks,
|
||||
BONE_PT_curved,
|
||||
BONE_PT_relations,
|
||||
BONE_PT_display,
|
||||
|
@@ -76,22 +76,21 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
|
||||
layout.prop(cam, "type")
|
||||
layout.row().prop(cam, "type", expand=True)
|
||||
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
if cam.type == 'PERSP':
|
||||
col = layout.column()
|
||||
row = col.row()
|
||||
if cam.lens_unit == 'MILLIMETERS':
|
||||
col.prop(cam, "lens")
|
||||
row.prop(cam, "lens")
|
||||
elif cam.lens_unit == 'FOV':
|
||||
row.prop(cam, "angle")
|
||||
col.prop(cam, "lens_unit")
|
||||
row.prop(cam, "lens_unit", text="")
|
||||
|
||||
elif cam.type == 'ORTHO':
|
||||
col.prop(cam, "ortho_scale")
|
||||
@@ -100,37 +99,40 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
|
||||
engine = context.engine
|
||||
if engine == 'CYCLES':
|
||||
ccam = cam.cycles
|
||||
col.prop(ccam, "panorama_type")
|
||||
col.prop(ccam, "panorama_type", text="Type")
|
||||
if ccam.panorama_type == 'FISHEYE_EQUIDISTANT':
|
||||
col.prop(ccam, "fisheye_fov")
|
||||
elif ccam.panorama_type == 'FISHEYE_EQUISOLID':
|
||||
col.prop(ccam, "fisheye_lens", text="Lens")
|
||||
col.prop(ccam, "fisheye_fov")
|
||||
row = layout.row()
|
||||
row.prop(ccam, "fisheye_lens", text="Lens")
|
||||
row.prop(ccam, "fisheye_fov")
|
||||
elif ccam.panorama_type == 'EQUIRECTANGULAR':
|
||||
sub = col.column(align=True)
|
||||
sub.prop(ccam, "latitude_min", text="Latitute Min")
|
||||
sub.prop(ccam, "latitude_max", text="Max")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(ccam, "longitude_min", text="Longiture Min")
|
||||
sub.prop(ccam, "longitude_max", text="Max")
|
||||
row = layout.row()
|
||||
sub = row.column(align=True)
|
||||
sub.prop(ccam, "latitude_min")
|
||||
sub.prop(ccam, "latitude_max")
|
||||
sub = row.column(align=True)
|
||||
sub.prop(ccam, "longitude_min")
|
||||
sub.prop(ccam, "longitude_max")
|
||||
elif engine in {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}:
|
||||
row = col.row()
|
||||
if cam.lens_unit == 'MILLIMETERS':
|
||||
col.prop(cam, "lens")
|
||||
row.prop(cam, "lens")
|
||||
elif cam.lens_unit == 'FOV':
|
||||
col.prop(cam, "angle")
|
||||
col.prop(cam, "lens_unit")
|
||||
row.prop(cam, "angle")
|
||||
row.prop(cam, "lens_unit", text="")
|
||||
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
split = layout.split()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cam, "shift_x", text="Shift X")
|
||||
sub.prop(cam, "shift_y", text="Y")
|
||||
col = split.column(align=True)
|
||||
col.label(text="Shift:")
|
||||
col.prop(cam, "shift_x", text="X")
|
||||
col.prop(cam, "shift_y", text="Y")
|
||||
|
||||
col.separator()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cam, "clip_start", text="Clip Start")
|
||||
sub.prop(cam, "clip_end", text="End")
|
||||
col = split.column(align=True)
|
||||
col.label(text="Clipping:")
|
||||
col.prop(cam, "clip_start", text="Start")
|
||||
col.prop(cam, "clip_end", text="End")
|
||||
|
||||
|
||||
class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
@@ -145,8 +147,6 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
render = context.scene.render
|
||||
st = context.camera.stereo
|
||||
cam = context.camera
|
||||
@@ -154,9 +154,9 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
is_spherical_stereo = cam.type != 'ORTHO' and render.use_spherical_stereo
|
||||
use_spherical_stereo = is_spherical_stereo and st.use_spherical_stereo
|
||||
|
||||
layout.prop(st, "convergence_mode")
|
||||
|
||||
col = layout.column()
|
||||
col.row().prop(st, "convergence_mode", expand=True)
|
||||
|
||||
sub = col.column()
|
||||
sub.active = st.convergence_mode != 'PARALLEL'
|
||||
sub.prop(st, "convergence_distance")
|
||||
@@ -165,20 +165,20 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
|
||||
if is_spherical_stereo:
|
||||
col.separator()
|
||||
col.prop(st, "use_spherical_stereo")
|
||||
sub = col.column()
|
||||
row = col.row()
|
||||
row.prop(st, "use_spherical_stereo")
|
||||
sub = row.row()
|
||||
sub.active = st.use_spherical_stereo
|
||||
sub.prop(st, "use_pole_merge")
|
||||
row = col.row(align=True)
|
||||
row.active = st.use_pole_merge
|
||||
row.prop(st, "pole_merge_angle_from")
|
||||
row.prop(st, "pole_merge_angle_to")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = st.use_pole_merge
|
||||
sub.prop(st, "pole_merge_angle_from", text="Pole Merge Angle Start")
|
||||
sub.prop(st, "pole_merge_angle_to", text="End")
|
||||
|
||||
col = layout.column()
|
||||
col.active = not use_spherical_stereo
|
||||
col.separator()
|
||||
col.prop(st, "pivot")
|
||||
col.label(text="Pivot:")
|
||||
row = col.row()
|
||||
row.active = not use_spherical_stereo
|
||||
row.prop(st, "pivot", expand=True)
|
||||
|
||||
|
||||
class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
@@ -196,55 +196,57 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
row.operator("camera.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("camera.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
layout.use_property_split = True
|
||||
layout.label(text="Sensor:")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cam, "sensor_fit")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
if cam.sensor_fit == 'AUTO':
|
||||
col.prop(cam, "sensor_width")
|
||||
col.prop(cam, "sensor_width", text="Size")
|
||||
else:
|
||||
sub = col.column(align=True)
|
||||
sub.active = cam.sensor_fit == 'HORIZONTAL'
|
||||
sub.prop(cam, "sensor_width", text="Width")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = cam.sensor_fit == 'VERTICAL'
|
||||
sub.prop(cam, "sensor_height", text="Height")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(cam, "sensor_fit", text="")
|
||||
|
||||
|
||||
class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
|
||||
bl_label = "Depth of Field"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
dof_options = cam.gpu_dof
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cam, "dof_object", text="Focus on Object")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Focus:")
|
||||
col.prop(cam, "dof_object", text="")
|
||||
sub = col.column()
|
||||
sub.active = (cam.dof_object is None)
|
||||
sub.prop(cam, "dof_distance", text="Focus Distance")
|
||||
|
||||
col.separator()
|
||||
sub.prop(cam, "dof_distance", text="Distance")
|
||||
|
||||
if context.engine == 'BLENDER_EEVEE':
|
||||
col = layout.column()
|
||||
col.label("Aperture")
|
||||
col = split.column(align=True)
|
||||
col.label("Aperture:")
|
||||
engine = context.engine
|
||||
col.prop(dof_options, "fstop")
|
||||
col.prop(dof_options, "blades")
|
||||
col.prop(dof_options, "rotation")
|
||||
col.prop(dof_options, "ratio")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(dof_options, "fstop")
|
||||
sub.prop(dof_options, "blades")
|
||||
sub.prop(dof_options, "rotation")
|
||||
sub.prop(dof_options, "ratio")
|
||||
else:
|
||||
hq_support = dof_options.is_hq_supported
|
||||
col = layout.column()
|
||||
col.label("Viewport")
|
||||
col = split.column(align=True)
|
||||
col.label("Viewport:")
|
||||
sub = col.column()
|
||||
sub.active = hq_support
|
||||
sub.prop(dof_options, "use_high_quality")
|
||||
@@ -356,21 +358,24 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
|
||||
|
||||
class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
bl_label = "Display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
|
||||
split = layout.split()
|
||||
split.label()
|
||||
split.prop_menu_enum(cam, "show_guide")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col = split.column()
|
||||
col.prop(cam, "show_limits", text="Limits")
|
||||
col.prop(cam, "show_mist", text="Mist")
|
||||
|
||||
col.prop(cam, "show_sensor", text="Sensor")
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
|
||||
col = split.column()
|
||||
col.prop_menu_enum(cam, "show_guide")
|
||||
col.separator()
|
||||
col.prop(cam, "draw_size", text="Size")
|
||||
col.separator()
|
||||
@@ -379,13 +384,6 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
sub.active = cam.show_passepartout
|
||||
sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(cam, "show_limits", text="Limits")
|
||||
col.prop(cam, "show_mist", text="Mist")
|
||||
col.prop(cam, "show_sensor", text="Sensor")
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
|
||||
|
||||
class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
||||
bl_label = "Safe Areas"
|
||||
@@ -415,30 +413,27 @@ def draw_display_safe_settings(layout, safe_data, settings):
|
||||
show_safe_areas = settings.show_safe_areas
|
||||
show_safe_center = settings.show_safe_center
|
||||
|
||||
layout.use_property_split = True
|
||||
split = layout.split()
|
||||
|
||||
row = layout.row(align=True)
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
row.menu("SAFE_AREAS_MT_presets", text=bpy.types.SAFE_AREAS_MT_presets.bl_label)
|
||||
row.operator("safe_areas.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("safe_areas.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.active = show_safe_areas
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(safe_data, "title", slider=True)
|
||||
sub.prop(safe_data, "action", slider=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
col.prop(settings, "show_safe_center", text="Center-Cut Safe Areas")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = show_safe_areas and show_safe_center
|
||||
sub.prop(safe_data, "title_center", slider=True)
|
||||
sub.prop(safe_data, "action_center", slider=True)
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.active = show_safe_areas
|
||||
col.prop(safe_data, "title", slider=True)
|
||||
col.prop(safe_data, "action", slider=True)
|
||||
|
||||
col = split.column()
|
||||
col.active = show_safe_areas and show_safe_center
|
||||
col.prop(safe_data, "title_center", slider=True)
|
||||
col.prop(safe_data, "action_center", slider=True)
|
||||
|
||||
|
||||
classes = (
|
||||
@@ -450,8 +445,8 @@ classes = (
|
||||
DATA_PT_camera_stereoscopy,
|
||||
DATA_PT_camera_dof,
|
||||
DATA_PT_camera_display,
|
||||
DATA_PT_camera_safe_areas,
|
||||
DATA_PT_camera_background_image,
|
||||
DATA_PT_camera_safe_areas,
|
||||
DATA_PT_custom_props_camera,
|
||||
)
|
||||
|
||||
|
@@ -93,42 +93,43 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
|
||||
row = layout.row()
|
||||
row.prop(curve, "dimensions", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_u", text="Resolution Preview U")
|
||||
if is_surf:
|
||||
sub.prop(curve, "resolution_v", text="V")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Resolution:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_u", text="Preview U")
|
||||
sub.prop(curve, "render_resolution_u", text="Render U")
|
||||
if is_surf:
|
||||
sub.prop(curve, "render_resolution_v", text="V")
|
||||
col.separator()
|
||||
|
||||
if is_curve:
|
||||
col.prop(curve, "twist_mode")
|
||||
col.label(text="Twisting:")
|
||||
col.prop(curve, "twist_mode", text="")
|
||||
col.prop(curve, "twist_smooth", text="Smooth")
|
||||
elif is_text:
|
||||
col.label(text="Display:")
|
||||
col.prop(curve, "use_fast_edit", text="Fast Editing")
|
||||
|
||||
if is_curve or is_text:
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
col = split.column()
|
||||
|
||||
if is_surf:
|
||||
sub = col.column()
|
||||
sub.label(text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_v", text="Preview V")
|
||||
sub.prop(curve, "render_resolution_v", text="Render V")
|
||||
|
||||
if is_curve or is_text:
|
||||
col.label(text="Fill:")
|
||||
sub = col.column()
|
||||
sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
|
||||
sub.prop(curve, "fill_mode")
|
||||
sub.prop(curve, "fill_mode", text="")
|
||||
col.prop(curve, "use_fill_deform")
|
||||
|
||||
if is_curve:
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
col.label(text="Path/Curve-Deform:")
|
||||
sub = col.column()
|
||||
sub.prop(curve, "use_radius")
|
||||
sub.prop(curve, "use_stretch")
|
||||
subsub = sub.row()
|
||||
subsub.prop(curve, "use_radius")
|
||||
subsub.prop(curve, "use_stretch")
|
||||
sub.prop(curve, "use_deform_bounds")
|
||||
|
||||
|
||||
@@ -139,17 +140,16 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
col = layout.column()
|
||||
col.prop(curve, "use_uv_as_generated")
|
||||
col.prop(curve, "use_auto_texspace")
|
||||
row = layout.row()
|
||||
row.prop(curve, "use_auto_texspace")
|
||||
row.prop(curve, "use_uv_as_generated")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(curve, "texspace_location")
|
||||
col.prop(curve, "texspace_size")
|
||||
row = layout.row()
|
||||
row.column().prop(curve, "texspace_location", text="Location")
|
||||
row.column().prop(curve, "texspace_size", text="Size")
|
||||
|
||||
layout.operator("curve.match_texture_space")
|
||||
|
||||
@@ -163,65 +163,49 @@ class DATA_PT_geometry_curve(CurveButtonsPanelCurve, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Modification:")
|
||||
col.prop(curve, "offset")
|
||||
col.prop(curve, "extrude")
|
||||
col.label(text="Taper Object:")
|
||||
col.prop(curve, "taper_object", text="")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (curve.bevel_object is None)
|
||||
sub.prop(curve, "extrude")
|
||||
|
||||
col.prop(curve, "taper_object")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = curve.taper_object is not None
|
||||
sub.prop(curve, "use_map_taper")
|
||||
|
||||
|
||||
class DATA_PT_geometry_curve_bevel(CurveButtonsPanelCurve, Panel):
|
||||
bl_label = "Bevel"
|
||||
bl_parent_id = "DATA_PT_geometry_curve"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (type(context.curve) in {Curve, TextCurve})
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.active = (curve.bevel_object is None)
|
||||
sub.prop(curve, "bevel_depth", text="Depth")
|
||||
sub.prop(curve, "bevel_resolution", text="Resolution")
|
||||
|
||||
col.prop(curve, "bevel_object", text="Object")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = curve.bevel_object is not None
|
||||
sub.prop(curve, "use_fill_caps")
|
||||
col = split.column()
|
||||
col.label(text="Bevel:")
|
||||
col.prop(curve, "bevel_depth", text="Depth")
|
||||
col.prop(curve, "bevel_resolution", text="Resolution")
|
||||
col.label(text="Bevel Object:")
|
||||
col.prop(curve, "bevel_object", text="")
|
||||
|
||||
if type(curve) is not TextCurve:
|
||||
col = layout.column(align=True)
|
||||
row = col.row()
|
||||
row.label(text="Bevel Factor:")
|
||||
|
||||
col = layout.column()
|
||||
col.active = (
|
||||
(curve.bevel_depth > 0.0) or
|
||||
(curve.extrude > 0.0) or
|
||||
(curve.bevel_object is not None)
|
||||
)
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "bevel_factor_start", text="Bevel Start")
|
||||
sub.prop(curve, "bevel_factor_end", text="End")
|
||||
(curve.bevel_object is not None))
|
||||
row = col.row(align=True)
|
||||
row.prop(curve, "bevel_factor_mapping_start", text="")
|
||||
row.prop(curve, "bevel_factor_start", text="Start")
|
||||
row = col.row(align=True)
|
||||
row.prop(curve, "bevel_factor_mapping_end", text="")
|
||||
row.prop(curve, "bevel_factor_end", text="End")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "bevel_factor_mapping_start", text="Bevel Mapping Start")
|
||||
sub.prop(curve, "bevel_factor_mapping_end", text="End")
|
||||
row = layout.row()
|
||||
sub = row.row()
|
||||
sub.active = curve.taper_object is not None
|
||||
sub.prop(curve, "use_map_taper")
|
||||
sub = row.row()
|
||||
sub.active = curve.bevel_object is not None
|
||||
sub.prop(curve, "use_fill_caps")
|
||||
|
||||
|
||||
class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
@@ -234,7 +218,6 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
@@ -245,9 +228,8 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
col.prop(curve, "eval_time")
|
||||
|
||||
# these are for paths only
|
||||
col.separator()
|
||||
|
||||
col.prop(curve, "use_path_follow")
|
||||
row = layout.row()
|
||||
row.prop(curve, "use_path_follow")
|
||||
|
||||
|
||||
class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
|
||||
@@ -255,64 +237,65 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
act_spline = curve.splines.active
|
||||
is_surf = type(curve) is SurfaceCurve
|
||||
is_poly = (act_spline.type == 'POLY')
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
|
||||
if is_poly:
|
||||
# These settings are below but its easier to have
|
||||
# polys set aside since they use so few settings
|
||||
row = layout.row()
|
||||
row.label(text="Cyclic:")
|
||||
row.prop(act_spline, "use_cyclic_u", text="U")
|
||||
|
||||
col.prop(act_spline, "use_cyclic_u")
|
||||
col.prop(act_spline, "use_smooth")
|
||||
layout.prop(act_spline, "use_smooth")
|
||||
else:
|
||||
col = split.column()
|
||||
col.label(text="Cyclic:")
|
||||
if act_spline.type == 'NURBS':
|
||||
col.label(text="Bezier:")
|
||||
col.label(text="Endpoint:")
|
||||
col.label(text="Order:")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "use_cyclic_u")
|
||||
if is_surf:
|
||||
sub.prop(act_spline, "use_cyclic_v", text="V")
|
||||
col.label(text="Resolution:")
|
||||
|
||||
col = split.column()
|
||||
col.prop(act_spline, "use_cyclic_u", text="U")
|
||||
|
||||
if act_spline.type == 'NURBS':
|
||||
sub = col.column(align=True)
|
||||
sub = col.column()
|
||||
# sub.active = (not act_spline.use_cyclic_u)
|
||||
sub.prop(act_spline, "use_bezier_u", text="Bezier U")
|
||||
sub.prop(act_spline, "use_bezier_u", text="U")
|
||||
sub.prop(act_spline, "use_endpoint_u", text="U")
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(act_spline, "order_u", text="U")
|
||||
col.prop(act_spline, "resolution_u", text="U")
|
||||
|
||||
if is_surf:
|
||||
subsub = sub.column()
|
||||
subsub.active = (not act_spline.use_cyclic_v)
|
||||
subsub.prop(act_spline, "use_bezier_v", text="V")
|
||||
col = split.column()
|
||||
col.prop(act_spline, "use_cyclic_v", text="V")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "use_endpoint_u", text="Endpoint U")
|
||||
|
||||
if is_surf:
|
||||
subsub = sub.column()
|
||||
subsub.active = (not act_spline.use_cyclic_v)
|
||||
subsub.prop(act_spline, "use_endpoint_v", text="V")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "order_u", text="Order U")
|
||||
|
||||
if is_surf:
|
||||
# its a surface, assume its a nurbs
|
||||
sub = col.column()
|
||||
sub.active = (not act_spline.use_cyclic_v)
|
||||
sub.prop(act_spline, "use_bezier_v", text="V")
|
||||
sub.prop(act_spline, "use_endpoint_v", text="V")
|
||||
sub = col.column()
|
||||
sub.prop(act_spline, "order_v", text="V")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "resolution_u", text="Resolution U")
|
||||
if is_surf:
|
||||
sub.prop(act_spline, "resolution_v", text="V")
|
||||
|
||||
if act_spline.type == 'BEZIER':
|
||||
|
||||
col.separator()
|
||||
col = layout.column()
|
||||
col.label(text="Interpolation:")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (curve.dimensions == '3D')
|
||||
sub.prop(act_spline, "tilt_interpolation", text="Interpolation Tilt")
|
||||
sub.prop(act_spline, "tilt_interpolation", text="Tilt")
|
||||
|
||||
col.prop(act_spline, "radius_interpolation", text="Radius")
|
||||
|
||||
@@ -341,46 +324,42 @@ class DATA_PT_font(CurveButtonsPanelText, Panel):
|
||||
row.label(text="Bold & Italic")
|
||||
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
|
||||
|
||||
layout.separator()
|
||||
# layout.prop(text, "font")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(char, "use_bold", toggle=True)
|
||||
row.prop(char, "use_italic", toggle=True)
|
||||
row.prop(char, "use_underline", toggle=True)
|
||||
row.prop(char, "use_small_caps", toggle=True)
|
||||
|
||||
|
||||
class DATA_PT_font_transform(CurveButtonsPanelText, Panel):
|
||||
bl_label = "Transform"
|
||||
bl_parent_id = "DATA_PT_font"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
text = context.curve
|
||||
char = context.curve.edit_format
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.separator()
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(text, "size", text="Size")
|
||||
col = split.column()
|
||||
col.prop(text, "shear")
|
||||
|
||||
col.separator()
|
||||
split = layout.split()
|
||||
|
||||
col.prop(text, "family")
|
||||
col.prop(text, "follow_curve")
|
||||
col = split.column()
|
||||
col.label(text="Object Font:")
|
||||
col.prop(text, "family", text="")
|
||||
|
||||
col.separator()
|
||||
col = split.column()
|
||||
col.label(text="Text on Curve:")
|
||||
col.prop(text, "follow_curve", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(text, "underline_position", text="Underline Position")
|
||||
sub.prop(text, "underline_height", text="Underline Thickness")
|
||||
sub.label(text="Underline:")
|
||||
sub.prop(text, "underline_position", text="Position")
|
||||
sub.prop(text, "underline_height", text="Thickness")
|
||||
|
||||
col.prop(text, "small_caps_scale", text="Small Caps Scale")
|
||||
col = split.column()
|
||||
col.label(text="Character:")
|
||||
col.prop(char, "use_bold")
|
||||
col.prop(char, "use_italic")
|
||||
col.prop(char, "use_underline")
|
||||
|
||||
row = layout.row()
|
||||
row.prop(text, "small_caps_scale", text="Small Caps")
|
||||
row.prop(char, "use_small_caps")
|
||||
|
||||
|
||||
class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
|
||||
@@ -391,40 +370,23 @@ class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
|
||||
|
||||
text = context.curve
|
||||
|
||||
|
||||
class DATA_PT_paragraph_alignment(CurveButtonsPanelText, Panel):
|
||||
bl_parent_id = "DATA_PT_paragraph"
|
||||
bl_label = "Alignment"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
text = context.curve
|
||||
|
||||
layout.label(text="Horizontal Alignment:")
|
||||
layout.row().prop(text, "align_x", expand=True)
|
||||
|
||||
layout.label(text="Vertical Alignment:")
|
||||
layout.row().prop(text, "align_y", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
class DATA_PT_paragraph_spacing(CurveButtonsPanelText, Panel):
|
||||
bl_parent_id = "DATA_PT_paragraph"
|
||||
bl_label = "Spacing"
|
||||
col = split.column(align=True)
|
||||
col.label(text="Spacing:")
|
||||
col.prop(text, "space_character", text="Letter")
|
||||
col.prop(text, "space_word", text="Word")
|
||||
col.prop(text, "space_line", text="Line")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
text = context.curve
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(text, "space_character", text="Character Spacing")
|
||||
col.prop(text, "space_word", text="Word Spacing")
|
||||
col.prop(text, "space_line", text="Line Spacing")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(text, "offset_x", text="Offset X")
|
||||
col = split.column(align=True)
|
||||
col.label(text="Offset:")
|
||||
col.prop(text, "offset_x", text="X")
|
||||
col.prop(text, "offset_y", text="Y")
|
||||
|
||||
|
||||
@@ -436,7 +398,10 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
|
||||
|
||||
text = context.curve
|
||||
|
||||
layout.operator("font.textbox_add", icon='ZOOMIN')
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.operator("font.textbox_add", icon='ZOOMIN')
|
||||
col = split.column()
|
||||
|
||||
for i, box in enumerate(text.text_boxes):
|
||||
|
||||
@@ -444,16 +409,19 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
|
||||
|
||||
row = boxy.row()
|
||||
|
||||
col = row.column()
|
||||
col.use_property_split = True
|
||||
split = row.split()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(box, "width", text="Size X")
|
||||
sub.prop(box, "height", text="Y")
|
||||
col = split.column(align=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(box, "x", text="Offset X")
|
||||
sub.prop(box, "y", text="Y")
|
||||
col.label(text="Dimensions:")
|
||||
col.prop(box, "width", text="Width")
|
||||
col.prop(box, "height", text="Height")
|
||||
|
||||
col = split.column(align=True)
|
||||
|
||||
col.label(text="Offset:")
|
||||
col.prop(box, "x", text="X")
|
||||
col.prop(box, "y", text="Y")
|
||||
|
||||
row.operator("font.textbox_remove", text="", icon='X', emboss=False).index = i
|
||||
|
||||
@@ -469,14 +437,10 @@ classes = (
|
||||
DATA_PT_shape_curve,
|
||||
DATA_PT_curve_texture_space,
|
||||
DATA_PT_geometry_curve,
|
||||
DATA_PT_geometry_curve_bevel,
|
||||
DATA_PT_pathanim,
|
||||
DATA_PT_active_spline,
|
||||
DATA_PT_font,
|
||||
DATA_PT_font_transform,
|
||||
DATA_PT_paragraph,
|
||||
DATA_PT_paragraph_alignment,
|
||||
DATA_PT_paragraph_spacing,
|
||||
DATA_PT_text_boxes,
|
||||
DATA_PT_custom_props_curve,
|
||||
)
|
||||
|
@@ -36,11 +36,10 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
layout.prop(ob, "empty_draw_type", text="Display As")
|
||||
layout.prop(ob, "empty_draw_type", text="Display")
|
||||
|
||||
if ob.empty_draw_type == 'IMAGE':
|
||||
layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data")
|
||||
@@ -50,11 +49,9 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
|
||||
row = layout.row(align=True)
|
||||
|
||||
layout.prop(ob, "color", text="Transparency", index=3, slider=True)
|
||||
col = layout.col(align=True)
|
||||
col.prop(ob, "empty_image_offset", text="Offset X", index=0)
|
||||
col.prop(ob, "empty_image_offset", text="Y", index=1)
|
||||
|
||||
layout.separator()
|
||||
row = layout.row(align=True)
|
||||
row.prop(ob, "empty_image_offset", text="Offset X", index=0)
|
||||
row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
|
||||
|
||||
layout.prop(ob, "empty_draw_size", text="Size")
|
||||
|
||||
|
@@ -80,27 +80,27 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(lamp, "type", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
split = layout.split()
|
||||
|
||||
col = col.column()
|
||||
col.prop(lamp, "color")
|
||||
col.prop(lamp, "energy")
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "color", text="")
|
||||
sub.prop(lamp, "energy")
|
||||
|
||||
if lamp.type in {'POINT', 'SPOT'}:
|
||||
|
||||
col = col.column()
|
||||
col.label(text="Falloff")
|
||||
col.prop(lamp, "falloff_type")
|
||||
col.prop(lamp, "distance")
|
||||
col.prop(lamp, "shadow_soft_size")
|
||||
sub.label(text="Falloff:")
|
||||
sub.prop(lamp, "falloff_type", text="")
|
||||
sub.prop(lamp, "distance")
|
||||
sub.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
|
||||
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
|
||||
col.label(text="Attenuation Factors:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "linear_attenuation", slider=True, text="Linear")
|
||||
sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
|
||||
|
||||
elif lamp.falloff_type == 'INVERSE_COEFFICIENTS':
|
||||
col.label(text="Inverse Coefficients")
|
||||
col.label(text="Inverse Coefficients:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "constant_coefficient", text="Constant")
|
||||
sub.prop(lamp, "linear_coefficient", text="Linear")
|
||||
@@ -119,31 +119,31 @@ class DATA_PT_EEVEE_lamp(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
layout.row().prop(lamp, "type", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
split = layout.split()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(lamp, "color")
|
||||
col.prop(lamp, "energy")
|
||||
col.prop(lamp, "specular_factor", text="Specular")
|
||||
|
||||
col.separator()
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "color", text="")
|
||||
sub.prop(lamp, "energy")
|
||||
|
||||
if lamp.type in {'POINT', 'SPOT', 'SUN'}:
|
||||
col.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
sub.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
elif lamp.type == 'AREA':
|
||||
col.prop(lamp, "shape")
|
||||
|
||||
sub = col.column(align=True)
|
||||
|
||||
sub = sub.column(align=True)
|
||||
sub.prop(lamp, "shape", text="")
|
||||
if lamp.shape in {'SQUARE', 'DISK'}:
|
||||
sub.prop(lamp, "size")
|
||||
elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}:
|
||||
sub.prop(lamp, "size", text="Size X")
|
||||
sub.prop(lamp, "size_y", text="Y")
|
||||
sub.prop(lamp, "size_y", text="Size Y")
|
||||
|
||||
col = split.column()
|
||||
col.prop(lamp, "specular_factor", text="Specular")
|
||||
|
||||
|
||||
class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
|
||||
@@ -162,81 +162,49 @@ class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
layout.active = lamp.use_shadow
|
||||
split = layout.split()
|
||||
split.active = lamp.use_shadow
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
|
||||
sub.prop(lamp, "shadow_buffer_clip_end", text="End")
|
||||
|
||||
col.prop(lamp, "shadow_buffer_soft", text="Softness")
|
||||
|
||||
col.separator()
|
||||
sub = split.column()
|
||||
col = sub.column(align=True)
|
||||
col.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
|
||||
col.prop(lamp, "shadow_buffer_clip_end", text="Clip End")
|
||||
col = sub.column()
|
||||
col.prop(lamp, "shadow_buffer_soft", text="Soft")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(lamp, "shadow_buffer_bias", text="Bias")
|
||||
col.prop(lamp, "shadow_buffer_exp", text="Exponent")
|
||||
col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
|
||||
|
||||
|
||||
class DATA_PT_EEVEE_shadow_cascaded_shadow_map(DataButtonsPanel, Panel):
|
||||
bl_label = "Cascaded Shadow Map"
|
||||
bl_parent_id = "DATA_PT_EEVEE_shadow"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
lamp = context.lamp
|
||||
engine = context.engine
|
||||
|
||||
return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
lamp = context.lamp
|
||||
layout.use_property_split = True
|
||||
|
||||
if lamp.type == 'SUN':
|
||||
col = layout.column()
|
||||
col.active = lamp.use_shadow
|
||||
col.label("Cascaded Shadow Map:")
|
||||
|
||||
col.prop(lamp, "shadow_cascade_count", text="Count")
|
||||
col.prop(lamp, "shadow_cascade_fade", text="Fade")
|
||||
split = col.split()
|
||||
|
||||
col.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
|
||||
col.prop(lamp, "shadow_cascade_exponent", text="Distribution")
|
||||
sub = split.column()
|
||||
sub.prop(lamp, "shadow_cascade_count", text="Count")
|
||||
sub.prop(lamp, "shadow_cascade_fade", text="Fade")
|
||||
|
||||
sub = split.column()
|
||||
sub.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
|
||||
sub.prop(lamp, "shadow_cascade_exponent", text="Distribution")
|
||||
|
||||
class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel):
|
||||
bl_label = "Contact Shadows"
|
||||
bl_parent_id = "DATA_PT_EEVEE_shadow"
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
lamp = context.lamp
|
||||
engine = context.engine
|
||||
return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
lamp = context.lamp
|
||||
|
||||
layout = self.layout
|
||||
layout.active = lamp.use_shadow
|
||||
layout.prop(lamp, "use_contact_shadow", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
lamp = context.lamp
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
col.active = lamp.use_shadow and lamp.use_contact_shadow
|
||||
layout.separator()
|
||||
|
||||
layout.prop(lamp, "use_contact_shadow")
|
||||
split = layout.split()
|
||||
split.active = lamp.use_contact_shadow
|
||||
col = split.column()
|
||||
col.prop(lamp, "contact_shadow_distance", text="Distance")
|
||||
col.prop(lamp, "contact_shadow_soft_size", text="Softness")
|
||||
col.prop(lamp, "contact_shadow_soft_size", text="Soft")
|
||||
|
||||
col = split.column()
|
||||
col.prop(lamp, "contact_shadow_bias", text="Bias")
|
||||
col.prop(lamp, "contact_shadow_thickness", text="Thickness")
|
||||
|
||||
@@ -304,7 +272,6 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
|
||||
|
||||
class DATA_PT_spot(DataButtonsPanel, Panel):
|
||||
bl_label = "Spot Shape"
|
||||
bl_parent_id = "DATA_PT_EEVEE_lamp"
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
@@ -315,15 +282,16 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(lamp, "spot_size", text="Size")
|
||||
col.prop(lamp, "spot_blend", text="Blend", slider=True)
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "spot_size", text="Size")
|
||||
sub.prop(lamp, "spot_blend", text="Blend", slider=True)
|
||||
col = split.column()
|
||||
col.prop(lamp, "show_cone")
|
||||
|
||||
|
||||
@@ -358,8 +326,6 @@ classes = (
|
||||
DATA_PT_lamp,
|
||||
DATA_PT_EEVEE_lamp,
|
||||
DATA_PT_EEVEE_shadow,
|
||||
DATA_PT_EEVEE_shadow_contact,
|
||||
DATA_PT_EEVEE_shadow_cascaded_shadow_map,
|
||||
DATA_PT_area,
|
||||
DATA_PT_spot,
|
||||
DATA_PT_falloff_curve,
|
||||
|
@@ -57,31 +57,24 @@ class DATA_PT_lattice(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lat = context.lattice
|
||||
|
||||
col = layout.column()
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_u")
|
||||
row.prop(lat, "interpolation_type_u", text="")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lat, "points_u", text="Resolution U")
|
||||
sub.prop(lat, "points_v", text="V")
|
||||
sub.prop(lat, "points_w", text="W")
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_v")
|
||||
row.prop(lat, "interpolation_type_v", text="")
|
||||
|
||||
col.separator()
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_w")
|
||||
row.prop(lat, "interpolation_type_w", text="")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lat, "interpolation_type_u", text="Interpolation U")
|
||||
sub.prop(lat, "interpolation_type_v", text="V")
|
||||
sub.prop(lat, "interpolation_type_w", text="W")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(lat, "use_outside")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop_search(lat, "vertex_group", context.object, "vertex_groups")
|
||||
row = layout.row()
|
||||
row.prop(lat, "use_outside")
|
||||
row.prop_search(lat, "vertex_group", context.object, "vertex_groups", text="")
|
||||
|
||||
|
||||
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -56,32 +56,34 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
probe = context.lightprobe
|
||||
|
||||
# layout.prop(probe, "type")
|
||||
split = layout.split()
|
||||
|
||||
if probe.type == 'GRID':
|
||||
col = layout.column()
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col.prop(probe, "influence_distance", "Distance")
|
||||
col.prop(probe, "falloff")
|
||||
col.prop(probe, "intensity")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(probe, "grid_resolution_x", text="Resolution X")
|
||||
col.label("Resolution:")
|
||||
col.prop(probe, "grid_resolution_x", text="X")
|
||||
col.prop(probe, "grid_resolution_y", text="Y")
|
||||
col.prop(probe, "grid_resolution_z", text="Z")
|
||||
|
||||
elif probe.type == 'PLANAR':
|
||||
col = layout.column()
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col.prop(probe, "influence_distance", "Distance")
|
||||
col.prop(probe, "falloff")
|
||||
else:
|
||||
col = layout.column()
|
||||
col.prop(probe, "influence_type")
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col.prop(probe, "influence_type", text="")
|
||||
|
||||
if probe.influence_type == 'ELIPSOID':
|
||||
col.prop(probe, "influence_distance", "Radius")
|
||||
@@ -91,24 +93,27 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
|
||||
col.prop(probe, "falloff")
|
||||
col.prop(probe, "intensity")
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.prop(probe, "clip_start", text="Clipping Start")
|
||||
col = split.column(align=True)
|
||||
|
||||
col.label("Clipping:")
|
||||
col.prop(probe, "clip_start", text="Start")
|
||||
|
||||
if probe.type != "PLANAR":
|
||||
sub.prop(probe, "clip_end", text="End")
|
||||
col.prop(probe, "clip_end", text="End")
|
||||
|
||||
if probe.type == 'GRID':
|
||||
col.separator()
|
||||
col.label("Visibility")
|
||||
|
||||
col.label("Visibility:")
|
||||
col.prop(probe, "visibility_buffer_bias", "Bias")
|
||||
col.prop(probe, "visibility_bleed_bias", "Bleed Bias")
|
||||
col.prop(probe, "visibility_blur", "Blur")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.label("Visibility Collection:")
|
||||
row = col.row(align=True)
|
||||
row.prop(probe, "visibility_collection")
|
||||
row.prop(probe, "visibility_collection", text="")
|
||||
row.prop(probe, "invert_visibility_collection", text="", icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
@@ -127,14 +132,14 @@ class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
probe = context.lightprobe
|
||||
|
||||
col = layout.column()
|
||||
col.active = probe.use_custom_parallax
|
||||
|
||||
col.prop(probe, "parallax_type")
|
||||
row = col.row()
|
||||
row.prop(probe, "parallax_type", expand=True)
|
||||
|
||||
if probe.parallax_type == 'ELIPSOID':
|
||||
col.prop(probe, "parallax_distance", "Radius")
|
||||
@@ -148,28 +153,31 @@ class DATA_PT_lightprobe_display(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
probe = context.lightprobe
|
||||
|
||||
col = layout.column()
|
||||
row = layout.row()
|
||||
row.prop(probe, "show_data")
|
||||
|
||||
if probe.type != "PLANAR":
|
||||
col.prop(probe, "data_draw_size", text="Size")
|
||||
row.prop(probe, "data_draw_size", text="Size")
|
||||
else:
|
||||
col.prop(ob, "empty_draw_size", text="Arrow Size")
|
||||
row.prop(ob, "empty_draw_size", text="Arrow Size")
|
||||
|
||||
col.prop(probe, "show_data")
|
||||
split = layout.split()
|
||||
|
||||
if probe.type in {'GRID', 'CUBEMAP'}:
|
||||
col = split.column()
|
||||
col.prop(probe, "show_influence")
|
||||
|
||||
col = split.column()
|
||||
col.prop(probe, "show_clip")
|
||||
|
||||
if probe.type == 'CUBEMAP':
|
||||
sub = col.column()
|
||||
sub.active = probe.use_custom_parallax
|
||||
sub.prop(probe, "show_parallax")
|
||||
col = split.column()
|
||||
col.active = probe.use_custom_parallax
|
||||
col.prop(probe, "show_parallax")
|
||||
|
||||
|
||||
classes = (
|
||||
|
@@ -158,18 +158,19 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mesh = context.mesh
|
||||
|
||||
col = layout.column()
|
||||
col.prop(mesh, "show_double_sided")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(mesh, "use_auto_smooth")
|
||||
sub = col.column()
|
||||
sub.active = mesh.use_auto_smooth and not mesh.has_custom_normals
|
||||
sub.prop(mesh, "auto_smooth_angle", text="Angle")
|
||||
|
||||
split.prop(mesh, "show_double_sided")
|
||||
|
||||
|
||||
class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
bl_label = "Texture Space"
|
||||
@@ -178,7 +179,6 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mesh = context.mesh
|
||||
|
||||
@@ -187,9 +187,9 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
layout.separator()
|
||||
|
||||
layout.prop(mesh, "use_auto_texspace")
|
||||
|
||||
layout.prop(mesh, "texspace_location", text="Location")
|
||||
layout.prop(mesh, "texspace_size", text="Size")
|
||||
row = layout.row()
|
||||
row.column().prop(mesh, "texspace_location", text="Location")
|
||||
row.column().prop(mesh, "texspace_size", text="Size")
|
||||
|
||||
|
||||
class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
|
||||
@@ -280,7 +280,6 @@ class DATA_PT_face_maps(MeshButtonsPanel, Panel):
|
||||
sub.operator("object.face_map_select", text="Select")
|
||||
sub.operator("object.face_map_deselect", text="Deselect")
|
||||
|
||||
|
||||
class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
|
||||
bl_label = "Shape Keys"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
@@ -54,18 +54,23 @@ class DATA_PT_metaball(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mball = context.meta_ball
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Resolution:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(mball, "resolution", text="Resolution View")
|
||||
sub.prop(mball, "resolution", text="View")
|
||||
sub.prop(mball, "render_resolution", text="Render")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Settings:")
|
||||
col.prop(mball, "threshold", text="Threshold")
|
||||
col.prop(mball, "update_method")
|
||||
|
||||
layout.label(text="Update:")
|
||||
layout.row().prop(mball, "update_method", expand=True)
|
||||
|
||||
|
||||
class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
|
||||
@@ -75,15 +80,14 @@ class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mball = context.meta_ball
|
||||
|
||||
layout.prop(mball, "use_auto_texspace")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(mball, "texspace_location")
|
||||
col.prop(mball, "texspace_size")
|
||||
row = layout.row()
|
||||
row.column().prop(mball, "texspace_location", text="Location")
|
||||
row.column().prop(mball, "texspace_size", text="Size")
|
||||
|
||||
|
||||
class DATA_PT_metaball_element(DataButtonsPanel, Panel):
|
||||
@@ -95,33 +99,35 @@ class DATA_PT_metaball_element(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
metaelem = context.meta_ball.elements.active
|
||||
|
||||
col = layout.column()
|
||||
layout.prop(metaelem, "type")
|
||||
|
||||
col.prop(metaelem, "type")
|
||||
|
||||
col.separator()
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Settings:")
|
||||
col.prop(metaelem, "stiffness", text="Stiffness")
|
||||
col.prop(metaelem, "use_negative", text="Negative")
|
||||
col.prop(metaelem, "hide", text="Hide")
|
||||
|
||||
sub = col.column(align=True)
|
||||
col = split.column(align=True)
|
||||
|
||||
if metaelem.type in {'CUBE', 'ELLIPSOID'}:
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
sub.prop(metaelem, "size_y", text="Y")
|
||||
sub.prop(metaelem, "size_z", text="Z")
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
col.prop(metaelem, "size_y", text="Y")
|
||||
col.prop(metaelem, "size_z", text="Z")
|
||||
|
||||
elif metaelem.type == 'TUBE':
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
|
||||
elif metaelem.type == 'PLANE':
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
sub.prop(metaelem, "size_y", text="Y")
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
col.prop(metaelem, "size_y", text="Y")
|
||||
|
||||
|
||||
class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -168,6 +168,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
if bpy.app.debug:
|
||||
layout.prop(md, "debug_options")
|
||||
|
||||
|
||||
def BUILD(self, layout, ob, md):
|
||||
split = layout.split()
|
||||
|
||||
@@ -327,10 +328,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
row.prop(md, "delimit")
|
||||
layout_info = layout
|
||||
|
||||
layout_info.label(
|
||||
text=iface_("Face Count: {:,}".format(md.face_count)),
|
||||
translate=False,
|
||||
)
|
||||
layout_info.label(text=iface_("Face Count: {:,}".format(md.face_count)),
|
||||
translate=False)
|
||||
|
||||
def DISPLACE(self, layout, ob, md):
|
||||
has_texture = (md.texture is not None)
|
||||
|
@@ -62,16 +62,14 @@ class DATA_PT_speaker(DataButtonsPanel, Panel):
|
||||
|
||||
speaker = context.speaker
|
||||
|
||||
layout.template_ID(speaker, "sound", open="sound.open_mono")
|
||||
split = layout.split(percentage=0.75)
|
||||
|
||||
layout.use_property_split = True
|
||||
split.template_ID(speaker, "sound", open="sound.open_mono")
|
||||
split.prop(speaker, "muted")
|
||||
|
||||
layout.prop(speaker, "muted")
|
||||
|
||||
col = layout.column()
|
||||
col.active = not speaker.muted
|
||||
col.prop(speaker, "volume", slider=True)
|
||||
col.prop(speaker, "pitch")
|
||||
row = layout.row()
|
||||
row.prop(speaker, "volume")
|
||||
row.prop(speaker, "pitch")
|
||||
|
||||
|
||||
class DATA_PT_distance(DataButtonsPanel, Panel):
|
||||
@@ -81,20 +79,20 @@ class DATA_PT_distance(DataButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
speaker = context.speaker
|
||||
layout.active = not speaker.muted
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(speaker, "volume_min", slider=True, text="Volume Min")
|
||||
sub.prop(speaker, "volume_max", slider=True, text="Max")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label("Volume:")
|
||||
col.prop(speaker, "volume_min", text="Minimum")
|
||||
col.prop(speaker, "volume_max", text="Maximum")
|
||||
col.prop(speaker, "attenuation")
|
||||
|
||||
col.separator()
|
||||
col.prop(speaker, "distance_max", text="Max Distance")
|
||||
col.prop(speaker, "distance_reference", text="Distance Reference")
|
||||
col = split.column()
|
||||
col.label("Distance:")
|
||||
col.prop(speaker, "distance_max", text="Maximum")
|
||||
col.prop(speaker, "distance_reference", text="Reference")
|
||||
|
||||
|
||||
class DATA_PT_cone(DataButtonsPanel, Panel):
|
||||
@@ -104,20 +102,18 @@ class DATA_PT_cone(DataButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
speaker = context.speaker
|
||||
layout.active = not speaker.muted
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(speaker, "cone_angle_outer", text="Angle Outer")
|
||||
sub.prop(speaker, "cone_angle_inner", text="Inner")
|
||||
col = split.column()
|
||||
col.label("Angle:")
|
||||
col.prop(speaker, "cone_angle_outer", text="Outer")
|
||||
col.prop(speaker, "cone_angle_inner", text="Inner")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(speaker, "cone_volume_outer", slider=True)
|
||||
col = split.column()
|
||||
col.label("Volume:")
|
||||
col.prop(speaker, "cone_volume_outer", text="Outer")
|
||||
|
||||
|
||||
class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -85,6 +85,7 @@ class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
|
||||
row.label(module_name)
|
||||
|
||||
|
||||
|
||||
class WORKSPACE_PT_custom_props(WorkSpaceButtonsPanel, PropertyPanel, Panel):
|
||||
_context_path = "workspace"
|
||||
_property_type = bpy.types.WorkSpace
|
||||
@@ -99,3 +100,4 @@ if __name__ == "__main__": # only for live edit.
|
||||
from bpy.utils import register_class
|
||||
for cls in classes:
|
||||
register_class(cls)
|
||||
|
||||
|
@@ -629,7 +629,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
row = layout.row(align=True)
|
||||
row.prop(linestyle, "panel", expand=True)
|
||||
if linestyle.panel == 'STROKES':
|
||||
# Chaining
|
||||
## Chaining
|
||||
layout.prop(linestyle, "use_chaining", text="Chaining:")
|
||||
split = layout.split(align=True)
|
||||
split.active = linestyle.use_chaining
|
||||
@@ -643,7 +643,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
col = split.column()
|
||||
col.prop(linestyle, "use_same_object")
|
||||
|
||||
# Splitting
|
||||
## Splitting
|
||||
layout.label(text="Splitting:")
|
||||
split = layout.split(align=True)
|
||||
# First column
|
||||
@@ -679,7 +679,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
sub.prop(linestyle, "split_dash3", text="D3")
|
||||
sub.prop(linestyle, "split_gap3", text="G3")
|
||||
|
||||
# Sorting
|
||||
## Sorting
|
||||
layout.prop(linestyle, "use_sorting", text="Sorting:")
|
||||
col = layout.column()
|
||||
col.active = linestyle.use_sorting
|
||||
@@ -693,7 +693,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
row = col.row(align=True)
|
||||
row.prop(linestyle, "sort_order", expand=True)
|
||||
|
||||
# Selection
|
||||
## Selection
|
||||
layout.label(text="Selection:")
|
||||
split = layout.split(align=True)
|
||||
# First column
|
||||
@@ -716,12 +716,12 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
sub.active = linestyle.use_chain_count
|
||||
sub.prop(linestyle, "chain_count")
|
||||
|
||||
# Caps
|
||||
## Caps
|
||||
layout.label(text="Caps:")
|
||||
row = layout.row(align=True)
|
||||
row.prop(linestyle, "caps", expand=True)
|
||||
|
||||
# Dashed lines
|
||||
## Dashed lines
|
||||
layout.prop(linestyle, "use_dashed_line", text="Dashed Line:")
|
||||
row = layout.row(align=True)
|
||||
row.active = linestyle.use_dashed_line
|
||||
@@ -788,8 +788,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
props = row.operator(
|
||||
"wm.properties_context_change",
|
||||
text="Go to Linestyle Textures Properties",
|
||||
icon='TEXTURE',
|
||||
)
|
||||
icon='TEXTURE')
|
||||
props.context = 'TEXTURE'
|
||||
|
||||
elif linestyle.panel == 'MISC':
|
||||
|
@@ -242,6 +242,7 @@ class GreasePencilStrokeEditPanel:
|
||||
if is_3d_view:
|
||||
layout.separator()
|
||||
|
||||
|
||||
layout.separator()
|
||||
col = layout.column(align=True)
|
||||
col.operator("gpencil.stroke_subdivide", text="Subdivide")
|
||||
|
@@ -23,7 +23,6 @@ from rna_prop_ui import PropertyPanel
|
||||
from bpy.app.translations import pgettext_iface as iface_
|
||||
from bpy_extras.node_utils import find_node_input, find_output_node
|
||||
|
||||
|
||||
class MATERIAL_MT_specials(Menu):
|
||||
bl_label = "Material Specials"
|
||||
|
||||
@@ -173,11 +172,11 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
|
||||
if mat.use_nodes:
|
||||
panel_node_draw(layout, mat.node_tree, ('OUTPUT_EEVEE_MATERIAL', 'OUTPUT_MATERIAL'))
|
||||
else:
|
||||
layout.use_property_split = True
|
||||
raym = mat.raytrace_mirror
|
||||
layout.prop(mat, "diffuse_color", text="Base Color")
|
||||
layout.prop(mat, "metallic")
|
||||
layout.prop(raym, "reflect_factor", text="Metallic")
|
||||
layout.prop(mat, "specular_intensity", text="Specular")
|
||||
layout.prop(mat, "roughness")
|
||||
layout.prop(raym, "gloss_factor", text="Roughness")
|
||||
|
||||
|
||||
class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
@@ -192,7 +191,6 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
|
||||
@@ -217,27 +215,6 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
row.prop(mat, "use_sss_translucency")
|
||||
|
||||
|
||||
class MATERIAL_PT_viewport(MaterialButtonsPanel, Panel):
|
||||
bl_label = "Viewport Display"
|
||||
bl_context = "material"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.material
|
||||
|
||||
def draw(self, context):
|
||||
mat = context.material
|
||||
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
col.prop(mat, "diffuse_color")
|
||||
col.prop(mat, "specular_color")
|
||||
col.prop(mat, "roughness")
|
||||
|
||||
|
||||
classes = (
|
||||
MATERIAL_MT_specials,
|
||||
MATERIAL_UL_matslots,
|
||||
@@ -246,10 +223,8 @@ classes = (
|
||||
EEVEE_MATERIAL_PT_context_material,
|
||||
EEVEE_MATERIAL_PT_surface,
|
||||
EEVEE_MATERIAL_PT_options,
|
||||
MATERIAL_PT_viewport,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
from bpy.utils import register_class
|
||||
for cls in classes:
|
||||
|
@@ -48,108 +48,129 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
col = layout.column()
|
||||
|
||||
ob = context.object
|
||||
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "location")
|
||||
sub.prop(ob, "lock_location", text="")
|
||||
row = layout.row()
|
||||
|
||||
row.column().prop(ob, "location")
|
||||
if ob.rotation_mode == 'QUATERNION':
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_quaternion", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(ob, "lock_rotation_w", text="")
|
||||
subsub.prop(ob, "lock_rotation", text="")
|
||||
row.column().prop(ob, "rotation_quaternion", text="Rotation")
|
||||
elif ob.rotation_mode == 'AXIS_ANGLE':
|
||||
#row.column().label(text="Rotation")
|
||||
#row.column().prop(pchan, "rotation_angle", text="Angle")
|
||||
#row.column().prop(pchan, "rotation_axis", text="Axis")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_axis_angle", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(ob, "lock_rotation_w", text="")
|
||||
subsub.prop(ob, "lock_rotation", text="")
|
||||
row.column().prop(ob, "rotation_axis_angle", text="Rotation")
|
||||
else:
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_euler", text="Rotation")
|
||||
sub.prop(ob, "lock_rotation", text="")
|
||||
row.column().prop(ob, "rotation_euler", text="Rotation")
|
||||
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "scale")
|
||||
sub.prop(ob, "lock_scale", text="")
|
||||
row.column().prop(ob, "scale")
|
||||
|
||||
col.prop(ob, "rotation_mode")
|
||||
layout.prop(ob, "rotation_mode")
|
||||
|
||||
|
||||
class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Delta Transform"
|
||||
bl_parent_id = "OBJECT_PT_transform"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
col = layout.column()
|
||||
row = layout.row()
|
||||
|
||||
col.column().prop(ob, "delta_location")
|
||||
row.column().prop(ob, "delta_location")
|
||||
if ob.rotation_mode == 'QUATERNION':
|
||||
col.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
|
||||
row.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
|
||||
elif ob.rotation_mode == 'AXIS_ANGLE':
|
||||
#row.column().label(text="Rotation")
|
||||
#row.column().prop(pchan, "delta_rotation_angle", text="Angle")
|
||||
#row.column().prop(pchan, "delta_rotation_axis", text="Axis")
|
||||
#row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation")
|
||||
col.column().label(text="Not for Axis-Angle")
|
||||
row.column().label(text="Not for Axis-Angle")
|
||||
else:
|
||||
col.column().prop(ob, "delta_rotation_euler", text="Delta Rotation")
|
||||
row.column().prop(ob, "delta_rotation_euler", text="Delta Rotation")
|
||||
|
||||
col.column().prop(ob, "delta_scale")
|
||||
row.column().prop(ob, "delta_scale")
|
||||
|
||||
|
||||
class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Relations"
|
||||
class OBJECT_PT_transform_locks(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Transform Locks"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split(percentage=0.1)
|
||||
|
||||
col.prop(ob, "parent")
|
||||
col = split.column(align=True)
|
||||
col.label(text="")
|
||||
col.label(text="X:")
|
||||
col.label(text="Y:")
|
||||
col.label(text="Z:")
|
||||
|
||||
split.column().prop(ob, "lock_location", text="Location")
|
||||
split.column().prop(ob, "lock_rotation", text="Rotation")
|
||||
split.column().prop(ob, "lock_scale", text="Scale")
|
||||
|
||||
if ob.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
|
||||
row = layout.row()
|
||||
row.prop(ob, "lock_rotations_4d", text="Lock Rotation")
|
||||
|
||||
sub = row.row()
|
||||
sub.active = ob.lock_rotations_4d
|
||||
sub.prop(ob, "lock_rotation_w", text="W")
|
||||
|
||||
|
||||
class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Relations"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(ob, "pass_index")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Parent:")
|
||||
col.prop(ob, "parent", text="")
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(ob, "parent_type")
|
||||
sub.prop(ob, "parent_type", text="")
|
||||
parent = ob.parent
|
||||
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
|
||||
sub.prop_search(ob, "parent_bone", parent.data, "bones")
|
||||
sub.prop_search(ob, "parent_bone", parent.data, "bones", text="")
|
||||
sub.active = (parent is not None)
|
||||
|
||||
col = col.column()
|
||||
col.active = (ob.parent is not None)
|
||||
col.prop(ob, "use_slow_parent")
|
||||
sub = col.column()
|
||||
sub.active = (ob.use_slow_parent)
|
||||
sub.prop(ob, "slow_parent_offset", text="Offset")
|
||||
|
||||
col.separator()
|
||||
class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Relations Extras"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
col = layout.column()
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col.prop(ob, "track_axis", text="Tracking Axis")
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Tracking Axes:")
|
||||
col.prop(ob, "track_axis", text="Axis")
|
||||
col.prop(ob, "up_axis", text="Up Axis")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(ob, "pass_index")
|
||||
col = split.column()
|
||||
col.prop(ob, "use_slow_parent")
|
||||
row = col.row()
|
||||
row.active = ((ob.parent is not None) and (ob.use_slow_parent))
|
||||
row.prop(ob, "slow_parent_offset", text="Offset")
|
||||
|
||||
|
||||
class COLLECTION_MT_specials(Menu):
|
||||
@@ -200,12 +221,10 @@ class OBJECT_PT_collections(ObjectButtonsPanel, Panel):
|
||||
|
||||
|
||||
class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Viewport Display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
bl_label = "Display"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
obj = context.object
|
||||
obj_type = obj.type
|
||||
@@ -214,7 +233,9 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
is_empty_image = (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE')
|
||||
is_dupli = (obj.dupli_type != 'NONE')
|
||||
|
||||
col = layout.column(align=True)
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(obj, "show_name", text="Name")
|
||||
col.prop(obj, "show_axis", text="Axis")
|
||||
# Makes no sense for cameras, armatures, etc.!
|
||||
@@ -224,39 +245,48 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
if obj_type == 'MESH' or is_dupli:
|
||||
col.prop(obj, "show_all_edges")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(obj, "show_bounds", text="Bounds")
|
||||
col = layout.column()
|
||||
col.active = obj.show_bounds
|
||||
col.prop(obj, "draw_bounds_type")
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
row.prop(obj, "show_bounds", text="Bounds")
|
||||
sub = row.row()
|
||||
sub.active = obj.show_bounds
|
||||
sub.prop(obj, "draw_bounds_type", text="")
|
||||
|
||||
col = layout.column()
|
||||
if is_geometry:
|
||||
col.prop(obj, "show_texture_space", text="Texture Space")
|
||||
col.prop(obj.display, "show_shadows", text="Shadow")
|
||||
col.prop(obj.display, "show_shadows")
|
||||
|
||||
col.prop(obj, "show_x_ray", text="X-Ray")
|
||||
# if obj_type == 'MESH' or is_empty_image:
|
||||
# col.prop(obj, "show_transparent", text="Transparency")
|
||||
if obj_type == 'MESH' or is_empty_image:
|
||||
col.prop(obj, "show_transparent", text="Transparency")
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
if is_wire:
|
||||
# wire objects only use the max. draw type for duplis
|
||||
col.active = is_dupli
|
||||
col.prop(
|
||||
obj, "draw_type",
|
||||
text="Maximum Dupli Draw Type" if is_wire else "Maximum Dupli Draw Type",
|
||||
)
|
||||
col.label(text="Maximum Dupli Draw Type:")
|
||||
else:
|
||||
col.label(text="Maximum Draw Type:")
|
||||
col.prop(obj, "draw_type", text="")
|
||||
|
||||
col = layout.column()
|
||||
col = split.column()
|
||||
if is_geometry or is_empty_image:
|
||||
# Only useful with object having faces/materials...
|
||||
col.prop(obj, "color")
|
||||
col.label(text="Object Color:")
|
||||
col.prop(obj, "color", text="")
|
||||
|
||||
col = layout.column()
|
||||
col.active = bool(is_dupli or obj.particle_systems)
|
||||
col.label(text="Duplicator Visibility:")
|
||||
row = col.row(align=True)
|
||||
row.prop(obj, "show_duplicator_for_viewport", text="Viewport")
|
||||
row.prop(obj, "show_duplicator_for_render", text="Render")
|
||||
|
||||
|
||||
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Duplication"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -265,15 +295,14 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(ob, "dupli_type", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
if ob.dupli_type == 'FRAMES':
|
||||
split = layout.split()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col = split.column(align=True)
|
||||
col.prop(ob, "dupli_frames_start", text="Start")
|
||||
col.prop(ob, "dupli_frames_end", text="End")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col = split.column(align=True)
|
||||
col.prop(ob, "dupli_frames_on", text="On")
|
||||
col.prop(ob, "dupli_frames_off", text="Off")
|
||||
|
||||
@@ -283,22 +312,15 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
|
||||
|
||||
elif ob.dupli_type == 'FACES':
|
||||
col = layout.column()
|
||||
col.prop(ob, "use_dupli_faces_scale", text="Scale")
|
||||
sub = col.column()
|
||||
row = layout.row()
|
||||
row.prop(ob, "use_dupli_faces_scale", text="Scale")
|
||||
sub = row.row()
|
||||
sub.active = ob.use_dupli_faces_scale
|
||||
sub.prop(ob, "dupli_faces_scale", text="Inherit Scale")
|
||||
|
||||
elif ob.dupli_type == 'COLLECTION':
|
||||
layout.prop(ob, "dupli_group", text="Collection")
|
||||
|
||||
if ob.dupli_type != 'NONE' or len(ob.particle_systems):
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(ob, "show_duplicator_for_viewport")
|
||||
col.prop(ob, "show_duplicator_for_render")
|
||||
|
||||
|
||||
from .properties_animviz import (
|
||||
MotionPathButtonsPanel,
|
||||
@@ -348,7 +370,9 @@ classes = (
|
||||
OBJECT_PT_context_object,
|
||||
OBJECT_PT_transform,
|
||||
OBJECT_PT_delta_transform,
|
||||
OBJECT_PT_transform_locks,
|
||||
OBJECT_PT_relations,
|
||||
OBJECT_PT_relations_extras,
|
||||
COLLECTION_MT_specials,
|
||||
OBJECT_PT_collections,
|
||||
OBJECT_PT_display,
|
||||
|
@@ -257,7 +257,6 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
|
||||
cloth = context.cloth.settings
|
||||
effector_weights_ui(self, context, cloth.effector_weights, 'CLOTH')
|
||||
|
||||
|
||||
classes = (
|
||||
CLOTH_MT_presets,
|
||||
PHYSICS_PT_cloth,
|
||||
|
@@ -67,13 +67,12 @@ class RENDER_PT_context(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
if rd.has_multiple_engines:
|
||||
layout.prop(rd, "engine", text="Render Engine")
|
||||
layout.prop(rd, "engine", text="")
|
||||
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
@@ -126,7 +125,6 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
@@ -136,47 +134,41 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
row.operator("render.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "resolution_x", text="Resolution X")
|
||||
col.prop(rd, "resolution_y", text="Y")
|
||||
col.prop(rd, "resolution_percentage", text="%")
|
||||
split = layout.split()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "pixel_aspect_x", text="Aspect X")
|
||||
col.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "use_border", text="Border")
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Resolution:")
|
||||
sub.prop(rd, "resolution_x", text="X")
|
||||
sub.prop(rd, "resolution_y", text="Y")
|
||||
sub.prop(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.label(text="Aspect Ratio:")
|
||||
sub.prop(rd, "pixel_aspect_x", text="X")
|
||||
sub.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
row = col.row()
|
||||
row.prop(rd, "use_border", text="Border")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_border
|
||||
sub.prop(rd, "use_crop_to_border", text="Crop")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(scene, "frame_start", text="Frame Start")
|
||||
col.prop(scene, "frame_end", text="End")
|
||||
col.prop(scene, "frame_step", text="Step")
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Frame Range:")
|
||||
sub.prop(scene, "frame_start")
|
||||
sub.prop(scene, "frame_end")
|
||||
sub.prop(scene, "frame_step")
|
||||
|
||||
col = layout.split(percentage=0.5)
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(text="Frame Rate")
|
||||
self.draw_framerate(col, rd)
|
||||
sub.label(text="Frame Rate:")
|
||||
|
||||
self.draw_framerate(sub, rd)
|
||||
|
||||
class RENDER_PT_frame_remapping(RenderButtonsPanel, Panel):
|
||||
bl_label = "Time Remapping"
|
||||
bl_parent_id = "RENDER_PT_dimensions"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "frame_map_old", text="Old")
|
||||
col.prop(rd, "frame_map_new", text="New")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.label(text="Time Remapping:")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.prop(rd, "frame_map_old", text="Old")
|
||||
subrow.prop(rd, "frame_map_new", text="New")
|
||||
|
||||
|
||||
class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
|
||||
@@ -186,15 +178,16 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
col = layout.column(align=True)
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_compositing")
|
||||
col.prop(rd, "use_sequencer")
|
||||
|
||||
col.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
split.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
@@ -204,13 +197,24 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.prop(rd, "use_stamp")
|
||||
col = layout.column()
|
||||
col.active = rd.use_stamp
|
||||
row = col.row()
|
||||
row.prop(rd, "stamp_font_size", text="Font Size")
|
||||
row.prop(rd, "use_stamp_labels", text="Draw Labels")
|
||||
|
||||
row = col.row()
|
||||
row.column().prop(rd, "stamp_foreground", slider=True)
|
||||
row.column().prop(rd, "stamp_background", slider=True)
|
||||
|
||||
layout.label("Enabled Metadata")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col = split.column()
|
||||
col.prop(rd, "use_stamp_time", text="Time")
|
||||
col.prop(rd, "use_stamp_date", text="Date")
|
||||
col.prop(rd, "use_stamp_render_time", text="RenderTime")
|
||||
@@ -218,7 +222,7 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
col.prop(rd, "use_stamp_scene", text="Scene")
|
||||
col.prop(rd, "use_stamp_memory", text="Memory")
|
||||
|
||||
col = split.column(align=True)
|
||||
col = split.column()
|
||||
col.prop(rd, "use_stamp_camera", text="Camera")
|
||||
col.prop(rd, "use_stamp_lens", text="Lens")
|
||||
col.prop(rd, "use_stamp_filename", text="Filename")
|
||||
@@ -226,40 +230,14 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
col.prop(rd, "use_stamp_marker", text="Marker")
|
||||
col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
|
||||
|
||||
if rd.use_sequencer:
|
||||
col.prop(rd, "use_stamp_strip_meta", text="Sequence Strip")
|
||||
|
||||
row = layout.split(percentage=0.3)
|
||||
row = layout.split(percentage=0.2)
|
||||
row.prop(rd, "use_stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_stamp_note
|
||||
sub.prop(rd, "stamp_note_text", text="")
|
||||
|
||||
|
||||
class RENDER_PT_stamp_burn(RenderButtonsPanel, Panel):
|
||||
bl_label = "Burn Into Image"
|
||||
bl_parent_id = "RENDER_PT_stamp"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_stamp", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
col.active = rd.use_stamp
|
||||
col.prop(rd, "stamp_font_size", text="Font Size")
|
||||
col.prop(rd, "use_stamp_labels", text="Draw Labels")
|
||||
col.column().prop(rd, "stamp_foreground", slider=True)
|
||||
col.column().prop(rd, "stamp_background", slider=True)
|
||||
if rd.use_sequencer:
|
||||
layout.label("Sequencer:")
|
||||
layout.prop(rd, "use_stamp_strip_meta")
|
||||
|
||||
|
||||
class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
@@ -268,7 +246,6 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
rd = context.scene.render
|
||||
image_settings = rd.image_settings
|
||||
@@ -276,17 +253,17 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
|
||||
layout.prop(rd, "filepath", text="")
|
||||
|
||||
layout.use_property_split = True
|
||||
split = layout.split()
|
||||
|
||||
col = layout.column(align=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = not rd.is_movie_format
|
||||
sub.prop(rd, "use_overwrite")
|
||||
sub.prop(rd, "use_placeholder")
|
||||
col = split.column()
|
||||
col.active = not rd.is_movie_format
|
||||
col.prop(rd, "use_overwrite")
|
||||
col.prop(rd, "use_placeholder")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_file_extension")
|
||||
col.prop(rd, "use_render_cache")
|
||||
|
||||
layout.use_property_split = False
|
||||
layout.template_image_settings(image_settings, color_management=False)
|
||||
if rd.use_multiview:
|
||||
layout.template_image_views(image_settings)
|
||||
@@ -470,7 +447,6 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -499,7 +475,6 @@ class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -525,7 +500,6 @@ class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -551,8 +525,6 @@ class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -582,32 +554,20 @@ class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
layout.active = props.use_volumetric
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(props, "volumetric_start")
|
||||
sub.prop(props, "volumetric_end")
|
||||
col.prop(props, "volumetric_start")
|
||||
col.prop(props, "volumetric_end")
|
||||
col.prop(props, "volumetric_tile_size")
|
||||
col.separator()
|
||||
col.prop(props, "volumetric_samples")
|
||||
sub.prop(props, "volumetric_sample_distribution")
|
||||
col.separator()
|
||||
col.prop(props, "volumetric_sample_distribution")
|
||||
col.prop(props, "use_volumetric_lights")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = props.use_volumetric_lights
|
||||
sub.prop(props, "volumetric_light_clamp", text="Light Clamping")
|
||||
col.separator()
|
||||
col.prop(props, "volumetric_light_clamp")
|
||||
col.prop(props, "use_volumetric_shadows")
|
||||
sub = col.column()
|
||||
sub.active = props.use_volumetric_shadows
|
||||
sub.prop(props, "volumetric_shadow_samples", text="Shadow Samples")
|
||||
col.separator()
|
||||
col.prop(props, "volumetric_shadow_samples")
|
||||
col.prop(props, "use_volumetric_colored_transmittance")
|
||||
|
||||
|
||||
@@ -627,13 +587,9 @@ class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
layout.active = props.use_sss
|
||||
|
||||
col = layout.column()
|
||||
col.prop(props, "sss_samples")
|
||||
col.prop(props, "sss_jitter_threshold")
|
||||
@@ -656,14 +612,12 @@ class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
col = layout.column()
|
||||
col.active = props.use_ssr
|
||||
col.prop(props, "use_ssr_refraction", text="Refraction")
|
||||
col.prop(props, "use_ssr_refraction")
|
||||
col.prop(props, "use_ssr_halfres")
|
||||
col.prop(props, "ssr_quality")
|
||||
col.prop(props, "ssr_max_roughness")
|
||||
@@ -683,8 +637,6 @@ class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -706,8 +658,6 @@ class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -728,8 +678,6 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -750,52 +698,30 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "filter_size")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "alpha_mode", text="Alpha")
|
||||
|
||||
|
||||
class RENDER_PT_hair(RenderButtonsPanel, Panel):
|
||||
bl_label = "Hair"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
row = layout.row()
|
||||
row.prop(rd, "hair_type", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
layout.prop(rd, "hair_subdiv")
|
||||
|
||||
|
||||
classes = (
|
||||
RENDER_MT_presets,
|
||||
RENDER_MT_ffmpeg_presets,
|
||||
RENDER_MT_framerate_presets,
|
||||
RENDER_PT_context,
|
||||
RENDER_PT_dimensions,
|
||||
RENDER_PT_frame_remapping,
|
||||
RENDER_PT_post_processing,
|
||||
RENDER_PT_stamp,
|
||||
RENDER_PT_output,
|
||||
RENDER_PT_encoding,
|
||||
RENDER_PT_stamp,
|
||||
RENDER_PT_stamp_burn,
|
||||
RENDER_UL_renderviews,
|
||||
RENDER_PT_stereoscopy,
|
||||
RENDER_PT_hair,
|
||||
RENDER_PT_clay_settings,
|
||||
RENDER_PT_eevee_sampling,
|
||||
RENDER_PT_eevee_film,
|
||||
|
@@ -69,12 +69,12 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
|
||||
layout.prop(scene, "camera")
|
||||
layout.prop(scene, "background_set")
|
||||
layout.prop(scene, "active_clip")
|
||||
layout.prop(scene, "background_set", text="Background")
|
||||
layout.prop(scene, "active_clip", text="Active Clip")
|
||||
|
||||
|
||||
class SCENE_PT_unit(SceneButtonsPanel, Panel):
|
||||
@@ -91,18 +91,23 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
|
||||
row.operator("scene.units_length_preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("scene.units_length_preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
layout.use_property_split = True
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(unit, "system")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(unit, "system_rotation")
|
||||
split = layout.split(percentage=0.35)
|
||||
split.label("Length:")
|
||||
split.prop(unit, "system", text="")
|
||||
split = layout.split(percentage=0.35)
|
||||
split.label("Angle:")
|
||||
split.prop(unit, "system_rotation", text="")
|
||||
|
||||
col = layout.column()
|
||||
col.enabled = unit.system != 'NONE'
|
||||
col.prop(unit, "scale_length")
|
||||
col.prop(unit, "use_separate")
|
||||
split = col.split(percentage=0.35)
|
||||
split.label("Unit Scale:")
|
||||
split.prop(unit, "scale_length", text="")
|
||||
split = col.split(percentage=0.35)
|
||||
split.row()
|
||||
split.prop(unit, "use_separate")
|
||||
|
||||
|
||||
class SceneKeyingSetsPanel:
|
||||
@@ -112,17 +117,16 @@ class SceneKeyingSetsPanel:
|
||||
SceneKeyingSetsPanel._draw_keyframing_setting(
|
||||
context, layout, ks, ksp, "Needed",
|
||||
"use_insertkey_override_needed", "use_insertkey_needed",
|
||||
userpref_fallback="use_keyframe_insert_needed",
|
||||
)
|
||||
userpref_fallback="use_keyframe_insert_needed")
|
||||
|
||||
SceneKeyingSetsPanel._draw_keyframing_setting(
|
||||
context, layout, ks, ksp, "Visual",
|
||||
"use_insertkey_override_visual", "use_insertkey_visual",
|
||||
userpref_fallback="use_visual_keying",
|
||||
)
|
||||
userpref_fallback="use_visual_keying")
|
||||
|
||||
SceneKeyingSetsPanel._draw_keyframing_setting(
|
||||
context, layout, ks, ksp, "XYZ to RGB",
|
||||
"use_insertkey_override_xyz_to_rgb", "use_insertkey_xyz_to_rgb",
|
||||
)
|
||||
"use_insertkey_override_xyz_to_rgb", "use_insertkey_xyz_to_rgb")
|
||||
|
||||
@staticmethod
|
||||
def _draw_keyframing_setting(context, layout, ks, ksp, label, toggle_prop, prop, userpref_fallback=None):
|
||||
@@ -160,7 +164,6 @@ class SceneKeyingSetsPanel:
|
||||
|
||||
class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
|
||||
bl_label = "Keying Sets"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
@@ -194,7 +197,6 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
|
||||
|
||||
class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
|
||||
bl_label = "Active Keying Set"
|
||||
bl_parent_id = "SCENE_PT_keying_sets"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
@@ -256,47 +258,22 @@ class SCENE_PT_color_management(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
view = scene.view_settings
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="Display:")
|
||||
col.prop(scene.display_settings, "display_device")
|
||||
col.prop(scene.sequencer_colorspace_settings, "name", text="Sequencer Color Space")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(view, "view_transform")
|
||||
col.prop(view, "exposure")
|
||||
col.prop(view, "gamma")
|
||||
col.prop(view, "look")
|
||||
col.separator()
|
||||
col.label(text="Render:")
|
||||
col.template_colormanaged_view_settings(scene, "view_settings")
|
||||
|
||||
|
||||
class SCENE_PT_color_management_curves(SceneButtonsPanel, Panel):
|
||||
bl_label = "Use Curves"
|
||||
bl_parent_id = "SCENE_PT_color_management"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header(self, context):
|
||||
|
||||
scene = context.scene
|
||||
view = scene.view_settings
|
||||
|
||||
self.layout.prop(view, "use_curve_mapping", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
view = scene.view_settings
|
||||
|
||||
layout.use_property_split = False
|
||||
layout.enabled = view.use_curve_mapping
|
||||
|
||||
layout.template_curve_mapping(view, "curve_mapping", levels=True)
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
col.label(text="Sequencer:")
|
||||
col.prop(scene.sequencer_colorspace_settings, "name")
|
||||
|
||||
|
||||
class SCENE_PT_audio(SceneButtonsPanel, Panel):
|
||||
@@ -306,34 +283,31 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = context.scene.render
|
||||
ffmpeg = rd.ffmpeg
|
||||
|
||||
layout.prop(scene, "audio_volume")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(scene, "audio_distance_model")
|
||||
|
||||
col.prop(ffmpeg, "audio_channels")
|
||||
col.prop(ffmpeg, "audio_mixrate", text="Sample Rate")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(scene, "audio_doppler_speed", text="Doppler Speed")
|
||||
col.prop(scene, "audio_doppler_factor", text="Doppler Factor")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("sound.bake_animation")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label("Distance Model:")
|
||||
col.prop(scene, "audio_distance_model", text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(scene, "audio_doppler_speed", text="Speed")
|
||||
sub.prop(scene, "audio_doppler_factor", text="Doppler")
|
||||
|
||||
col = split.column()
|
||||
col.label("Format:")
|
||||
col.prop(ffmpeg, "audio_channels", text="")
|
||||
col.prop(ffmpeg, "audio_mixrate", text="Rate")
|
||||
|
||||
|
||||
class SCENE_PT_physics(SceneButtonsPanel, Panel):
|
||||
bl_label = "Gravity"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header(self, context):
|
||||
@@ -341,18 +315,16 @@ class SCENE_PT_physics(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
|
||||
layout.active = scene.use_gravity
|
||||
|
||||
layout.prop(scene, "gravity")
|
||||
layout.prop(scene, "gravity", text="")
|
||||
|
||||
|
||||
class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
|
||||
bl_label = "Rigid Body World"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
@@ -396,8 +368,7 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
|
||||
|
||||
|
||||
class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel):
|
||||
bl_label = "Cache"
|
||||
bl_parent_id = "SCENE_PT_rigid_body_world"
|
||||
bl_label = "Rigid Body Cache"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
@@ -414,8 +385,7 @@ class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel):
|
||||
|
||||
|
||||
class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel):
|
||||
bl_label = "Field Weights"
|
||||
bl_parent_id = "SCENE_PT_rigid_body_world"
|
||||
bl_label = "Rigid Body Field Weights"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
@@ -433,7 +403,6 @@ class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel):
|
||||
|
||||
class SCENE_PT_simplify(SceneButtonsPanel, Panel):
|
||||
bl_label = "Simplify"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header(self, context):
|
||||
@@ -442,21 +411,22 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.active = rd.use_simplify
|
||||
|
||||
col = layout.column()
|
||||
col.prop(rd, "simplify_subdivision", text="Max Viewport Subdivision")
|
||||
col.prop(rd, "simplify_child_particles", text="Max Child Particles")
|
||||
split = layout.split()
|
||||
|
||||
col.separator()
|
||||
col = split.column()
|
||||
col.label(text="Viewport:")
|
||||
col.prop(rd, "simplify_subdivision", text="Subdivision")
|
||||
col.prop(rd, "simplify_child_particles", text="Child Particles")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(rd, "simplify_subdivision_render", text="Max Render Subdivision")
|
||||
col.prop(rd, "simplify_child_particles_render", text="Max Child Particles")
|
||||
col = split.column()
|
||||
col.label(text="Render:")
|
||||
col.prop(rd, "simplify_subdivision_render", text="Subdivision")
|
||||
col.prop(rd, "simplify_child_particles_render", text="Child Particles")
|
||||
|
||||
|
||||
class SCENE_PT_viewport_display(SceneButtonsPanel, Panel):
|
||||
@@ -469,29 +439,9 @@ class SCENE_PT_viewport_display(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
col = layout.column()
|
||||
col.prop(scene.display, "light_direction")
|
||||
col.prop(scene.display, "shadow_shift")
|
||||
|
||||
|
||||
class SCENE_PT_viewport_display_ssao(SceneButtonsPanel, Panel):
|
||||
bl_label = "Screen Space Ambient Occlusion"
|
||||
bl_parent_id = "SCENE_PT_viewport_display"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return True
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
col = layout.column()
|
||||
col.prop(scene.display, "matcap_ssao_samples")
|
||||
col.prop(scene.display, "matcap_ssao_distance")
|
||||
col.prop(scene.display, "matcap_ssao_attenuation")
|
||||
layout.prop(scene.display, "light_direction", text="")
|
||||
layout.prop(scene.display, "shadow_shift")
|
||||
|
||||
|
||||
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
|
||||
@@ -508,9 +458,7 @@ classes = (
|
||||
SCENE_PT_keying_sets,
|
||||
SCENE_PT_keying_set_paths,
|
||||
SCENE_PT_color_management,
|
||||
SCENE_PT_color_management_curves,
|
||||
SCENE_PT_viewport_display,
|
||||
SCENE_PT_viewport_display_ssao,
|
||||
SCENE_PT_audio,
|
||||
SCENE_PT_physics,
|
||||
SCENE_PT_rigid_body_world,
|
||||
|
@@ -59,7 +59,6 @@ class TEXTURE_UL_texslots(UIList):
|
||||
layout.alignment = 'CENTER'
|
||||
layout.label(text="", icon_value=icon)
|
||||
|
||||
|
||||
def context_tex_datablock(context):
|
||||
idblock = context.brush
|
||||
if idblock:
|
||||
@@ -107,7 +106,6 @@ class TEXTURE_PT_preview(TextureButtonsPanel, Panel):
|
||||
if isinstance(idblock, Brush):
|
||||
layout.prop(tex, "use_preview_alpha")
|
||||
|
||||
|
||||
class TEXTURE_PT_context(TextureButtonsPanel, Panel):
|
||||
bl_label = ""
|
||||
bl_context = "texture"
|
||||
|
@@ -43,7 +43,7 @@ class VIEWLAYER_PT_layer(ViewLayerButtonsPanel, Panel):
|
||||
rd = scene.render
|
||||
layer = bpy.context.view_layer
|
||||
|
||||
layout.prop(layer, "use", text="Use for Rendering")
|
||||
layout.prop(layer, "use", text="Use for Rendering");
|
||||
layout.prop(rd, "use_single_layer", text="Render Single Layer")
|
||||
|
||||
|
||||
|
@@ -1018,11 +1018,9 @@ class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel):
|
||||
if clip.use_proxy_custom_directory:
|
||||
col.prop(clip.proxy, "directory")
|
||||
|
||||
col.operator(
|
||||
"clip.rebuild_proxy",
|
||||
col.operator("clip.rebuild_proxy",
|
||||
text="Build Proxy / Timecode" if clip.source == 'MOVIE'
|
||||
else "Build Proxy"
|
||||
)
|
||||
else "Build Proxy")
|
||||
|
||||
if clip.source == 'MOVIE':
|
||||
col2 = col.column()
|
||||
@@ -1191,7 +1189,6 @@ class CLIP_PT_tools_grease_pencil_brush(GreasePencilBrushPanel, Panel):
|
||||
class CLIP_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
|
||||
|
||||
class CLIP_MT_view(Menu):
|
||||
bl_label = "View"
|
||||
|
||||
|
@@ -469,66 +469,6 @@ class DOPESHEET_MT_delete(Menu):
|
||||
layout.operator("action.clean", text="Clean Channels").channels = True
|
||||
|
||||
|
||||
class DOPESHEET_MT_specials(Menu):
|
||||
bl_label = "Dope Sheet Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("action.copy", text="Copy")
|
||||
layout.operator("action.paste", text="Paste")
|
||||
layout.operator("action.paste", text="Paste Flipped").flipped = True
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator_menu_enum("action.handle_type", "type", text="Handle Type")
|
||||
layout.operator_menu_enum("action.interpolation_type", "type", text="Interpolation Mode")
|
||||
layout.operator_menu_enum("action.easing_type", "type", text="Easing Type")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("action.keyframe_insert").type = 'SEL'
|
||||
layout.operator("action.duplicate_move")
|
||||
layout.operator("action.delete")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator_menu_enum("action.mirror", "type", text="Mirror")
|
||||
layout.operator_menu_enum("action.snap", "type", text="Snap")
|
||||
|
||||
|
||||
class DOPESHEET_MT_channel_specials(Menu):
|
||||
bl_label = "Dope Sheet Channel Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("anim.channels_setting_enable", text="Mute Channels").type = 'MUTE'
|
||||
layout.operator("anim.channels_setting_disable", text="Unmute Channels").type = 'MUTE'
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_setting_enable", text="Protect Channels").type = 'PROTECT'
|
||||
layout.operator("anim.channels_setting_disable", text="Unprotect Channels").type = 'PROTECT'
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_group")
|
||||
layout.operator("anim.channels_ungroup")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_editable_toggle")
|
||||
layout.operator_menu_enum("action.extrapolation_type", "type", text="Extrapolation Mode")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_expand")
|
||||
layout.operator("anim.channels_collapse")
|
||||
|
||||
layout.separator()
|
||||
layout.operator_menu_enum("anim.channels_move", "direction", text="Move...")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("anim.channels_delete")
|
||||
|
||||
|
||||
classes = (
|
||||
DOPESHEET_HT_header,
|
||||
DOPESHEET_HT_editor_buttons,
|
||||
@@ -542,8 +482,6 @@ classes = (
|
||||
DOPESHEET_MT_gpencil_channel,
|
||||
DOPESHEET_MT_gpencil_frame,
|
||||
DOPESHEET_MT_delete,
|
||||
DOPESHEET_MT_specials,
|
||||
DOPESHEET_MT_channel_specials,
|
||||
)
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
|
@@ -299,76 +299,6 @@ class GRAPH_MT_delete(Menu):
|
||||
layout.operator("graph.clean").channels = False
|
||||
layout.operator("graph.clean", text="Clean Channels").channels = True
|
||||
|
||||
|
||||
class GRAPH_MT_specials(Menu):
|
||||
bl_label = "F-Curve Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("graph.copy", text="Copy")
|
||||
layout.operator("graph.paste", text="Paste")
|
||||
layout.operator("graph.paste", text="Paste Flipped").flipped = True
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator_menu_enum("graph.handle_type", "type", text="Handle Type")
|
||||
layout.operator_menu_enum("graph.interpolation_type", "type", text="Interpolation Mode")
|
||||
layout.operator_menu_enum("graph.easing_type", "type", text="Easing Type")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("graph.keyframe_insert").type = 'SEL'
|
||||
layout.operator("graph.duplicate_move")
|
||||
layout.operator("graph.delete")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator_menu_enum("graph.mirror", "type", text="Mirror")
|
||||
layout.operator_menu_enum("graph.snap", "type", text="Snap")
|
||||
|
||||
|
||||
class GRAPH_MT_channel_specials(Menu):
|
||||
bl_label = "F-Curve Channel Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
st = context.space_data
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_setting_enable", text="Mute Channels").type = 'MUTE'
|
||||
layout.operator("anim.channels_setting_disable", text="Unmute Channels").type = 'MUTE'
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_setting_enable", text="Protect Channels").type = 'PROTECT'
|
||||
layout.operator("anim.channels_setting_disable", text="Unprotect Channels").type = 'PROTECT'
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_group")
|
||||
layout.operator("anim.channels_ungroup")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_editable_toggle")
|
||||
layout.operator_menu_enum("graph.extrapolation_type", "type", text="Extrapolation Mode")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("graph.hide", text="Hide Selected Curves").unselected = False
|
||||
layout.operator("graph.hide", text="Hide Unselected Curves").unselected = True
|
||||
layout.operator("graph.reveal")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("anim.channels_expand")
|
||||
layout.operator("anim.channels_collapse")
|
||||
|
||||
layout.separator()
|
||||
layout.operator_menu_enum("anim.channels_move", "direction", text="Move...")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("anim.channels_delete")
|
||||
if st.mode == 'DRIVERS':
|
||||
layout.operator("graph.driver_delete_invalid")
|
||||
|
||||
|
||||
classes = (
|
||||
GRAPH_HT_header,
|
||||
GRAPH_MT_editor_menus,
|
||||
@@ -379,8 +309,6 @@ classes = (
|
||||
GRAPH_MT_key,
|
||||
GRAPH_MT_key_transform,
|
||||
GRAPH_MT_delete,
|
||||
GRAPH_MT_specials,
|
||||
GRAPH_MT_channel_specials,
|
||||
)
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
|
@@ -422,43 +422,6 @@ class IMAGE_MT_uvs_select_mode(Menu):
|
||||
props.data_path = "tool_settings.uv_select_mode"
|
||||
|
||||
|
||||
class IMAGE_MT_specials(Menu):
|
||||
bl_label = "UV Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
|
||||
# UV Edit Mode
|
||||
if sima.show_uvedit:
|
||||
layout.operator("uv.unwrap")
|
||||
layout.operator("uv.follow_active_quads")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("uv.pin").clear = False
|
||||
layout.operator("uv.pin", text="Unpin").clear = True
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("uv.weld")
|
||||
layout.operator("uv.stitch")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator_enum("uv.align", "axis") # W, 2/3/4
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("transform.mirror", text="Mirror X").constraint_axis[0] = True
|
||||
layout.operator("transform.mirror", text="Mirror Y").constraint_axis[1] = True
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.menu("IMAGE_MT_uvs_snap")
|
||||
|
||||
|
||||
class IMAGE_HT_header(Header):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
|
||||
@@ -621,7 +584,6 @@ class IMAGE_PT_tools_mask(MASK_PT_tools, Panel):
|
||||
bl_region_type = 'TOOLS'
|
||||
bl_category = 'Mask'
|
||||
|
||||
|
||||
class IMAGE_PT_tools_mask_add(MASK_PT_add, Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
@@ -1165,6 +1127,8 @@ class IMAGE_PT_uv_sculpt(Panel, ImagePaintPanel):
|
||||
col.prop(uvsculpt, "show_brush")
|
||||
|
||||
|
||||
|
||||
|
||||
class IMAGE_PT_options_uvs(Panel, UVToolsPanel):
|
||||
bl_label = "UV Options"
|
||||
bl_category = "Options"
|
||||
@@ -1344,7 +1308,6 @@ classes = (
|
||||
IMAGE_MT_uvs_mirror,
|
||||
IMAGE_MT_uvs_weldalign,
|
||||
IMAGE_MT_uvs_select_mode,
|
||||
IMAGE_MT_specials,
|
||||
IMAGE_HT_header,
|
||||
MASK_MT_editor_menus,
|
||||
IMAGE_PT_mask,
|
||||
|
@@ -290,41 +290,6 @@ class NODE_MT_node_color_specials(Menu):
|
||||
layout.operator("node.node_copy_color", icon='COPY_ID')
|
||||
|
||||
|
||||
class NODE_MT_specials(Menu):
|
||||
bl_label = "Node Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
layout.operator("node.duplicate_move")
|
||||
layout.operator("node.delete")
|
||||
layout.operator_context = 'EXEC_DEFAULT'
|
||||
|
||||
layout.operator("node.delete_reconnect")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("node.link_make").replace = False
|
||||
layout.operator("node.link_make", text="Make and Replace Links").replace = True
|
||||
layout.operator("node.links_detach")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("node.group_make", text="Group")
|
||||
layout.operator("node.group_ungroup", text="Ungroup")
|
||||
layout.operator("node.group_edit").exit = False
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("node.hide_toggle")
|
||||
layout.operator("node.mute_toggle")
|
||||
layout.operator("node.preview_toggle")
|
||||
layout.operator("node.hide_socket_toggle")
|
||||
layout.operator("node.options_toggle")
|
||||
layout.operator("node.collapse_hide_unused_toggle")
|
||||
|
||||
|
||||
class NODE_PT_active_node_generic(Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
@@ -542,15 +507,11 @@ class NODE_PT_tools_grease_pencil_sculpt(GreasePencilStrokeSculptPanel, Panel):
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
# Grease Pencil drawing brushes
|
||||
|
||||
|
||||
class NODE_PT_tools_grease_pencil_brush(GreasePencilBrushPanel, Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
# Grease Pencil drawing curves
|
||||
|
||||
|
||||
class NODE_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
@@ -561,7 +522,6 @@ class NODE_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Pane
|
||||
def node_draw_tree_view(layout, context):
|
||||
pass
|
||||
|
||||
|
||||
classes = (
|
||||
NODE_HT_header,
|
||||
NODE_MT_editor_menus,
|
||||
@@ -571,7 +531,6 @@ classes = (
|
||||
NODE_MT_node,
|
||||
NODE_MT_node_color_presets,
|
||||
NODE_MT_node_color_specials,
|
||||
NODE_MT_specials,
|
||||
NODE_PT_active_node_generic,
|
||||
NODE_PT_active_node_color,
|
||||
NODE_PT_active_node_properties,
|
||||
|