Compare commits
1 Commits
temp-keyma
...
tmp-Collec
Author | SHA1 | Date | |
---|---|---|---|
d1e3ba22a0 |
@@ -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
|
||||
)
|
||||
)
|
||||
|
@@ -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()
|
||||
|
@@ -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,9 +11,9 @@ if "%BUILD_ARCH%"=="x64" (
|
||||
)
|
||||
|
||||
if "%WITH_CLANG%"=="1" (
|
||||
set CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -T"LLVM-vs2017"
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
|
||||
)
|
||||
) else (
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
@@ -19,7 +21,6 @@ if "%WITH_CLANG%"=="1" (
|
||||
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" (
|
||||
|
@@ -12,12 +12,7 @@ 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 (
|
||||
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -products * -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
|
||||
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
|
||||
)
|
||||
|
||||
|
@@ -53,10 +53,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" (
|
||||
|
@@ -23,5 +23,3 @@ 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.
|
||||
|
@@ -162,55 +162,33 @@ class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
|
||||
|
||||
if cscene.progressive == 'PATH' or use_branched_path(context) is False:
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "samples", text="Render")
|
||||
col.prop(cscene, "preview_samples", text="Viewport")
|
||||
col.separator()
|
||||
col.prop(cscene, "samples", text="Render Samples")
|
||||
col.prop(cscene, "preview_samples", text="Preview Samples")
|
||||
col.prop(cscene, "use_square_samples") # Duplicate below.
|
||||
else:
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "aa_samples", text="Render Samples")
|
||||
col.prop(cscene, "preview_aa_samples", text="Preview Samples")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="AA Samples")
|
||||
col.prop(cscene, "aa_samples", text="Render")
|
||||
col.prop(cscene, "preview_aa_samples", text="Preview")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Samples")
|
||||
col.prop(cscene, "diffuse_samples", text="Diffuse")
|
||||
col.prop(cscene, "glossy_samples", text="Glossy")
|
||||
col.prop(cscene, "transmission_samples", text="Transmission")
|
||||
col.prop(cscene, "ao_samples", text="AO")
|
||||
col.prop(cscene, "diffuse_samples", text="Diffuse Samples")
|
||||
col.prop(cscene, "glossy_samples", text="Glossy Samples")
|
||||
col.prop(cscene, "transmission_samples", text="Transmission Samples")
|
||||
col.prop(cscene, "ao_samples", text="AO Samples")
|
||||
|
||||
sub = col.row(align=True)
|
||||
sub.active = use_sample_all_lights(context)
|
||||
sub.prop(cscene, "mesh_light_samples", text="Mesh Light")
|
||||
col.prop(cscene, "subsurface_samples", text="Subsurface")
|
||||
col.prop(cscene, "volume_samples", text="Volume")
|
||||
col.separator()
|
||||
sub.prop(cscene, "mesh_light_samples", text="Mesh Light Samples")
|
||||
|
||||
col.prop(cscene, "subsurface_samples", text="Subsurface Samples")
|
||||
col.prop(cscene, "volume_samples", text="Volume Samples")
|
||||
|
||||
col.prop(cscene, "use_square_samples") # Duplicate above.
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "sample_all_lights_direct")
|
||||
col.prop(cscene, "sample_all_lights_indirect")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(cscene, "seed")
|
||||
row.prop(cscene, "use_animated_seed", text="", icon="TIME")
|
||||
|
||||
layout.prop(cscene, "sampling_pattern", text="Pattern")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_sampling_light(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Light"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_sampling"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "light_sampling_threshold", text="Light Threshold")
|
||||
|
||||
@@ -218,6 +196,12 @@ class CYCLES_RENDER_PT_sampling_light(CyclesButtonsPanel, Panel):
|
||||
col.prop(cscene, "sample_clamp_direct")
|
||||
col.prop(cscene, "sample_clamp_indirect")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(cscene, "seed")
|
||||
row.prop(cscene, "use_animated_seed", text="", icon="TIME")
|
||||
|
||||
layout.row().prop(cscene, "sampling_pattern", text="Pattern")
|
||||
|
||||
draw_samples_info(layout, context)
|
||||
|
||||
|
||||
@@ -225,79 +209,38 @@ class CYCLES_RENDER_PT_geometry(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Geometry"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_geometry_subdivision(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Subdivision"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_geometry"
|
||||
|
||||
@classmethod
|
||||
def poll(self, context):
|
||||
return context.scene.cycles.feature_set == 'EXPERIMENTAL'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
ccscene = scene.cycles_curves
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "volume_step_size", text="Volume Step Size")
|
||||
col.prop(cscene, "volume_max_steps", text="Volume Max Steps")
|
||||
|
||||
col.separator()
|
||||
|
||||
if cscene.feature_set == 'EXPERIMENTAL':
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cscene, "dicing_rate", text="Dicing Rate Render")
|
||||
sub.prop(cscene, "preview_dicing_rate", text="Preview")
|
||||
|
||||
col.separator()
|
||||
sub.prop(cscene, "preview_dicing_rate", text="Dicing Rate Preview")
|
||||
|
||||
col.prop(cscene, "offscreen_dicing_scale", text="Offscreen Scale")
|
||||
col.prop(cscene, "max_subdivisions")
|
||||
|
||||
col.prop(cscene, "dicing_camera")
|
||||
|
||||
col.separator()
|
||||
|
||||
class CYCLES_RENDER_PT_geometry_volume(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Volume"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_geometry"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
ccscene = scene.cycles_curves
|
||||
|
||||
layout.prop(ccscene, "use_curves", text="Hair Rendering")
|
||||
col = layout.column()
|
||||
col.prop(cscene, "volume_step_size", text="Step Size")
|
||||
col.prop(cscene, "volume_max_steps", text="Max Steps")
|
||||
col.active = ccscene.use_curves
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_geometry_hair(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Hair"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_geometry"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw_header(self, context):
|
||||
layout = self.layout
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
ccscene = scene.cycles_curves
|
||||
|
||||
layout.prop(ccscene, "use_curves", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
ccscene = scene.cycles_curves
|
||||
|
||||
layout.active = ccscene.use_curves
|
||||
|
||||
col = layout.column()
|
||||
col.prop(ccscene, "minimum_width", text="Min Pixels")
|
||||
col.prop(ccscene, "maximum_width", text="Max Extension")
|
||||
col.prop(ccscene, "shape", text="Shape")
|
||||
@@ -327,41 +270,14 @@ class CYCLES_RENDER_PT_light_paths(CyclesButtonsPanel, Panel):
|
||||
row.operator("render.cycles_integrator_preset_add", text="", icon="ZOOMIN")
|
||||
row.operator("render.cycles_integrator_preset_add", text="", icon="ZOOMOUT").remove_active = True
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_light_paths_max_bounces(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Max Bounces"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_light_paths"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "max_bounces", text="Total")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "max_bounces", text="Max Bounces")
|
||||
col.prop(cscene, "transparent_max_bounces", text="Transparency")
|
||||
col.prop(cscene, "diffuse_bounces", text="Diffuse")
|
||||
col.prop(cscene, "glossy_bounces", text="Glossy")
|
||||
col.prop(cscene, "transparent_max_bounces", text="Transparency")
|
||||
col.prop(cscene, "transmission_bounces", text="Transmission")
|
||||
col.prop(cscene, "volume_bounces", text="Volume")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_light_paths_caustics(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Caustics"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_light_paths"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "blur_glossy")
|
||||
col.prop(cscene, "caustics_reflective")
|
||||
@@ -389,29 +305,9 @@ class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||
col = layout.column()
|
||||
col.prop(cscene, "motion_blur_position", text="Position")
|
||||
col.prop(rd, "motion_blur_shutter")
|
||||
col.separator()
|
||||
col.prop(cscene, "rolling_shutter_type", text="Rolling Shutter")
|
||||
sub = col.column()
|
||||
sub.active = cscene.rolling_shutter_type != 'NONE'
|
||||
sub.prop(cscene, "rolling_shutter_duration")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_motion_blur_curve(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Shutter Curve"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_motion_blur"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
rd = scene.render
|
||||
layout.active = rd.use_motion_blur
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.label("Shutter curve:")
|
||||
col.template_curve_mapping(rd, "motion_blur_shutter_curve")
|
||||
|
||||
col = layout.column(align=True)
|
||||
@@ -423,6 +319,12 @@ class CYCLES_RENDER_PT_motion_blur_curve(CyclesButtonsPanel, Panel):
|
||||
row.operator("render.shutter_curve_preset", icon='LINCURVE', text="").shape = 'LINE'
|
||||
row.operator("render.shutter_curve_preset", icon='NOCURVE', text="").shape = 'MAX'
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "rolling_shutter_type")
|
||||
row = col.row()
|
||||
row.active = cscene.rolling_shutter_type != 'NONE'
|
||||
row.prop(cscene, "rolling_shutter_duration")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_film(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Film"
|
||||
@@ -437,51 +339,24 @@ class CYCLES_RENDER_PT_film(CyclesButtonsPanel, Panel):
|
||||
col = layout.column()
|
||||
col.prop(cscene, "film_exposure")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_film_transparency(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Transparency"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_film"
|
||||
|
||||
def draw_header(self, context):
|
||||
layout = self.layout
|
||||
rd = context.scene.render
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
|
||||
layout.prop(cscene, "film_transparent", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
|
||||
layout.active = cscene.film_transparent
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "film_transparent_glass", text="Transparent Glass")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = cscene.film_transparent and cscene.film_transparent_glass
|
||||
sub.prop(cscene, "film_transparent_roughness", text="Roughness Threshold")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_film_pixel_filter(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Pixel Filter"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_film"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "pixel_filter_type", text="Type")
|
||||
col.prop(cscene, "pixel_filter_type")
|
||||
if cscene.pixel_filter_type != 'BOX':
|
||||
col.prop(cscene, "filter_width", text="Width")
|
||||
col.prop(cscene, "filter_width")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "film_transparent")
|
||||
sub = col.column()
|
||||
sub.prop(cscene, "film_transparent_glass", text="Transparent Glass")
|
||||
sub.active = cscene.film_transparent
|
||||
|
||||
col = layout.column()
|
||||
col.active = cscene.film_transparent and cscene.film_transparent_glass
|
||||
col.prop(cscene, "film_transparent_roughness", text="Roughness Threshold")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_performance(CyclesButtonsPanel, Panel):
|
||||
@@ -497,45 +372,13 @@ class CYCLES_RENDER_PT_performance(CyclesButtonsPanel, Panel):
|
||||
cscene = scene.cycles
|
||||
|
||||
col = layout.column()
|
||||
col.active = show_device_active(context)
|
||||
col.prop(cscene, "device")
|
||||
|
||||
from . import engine
|
||||
if engine.with_osl() and use_cpu(context):
|
||||
col.prop(cscene, "shading_system")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_performance_threads(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Threads"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_performance"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
cscene = scene.cycles
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(rd, "threads_mode")
|
||||
col.row(align=True).prop(rd, "threads_mode")
|
||||
sub = col.column(align=True)
|
||||
sub.enabled = rd.threads_mode == 'FIXED'
|
||||
sub.prop(rd, "threads")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_performance_tiles(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Tiles"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_performance"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
cscene = scene.cycles
|
||||
col.separator()
|
||||
|
||||
col = layout.column()
|
||||
|
||||
@@ -551,63 +394,28 @@ class CYCLES_RENDER_PT_performance_tiles(CyclesButtonsPanel, Panel):
|
||||
sub.active = False
|
||||
sub.prop(cscene, "use_progressive_refine")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Acceleration Structure"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_performance"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
cscene = scene.cycles
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(cscene, "debug_use_spatial_splits")
|
||||
col.prop(cscene, "debug_use_hair_bvh")
|
||||
sub = col.column()
|
||||
sub.active = not cscene.debug_use_spatial_splits
|
||||
sub.prop(cscene, "debug_bvh_time_steps")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_performance_final_render(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Final Render"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_performance"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
cscene = scene.cycles
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(rd, "use_save_buffers")
|
||||
col.prop(rd, "use_persistent_data", text="Persistent Images")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_performance_viewport(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Viewport"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_performance"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
cscene = scene.cycles
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(rd, "preview_pixel_size", text="Pixel Size")
|
||||
|
||||
col.prop(cscene, "debug_use_spatial_splits")
|
||||
col.prop(cscene, "debug_use_hair_bvh")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = not cscene.debug_use_spatial_splits
|
||||
sub.prop(cscene, "debug_bvh_time_steps")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(rd, "preview_pixel_size", text="Viewport Pixel Size")
|
||||
col.prop(cscene, "preview_start_resolution", text="Start Pixels")
|
||||
|
||||
|
||||
@@ -939,7 +747,7 @@ class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||
if CyclesButtonsPanel.poll(context) and ob:
|
||||
if ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META', 'CAMERA'}:
|
||||
return True
|
||||
if ob.dupli_type == 'COLLECTION' and ob.dupli_group:
|
||||
if ob.dupli_type == 'GROUP' and ob.dupli_group:
|
||||
return True
|
||||
# TODO(sergey): More duplicator types here?
|
||||
return False
|
||||
@@ -984,7 +792,7 @@ class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel):
|
||||
ob = context.object
|
||||
return (CyclesButtonsPanel.poll(context) and
|
||||
ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LAMP'}) or
|
||||
(ob.dupli_type == 'COLLECTION' and ob.dupli_group)))
|
||||
(ob.dupli_type == 'GROUP' and ob.dupli_group)))
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -1231,7 +1039,6 @@ class CYCLES_WORLD_PT_volume(CyclesButtonsPanel, Panel):
|
||||
class CYCLES_WORLD_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Ambient Occlusion"
|
||||
bl_context = "world"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -1243,16 +1050,15 @@ class CYCLES_WORLD_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
light = context.world.light_settings
|
||||
scene = context.scene
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
row = layout.row()
|
||||
sub = row.row()
|
||||
sub.active = light.use_ambient_occlusion or scene.render.use_simplify
|
||||
sub.prop(light, "ao_factor", text="Factor")
|
||||
col.prop(light, "distance", text="Distance")
|
||||
row.prop(light, "distance", text="Distance")
|
||||
|
||||
|
||||
class CYCLES_WORLD_PT_mist(CyclesButtonsPanel, Panel):
|
||||
@@ -1317,65 +1123,33 @@ class CYCLES_WORLD_PT_settings(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
world = context.world
|
||||
cworld = world.cycles
|
||||
# cscene = context.scene.cycles
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
|
||||
class CYCLES_WORLD_PT_settings_surface(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Surface"
|
||||
bl_parent_id = "CYCLES_WORLD_PT_settings"
|
||||
bl_context = "world"
|
||||
col = split.column()
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.world and CyclesButtonsPanel.poll(context)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
world = context.world
|
||||
cworld = world.cycles
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="Surface:")
|
||||
col.prop(cworld, "sample_as_light", text="Multiple Importance")
|
||||
|
||||
sub = col.column()
|
||||
sub = col.column(align=True)
|
||||
sub.active = cworld.sample_as_light
|
||||
sub.prop(cworld, "sample_map_resolution")
|
||||
if use_branched_path(context):
|
||||
subsub = sub.column(align=True)
|
||||
subsub = sub.row(align=True)
|
||||
subsub.active = use_sample_all_lights(context)
|
||||
subsub.prop(cworld, "samples")
|
||||
sub.prop(cworld, "max_bounces")
|
||||
|
||||
|
||||
class CYCLES_WORLD_PT_settings_volume(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Volume"
|
||||
bl_parent_id = "CYCLES_WORLD_PT_settings"
|
||||
bl_context = "world"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.world and CyclesButtonsPanel.poll(context)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
world = context.world
|
||||
cworld = world.cycles
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Volume:")
|
||||
sub = col.column()
|
||||
sub.active = use_cpu(context)
|
||||
sub.prop(cworld, "volume_sampling", text="Sampling")
|
||||
col.prop(cworld, "volume_interpolation", text="Interpolation")
|
||||
sub.prop(cworld, "volume_sampling", text="")
|
||||
col.prop(cworld, "volume_interpolation", text="")
|
||||
col.prop(cworld, "homogeneous_volume", text="Homogeneous")
|
||||
|
||||
|
||||
@@ -1453,60 +1227,30 @@ class CYCLES_MATERIAL_PT_settings(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
cmat = mat.cycles
|
||||
|
||||
layout.prop(mat, "pass_index")
|
||||
|
||||
|
||||
class CYCLES_MATERIAL_PT_settings_surface(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Surface"
|
||||
bl_parent_id = "CYCLES_MATERIAL_PT_settings"
|
||||
bl_context = "material"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.material and CyclesButtonsPanel.poll(context)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
cmat = mat.cycles
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.label(text="Surface:")
|
||||
col.prop(cmat, "sample_as_light", text="Multiple Importance")
|
||||
col.prop(cmat, "use_transparent_shadow")
|
||||
col.prop(cmat, "displacement_method", text="Displacement Method")
|
||||
|
||||
col.separator()
|
||||
col.label(text="Geometry:")
|
||||
col.prop(cmat, "displacement_method", text="")
|
||||
|
||||
class CYCLES_MATERIAL_PT_settings_volume(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Volume"
|
||||
bl_parent_id = "CYCLES_MATERIAL_PT_settings"
|
||||
bl_context = "material"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.material and CyclesButtonsPanel.poll(context)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
cmat = mat.cycles
|
||||
|
||||
col = layout.column()
|
||||
col = split.column()
|
||||
col.label(text="Volume:")
|
||||
sub = col.column()
|
||||
sub.active = use_cpu(context)
|
||||
sub.prop(cmat, "volume_sampling", text="Sampling")
|
||||
col.prop(cmat, "volume_interpolation", text="Interpolation")
|
||||
sub.prop(cmat, "volume_sampling", text="")
|
||||
col.prop(cmat, "volume_interpolation", text="")
|
||||
col.prop(cmat, "homogeneous_volume", text="Homogeneous")
|
||||
|
||||
|
||||
col.separator()
|
||||
col.prop(mat, "pass_index")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
|
||||
@@ -1653,19 +1397,8 @@ class CYCLES_SCENE_PT_simplify(CyclesButtonsPanel, Panel):
|
||||
rd = context.scene.render
|
||||
self.layout.prop(rd, "use_simplify", text="")
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
|
||||
|
||||
class CYCLES_SCENE_PT_simplify_viewport(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Viewport"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "CYCLES_SCENE_PT_simplify"
|
||||
COMPAT_ENGINES = {'CYCLES'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
@@ -1673,65 +1406,46 @@ class CYCLES_SCENE_PT_simplify_viewport(CyclesButtonsPanel, Panel):
|
||||
|
||||
layout.active = rd.use_simplify
|
||||
|
||||
col = layout.column()
|
||||
col.prop(rd, "simplify_subdivision", text="Max Subdivision")
|
||||
col.prop(rd, "simplify_child_particles", text="Child Particles")
|
||||
col.prop(cscene, "texture_limit", text="Texture Limit")
|
||||
col.prop(cscene, "ao_bounces", text="AO Bounces")
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Subdivision")
|
||||
row = col.row(align=True)
|
||||
row.prop(rd, "simplify_subdivision", text="Viewport")
|
||||
row.prop(rd, "simplify_subdivision_render", text="Render")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Child Particles")
|
||||
row = col.row(align=True)
|
||||
row.prop(rd, "simplify_child_particles", text="Viewport")
|
||||
row.prop(rd, "simplify_child_particles_render", text="Render")
|
||||
|
||||
class CYCLES_SCENE_PT_simplify_render(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Render"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "CYCLES_SCENE_PT_simplify"
|
||||
COMPAT_ENGINES = {'CYCLES'}
|
||||
col = layout.column(align=True)
|
||||
split = col.split()
|
||||
sub = split.column()
|
||||
sub.label(text="Texture Limit Viewport")
|
||||
sub.prop(cscene, "texture_limit", text="")
|
||||
sub = split.column()
|
||||
sub.label(text="Texture Limit Render")
|
||||
sub.prop(cscene, "texture_limit_render", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
cscene = scene.cycles
|
||||
|
||||
layout.active = rd.use_simplify
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(rd, "simplify_subdivision_render", text="Max Subdivision")
|
||||
col.prop(rd, "simplify_child_particles_render", text="Child Particles")
|
||||
col.prop(cscene, "texture_limit_render", text="Texture Limit")
|
||||
col.prop(cscene, "ao_bounces_render", text="AO Bounces")
|
||||
|
||||
|
||||
class CYCLES_SCENE_PT_simplify_culling(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Culling"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "CYCLES_SCENE_PT_simplify"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'CYCLES'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
cscene = scene.cycles
|
||||
|
||||
layout.active = rd.use_simplify
|
||||
|
||||
col = layout.column()
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.prop(cscene, "use_camera_cull")
|
||||
sub = col.column()
|
||||
sub.active = cscene.use_camera_cull
|
||||
sub.prop(cscene, "camera_cull_margin")
|
||||
row = col.row()
|
||||
row.active = cscene.use_camera_cull
|
||||
row.prop(cscene, "camera_cull_margin")
|
||||
|
||||
col = layout.column()
|
||||
col = split.column()
|
||||
col.prop(cscene, "use_distance_cull")
|
||||
sub = col.column()
|
||||
sub.active = cscene.use_distance_cull
|
||||
sub.prop(cscene, "distance_cull_margin", text="Distance")
|
||||
row = col.row()
|
||||
row.active = cscene.use_distance_cull
|
||||
row.prop(cscene, "distance_cull_margin", text="Distance")
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.prop(cscene, "ao_bounces")
|
||||
|
||||
col = split.column()
|
||||
col.prop(cscene, "ao_bounces_render")
|
||||
|
||||
|
||||
def draw_device(self, context):
|
||||
@@ -1746,6 +1460,13 @@ def draw_device(self, context):
|
||||
col = layout.column()
|
||||
col.prop(cscene, "feature_set")
|
||||
|
||||
col = layout.column()
|
||||
col.active = show_device_active(context)
|
||||
col.prop(cscene, "device")
|
||||
|
||||
if engine.with_osl() and use_cpu(context):
|
||||
layout.prop(cscene, "shading_system")
|
||||
|
||||
|
||||
def draw_pause(self, context):
|
||||
layout = self.layout
|
||||
@@ -1788,25 +1509,11 @@ classes = (
|
||||
CYCLES_MT_sampling_presets,
|
||||
CYCLES_MT_integrator_presets,
|
||||
CYCLES_RENDER_PT_sampling,
|
||||
CYCLES_RENDER_PT_sampling_light,
|
||||
CYCLES_RENDER_PT_geometry,
|
||||
CYCLES_RENDER_PT_geometry_subdivision,
|
||||
CYCLES_RENDER_PT_geometry_volume,
|
||||
CYCLES_RENDER_PT_geometry_hair,
|
||||
CYCLES_RENDER_PT_light_paths,
|
||||
CYCLES_RENDER_PT_light_paths_max_bounces,
|
||||
CYCLES_RENDER_PT_light_paths_caustics,
|
||||
CYCLES_RENDER_PT_motion_blur,
|
||||
CYCLES_RENDER_PT_motion_blur_curve,
|
||||
CYCLES_RENDER_PT_film,
|
||||
CYCLES_RENDER_PT_film_transparency,
|
||||
CYCLES_RENDER_PT_film_pixel_filter,
|
||||
CYCLES_RENDER_PT_performance,
|
||||
CYCLES_RENDER_PT_performance_threads,
|
||||
CYCLES_RENDER_PT_performance_tiles,
|
||||
CYCLES_RENDER_PT_performance_acceleration_structure,
|
||||
CYCLES_RENDER_PT_performance_final_render,
|
||||
CYCLES_RENDER_PT_performance_viewport,
|
||||
CYCLES_RENDER_PT_filter,
|
||||
CYCLES_RENDER_PT_layer_passes,
|
||||
CYCLES_RENDER_PT_denoising,
|
||||
@@ -1827,21 +1534,14 @@ classes = (
|
||||
CYCLES_WORLD_PT_mist,
|
||||
CYCLES_WORLD_PT_ray_visibility,
|
||||
CYCLES_WORLD_PT_settings,
|
||||
CYCLES_WORLD_PT_settings_surface,
|
||||
CYCLES_WORLD_PT_settings_volume,
|
||||
CYCLES_MATERIAL_PT_preview,
|
||||
CYCLES_MATERIAL_PT_surface,
|
||||
CYCLES_MATERIAL_PT_volume,
|
||||
CYCLES_MATERIAL_PT_displacement,
|
||||
CYCLES_MATERIAL_PT_settings,
|
||||
CYCLES_MATERIAL_PT_settings_surface,
|
||||
CYCLES_MATERIAL_PT_settings_volume,
|
||||
CYCLES_RENDER_PT_bake,
|
||||
CYCLES_RENDER_PT_debug,
|
||||
CYCLES_SCENE_PT_simplify,
|
||||
CYCLES_SCENE_PT_simplify_viewport,
|
||||
CYCLES_SCENE_PT_simplify_render,
|
||||
CYCLES_SCENE_PT_simplify_culling,
|
||||
)
|
||||
|
||||
|
||||
|
@@ -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,8 +563,6 @@ 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;
|
||||
@@ -590,7 +582,7 @@ 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,
|
||||
|
@@ -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 |
@@ -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,
|
||||
@@ -2397,7 +2394,7 @@ 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)
|
||||
|
||||
wm.popover(draw_menu, keymap=keymap)
|
||||
return {'FINISHED'}
|
||||
|
@@ -88,7 +88,7 @@ _modules = [
|
||||
"space_userpref",
|
||||
"space_view3d",
|
||||
"space_view3d_toolbar",
|
||||
]
|
||||
]
|
||||
|
||||
import bpy
|
||||
|
||||
@@ -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,
|
||||
|
@@ -180,20 +180,9 @@ class DATA_PT_geometry_curve(CurveButtonsPanelCurve, Panel):
|
||||
sub.active = curve.taper_object is not None
|
||||
sub.prop(curve, "use_map_taper")
|
||||
|
||||
col.separator()
|
||||
|
||||
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
|
||||
layout.label(text="Bevel")
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
@@ -349,18 +338,8 @@ class DATA_PT_font(CurveButtonsPanelText, Panel):
|
||||
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
|
||||
# layout.prop(text, "font")
|
||||
|
||||
col = layout.column()
|
||||
|
||||
@@ -391,31 +370,12 @@ 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="Alignment")
|
||||
layout.row().prop(text, "align_x", expand=True)
|
||||
layout.row().prop(text, "align_y", expand=True)
|
||||
|
||||
|
||||
class DATA_PT_paragraph_spacing(CurveButtonsPanelText, Panel):
|
||||
bl_parent_id = "DATA_PT_paragraph"
|
||||
bl_label = "Spacing"
|
||||
|
||||
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")
|
||||
@@ -469,14 +429,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,
|
||||
)
|
||||
|
@@ -181,26 +181,10 @@ class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
|
||||
col.prop(lamp, "shadow_buffer_exp", text="Exponent")
|
||||
col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
|
||||
|
||||
col.separator()
|
||||
|
||||
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
|
||||
|
||||
col = layout.column()
|
||||
if lamp.type == 'SUN':
|
||||
col.label("Cascaded Shadow Map")
|
||||
|
||||
col.prop(lamp, "shadow_cascade_count", text="Count")
|
||||
col.prop(lamp, "shadow_cascade_fade", text="Fade")
|
||||
@@ -208,32 +192,12 @@ class DATA_PT_EEVEE_shadow_cascaded_shadow_map(DataButtonsPanel, Panel):
|
||||
col.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
|
||||
col.prop(lamp, "shadow_cascade_exponent", text="Distribution")
|
||||
|
||||
layout.separator()
|
||||
|
||||
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
|
||||
layout.prop(lamp, "use_contact_shadow")
|
||||
|
||||
col = layout.column()
|
||||
col.active = lamp.use_shadow and lamp.use_contact_shadow
|
||||
col.active = lamp.use_contact_shadow
|
||||
|
||||
col.prop(lamp, "contact_shadow_distance", text="Distance")
|
||||
col.prop(lamp, "contact_shadow_soft_size", text="Softness")
|
||||
@@ -304,7 +268,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
|
||||
@@ -358,8 +321,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,
|
||||
|
@@ -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")
|
||||
|
@@ -43,8 +43,8 @@ class MASK_UL_layers(UIList):
|
||||
|
||||
class MASK_PT_mask:
|
||||
# subclasses must define...
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
bl_label = "Mask Settings"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@@ -66,8 +66,8 @@ class MASK_PT_mask:
|
||||
|
||||
class MASK_PT_layers:
|
||||
# subclasses must define...
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
bl_label = "Mask Layers"
|
||||
|
||||
@classmethod
|
||||
@@ -114,8 +114,8 @@ class MASK_PT_layers:
|
||||
|
||||
class MASK_PT_spline:
|
||||
# subclasses must define...
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
bl_label = "Active Spline"
|
||||
|
||||
@classmethod
|
||||
@@ -148,8 +148,8 @@ class MASK_PT_spline:
|
||||
|
||||
class MASK_PT_point:
|
||||
# subclasses must define...
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
bl_label = "Active Point"
|
||||
|
||||
@classmethod
|
||||
@@ -203,8 +203,8 @@ class MASK_PT_point:
|
||||
|
||||
class MASK_PT_display:
|
||||
# subclasses must define...
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
bl_label = "Mask Display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@@ -229,8 +229,8 @@ class MASK_PT_display:
|
||||
|
||||
class MASK_PT_transforms:
|
||||
# subclasses must define...
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'TOOLS'
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'TOOLS'
|
||||
bl_label = "Transforms"
|
||||
bl_category = "Mask"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
@@ -253,8 +253,8 @@ class MASK_PT_transforms:
|
||||
|
||||
class MASK_PT_tools:
|
||||
# subclasses must define...
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'TOOLS'
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'TOOLS'
|
||||
bl_label = "Mask Tools"
|
||||
bl_category = "Mask"
|
||||
|
||||
@@ -291,8 +291,8 @@ class MASK_PT_tools:
|
||||
|
||||
class MASK_PT_add:
|
||||
# subclasses must define...
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'TOOLS'
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'TOOLS'
|
||||
bl_label = "Add"
|
||||
bl_category = "Mask"
|
||||
|
||||
|
@@ -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,7 +172,6 @@ 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
|
||||
layout.prop(mat, "diffuse_color", text="Base Color")
|
||||
layout.prop(mat, "metallic")
|
||||
layout.prop(mat, "specular_intensity", text="Specular")
|
||||
@@ -192,7 +190,6 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
|
||||
|
@@ -86,7 +86,6 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
|
||||
|
||||
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):
|
||||
|
@@ -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,
|
||||
|
@@ -117,7 +117,7 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
|
||||
rbo = ob.rigid_body
|
||||
|
||||
#col = layout.column(align=1)
|
||||
# col.label(text="Activation:")
|
||||
#col.label(text="Activation:")
|
||||
# XXX: settings such as activate on collison/etc.
|
||||
|
||||
split = layout.split()
|
||||
|
@@ -152,7 +152,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
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_start", text="Frame Range Start")
|
||||
col.prop(scene, "frame_end", text="End")
|
||||
col.prop(scene, "frame_step", text="Step")
|
||||
|
||||
@@ -161,21 +161,8 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
col.label(text="Frame Rate")
|
||||
self.draw_framerate(col, 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_old", text="Time Remapping Old")
|
||||
col.prop(rd, "frame_map_new", text="New")
|
||||
|
||||
|
||||
@@ -235,25 +222,11 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
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
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(rd, "use_stamp", text="Burn Into Image")
|
||||
col = layout.column()
|
||||
col.active = rd.use_stamp
|
||||
col.prop(rd, "stamp_font_size", text="Font Size")
|
||||
@@ -777,7 +750,6 @@ class RENDER_PT_hair(RenderButtonsPanel, Panel):
|
||||
row = layout.row()
|
||||
row.prop(rd, "hair_type", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
layout.prop(rd, "hair_subdiv")
|
||||
|
||||
|
||||
@@ -787,12 +759,10 @@ classes = (
|
||||
RENDER_MT_framerate_presets,
|
||||
RENDER_PT_context,
|
||||
RENDER_PT_dimensions,
|
||||
RENDER_PT_frame_remapping,
|
||||
RENDER_PT_post_processing,
|
||||
RENDER_PT_output,
|
||||
RENDER_PT_encoding,
|
||||
RENDER_PT_stamp,
|
||||
RENDER_PT_stamp_burn,
|
||||
RENDER_UL_renderviews,
|
||||
RENDER_PT_stereoscopy,
|
||||
RENDER_PT_hair,
|
||||
|
@@ -160,7 +160,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 +193,7 @@ 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"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
@@ -259,44 +258,18 @@ class SCENE_PT_color_management(SceneButtonsPanel, Panel):
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
view = scene.view_settings
|
||||
|
||||
col = layout.column()
|
||||
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.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.separator()
|
||||
col = layout.column()
|
||||
col.prop(scene.sequencer_colorspace_settings, "name", text="Sequencer Color Space")
|
||||
|
||||
|
||||
class SCENE_PT_audio(SceneButtonsPanel, Panel):
|
||||
@@ -333,7 +306,6 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
|
||||
|
||||
class SCENE_PT_physics(SceneButtonsPanel, Panel):
|
||||
bl_label = "Gravity"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header(self, context):
|
||||
@@ -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'}
|
||||
|
||||
@@ -476,24 +446,6 @@ class SCENE_PT_viewport_display(SceneButtonsPanel, Panel):
|
||||
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")
|
||||
|
||||
|
||||
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
_context_path = "scene"
|
||||
@@ -508,9 +460,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"
|
||||
|
||||
|
@@ -425,11 +425,11 @@ class DOPESHEET_MT_gpencil_channel(Menu):
|
||||
layout.operator("anim.channels_editable_toggle")
|
||||
|
||||
# XXX: to be enabled when these are ready for use!
|
||||
# layout.separator()
|
||||
# layout.operator("anim.channels_expand")
|
||||
# layout.operator("anim.channels_collapse")
|
||||
#layout.separator()
|
||||
#layout.operator("anim.channels_expand")
|
||||
#layout.operator("anim.channels_collapse")
|
||||
|
||||
# layout.separator()
|
||||
#layout.separator()
|
||||
#layout.operator_menu_enum("anim.channels_move", "direction", text="Move...")
|
||||
|
||||
|
||||
@@ -450,9 +450,9 @@ class DOPESHEET_MT_gpencil_frame(Menu):
|
||||
layout.separator()
|
||||
layout.operator("action.keyframe_type")
|
||||
|
||||
# layout.separator()
|
||||
# layout.operator("action.copy")
|
||||
# layout.operator("action.paste")
|
||||
#layout.separator()
|
||||
#layout.operator("action.copy")
|
||||
#layout.operator("action.paste")
|
||||
|
||||
|
||||
class DOPESHEET_MT_delete(Menu):
|
||||
@@ -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,
|
||||
|
@@ -179,7 +179,7 @@ class OUTLINER_MT_collection(Menu):
|
||||
layout.operator("outliner.collection_instance", text="Instance to Scene")
|
||||
if space.display_mode != 'VIEW_LAYER':
|
||||
layout.operator("outliner.collection_link", text="Link to Scene")
|
||||
layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK'
|
||||
layout.operator("outliner.id_operation", text="Unlink").type='UNLINK'
|
||||
|
||||
if space.display_mode == 'VIEW_LAYER':
|
||||
layout.separator()
|
||||
@@ -206,20 +206,20 @@ class OUTLINER_MT_object(Menu):
|
||||
|
||||
space = context.space_data
|
||||
|
||||
layout.operator("outliner.object_operation", text="Delete").type = 'DELETE'
|
||||
layout.operator("outliner.object_operation", text="Delete").type='DELETE'
|
||||
if space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection:
|
||||
layout.operator("outliner.object_operation", text="Delete Hierarchy").type = 'DELETE_HIERARCHY'
|
||||
layout.operator("outliner.object_operation", text="Delete Hierarchy").type='DELETE_HIERARCHY'
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("outliner.object_operation", text="Select").type = 'SELECT'
|
||||
layout.operator("outliner.object_operation", text="Select Hierarchy").type = 'SELECT_HIERARCHY'
|
||||
layout.operator("outliner.object_operation", text="Deselect").type = 'DESELECT'
|
||||
layout.operator("outliner.object_operation", text="Select").type='SELECT'
|
||||
layout.operator("outliner.object_operation", text="Select Hierarchy").type='SELECT_HIERARCHY'
|
||||
layout.operator("outliner.object_operation", text="Deselect").type='DESELECT'
|
||||
|
||||
layout.separator()
|
||||
|
||||
if not (space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection):
|
||||
layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK'
|
||||
layout.operator("outliner.id_operation", text="Unlink").type='UNLINK'
|
||||
layout.separator()
|
||||
|
||||
layout.operator_menu_enum("outliner.id_operation", 'type', text="ID Data")
|
||||
|
@@ -73,6 +73,7 @@ class STATUSBAR_HT_header(Header):
|
||||
return
|
||||
|
||||
|
||||
|
||||
classes = (
|
||||
STATUSBAR_HT_header,
|
||||
)
|
||||
|
@@ -117,7 +117,6 @@ class TIME_MT_editor_menus(Menu):
|
||||
panel_type="TIME_PT_keyframing_settings",
|
||||
text="Keying")
|
||||
|
||||
|
||||
class TIME_MT_marker(Menu):
|
||||
bl_label = "Marker"
|
||||
|
||||
@@ -218,7 +217,6 @@ def marker_menu_generic(layout):
|
||||
|
||||
###################################
|
||||
|
||||
|
||||
class TimelinePanelButtons:
|
||||
bl_space_type = 'DOPESHEET_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
|
@@ -339,7 +339,9 @@ class ToolSelectPanelHelper:
|
||||
# - None: Signal to finish (complete any final operations, e.g. add padding).
|
||||
|
||||
@staticmethod
|
||||
def _layout_generator_single_column(layout, scale_y):
|
||||
def _layout_generator_single_column(layout):
|
||||
scale_y = 2.0
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.scale_y = scale_y
|
||||
is_sep = False
|
||||
@@ -353,8 +355,9 @@ class ToolSelectPanelHelper:
|
||||
is_sep = yield col
|
||||
|
||||
@staticmethod
|
||||
def _layout_generator_multi_columns(layout, column_count, scale_y):
|
||||
scale_x = scale_y * 1.1
|
||||
def _layout_generator_multi_columns(layout, column_count):
|
||||
scale_y = 2.0
|
||||
scale_x = 2.2
|
||||
column_last = column_count - 1
|
||||
|
||||
col = layout.column(align=True)
|
||||
@@ -391,7 +394,7 @@ class ToolSelectPanelHelper:
|
||||
column_index += 1
|
||||
|
||||
@staticmethod
|
||||
def _layout_generator_detect_from_region(layout, region, scale_y):
|
||||
def _layout_generator_detect_from_region(layout, region):
|
||||
"""
|
||||
Choose an appropriate layout for the toolbar.
|
||||
"""
|
||||
@@ -418,14 +421,15 @@ class ToolSelectPanelHelper:
|
||||
column_count = 1
|
||||
|
||||
if column_count == 1:
|
||||
ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout, scale_y=scale_y)
|
||||
ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout)
|
||||
else:
|
||||
ui_gen = ToolSelectPanelHelper._layout_generator_multi_columns(layout, column_count=column_count, scale_y=scale_y)
|
||||
ui_gen = ToolSelectPanelHelper._layout_generator_multi_columns(layout, column_count=column_count)
|
||||
|
||||
return ui_gen, show_text
|
||||
|
||||
|
||||
@classmethod
|
||||
def draw_cls(cls, layout, context, detect_layout=True, scale_y=2.0):
|
||||
def draw_cls(cls, layout, context, detect_layout=True):
|
||||
# Use a classmethod so it can be called outside of a panel context.
|
||||
|
||||
# XXX, this UI isn't very nice.
|
||||
@@ -441,9 +445,9 @@ class ToolSelectPanelHelper:
|
||||
)
|
||||
|
||||
if detect_layout:
|
||||
ui_gen, show_text = cls._layout_generator_detect_from_region(layout, context.region, scale_y)
|
||||
ui_gen, show_text = cls._layout_generator_detect_from_region(layout, context.region)
|
||||
else:
|
||||
ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout, scale_y)
|
||||
ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout)
|
||||
show_text = True
|
||||
|
||||
# Start iteration
|
||||
@@ -672,7 +676,6 @@ def keymap_from_context(context, space_type):
|
||||
wm.keyconfigs.update()
|
||||
return keymap
|
||||
|
||||
|
||||
classes = (
|
||||
WM_MT_toolsystem_submenu,
|
||||
)
|
||||
|
@@ -292,6 +292,7 @@ class _defs_edit_armature:
|
||||
|
||||
class _defs_edit_mesh:
|
||||
|
||||
|
||||
@ToolDef.from_fn
|
||||
def cube_add():
|
||||
return dict(
|
||||
|
@@ -141,7 +141,7 @@ class TOPBAR_HT_lower_bar(Header):
|
||||
elif mode == 'POSE':
|
||||
pass
|
||||
elif mode == 'PARTICLE':
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
|
||||
pass
|
||||
|
||||
def draw_right(self, context):
|
||||
layout = self.layout
|
||||
@@ -610,11 +610,6 @@ class INFO_MT_edit(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("screen.repeat_last")
|
||||
layout.operator("screen.repeat_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
|
||||
|
||||
|
||||
|
@@ -141,6 +141,7 @@ class USERPREF_MT_app_templates(Menu):
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
props = layout.operator("wm.app_template_install")
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
self.draw_ex(context, use_splash=False, use_default=True, use_install=True)
|
||||
|
||||
@@ -281,14 +282,14 @@ class USERPREF_PT_interface(Panel):
|
||||
row.separator()
|
||||
|
||||
col = row.column()
|
||||
# Toolbox doesn't exist yet
|
||||
# col.label(text="Toolbox:")
|
||||
#Toolbox doesn't exist yet
|
||||
#col.label(text="Toolbox:")
|
||||
#col.prop(view, "show_column_layout")
|
||||
#col.label(text="Open Toolbox Delay:")
|
||||
#col.prop(view, "open_left_mouse_delay", text="Hold LMB")
|
||||
#col.prop(view, "open_right_mouse_delay", text="Hold RMB")
|
||||
col.prop(view, "show_manipulator")
|
||||
# Currently not working
|
||||
## Currently not working
|
||||
# col.prop(view, "show_manipulator_shaded")
|
||||
sub = col.column()
|
||||
sub.active = view.show_manipulator
|
||||
@@ -327,6 +328,7 @@ class USERPREF_PT_interface(Panel):
|
||||
col.prop(view, "show_view3d_cursor")
|
||||
|
||||
|
||||
|
||||
class USERPREF_PT_edit(Panel):
|
||||
bl_space_type = 'USER_PREFERENCES'
|
||||
bl_label = "Edit"
|
||||
@@ -410,7 +412,7 @@ class USERPREF_PT_edit(Panel):
|
||||
|
||||
sub = col.column()
|
||||
|
||||
# ~ sub.active = edit.use_keyframe_insert_auto # incorrect, time-line can enable
|
||||
#~ sub.active = edit.use_keyframe_insert_auto # incorrect, time-line can enable
|
||||
sub.prop(edit, "use_keyframe_insert_available", text="Only Insert Available")
|
||||
|
||||
col.separator()
|
||||
@@ -1215,7 +1217,7 @@ class USERPREF_PT_input(Panel):
|
||||
|
||||
#sub.prop(inputs, "use_mouse_mmb_paste")
|
||||
|
||||
# col.separator()
|
||||
#col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
|
||||
@@ -1408,6 +1410,7 @@ class USERPREF_PT_addons(Panel):
|
||||
sub_col.label(" " + addon_file)
|
||||
sub_col.label(" " + addon_path)
|
||||
|
||||
|
||||
if addon_utils.error_encoding:
|
||||
self.draw_error(
|
||||
col,
|
||||
|
@@ -1483,7 +1483,7 @@ class VIEW3D_MT_object_clear(Menu):
|
||||
|
||||
|
||||
class VIEW3D_MT_object_specials(Menu):
|
||||
bl_label = "Object Context Menu"
|
||||
bl_label = "Context Menu"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -2113,7 +2113,7 @@ class VIEW3D_MT_particle(Menu):
|
||||
|
||||
|
||||
class VIEW3D_MT_particle_specials(Menu):
|
||||
bl_label = "Particle Context Menu"
|
||||
bl_label = "Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -2363,7 +2363,7 @@ class VIEW3D_MT_pose_apply(Menu):
|
||||
|
||||
|
||||
class VIEW3D_MT_pose_specials(Menu):
|
||||
bl_label = "Pose Context Menu"
|
||||
bl_label = "Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -2496,7 +2496,7 @@ class VIEW3D_MT_edit_mesh(Menu):
|
||||
|
||||
|
||||
class VIEW3D_MT_edit_mesh_specials(Menu):
|
||||
bl_label = "Mesh Context Menu"
|
||||
bl_label = "Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -3030,7 +3030,7 @@ class VIEW3D_MT_edit_curve_clean(Menu):
|
||||
|
||||
|
||||
class VIEW3D_MT_edit_curve_specials(Menu):
|
||||
bl_label = "Curve Context Menu"
|
||||
bl_label = "Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -3244,7 +3244,7 @@ class VIEW3D_MT_edit_armature(Menu):
|
||||
|
||||
|
||||
class VIEW3D_MT_armature_specials(Menu):
|
||||
bl_label = "Armature Context Menu"
|
||||
bl_label = "Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -3394,45 +3394,6 @@ class VIEW3D_MT_edit_gpencil_interpolate(Menu):
|
||||
layout.operator("gpencil.interpolate_sequence", text="Sequence")
|
||||
|
||||
|
||||
class VIEW3D_PIE_object_mode(Menu):
|
||||
bl_label = "Mode"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
pie = layout.menu_pie()
|
||||
pie.operator_enum("OBJECT_OT_mode_set", "mode")
|
||||
|
||||
|
||||
class VIEW3D_PIE_view(Menu):
|
||||
bl_label = "View"
|
||||
bl_idname = "VIEW3D_PIE_view"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
pie = layout.menu_pie()
|
||||
pie.operator_enum("VIEW3D_OT_viewnumpad", "type")
|
||||
pie.operator("view3d.view_selected", text="View Selected", icon='ZOOM_SELECTED')
|
||||
|
||||
|
||||
class VIEW3D_PIE_view_more(Menu):
|
||||
bl_label = "More"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
pie = layout.menu_pie()
|
||||
pie.operator("VIEW3D_OT_view_persportho", text="Persp/Ortho", icon='RESTRICT_VIEW_OFF')
|
||||
pie.operator("VIEW3D_OT_camera_to_view")
|
||||
pie.operator("VIEW3D_OT_view_selected")
|
||||
pie.operator("VIEW3D_OT_view_all")
|
||||
pie.operator("VIEW3D_OT_localview")
|
||||
pie.operator("SCREEN_OT_region_quadview")
|
||||
|
||||
|
||||
|
||||
|
||||
# ********** Panel **********
|
||||
|
||||
|
||||
@@ -3515,6 +3476,31 @@ class VIEW3D_PT_view3d_cursor(Panel):
|
||||
layout.column().prop(view, "cursor_location", text="Location")
|
||||
|
||||
|
||||
class VIEW3D_PT_view3d_name(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Item"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.space_data and context.active_object)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.active_object
|
||||
row = layout.row()
|
||||
row.label(text="", icon='OBJECT_DATA')
|
||||
row.prop(ob, "name", text="")
|
||||
|
||||
if ob.type == 'ARMATURE' and ob.mode in {'EDIT', 'POSE'}:
|
||||
bone = context.active_bone
|
||||
if bone:
|
||||
row = layout.row()
|
||||
row.label(text="", icon='BONE_DATA')
|
||||
row.prop(bone, "name", text="")
|
||||
|
||||
|
||||
class VIEW3D_PT_shading(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
@@ -3531,7 +3517,13 @@ class VIEW3D_PT_shading(Panel):
|
||||
shading = view.shading
|
||||
|
||||
col = layout.column()
|
||||
col.row().label("Lighting")
|
||||
|
||||
if shading.type == 'SOLID':
|
||||
col.row().prop(shading, "color_type", expand=True)
|
||||
|
||||
if shading.color_type == 'SINGLE':
|
||||
col.row().prop(shading, "single_color", text="")
|
||||
|
||||
if shading.type in ('SOLID', 'TEXTURED'):
|
||||
col.row().prop(shading, "light", expand=True)
|
||||
if shading.light == 'STUDIO':
|
||||
@@ -3539,47 +3531,25 @@ class VIEW3D_PT_shading(Panel):
|
||||
if shading.studio_light_orientation == 'WORLD':
|
||||
col.row().prop(shading, "studiolight_rot_z")
|
||||
|
||||
elif shading.light == 'MATCAP':
|
||||
col.row().template_icon_view(shading, "matcap")
|
||||
|
||||
if shading.type == 'SOLID':
|
||||
col.separator()
|
||||
col.row().label("Color")
|
||||
col.row().prop(shading, "color_type", expand=True)
|
||||
|
||||
if shading.color_type == 'SINGLE':
|
||||
col.row().prop(shading, "single_color", text="")
|
||||
|
||||
if shading.type in ('SOLID', 'TEXTURED'):
|
||||
col.separator()
|
||||
|
||||
if not shading.light == 'MATCAP':
|
||||
row = col.row()
|
||||
row.prop(shading, "show_specular_highlight")
|
||||
|
||||
if shading.type in ('SOLID', 'TEXTURED'):
|
||||
row = col.split(0.4)
|
||||
col.separator()
|
||||
|
||||
row = col.row()
|
||||
row.prop(shading, "show_xray")
|
||||
sub = row.row()
|
||||
sub.active = shading.show_xray
|
||||
sub.prop(shading, "xray_alpha", text="")
|
||||
|
||||
row = col.split(0.4)
|
||||
row = col.row()
|
||||
row.active = not shading.show_xray
|
||||
row.prop(shading, "show_shadows")
|
||||
sub = row.row()
|
||||
sub.active = shading.show_shadows and not shading.show_xray
|
||||
sub.prop(shading, "shadow_intensity", text="")
|
||||
|
||||
row = col.split(0.4)
|
||||
row.active = not shading.show_xray
|
||||
row.prop(shading, "show_cavity")
|
||||
sub = row.column(align=True)
|
||||
sub.active = not shading.show_xray and shading.show_cavity
|
||||
sub.prop(shading, "cavity_ridge_factor")
|
||||
sub.prop(shading, "cavity_valley_factor")
|
||||
|
||||
row = col.split(0.4)
|
||||
row = col.row()
|
||||
row.prop(shading, "show_object_outline")
|
||||
sub = row.row()
|
||||
sub.active = shading.show_object_outline
|
||||
@@ -3610,6 +3580,7 @@ class VIEW3D_PT_overlay(Panel):
|
||||
view = context.space_data
|
||||
shading = view.shading
|
||||
overlay = view.overlay
|
||||
scene = context.scene
|
||||
toolsettings = context.tool_settings
|
||||
display_all = overlay.show_overlays
|
||||
|
||||
@@ -3625,13 +3596,7 @@ class VIEW3D_PT_overlay(Panel):
|
||||
col.prop(overlay, "show_relationship_lines")
|
||||
col.prop(overlay, "show_motion_paths")
|
||||
col.prop(overlay, "show_face_orientation")
|
||||
|
||||
row = col.row()
|
||||
row.prop(overlay, "show_wireframes")
|
||||
sub = row.row()
|
||||
sub.active = overlay.show_wireframes
|
||||
sub.prop(overlay, "wireframe_threshold", text="")
|
||||
|
||||
col.prop(overlay, "show_wireframes")
|
||||
col.prop(overlay, "show_backface_culling")
|
||||
|
||||
if shading.type == "MATERIAL":
|
||||
@@ -3651,27 +3616,12 @@ class VIEW3D_PT_overlay(Panel):
|
||||
sub.active = bool(overlay.show_floor or view.region_quadviews or not view.region_3d.is_perspective)
|
||||
subsub = sub.column(align=True)
|
||||
subsub.active = overlay.show_floor
|
||||
subsub.prop(overlay, "grid_scale", text="Scale")
|
||||
subsub.prop(overlay, "grid_subdivisions", text="Subdivisions")
|
||||
|
||||
col.prop(view, "show_reconstruction", text="Motion Tracking")
|
||||
sub = col.column(align=True)
|
||||
|
||||
sub.active = view.show_reconstruction
|
||||
sub.prop(view, "show_camera_path", text="Camera Path")
|
||||
sub.prop(view, "show_bundle_names", text="3D Marker Names")
|
||||
sub.label(text="Track Type and Size:")
|
||||
row = sub.row(align=True)
|
||||
row.prop(view, "tracks_draw_type", text="")
|
||||
row.prop(view, "tracks_draw_size", text="")
|
||||
col.separator()
|
||||
sub.prop(overlay, "grid_scale", text="Scale")
|
||||
sub.prop(overlay, "grid_subdivisions", text="Subdivisions")
|
||||
|
||||
if context.mode == 'EDIT_MESH':
|
||||
data = context.active_object.data
|
||||
statvis = context.tool_settings.statvis
|
||||
with_freestyle = bpy.app.build_options.freestyle
|
||||
col.separator()
|
||||
col.label(text="Edit Mesh:")
|
||||
col.label(text="Edit Mode:")
|
||||
|
||||
col.prop(overlay, "show_occlude_wire")
|
||||
|
||||
@@ -3690,72 +3640,6 @@ class VIEW3D_PT_overlay(Panel):
|
||||
sub.active = overlay.show_vertex_normals or overlay.show_face_normals or overlay.show_split_normals
|
||||
sub.prop(overlay, "normals_length", text="Size")
|
||||
|
||||
split = col.split()
|
||||
|
||||
sub = split.column()
|
||||
sub.prop(data, "show_faces", text="Faces")
|
||||
sub.prop(data, "show_edges", text="Edges")
|
||||
sub.prop(data, "show_edge_crease", text="Creases")
|
||||
|
||||
if with_freestyle:
|
||||
sub.prop(data, "show_edge_seams", text="Seams")
|
||||
|
||||
sub = split.column()
|
||||
if not with_freestyle:
|
||||
sub.prop(data, "show_edge_seams", text="Seams")
|
||||
sub.prop(data, "show_edge_sharp", text="Sharp", text_ctxt=i18n_contexts.plural)
|
||||
col.prop(data, "show_edge_bevel_weight", text="Bevel")
|
||||
if with_freestyle:
|
||||
sub.prop(data, "show_freestyle_edge_marks", text="Edge Marks")
|
||||
sub.prop(data, "show_freestyle_face_marks", text="Face Marks")
|
||||
|
||||
col.separator()
|
||||
split = col.split()
|
||||
sub = split.column()
|
||||
sub.label(text="Edge Info:")
|
||||
sub.prop(data, "show_extra_edge_length", text="Length")
|
||||
sub.prop(data, "show_extra_edge_angle", text="Angle")
|
||||
sub = split.column()
|
||||
sub.label(text="Face Info:")
|
||||
sub.prop(data, "show_extra_face_area", text="Area")
|
||||
sub.prop(data, "show_extra_face_angle", text="Angle")
|
||||
if bpy.app.debug:
|
||||
sub.prop(data, "show_extra_indices", text="Indices")
|
||||
|
||||
col.prop(data, "show_statvis", text="Mesh Analysis")
|
||||
sub = col.column()
|
||||
sub.active = data.show_statvis
|
||||
sub.prop(statvis, "type")
|
||||
statvis_type = statvis.type
|
||||
if statvis_type == 'OVERHANG':
|
||||
row = sub.row(align=True)
|
||||
row.prop(statvis, "overhang_min", text="")
|
||||
row.prop(statvis, "overhang_max", text="")
|
||||
layout.row().prop(statvis, "overhang_axis", expand=True)
|
||||
elif statvis_type == 'THICKNESS':
|
||||
row = sub.row(align=True)
|
||||
row.prop(statvis, "thickness_min", text="")
|
||||
row.prop(statvis, "thickness_max", text="")
|
||||
layout.prop(statvis, "thickness_samples")
|
||||
elif statvis_type == 'INTERSECT':
|
||||
pass
|
||||
elif statvis_type == 'DISTORT':
|
||||
row = sub.row(align=True)
|
||||
row.prop(statvis, "distort_min", text="")
|
||||
row.prop(statvis, "distort_max", text="")
|
||||
elif statvis_type == 'SHARP':
|
||||
row = sub.row(align=True)
|
||||
row.prop(statvis, "sharp_min", text="")
|
||||
row.prop(statvis, "sharp_max", text="")
|
||||
|
||||
elif context.mode == 'EDIT_CURVE':
|
||||
data = context.active_object.data
|
||||
col.separator()
|
||||
col.label(text="Edit Curve:")
|
||||
row = col.row()
|
||||
row.prop(data, "show_handles", text="Handles")
|
||||
row.prop(data, "show_normal_face", text="Normals")
|
||||
|
||||
elif context.mode == 'POSE':
|
||||
col.separator()
|
||||
col.label(text="Pose Mode:")
|
||||
@@ -3763,11 +3647,7 @@ class VIEW3D_PT_overlay(Panel):
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
col.prop(overlay, "show_transparent_bones")
|
||||
row = col.split(0.65)
|
||||
row.prop(overlay, "show_bone_selection")
|
||||
sub = row.column()
|
||||
sub.active = display_all and overlay.show_bone_selection
|
||||
sub.prop(overlay, "bone_selection_alpha", text="")
|
||||
col.prop(overlay, "show_bone_selection")
|
||||
|
||||
elif context.mode == 'EDIT_ARMATURE':
|
||||
col.separator()
|
||||
@@ -3854,6 +3734,157 @@ class VIEW3D_PT_view3d_stereo(Panel):
|
||||
split.prop(view, "stereo_3d_volume_alpha", text="Alpha")
|
||||
|
||||
|
||||
class VIEW3D_PT_view3d_motion_tracking(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Motion Tracking"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
view = context.space_data
|
||||
return (view)
|
||||
|
||||
def draw_header(self, context):
|
||||
view = context.space_data
|
||||
|
||||
self.layout.prop(view, "show_reconstruction", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
view = context.space_data
|
||||
|
||||
col = layout.column()
|
||||
col.active = view.show_reconstruction
|
||||
col.prop(view, "show_camera_path", text="Camera Path")
|
||||
col.prop(view, "show_bundle_names", text="3D Marker Names")
|
||||
col.label(text="Track Type and Size:")
|
||||
row = col.row(align=True)
|
||||
row.prop(view, "tracks_draw_type", text="")
|
||||
row.prop(view, "tracks_draw_size", text="")
|
||||
|
||||
|
||||
class VIEW3D_PT_view3d_meshdisplay(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Mesh Display"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
# The active object check is needed because of local-mode
|
||||
return (context.active_object and (context.mode == 'EDIT_MESH'))
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
with_freestyle = bpy.app.build_options.freestyle
|
||||
|
||||
mesh = context.active_object.data
|
||||
scene = context.scene
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Overlays:")
|
||||
col.prop(mesh, "show_faces", text="Faces")
|
||||
col.prop(mesh, "show_edges", text="Edges")
|
||||
col.prop(mesh, "show_edge_crease", text="Creases")
|
||||
if with_freestyle:
|
||||
col.prop(mesh, "show_edge_seams", text="Seams")
|
||||
|
||||
col = split.column()
|
||||
col.label()
|
||||
if not with_freestyle:
|
||||
col.prop(mesh, "show_edge_seams", text="Seams")
|
||||
col.prop(mesh, "show_edge_sharp", text="Sharp", text_ctxt=i18n_contexts.plural)
|
||||
col.prop(mesh, "show_edge_bevel_weight", text="Bevel")
|
||||
if with_freestyle:
|
||||
col.prop(mesh, "show_freestyle_edge_marks", text="Edge Marks")
|
||||
col.prop(mesh, "show_freestyle_face_marks", text="Face Marks")
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.separator()
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.label(text="Edge Info:")
|
||||
col.prop(mesh, "show_extra_edge_length", text="Length")
|
||||
col.prop(mesh, "show_extra_edge_angle", text="Angle")
|
||||
col = split.column()
|
||||
col.label(text="Face Info:")
|
||||
col.prop(mesh, "show_extra_face_area", text="Area")
|
||||
col.prop(mesh, "show_extra_face_angle", text="Angle")
|
||||
if bpy.app.debug:
|
||||
layout.prop(mesh, "show_extra_indices", text="Indices")
|
||||
|
||||
|
||||
class VIEW3D_PT_view3d_meshstatvis(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Mesh Analysis"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
# The active object check is needed because of local-mode
|
||||
return (context.active_object and (context.mode == 'EDIT_MESH'))
|
||||
|
||||
def draw_header(self, context):
|
||||
mesh = context.active_object.data
|
||||
|
||||
self.layout.prop(mesh, "show_statvis", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
mesh = context.active_object.data
|
||||
statvis = context.tool_settings.statvis
|
||||
layout.active = mesh.show_statvis
|
||||
|
||||
layout.prop(statvis, "type")
|
||||
statvis_type = statvis.type
|
||||
if statvis_type == 'OVERHANG':
|
||||
row = layout.row(align=True)
|
||||
row.prop(statvis, "overhang_min", text="")
|
||||
row.prop(statvis, "overhang_max", text="")
|
||||
layout.row().prop(statvis, "overhang_axis", expand=True)
|
||||
elif statvis_type == 'THICKNESS':
|
||||
row = layout.row(align=True)
|
||||
row.prop(statvis, "thickness_min", text="")
|
||||
row.prop(statvis, "thickness_max", text="")
|
||||
layout.prop(statvis, "thickness_samples")
|
||||
elif statvis_type == 'INTERSECT':
|
||||
pass
|
||||
elif statvis_type == 'DISTORT':
|
||||
row = layout.row(align=True)
|
||||
row.prop(statvis, "distort_min", text="")
|
||||
row.prop(statvis, "distort_max", text="")
|
||||
elif statvis_type == 'SHARP':
|
||||
row = layout.row(align=True)
|
||||
row.prop(statvis, "sharp_min", text="")
|
||||
row.prop(statvis, "sharp_max", text="")
|
||||
|
||||
|
||||
class VIEW3D_PT_view3d_curvedisplay(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Curve Display"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
editmesh = context.mode == 'EDIT_CURVE'
|
||||
return (editmesh)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
curve = context.active_object.data
|
||||
|
||||
col = layout.column()
|
||||
row = col.row()
|
||||
row.prop(curve, "show_handles", text="Handles")
|
||||
row.prop(curve, "show_normal_face", text="Normals")
|
||||
|
||||
|
||||
class VIEW3D_PT_transform_orientations(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
@@ -4048,14 +4079,17 @@ classes = (
|
||||
VIEW3D_MT_edit_armature_delete,
|
||||
VIEW3D_MT_edit_gpencil_transform,
|
||||
VIEW3D_MT_edit_gpencil_interpolate,
|
||||
VIEW3D_PIE_object_mode,
|
||||
VIEW3D_PIE_view,
|
||||
VIEW3D_PT_grease_pencil,
|
||||
VIEW3D_PT_grease_pencil_palettecolor,
|
||||
VIEW3D_PT_view3d_properties,
|
||||
VIEW3D_PT_view3d_cursor,
|
||||
VIEW3D_PT_view3d_name,
|
||||
VIEW3D_PT_quad_view,
|
||||
VIEW3D_PT_view3d_stereo,
|
||||
VIEW3D_PT_view3d_motion_tracking,
|
||||
VIEW3D_PT_view3d_meshdisplay,
|
||||
VIEW3D_PT_view3d_meshstatvis,
|
||||
VIEW3D_PT_view3d_curvedisplay,
|
||||
VIEW3D_PT_shading,
|
||||
VIEW3D_PT_overlay,
|
||||
VIEW3D_PT_transform_orientations,
|
||||
|
@@ -101,7 +101,6 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
|
||||
|
||||
# ********** default tools for editmode_curve ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_curveedit_options_stroke(View3DPanel, Panel):
|
||||
bl_category = "Options"
|
||||
bl_context = ".curve_edit" # dot on purpose (access from topbar)
|
||||
@@ -156,6 +155,8 @@ class VIEW3D_PT_tools_curveedit_options_stroke(View3DPanel, Panel):
|
||||
colsub.prop(cps, "surface_plane", expand=True)
|
||||
|
||||
|
||||
|
||||
|
||||
# ********** default tools for editmode_armature ****************
|
||||
|
||||
|
||||
@@ -1322,8 +1323,6 @@ class VIEW3D_PT_tools_grease_pencil_brush(GreasePencilBrushPanel, Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
|
||||
# Grease Pencil drawingcurves
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
|
||||
|
@@ -29,8 +29,8 @@ extern "C" {
|
||||
|
||||
struct bContext;
|
||||
struct CacheReader;
|
||||
struct DerivedMesh;
|
||||
struct ListBase;
|
||||
struct Mesh;
|
||||
struct Object;
|
||||
struct Scene;
|
||||
|
||||
@@ -114,10 +114,9 @@ void ABC_get_transform(struct CacheReader *reader,
|
||||
float time,
|
||||
float scale);
|
||||
|
||||
/* Either modifies current_mesh in-place or constructs a new mesh. */
|
||||
struct Mesh *ABC_read_mesh(struct CacheReader *reader,
|
||||
struct DerivedMesh *ABC_read_mesh(struct CacheReader *reader,
|
||||
struct Object *ob,
|
||||
struct Mesh *current_mesh,
|
||||
struct DerivedMesh *dm,
|
||||
const float time,
|
||||
const char **err_str,
|
||||
int flags);
|
||||
|
@@ -37,8 +37,8 @@ extern "C" {
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
|
||||
#include "BKE_cdderivedmesh.h"
|
||||
#include "BKE_curve.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_object.h"
|
||||
|
||||
#include "ED_curve.h"
|
||||
@@ -400,13 +400,13 @@ void read_curve_sample(Curve *cu, const ICurvesSchema &schema, const ISampleSele
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE: Alembic only stores data about control points, but the Mesh
|
||||
/* NOTE: Alembic only stores data about control points, but the DerivedMesh
|
||||
* passed from the cache modifier contains the displist, which has more data
|
||||
* than the control points, so to avoid corrupting the displist we modify the
|
||||
* object directly and create a new Mesh from that. Also we might need to
|
||||
* object directly and create a new DerivedMesh from that. Also we might need to
|
||||
* create new or delete existing NURBS in the curve.
|
||||
*/
|
||||
Mesh *AbcCurveReader::read_mesh(Mesh * /*existing_mesh*/,
|
||||
DerivedMesh *AbcCurveReader::read_derivedmesh(DerivedMesh * /*dm*/,
|
||||
const ISampleSelector &sample_sel,
|
||||
int /*read_flag*/,
|
||||
const char ** /*err_str*/)
|
||||
@@ -450,5 +450,5 @@ Mesh *AbcCurveReader::read_mesh(Mesh * /*existing_mesh*/,
|
||||
}
|
||||
}
|
||||
|
||||
return BKE_mesh_new_nomain_from_curve(m_object);
|
||||
return CDDM_from_curve(m_object);
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
const char **err_str) const;
|
||||
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel);
|
||||
struct Mesh *read_mesh(struct Mesh *existing_mesh,
|
||||
DerivedMesh *read_derivedmesh(DerivedMesh *dm,
|
||||
const Alembic::Abc::ISampleSelector &sample_sel,
|
||||
int read_flag,
|
||||
const char **err_str);
|
||||
|
@@ -60,8 +60,6 @@ extern "C" {
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_scene.h"
|
||||
|
||||
#include "DEG_depsgraph_query.h"
|
||||
}
|
||||
|
||||
using Alembic::Abc::TimeSamplingPtr;
|
||||
@@ -383,13 +381,14 @@ void AbcExporter::createTransformWritersHierarchy(Depsgraph *depsgraph)
|
||||
|
||||
void AbcExporter::exploreTransform(Depsgraph *depsgraph, Base *ob_base, Object *parent, Object *dupliObParent)
|
||||
{
|
||||
Object *ob = ob_base->object;
|
||||
|
||||
/* If an object isn't exported itself, its duplilist shouldn't be
|
||||
* exported either. */
|
||||
if (!export_object(&m_settings, ob_base, dupliObParent != NULL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object *ob = DEG_get_evaluated_object(depsgraph, ob_base->object);
|
||||
if (object_type_is_exportable(m_scene, ob)) {
|
||||
createTransformWriter(depsgraph, ob, parent, dupliObParent);
|
||||
}
|
||||
@@ -418,9 +417,9 @@ void AbcExporter::exploreTransform(Depsgraph *depsgraph, Base *ob_base, Object *
|
||||
exploreTransform(depsgraph, &fake_base, dupli_parent, ob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free_object_duplilist(lb);
|
||||
}
|
||||
}
|
||||
|
||||
AbcTransformWriter * AbcExporter::createTransformWriter(Depsgraph *depsgraph, Object *ob, Object *parent, Object *dupliObParent)
|
||||
@@ -528,9 +527,9 @@ void AbcExporter::exploreObject(Depsgraph *depsgraph, Base *ob_base, Object *dup
|
||||
exploreObject(depsgraph, &fake_base, ob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free_object_duplilist(lb);
|
||||
}
|
||||
}
|
||||
|
||||
void AbcExporter::createParticleSystemsWriters(Object *ob, AbcTransformWriter *xform)
|
||||
|
@@ -30,16 +30,12 @@
|
||||
extern "C" {
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math_geom.h"
|
||||
|
||||
#include "BKE_library.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_mesh_runtime.h"
|
||||
#include "BKE_DerivedMesh.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_particle.h"
|
||||
}
|
||||
@@ -81,8 +77,8 @@ void AbcHairWriter::do_write()
|
||||
return;
|
||||
}
|
||||
|
||||
Mesh *mesh = mesh_get_eval_final(m_depsgraph, m_scene, m_object, CD_MASK_MESH);
|
||||
BKE_mesh_tessface_ensure(mesh);
|
||||
DerivedMesh *dm = mesh_create_derived_render(m_depsgraph, m_scene, m_object, CD_MASK_MESH);
|
||||
DM_ensure_tessface(dm);
|
||||
|
||||
std::vector<Imath::V3f> verts;
|
||||
std::vector<int32_t> hvertices;
|
||||
@@ -92,14 +88,14 @@ void AbcHairWriter::do_write()
|
||||
if (m_psys->pathcache) {
|
||||
ParticleSettings *part = m_psys->part;
|
||||
|
||||
write_hair_sample(mesh, part, verts, norm_values, uv_values, hvertices);
|
||||
write_hair_sample(dm, part, verts, norm_values, uv_values, hvertices);
|
||||
|
||||
if (m_settings.export_child_hairs && m_psys->childcache) {
|
||||
write_hair_child_sample(mesh, part, verts, norm_values, uv_values, hvertices);
|
||||
write_hair_child_sample(dm, part, verts, norm_values, uv_values, hvertices);
|
||||
}
|
||||
}
|
||||
|
||||
BKE_id_free(NULL, mesh);
|
||||
dm->release(dm);
|
||||
|
||||
Alembic::Abc::P3fArraySample iPos(verts);
|
||||
m_sample = OCurvesSchema::Sample(iPos, hvertices);
|
||||
@@ -123,7 +119,7 @@ void AbcHairWriter::do_write()
|
||||
m_schema.set(m_sample);
|
||||
}
|
||||
|
||||
void AbcHairWriter::write_hair_sample(Mesh *mesh,
|
||||
void AbcHairWriter::write_hair_sample(DerivedMesh *dm,
|
||||
ParticleSettings *part,
|
||||
std::vector<Imath::V3f> &verts,
|
||||
std::vector<Imath::V3f> &norm_values,
|
||||
@@ -134,9 +130,9 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
|
||||
float inv_mat[4][4];
|
||||
invert_m4_m4_safe(inv_mat, m_object->obmat);
|
||||
|
||||
MTFace *mtface = mesh->mtface;
|
||||
MFace *mface = mesh->mface;
|
||||
MVert *mverts = mesh->mvert;
|
||||
MTFace *mtface = static_cast<MTFace *>(CustomData_get_layer(&dm->faceData, CD_MTFACE));
|
||||
MFace *mface = dm->getTessFaceArray(dm);
|
||||
MVert *mverts = dm->getVertArray(dm);
|
||||
|
||||
if ((!mtface || !mface) && !m_uv_warning_shown) {
|
||||
std::fprintf(stderr, "Warning, no UV set found for underlying geometry of %s.\n",
|
||||
@@ -159,9 +155,8 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
|
||||
if (part->from == PART_FROM_FACE && mtface) {
|
||||
const int num = pa->num_dmcache >= 0 ? pa->num_dmcache : pa->num;
|
||||
|
||||
if (num < mesh->totface) {
|
||||
/* TODO(Sybren): check whether the NULL check here and if(mface) are actually required */
|
||||
MFace *face = mface == NULL ? NULL : &mface[num];
|
||||
if (num < dm->getNumTessFaces(dm)) {
|
||||
MFace *face = static_cast<MFace *>(dm->getTessFaceData(dm, num, CD_MFACE));
|
||||
MTFace *tface = mtface + num;
|
||||
|
||||
if (mface) {
|
||||
@@ -177,7 +172,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::fprintf(stderr, "Particle to faces overflow (%d/%d)\n", num, mesh->totface);
|
||||
std::fprintf(stderr, "Particle to faces overflow (%d/%d)\n", num, dm->getNumTessFaces(dm));
|
||||
}
|
||||
}
|
||||
else if (part->from == PART_FROM_VERT && mtface) {
|
||||
@@ -185,8 +180,8 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
|
||||
const int num = (pa->num_dmcache >= 0) ? pa->num_dmcache : pa->num;
|
||||
|
||||
/* iterate over all faces to find a corresponding underlying UV */
|
||||
for (int n = 0; n < mesh->totface; ++n) {
|
||||
MFace *face = &mface[n];
|
||||
for (int n = 0; n < dm->getNumTessFaces(dm); ++n) {
|
||||
MFace *face = static_cast<MFace *>(dm->getTessFaceData(dm, n, CD_MFACE));
|
||||
MTFace *tface = mtface + n;
|
||||
unsigned int vtx[4];
|
||||
vtx[0] = face->v1;
|
||||
@@ -235,7 +230,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
|
||||
}
|
||||
}
|
||||
|
||||
void AbcHairWriter::write_hair_child_sample(Mesh *mesh,
|
||||
void AbcHairWriter::write_hair_child_sample(DerivedMesh *dm,
|
||||
ParticleSettings *part,
|
||||
std::vector<Imath::V3f> &verts,
|
||||
std::vector<Imath::V3f> &norm_values,
|
||||
@@ -246,8 +241,8 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh,
|
||||
float inv_mat[4][4];
|
||||
invert_m4_m4_safe(inv_mat, m_object->obmat);
|
||||
|
||||
MTFace *mtface = mesh->mtface;
|
||||
MVert *mverts = mesh->mvert;
|
||||
MTFace *mtface = static_cast<MTFace *>(CustomData_get_layer(&dm->faceData, CD_MTFACE));
|
||||
MVert *mverts = dm->getVertArray(dm);
|
||||
|
||||
ParticleCacheKey **cache = m_psys->childcache;
|
||||
ParticleCacheKey *path;
|
||||
@@ -270,7 +265,7 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh,
|
||||
continue;
|
||||
}
|
||||
|
||||
MFace *face = &mesh->mface[num];
|
||||
MFace *face = static_cast<MFace *>(dm->getTessFaceData(dm, num, CD_MFACE));
|
||||
MTFace *tface = mtface + num;
|
||||
|
||||
float r_uv[2], tmpnor[3], mapfw[4], vec[3];
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "abc_object.h"
|
||||
|
||||
struct DerivedMesh;
|
||||
struct ParticleSettings;
|
||||
struct ParticleSystem;
|
||||
|
||||
@@ -50,14 +51,14 @@ public:
|
||||
private:
|
||||
virtual void do_write();
|
||||
|
||||
void write_hair_sample(struct Mesh *mesh,
|
||||
void write_hair_sample(DerivedMesh *dm,
|
||||
ParticleSettings *part,
|
||||
std::vector<Imath::V3f> &verts,
|
||||
std::vector<Imath::V3f> &norm_values,
|
||||
std::vector<Imath::V2f> &uv_values,
|
||||
std::vector<int32_t> &hvertices);
|
||||
|
||||
void write_hair_child_sample(struct Mesh *mesh,
|
||||
void write_hair_child_sample(DerivedMesh *dm,
|
||||
ParticleSettings *part,
|
||||
std::vector<Imath::V3f> &verts,
|
||||
std::vector<Imath::V3f> &norm_values,
|
||||
|
@@ -30,7 +30,6 @@
|
||||
extern "C" {
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
#include "DNA_object_fluidsim_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
@@ -38,10 +37,10 @@ extern "C" {
|
||||
#include "BLI_math_geom.h"
|
||||
#include "BLI_string.h"
|
||||
|
||||
#include "BKE_cdderivedmesh.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_mesh_runtime.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_object.h"
|
||||
|
||||
@@ -104,27 +103,27 @@ using Alembic::AbcGeom::IN3fGeomParam;
|
||||
|
||||
/* NOTE: Alembic's polygon winding order is clockwise, to match with Renderman. */
|
||||
|
||||
static void get_vertices(struct Mesh *mesh, std::vector<Imath::V3f> &points)
|
||||
static void get_vertices(DerivedMesh *dm, std::vector<Imath::V3f> &points)
|
||||
{
|
||||
points.clear();
|
||||
points.resize(mesh->totvert);
|
||||
points.resize(dm->getNumVerts(dm));
|
||||
|
||||
MVert *verts = mesh->mvert;
|
||||
MVert *verts = dm->getVertArray(dm);
|
||||
|
||||
for (int i = 0, e = mesh->totvert; i < e; ++i) {
|
||||
for (int i = 0, e = dm->getNumVerts(dm); i < e; ++i) {
|
||||
copy_yup_from_zup(points[i].getValue(), verts[i].co);
|
||||
}
|
||||
}
|
||||
|
||||
static void get_topology(struct Mesh *mesh,
|
||||
static void get_topology(DerivedMesh *dm,
|
||||
std::vector<int32_t> &poly_verts,
|
||||
std::vector<int32_t> &loop_counts,
|
||||
bool &smooth_normal)
|
||||
{
|
||||
const int num_poly = mesh->totpoly;
|
||||
const int num_loops = mesh->totloop;
|
||||
MLoop *mloop = mesh->mloop;
|
||||
MPoly *mpoly = mesh->mpoly;
|
||||
const int num_poly = dm->getNumPolys(dm);
|
||||
const int num_loops = dm->getNumLoops(dm);
|
||||
MLoop *mloop = dm->getLoopArray(dm);
|
||||
MPoly *mpoly = dm->getPolyArray(dm);
|
||||
|
||||
poly_verts.clear();
|
||||
loop_counts.clear();
|
||||
@@ -146,7 +145,7 @@ static void get_topology(struct Mesh *mesh,
|
||||
}
|
||||
}
|
||||
|
||||
static void get_creases(struct Mesh *mesh,
|
||||
static void get_creases(DerivedMesh *dm,
|
||||
std::vector<int32_t> &indices,
|
||||
std::vector<int32_t> &lengths,
|
||||
std::vector<float> &sharpnesses)
|
||||
@@ -157,9 +156,9 @@ static void get_creases(struct Mesh *mesh,
|
||||
lengths.clear();
|
||||
sharpnesses.clear();
|
||||
|
||||
MEdge *edge = mesh->medge;
|
||||
MEdge *edge = dm->getEdgeArray(dm);
|
||||
|
||||
for (int i = 0, e = mesh->totedge; i < e; ++i) {
|
||||
for (int i = 0, e = dm->getNumEdges(dm); i < e; ++i) {
|
||||
const float sharpness = static_cast<float>(edge[i].crease) * factor;
|
||||
|
||||
if (sharpness != 0.0f) {
|
||||
@@ -172,40 +171,41 @@ static void get_creases(struct Mesh *mesh,
|
||||
lengths.resize(sharpnesses.size(), 2);
|
||||
}
|
||||
|
||||
static void get_vertex_normals(struct Mesh *mesh, std::vector<Imath::V3f> &normals)
|
||||
static void get_vertex_normals(DerivedMesh *dm, std::vector<Imath::V3f> &normals)
|
||||
{
|
||||
normals.clear();
|
||||
normals.resize(mesh->totvert);
|
||||
normals.resize(dm->getNumVerts(dm));
|
||||
|
||||
MVert *verts = mesh->mvert;
|
||||
MVert *verts = dm->getVertArray(dm);
|
||||
float no[3];
|
||||
|
||||
for (int i = 0, e = mesh->totvert; i < e; ++i) {
|
||||
for (int i = 0, e = dm->getNumVerts(dm); i < e; ++i) {
|
||||
normal_short_to_float_v3(no, verts[i].no);
|
||||
copy_yup_from_zup(normals[i].getValue(), no);
|
||||
}
|
||||
}
|
||||
|
||||
static void get_loop_normals(struct Mesh *mesh, std::vector<Imath::V3f> &normals)
|
||||
static void get_loop_normals(DerivedMesh *dm, std::vector<Imath::V3f> &normals)
|
||||
{
|
||||
MPoly *mp = mesh->mpoly;
|
||||
MPoly *mpoly = dm->getPolyArray(dm);
|
||||
MPoly *mp = mpoly;
|
||||
|
||||
MLoop *mloop = mesh->mloop;
|
||||
MLoop *mloop = dm->getLoopArray(dm);
|
||||
MLoop *ml = mloop;
|
||||
|
||||
MVert *verts = mesh->mvert;
|
||||
MVert *verts = dm->getVertArray(dm);
|
||||
|
||||
const float (*lnors)[3] = static_cast<float(*)[3]>(CustomData_get_layer(&mesh->ldata, CD_NORMAL));
|
||||
const float (*lnors)[3] = static_cast<float(*)[3]>(dm->getLoopDataArray(dm, CD_NORMAL));
|
||||
|
||||
normals.clear();
|
||||
normals.resize(mesh->totloop);
|
||||
normals.resize(dm->getNumLoops(dm));
|
||||
|
||||
unsigned loop_index = 0;
|
||||
|
||||
/* NOTE: data needs to be written in the reverse order. */
|
||||
|
||||
if (lnors) {
|
||||
for (int i = 0, e = mesh->totpoly; i < e; ++i, ++mp) {
|
||||
for (int i = 0, e = dm->getNumPolys(dm); i < e; ++i, ++mp) {
|
||||
ml = mloop + mp->loopstart + (mp->totloop - 1);
|
||||
|
||||
for (int j = 0; j < mp->totloop; --ml, ++j, ++loop_index) {
|
||||
@@ -217,7 +217,7 @@ static void get_loop_normals(struct Mesh *mesh, std::vector<Imath::V3f> &normals
|
||||
else {
|
||||
float no[3];
|
||||
|
||||
for (int i = 0, e = mesh->totpoly; i < e; ++i, ++mp) {
|
||||
for (int i = 0, e = dm->getNumPolys(dm); i < e; ++i, ++mp) {
|
||||
ml = mloop + mp->loopstart + (mp->totloop - 1);
|
||||
|
||||
/* Flat shaded, use common normal for all verts. */
|
||||
@@ -369,37 +369,36 @@ void AbcMeshWriter::do_write()
|
||||
if (!m_first_frame && !m_is_animated)
|
||||
return;
|
||||
|
||||
bool needsfree;
|
||||
struct Mesh *mesh = getFinalMesh(needsfree);
|
||||
DerivedMesh *dm = getFinalMesh();
|
||||
|
||||
try {
|
||||
if (m_settings.use_subdiv_schema && m_subdiv_schema.valid()) {
|
||||
writeSubD(mesh);
|
||||
writeSubD(dm);
|
||||
}
|
||||
else {
|
||||
writeMesh(mesh);
|
||||
writeMesh(dm);
|
||||
}
|
||||
|
||||
if (needsfree) BKE_id_free(NULL, mesh);
|
||||
freeMesh(dm);
|
||||
}
|
||||
catch (...) {
|
||||
if (needsfree) BKE_id_free(NULL, mesh);
|
||||
freeMesh(dm);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
void AbcMeshWriter::writeMesh(struct Mesh *mesh)
|
||||
void AbcMeshWriter::writeMesh(DerivedMesh *dm)
|
||||
{
|
||||
std::vector<Imath::V3f> points, normals;
|
||||
std::vector<int32_t> poly_verts, loop_counts;
|
||||
|
||||
bool smooth_normal = false;
|
||||
|
||||
get_vertices(mesh, points);
|
||||
get_topology(mesh, poly_verts, loop_counts, smooth_normal);
|
||||
get_vertices(dm, points);
|
||||
get_topology(dm, poly_verts, loop_counts, smooth_normal);
|
||||
|
||||
if (m_first_frame && m_settings.export_face_sets) {
|
||||
writeFaceSets(mesh, m_mesh_schema);
|
||||
writeFaceSets(dm, m_mesh_schema);
|
||||
}
|
||||
|
||||
m_mesh_sample = OPolyMeshSchema::Sample(V3fArraySample(points),
|
||||
@@ -408,7 +407,7 @@ void AbcMeshWriter::writeMesh(struct Mesh *mesh)
|
||||
|
||||
UVSample sample;
|
||||
if (m_first_frame && m_settings.export_uvs) {
|
||||
const char *name = get_uv_sample(sample, m_custom_data_config, &mesh->ldata);
|
||||
const char *name = get_uv_sample(sample, m_custom_data_config, &dm->loopData);
|
||||
|
||||
if (!sample.indices.empty() && !sample.uvs.empty()) {
|
||||
OV2fGeomParam::Sample uv_sample;
|
||||
@@ -420,15 +419,15 @@ void AbcMeshWriter::writeMesh(struct Mesh *mesh)
|
||||
m_mesh_sample.setUVs(uv_sample);
|
||||
}
|
||||
|
||||
write_custom_data(m_mesh_schema.getArbGeomParams(), m_custom_data_config, &mesh->ldata, CD_MLOOPUV);
|
||||
write_custom_data(m_mesh_schema.getArbGeomParams(), m_custom_data_config, &dm->loopData, CD_MLOOPUV);
|
||||
}
|
||||
|
||||
if (m_settings.export_normals) {
|
||||
if (smooth_normal) {
|
||||
get_loop_normals(mesh, normals);
|
||||
get_loop_normals(dm, normals);
|
||||
}
|
||||
else {
|
||||
get_vertex_normals(mesh, normals);
|
||||
get_vertex_normals(dm, normals);
|
||||
}
|
||||
|
||||
ON3fGeomParam::Sample normals_sample;
|
||||
@@ -442,7 +441,7 @@ void AbcMeshWriter::writeMesh(struct Mesh *mesh)
|
||||
|
||||
if (m_is_liquid) {
|
||||
std::vector<Imath::V3f> velocities;
|
||||
getVelocities(mesh, velocities);
|
||||
getVelocities(dm, velocities);
|
||||
|
||||
m_mesh_sample.setVelocities(V3fArraySample(velocities));
|
||||
}
|
||||
@@ -451,10 +450,10 @@ void AbcMeshWriter::writeMesh(struct Mesh *mesh)
|
||||
|
||||
m_mesh_schema.set(m_mesh_sample);
|
||||
|
||||
writeArbGeoParams(mesh);
|
||||
writeArbGeoParams(dm);
|
||||
}
|
||||
|
||||
void AbcMeshWriter::writeSubD(struct Mesh *mesh)
|
||||
void AbcMeshWriter::writeSubD(DerivedMesh *dm)
|
||||
{
|
||||
std::vector<float> crease_sharpness;
|
||||
std::vector<Imath::V3f> points;
|
||||
@@ -463,12 +462,12 @@ void AbcMeshWriter::writeSubD(struct Mesh *mesh)
|
||||
|
||||
bool smooth_normal = false;
|
||||
|
||||
get_vertices(mesh, points);
|
||||
get_topology(mesh, poly_verts, loop_counts, smooth_normal);
|
||||
get_creases(mesh, crease_indices, crease_lengths, crease_sharpness);
|
||||
get_vertices(dm, points);
|
||||
get_topology(dm, poly_verts, loop_counts, smooth_normal);
|
||||
get_creases(dm, crease_indices, crease_lengths, crease_sharpness);
|
||||
|
||||
if (m_first_frame && m_settings.export_face_sets) {
|
||||
writeFaceSets(mesh, m_subdiv_schema);
|
||||
writeFaceSets(dm, m_subdiv_schema);
|
||||
}
|
||||
|
||||
m_subdiv_sample = OSubDSchema::Sample(V3fArraySample(points),
|
||||
@@ -477,7 +476,7 @@ void AbcMeshWriter::writeSubD(struct Mesh *mesh)
|
||||
|
||||
UVSample sample;
|
||||
if (m_first_frame && m_settings.export_uvs) {
|
||||
const char *name = get_uv_sample(sample, m_custom_data_config, &mesh->ldata);
|
||||
const char *name = get_uv_sample(sample, m_custom_data_config, &dm->loopData);
|
||||
|
||||
if (!sample.indices.empty() && !sample.uvs.empty()) {
|
||||
OV2fGeomParam::Sample uv_sample;
|
||||
@@ -489,7 +488,7 @@ void AbcMeshWriter::writeSubD(struct Mesh *mesh)
|
||||
m_subdiv_sample.setUVs(uv_sample);
|
||||
}
|
||||
|
||||
write_custom_data(m_subdiv_schema.getArbGeomParams(), m_custom_data_config, &mesh->ldata, CD_MLOOPUV);
|
||||
write_custom_data(m_subdiv_schema.getArbGeomParams(), m_custom_data_config, &dm->loopData, CD_MLOOPUV);
|
||||
}
|
||||
|
||||
if (!crease_indices.empty()) {
|
||||
@@ -501,11 +500,11 @@ void AbcMeshWriter::writeSubD(struct Mesh *mesh)
|
||||
m_subdiv_sample.setSelfBounds(bounds());
|
||||
m_subdiv_schema.set(m_subdiv_sample);
|
||||
|
||||
writeArbGeoParams(mesh);
|
||||
writeArbGeoParams(dm);
|
||||
}
|
||||
|
||||
template <typename Schema>
|
||||
void AbcMeshWriter::writeFaceSets(struct Mesh *dm, Schema &schema)
|
||||
void AbcMeshWriter::writeFaceSets(DerivedMesh *dm, Schema &schema)
|
||||
{
|
||||
std::map< std::string, std::vector<int32_t> > geo_groups;
|
||||
getGeoGroups(dm, geo_groups);
|
||||
@@ -519,15 +518,14 @@ void AbcMeshWriter::writeFaceSets(struct Mesh *dm, Schema &schema)
|
||||
}
|
||||
}
|
||||
|
||||
Mesh *AbcMeshWriter::getFinalMesh(bool &r_needsfree)
|
||||
DerivedMesh *AbcMeshWriter::getFinalMesh()
|
||||
{
|
||||
/* We don't want subdivided mesh data */
|
||||
if (m_subsurf_mod) {
|
||||
m_subsurf_mod->mode |= eModifierMode_DisableTemporary;
|
||||
}
|
||||
|
||||
struct Mesh *mesh = mesh_get_eval_final(m_depsgraph, m_scene, m_object, CD_MASK_MESH);
|
||||
r_needsfree = false;
|
||||
DerivedMesh *dm = mesh_create_derived_render(m_depsgraph, m_scene, m_object, CD_MASK_MESH);
|
||||
|
||||
if (m_subsurf_mod) {
|
||||
m_subsurf_mod->mode &= ~eModifierMode_DisableTemporary;
|
||||
@@ -538,31 +536,34 @@ Mesh *AbcMeshWriter::getFinalMesh(bool &r_needsfree)
|
||||
const int quad_method = m_settings.quad_method;
|
||||
const int ngon_method = m_settings.ngon_method;
|
||||
|
||||
struct BMeshCreateParams bmcp = {.use_toolflags = false,};
|
||||
struct BMeshFromMeshParams bmfmp = {.calc_face_normal = true,};
|
||||
BMesh *bm = BKE_mesh_to_bmesh_ex(mesh, &bmcp, &bmfmp);
|
||||
BMesh *bm = DM_to_bmesh(dm, true);
|
||||
|
||||
BM_mesh_triangulate(bm, quad_method, ngon_method, tag_only, NULL, NULL, NULL);
|
||||
|
||||
struct BMeshToMeshParams bmmp = {0};
|
||||
Mesh *result = BKE_bmesh_to_mesh_nomain(bm, &bmmp);
|
||||
DerivedMesh *result = CDDM_from_bmesh(bm, false);
|
||||
BM_mesh_free(bm);
|
||||
|
||||
mesh = result;
|
||||
r_needsfree = true;
|
||||
freeMesh(dm);
|
||||
|
||||
dm = result;
|
||||
}
|
||||
|
||||
m_custom_data_config.pack_uvs = m_settings.pack_uv;
|
||||
m_custom_data_config.mpoly = mesh->mpoly;
|
||||
m_custom_data_config.mloop = mesh->mloop;
|
||||
m_custom_data_config.totpoly = mesh->totpoly;
|
||||
m_custom_data_config.totloop = mesh->totloop;
|
||||
m_custom_data_config.totvert = mesh->totvert;
|
||||
m_custom_data_config.mpoly = dm->getPolyArray(dm);
|
||||
m_custom_data_config.mloop = dm->getLoopArray(dm);
|
||||
m_custom_data_config.totpoly = dm->getNumPolys(dm);
|
||||
m_custom_data_config.totloop = dm->getNumLoops(dm);
|
||||
m_custom_data_config.totvert = dm->getNumVerts(dm);
|
||||
|
||||
return mesh;
|
||||
return dm;
|
||||
}
|
||||
|
||||
void AbcMeshWriter::writeArbGeoParams(struct Mesh *dm)
|
||||
void AbcMeshWriter::freeMesh(DerivedMesh *dm)
|
||||
{
|
||||
dm->release(dm);
|
||||
}
|
||||
|
||||
void AbcMeshWriter::writeArbGeoParams(DerivedMesh *dm)
|
||||
{
|
||||
if (m_is_liquid) {
|
||||
/* We don't need anything more for liquid meshes. */
|
||||
@@ -571,17 +572,17 @@ void AbcMeshWriter::writeArbGeoParams(struct Mesh *dm)
|
||||
|
||||
if (m_first_frame && m_settings.export_vcols) {
|
||||
if (m_subdiv_schema.valid()) {
|
||||
write_custom_data(m_subdiv_schema.getArbGeomParams(), m_custom_data_config, &dm->ldata, CD_MLOOPCOL);
|
||||
write_custom_data(m_subdiv_schema.getArbGeomParams(), m_custom_data_config, &dm->loopData, CD_MLOOPCOL);
|
||||
}
|
||||
else {
|
||||
write_custom_data(m_mesh_schema.getArbGeomParams(), m_custom_data_config, &dm->ldata, CD_MLOOPCOL);
|
||||
write_custom_data(m_mesh_schema.getArbGeomParams(), m_custom_data_config, &dm->loopData, CD_MLOOPCOL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AbcMeshWriter::getVelocities(struct Mesh *mesh, std::vector<Imath::V3f> &vels)
|
||||
void AbcMeshWriter::getVelocities(DerivedMesh *dm, std::vector<Imath::V3f> &vels)
|
||||
{
|
||||
const int totverts = mesh->totvert;
|
||||
const int totverts = dm->getNumVerts(dm);
|
||||
|
||||
vels.clear();
|
||||
vels.resize(totverts);
|
||||
@@ -604,11 +605,11 @@ void AbcMeshWriter::getVelocities(struct Mesh *mesh, std::vector<Imath::V3f> &ve
|
||||
}
|
||||
|
||||
void AbcMeshWriter::getGeoGroups(
|
||||
struct Mesh *mesh,
|
||||
DerivedMesh *dm,
|
||||
std::map<std::string, std::vector<int32_t> > &geo_groups)
|
||||
{
|
||||
const int num_poly = mesh->totpoly;
|
||||
MPoly *polygons = mesh->mpoly;
|
||||
const int num_poly = dm->getNumPolys(dm);
|
||||
MPoly *polygons = dm->getPolyArray(dm);
|
||||
|
||||
for (int i = 0; i < num_poly; ++i) {
|
||||
MPoly ¤t_poly = polygons[i];
|
||||
@@ -637,7 +638,7 @@ void AbcMeshWriter::getGeoGroups(
|
||||
|
||||
std::vector<int32_t> faceArray;
|
||||
|
||||
for (int i = 0, e = mesh->totface; i < e; ++i) {
|
||||
for (int i = 0, e = dm->getNumTessFaces(dm); i < e; ++i) {
|
||||
faceArray.push_back(i);
|
||||
}
|
||||
|
||||
@@ -872,11 +873,11 @@ ABC_INLINE void read_normals_params(AbcMeshData &abc_data,
|
||||
}
|
||||
}
|
||||
|
||||
static bool check_smooth_poly_flag(Mesh *mesh)
|
||||
static bool check_smooth_poly_flag(DerivedMesh *dm)
|
||||
{
|
||||
MPoly *mpolys = mesh->mpoly;
|
||||
MPoly *mpolys = dm->getPolyArray(dm);
|
||||
|
||||
for (int i = 0, e = mesh->totpoly; i < e; ++i) {
|
||||
for (int i = 0, e = dm->getNumPolys(dm); i < e; ++i) {
|
||||
MPoly &poly = mpolys[i];
|
||||
|
||||
if ((poly.flag & ME_SMOOTH) != 0) {
|
||||
@@ -887,11 +888,11 @@ static bool check_smooth_poly_flag(Mesh *mesh)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void set_smooth_poly_flag(Mesh *mesh)
|
||||
static void set_smooth_poly_flag(DerivedMesh *dm)
|
||||
{
|
||||
MPoly *mpolys = mesh->mpoly;
|
||||
MPoly *mpolys = dm->getPolyArray(dm);
|
||||
|
||||
for (int i = 0, e = mesh->totpoly; i < e; ++i) {
|
||||
for (int i = 0, e = dm->getNumPolys(dm); i < e; ++i) {
|
||||
MPoly &poly = mpolys[i];
|
||||
poly.flag |= ME_SMOOTH;
|
||||
}
|
||||
@@ -899,7 +900,7 @@ static void set_smooth_poly_flag(Mesh *mesh)
|
||||
|
||||
static void *add_customdata_cb(void *user_data, const char *name, int data_type)
|
||||
{
|
||||
Mesh *mesh = static_cast<Mesh *>(user_data);
|
||||
DerivedMesh *dm = static_cast<DerivedMesh *>(user_data);
|
||||
CustomDataType cd_data_type = static_cast<CustomDataType>(data_type);
|
||||
void *cd_ptr;
|
||||
CustomData *loopdata;
|
||||
@@ -910,7 +911,7 @@ static void *add_customdata_cb(void *user_data, const char *name, int data_type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
loopdata = &mesh->ldata;
|
||||
loopdata = dm->getLoopDataLayout(dm);
|
||||
cd_ptr = CustomData_get_layer_named(loopdata, cd_data_type, name);
|
||||
if (cd_ptr != NULL) {
|
||||
/* layer already exists, so just return it. */
|
||||
@@ -919,7 +920,7 @@ static void *add_customdata_cb(void *user_data, const char *name, int data_type)
|
||||
|
||||
/* create a new layer, taking care to construct the hopefully-soon-to-be-removed
|
||||
* CD_MTEXPOLY layer too, with the same name. */
|
||||
numloops = mesh->totloop;
|
||||
numloops = dm->getNumLoops(dm);
|
||||
cd_ptr = CustomData_add_layer_named(loopdata, cd_data_type, CD_DEFAULT,
|
||||
NULL, numloops, name);
|
||||
return cd_ptr;
|
||||
@@ -985,19 +986,17 @@ static void read_mesh_sample(const std::string & iobject_full_name,
|
||||
}
|
||||
}
|
||||
|
||||
CDStreamConfig get_config(Mesh *mesh)
|
||||
CDStreamConfig get_config(DerivedMesh *dm)
|
||||
{
|
||||
CDStreamConfig config;
|
||||
|
||||
BLI_assert(mesh->mvert);
|
||||
|
||||
config.user_data = mesh;
|
||||
config.mvert = mesh->mvert;
|
||||
config.mloop = mesh->mloop;
|
||||
config.mpoly = mesh->mpoly;
|
||||
config.totloop = mesh->totloop;
|
||||
config.totpoly = mesh->totpoly;
|
||||
config.loopdata = &mesh->ldata;
|
||||
config.user_data = dm;
|
||||
config.mvert = dm->getVertArray(dm);
|
||||
config.mloop = dm->getLoopArray(dm);
|
||||
config.mpoly = dm->getPolyArray(dm);
|
||||
config.totloop = dm->getNumLoops(dm);
|
||||
config.totpoly = dm->getNumPolys(dm);
|
||||
config.loopdata = dm->getLoopDataLayout(dm);
|
||||
config.add_customdata_cb = add_customdata_cb;
|
||||
|
||||
return config;
|
||||
@@ -1028,8 +1027,14 @@ void AbcMeshReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec
|
||||
m_object = BKE_object_add_only_object(bmain, OB_MESH, m_object_name.c_str());
|
||||
m_object->data = mesh;
|
||||
|
||||
Mesh *read_mesh = this->read_mesh(mesh, sample_sel, MOD_MESHSEQ_READ_ALL, NULL);
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, CD_MASK_MESH, true);
|
||||
DerivedMesh *dm = CDDM_from_mesh(mesh);
|
||||
DerivedMesh *ndm = this->read_derivedmesh(dm, sample_sel, MOD_MESHSEQ_READ_ALL, NULL);
|
||||
|
||||
if (ndm != dm) {
|
||||
dm->release(dm);
|
||||
}
|
||||
|
||||
DM_to_mesh(ndm, mesh, m_object, CD_MASK_MESH, true);
|
||||
|
||||
if (m_settings->validate_meshes) {
|
||||
BKE_mesh_validate(mesh, false, false);
|
||||
@@ -1059,7 +1064,7 @@ bool AbcMeshReader::accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHe
|
||||
return true;
|
||||
}
|
||||
|
||||
Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
DerivedMesh *AbcMeshReader::read_derivedmesh(DerivedMesh *dm,
|
||||
const ISampleSelector &sample_sel,
|
||||
int read_flag,
|
||||
const char **err_str)
|
||||
@@ -1070,17 +1075,17 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
const Alembic::Abc::Int32ArraySamplePtr &face_indices = sample.getFaceIndices();
|
||||
const Alembic::Abc::Int32ArraySamplePtr &face_counts = sample.getFaceCounts();
|
||||
|
||||
Mesh *new_mesh = NULL;
|
||||
DerivedMesh *new_dm = NULL;
|
||||
|
||||
/* Only read point data when streaming meshes, unless we need to create new ones. */
|
||||
ImportSettings settings;
|
||||
settings.read_flag |= read_flag;
|
||||
|
||||
bool topology_changed = positions->size() != existing_mesh->totvert ||
|
||||
face_counts->size() != existing_mesh->totpoly ||
|
||||
face_indices->size() != existing_mesh->totloop;
|
||||
bool topology_changed = positions->size() != dm->getNumVerts(dm) ||
|
||||
face_counts->size() != dm->getNumPolys(dm) ||
|
||||
face_indices->size() != dm->getNumLoops(dm);
|
||||
if (topology_changed) {
|
||||
new_mesh = BKE_mesh_new_nomain_from_template(existing_mesh,
|
||||
new_dm = CDDM_from_template(dm,
|
||||
positions->size(),
|
||||
0,
|
||||
0,
|
||||
@@ -1093,8 +1098,8 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
/* If the face count changed (e.g. by triangulation), only read points.
|
||||
* This prevents crash from T49813.
|
||||
* TODO(kevin): perhaps find a better way to do this? */
|
||||
if (face_counts->size() != existing_mesh->totpoly ||
|
||||
face_indices->size() != existing_mesh->totloop)
|
||||
if (face_counts->size() != dm->getNumPolys(dm) ||
|
||||
face_indices->size() != dm->getNumLoops(dm))
|
||||
{
|
||||
settings.read_flag = MOD_MESHSEQ_READ_VERT;
|
||||
|
||||
@@ -1105,39 +1110,40 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
}
|
||||
}
|
||||
|
||||
CDStreamConfig config = get_config(new_mesh ? new_mesh : existing_mesh);
|
||||
CDStreamConfig config = get_config(new_dm ? new_dm : dm);
|
||||
config.time = sample_sel.getRequestedTime();
|
||||
|
||||
bool do_normals = false;
|
||||
read_mesh_sample(m_iobject.getFullName(),
|
||||
&settings, m_schema, sample_sel, config, do_normals);
|
||||
|
||||
if (new_mesh) {
|
||||
if (new_dm) {
|
||||
/* Check if we had ME_SMOOTH flag set to restore it. */
|
||||
if (!do_normals && check_smooth_poly_flag(existing_mesh)) {
|
||||
set_smooth_poly_flag(new_mesh);
|
||||
if (!do_normals && check_smooth_poly_flag(dm)) {
|
||||
set_smooth_poly_flag(new_dm);
|
||||
}
|
||||
|
||||
BKE_mesh_calc_normals(new_mesh);
|
||||
BKE_mesh_calc_edges(new_mesh, false, false);
|
||||
CDDM_calc_normals(new_dm);
|
||||
CDDM_calc_edges(new_dm);
|
||||
|
||||
/* Here we assume that the number of materials doesn't change, i.e. that
|
||||
* the material slots that were created when the object was loaded from
|
||||
* Alembic are still valid now. */
|
||||
size_t num_polys = new_mesh->totpoly;
|
||||
size_t num_polys = new_dm->getNumPolys(new_dm);
|
||||
if (num_polys > 0) {
|
||||
MPoly *dmpolies = new_dm->getPolyArray(new_dm);
|
||||
std::map<std::string, int> mat_map;
|
||||
assign_facesets_to_mpoly(sample_sel, 0, new_mesh->mpoly, num_polys, mat_map);
|
||||
assign_facesets_to_mpoly(sample_sel, 0, dmpolies, num_polys, mat_map);
|
||||
}
|
||||
|
||||
return new_mesh;
|
||||
return new_dm;
|
||||
}
|
||||
|
||||
if (do_normals) {
|
||||
BKE_mesh_calc_normals(existing_mesh);
|
||||
CDDM_calc_normals(dm);
|
||||
}
|
||||
|
||||
return existing_mesh;
|
||||
return dm;
|
||||
}
|
||||
|
||||
void AbcMeshReader::assign_facesets_to_mpoly(
|
||||
@@ -1299,8 +1305,14 @@ void AbcSubDReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec
|
||||
m_object = BKE_object_add_only_object(bmain, OB_MESH, m_object_name.c_str());
|
||||
m_object->data = mesh;
|
||||
|
||||
Mesh *read_mesh = this->read_mesh(mesh, sample_sel, MOD_MESHSEQ_READ_ALL, NULL);
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, CD_MASK_MESH, true);
|
||||
DerivedMesh *dm = CDDM_from_mesh(mesh);
|
||||
DerivedMesh *ndm = this->read_derivedmesh(dm, sample_sel, MOD_MESHSEQ_READ_ALL, NULL);
|
||||
|
||||
if (ndm != dm) {
|
||||
dm->release(dm);
|
||||
}
|
||||
|
||||
DM_to_mesh(ndm, mesh, m_object, CD_MASK_MESH, true);
|
||||
|
||||
const ISubDSchema::Sample sample = m_schema.getValue(sample_sel);
|
||||
Int32ArraySamplePtr indices = sample.getCreaseIndices();
|
||||
@@ -1332,7 +1344,7 @@ void AbcSubDReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec
|
||||
}
|
||||
}
|
||||
|
||||
Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh,
|
||||
DerivedMesh *AbcSubDReader::read_derivedmesh(DerivedMesh *dm,
|
||||
const ISampleSelector &sample_sel,
|
||||
int read_flag,
|
||||
const char **err_str)
|
||||
@@ -1343,13 +1355,13 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh,
|
||||
const Alembic::Abc::Int32ArraySamplePtr &face_indices = sample.getFaceIndices();
|
||||
const Alembic::Abc::Int32ArraySamplePtr &face_counts = sample.getFaceCounts();
|
||||
|
||||
Mesh *new_mesh = NULL;
|
||||
DerivedMesh *new_dm = NULL;
|
||||
|
||||
ImportSettings settings;
|
||||
settings.read_flag |= read_flag;
|
||||
|
||||
if (existing_mesh->totvert != positions->size()) {
|
||||
new_mesh = BKE_mesh_new_nomain_from_template(existing_mesh,
|
||||
if (dm->getNumVerts(dm) != positions->size()) {
|
||||
new_dm = CDDM_from_template(dm,
|
||||
positions->size(),
|
||||
0,
|
||||
0,
|
||||
@@ -1362,8 +1374,8 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh,
|
||||
/* If the face count changed (e.g. by triangulation), only read points.
|
||||
* This prevents crash from T49813.
|
||||
* TODO(kevin): perhaps find a better way to do this? */
|
||||
if (face_counts->size() != existing_mesh->totpoly ||
|
||||
face_indices->size() != existing_mesh->totpoly)
|
||||
if (face_counts->size() != dm->getNumPolys(dm) ||
|
||||
face_indices->size() != dm->getNumLoops(dm))
|
||||
{
|
||||
settings.read_flag = MOD_MESHSEQ_READ_VERT;
|
||||
|
||||
@@ -1375,22 +1387,22 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh,
|
||||
}
|
||||
|
||||
/* Only read point data when streaming meshes, unless we need to create new ones. */
|
||||
CDStreamConfig config = get_config(new_mesh ? new_mesh : existing_mesh);
|
||||
CDStreamConfig config = get_config(new_dm ? new_dm : dm);
|
||||
config.time = sample_sel.getRequestedTime();
|
||||
read_subd_sample(m_iobject.getFullName(),
|
||||
&settings, m_schema, sample_sel, config);
|
||||
|
||||
if (new_mesh) {
|
||||
if (new_dm) {
|
||||
/* Check if we had ME_SMOOTH flag set to restore it. */
|
||||
if (check_smooth_poly_flag(existing_mesh)) {
|
||||
set_smooth_poly_flag(new_mesh);
|
||||
if (check_smooth_poly_flag(dm)) {
|
||||
set_smooth_poly_flag(new_dm);
|
||||
}
|
||||
|
||||
BKE_mesh_calc_normals(new_mesh);
|
||||
BKE_mesh_calc_edges(new_mesh, false, false);
|
||||
CDDM_calc_normals(new_dm);
|
||||
CDDM_calc_edges(new_dm);
|
||||
|
||||
return new_mesh;
|
||||
return new_dm;
|
||||
}
|
||||
|
||||
return existing_mesh;
|
||||
return dm;
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "abc_customdata.h"
|
||||
#include "abc_object.h"
|
||||
|
||||
struct DerivedMesh;
|
||||
struct Mesh;
|
||||
struct ModifierData;
|
||||
|
||||
@@ -64,28 +65,29 @@ private:
|
||||
|
||||
bool isAnimated() const;
|
||||
|
||||
void writeMesh(struct Mesh *mesh);
|
||||
void writeSubD(struct Mesh *mesh);
|
||||
void writeMesh(DerivedMesh *dm);
|
||||
void writeSubD(DerivedMesh *dm);
|
||||
|
||||
void getMeshInfo(struct Mesh *mesh, std::vector<float> &points,
|
||||
void getMeshInfo(DerivedMesh *dm, std::vector<float> &points,
|
||||
std::vector<int32_t> &facePoints,
|
||||
std::vector<int32_t> &faceCounts,
|
||||
std::vector<int32_t> &creaseIndices,
|
||||
std::vector<int32_t> &creaseLengths,
|
||||
std::vector<float> &creaseSharpness);
|
||||
|
||||
struct Mesh *getFinalMesh(bool &r_needsfree);
|
||||
DerivedMesh *getFinalMesh();
|
||||
void freeMesh(DerivedMesh *dm);
|
||||
|
||||
void getMaterialIndices(struct Mesh *mesh, std::vector<int32_t> &indices);
|
||||
void getMaterialIndices(DerivedMesh *dm, std::vector<int32_t> &indices);
|
||||
|
||||
void writeArbGeoParams(struct Mesh *mesh);
|
||||
void getGeoGroups(struct Mesh *mesh, std::map<std::string, std::vector<int32_t> > &geoGroups);
|
||||
void writeArbGeoParams(DerivedMesh *dm);
|
||||
void getGeoGroups(DerivedMesh *dm, std::map<std::string, std::vector<int32_t> > &geoGroups);
|
||||
|
||||
/* fluid surfaces support */
|
||||
void getVelocities(struct Mesh *mesh, std::vector<Imath::V3f> &vels);
|
||||
void getVelocities(DerivedMesh *dm, std::vector<Imath::V3f> &vels);
|
||||
|
||||
template <typename Schema>
|
||||
void writeFaceSets(struct Mesh *mesh, Schema &schema);
|
||||
void writeFaceSets(DerivedMesh *dm, Schema &schema);
|
||||
};
|
||||
|
||||
/* ************************************************************************** */
|
||||
@@ -104,7 +106,7 @@ public:
|
||||
const char **err_str) const;
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel);
|
||||
|
||||
struct Mesh *read_mesh(struct Mesh *existing_mesh,
|
||||
DerivedMesh *read_derivedmesh(DerivedMesh *dm,
|
||||
const Alembic::Abc::ISampleSelector &sample_sel,
|
||||
int read_flag,
|
||||
const char **err_str);
|
||||
@@ -134,7 +136,7 @@ public:
|
||||
const Object *const ob,
|
||||
const char **err_str) const;
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel);
|
||||
struct Mesh *read_mesh(struct Mesh *existing_mesh,
|
||||
DerivedMesh *read_derivedmesh(DerivedMesh *dm,
|
||||
const Alembic::Abc::ISampleSelector &sample_sel,
|
||||
int read_flag,
|
||||
const char **err_str);
|
||||
@@ -146,6 +148,6 @@ void read_mverts(MVert *mverts,
|
||||
const Alembic::AbcGeom::P3fArraySamplePtr &positions,
|
||||
const Alembic::AbcGeom::N3fArraySamplePtr &normals);
|
||||
|
||||
CDStreamConfig get_config(struct Mesh *mesh);
|
||||
CDStreamConfig get_config(DerivedMesh *dm);
|
||||
|
||||
#endif /* __ABC_MESH_H__ */
|
||||
|
@@ -248,12 +248,12 @@ Imath::M44d get_matrix(const IXformSchema &schema, const float time)
|
||||
return s0.getMatrix();
|
||||
}
|
||||
|
||||
struct Mesh *AbcObjectReader::read_mesh(struct Mesh *existing_mesh,
|
||||
DerivedMesh *AbcObjectReader::read_derivedmesh(DerivedMesh *dm,
|
||||
const Alembic::Abc::ISampleSelector &UNUSED(sample_sel),
|
||||
int UNUSED(read_flag),
|
||||
const char **UNUSED(err_str))
|
||||
{
|
||||
return existing_mesh;
|
||||
return dm;
|
||||
}
|
||||
|
||||
void AbcObjectReader::setupObjectTransform(const float time)
|
||||
|
@@ -124,7 +124,7 @@ static bool has_animations(Schema &schema, ImportSettings *settings)
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
struct Mesh;
|
||||
struct DerivedMesh;
|
||||
|
||||
using Alembic::AbcCoreAbstract::chrono_t;
|
||||
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
|
||||
virtual void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) = 0;
|
||||
|
||||
virtual struct Mesh *read_mesh(struct Mesh *mesh,
|
||||
virtual DerivedMesh *read_derivedmesh(DerivedMesh *dm,
|
||||
const Alembic::Abc::ISampleSelector &sample_sel,
|
||||
int read_flag,
|
||||
const char **err_str);
|
||||
|
@@ -40,8 +40,6 @@ extern "C" {
|
||||
#include "BKE_scene.h"
|
||||
|
||||
#include "BLI_math.h"
|
||||
|
||||
#include "DEG_depsgraph_query.h"
|
||||
}
|
||||
|
||||
using Alembic::AbcGeom::kVertexScope;
|
||||
@@ -104,7 +102,7 @@ void AbcPointsWriter::do_write()
|
||||
continue;
|
||||
}
|
||||
|
||||
state.time = DEG_get_ctime(m_depsgraph);
|
||||
state.time = BKE_scene_frame_get(m_scene);
|
||||
|
||||
if (psys_get_particle_state(&sim, p, &state, 0) == 0) {
|
||||
continue;
|
||||
@@ -175,9 +173,15 @@ bool AbcPointsReader::accepts_object_type(const Alembic::AbcCoreAbstract::Object
|
||||
void AbcPointsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel)
|
||||
{
|
||||
Mesh *mesh = BKE_mesh_add(bmain, m_data_name.c_str());
|
||||
Mesh *read_mesh = this->read_mesh(mesh, sample_sel, 0, NULL);
|
||||
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, CD_MASK_MESH, true);
|
||||
DerivedMesh *dm = CDDM_from_mesh(mesh);
|
||||
DerivedMesh *ndm = this->read_derivedmesh(dm, sample_sel, 0, NULL);
|
||||
|
||||
if (ndm != dm) {
|
||||
dm->release(dm);
|
||||
}
|
||||
|
||||
DM_to_mesh(ndm, mesh, m_object, CD_MASK_MESH, true);
|
||||
|
||||
if (m_settings->validate_meshes) {
|
||||
BKE_mesh_validate(mesh, false, false);
|
||||
@@ -214,7 +218,7 @@ void read_points_sample(const IPointsSchema &schema,
|
||||
read_mverts(config.mvert, positions, vnormals);
|
||||
}
|
||||
|
||||
struct Mesh *AbcPointsReader::read_mesh(struct Mesh *existing_mesh,
|
||||
DerivedMesh *AbcPointsReader::read_derivedmesh(DerivedMesh *dm,
|
||||
const ISampleSelector &sample_sel,
|
||||
int /*read_flag*/,
|
||||
const char ** /*err_str*/)
|
||||
@@ -223,14 +227,14 @@ struct Mesh *AbcPointsReader::read_mesh(struct Mesh *existing_mesh,
|
||||
|
||||
const P3fArraySamplePtr &positions = sample.getPositions();
|
||||
|
||||
Mesh *new_mesh = NULL;
|
||||
DerivedMesh *new_dm = NULL;
|
||||
|
||||
if (existing_mesh->totvert != positions->size()) {
|
||||
new_mesh = BKE_mesh_new_nomain(positions->size(), 0, 0, 0, 0);
|
||||
if (dm->getNumVerts(dm) != positions->size()) {
|
||||
new_dm = CDDM_new(positions->size(), 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
CDStreamConfig config = get_config(new_mesh ? new_mesh : existing_mesh);
|
||||
CDStreamConfig config = get_config(new_dm ? new_dm : dm);
|
||||
read_points_sample(m_schema, sample_sel, config);
|
||||
|
||||
return new_mesh ? new_mesh : existing_mesh;
|
||||
return new_dm ? new_dm : dm;
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel);
|
||||
|
||||
struct Mesh *read_mesh(struct Mesh *existing_mesh,
|
||||
DerivedMesh *read_derivedmesh(DerivedMesh *dm,
|
||||
const Alembic::Abc::ISampleSelector &sample_sel,
|
||||
int read_flag,
|
||||
const char **err_str);
|
||||
|
@@ -960,9 +960,9 @@ void ABC_get_transform(CacheReader *reader, float r_mat[4][4], float time, float
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
Mesh *ABC_read_mesh(CacheReader *reader,
|
||||
DerivedMesh *ABC_read_mesh(CacheReader *reader,
|
||||
Object *ob,
|
||||
Mesh *existing_mesh,
|
||||
DerivedMesh *dm,
|
||||
const float time,
|
||||
const char **err_str,
|
||||
int read_flag)
|
||||
@@ -984,7 +984,7 @@ Mesh *ABC_read_mesh(CacheReader *reader,
|
||||
/* kFloorIndex is used to be compatible with non-interpolating
|
||||
* properties; they use the floor. */
|
||||
ISampleSelector sample_sel(time, ISampleSelector::kFloorIndex);
|
||||
return abc_reader->read_mesh(existing_mesh, sample_sel, read_flag, err_str);
|
||||
return abc_reader->read_derivedmesh(dm, sample_sel, read_flag, err_str);
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
@@ -531,6 +531,18 @@ DMCoNo *mesh_get_mapped_verts_nors(struct Scene *scene, struct Object *ob);
|
||||
void mesh_get_mapped_verts_coords(DerivedMesh *dm, float (*r_cos)[3], const int totcos);
|
||||
|
||||
/* */
|
||||
DerivedMesh *mesh_get_derived_final(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene,
|
||||
struct Object *ob, CustomDataMask dataMask);
|
||||
struct Mesh *mesh_get_eval_final(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, CustomDataMask dataMask);
|
||||
|
||||
DerivedMesh *mesh_get_derived_deform(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene,
|
||||
struct Object *ob, CustomDataMask dataMask);
|
||||
struct Mesh *mesh_get_eval_deform(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene,
|
||||
struct Object *ob, CustomDataMask dataMask);
|
||||
|
||||
DerivedMesh *mesh_create_derived_for_modifier(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob,
|
||||
|
@@ -32,17 +32,16 @@
|
||||
* \author nzc
|
||||
* \since March 2001
|
||||
*/
|
||||
struct Depsgraph;
|
||||
struct Path;
|
||||
struct Object;
|
||||
struct Scene;
|
||||
struct ListBase;
|
||||
struct bAnimVizSettings;
|
||||
struct bMotionPath;
|
||||
struct bPoseChannel;
|
||||
struct Depsgraph;
|
||||
struct ListBase;
|
||||
struct Main;
|
||||
struct Object;
|
||||
struct ParticleSystem;
|
||||
struct Path;
|
||||
struct ReportList;
|
||||
struct Scene;
|
||||
struct Main;
|
||||
|
||||
/* ---------------------------------------------------- */
|
||||
/* Animation Visualization */
|
||||
@@ -69,6 +68,7 @@ int where_on_path(struct Object *ob, float ctime, float vec[4], float dir[3], fl
|
||||
/* ---------------------------------------------------- */
|
||||
/* Dupli-Geometry */
|
||||
|
||||
struct ListBase *object_duplilist_ex(struct Depsgraph *depsgraph, struct Scene *sce, struct Object *ob, bool update);
|
||||
struct ListBase *object_duplilist(struct Depsgraph *depsgraph, struct Scene *sce, struct Object *ob);
|
||||
void free_object_duplilist(struct ListBase *lb);
|
||||
int count_duplilist(struct Object *ob);
|
||||
@@ -83,26 +83,6 @@ typedef struct DupliApplyData {
|
||||
DupliExtraData *extra;
|
||||
} DupliApplyData;
|
||||
|
||||
typedef struct DupliObject {
|
||||
struct DupliObject *next, *prev;
|
||||
struct Object *ob;
|
||||
float mat[4][4];
|
||||
float orco[3], uv[2];
|
||||
|
||||
short type; /* from Object.transflag */
|
||||
char no_draw;
|
||||
|
||||
/* Persistent identifier for a dupli object, for inter-frame matching of
|
||||
* objects with motion blur, or inter-update matching for syncing. */
|
||||
int persistent_id[16]; /* 2*MAX_DUPLI_RECUR */
|
||||
|
||||
/* Particle this dupli was generated from. */
|
||||
struct ParticleSystem *particle_system;
|
||||
|
||||
/* Random ID for shading */
|
||||
unsigned int random_id;
|
||||
} DupliObject;
|
||||
|
||||
DupliApplyData *duplilist_apply(struct Depsgraph *depsgraph, struct Object *ob, struct Scene *scene, struct ListBase *duplilist);
|
||||
void duplilist_restore(struct ListBase *duplilist, DupliApplyData *apply_data);
|
||||
void duplilist_free_apply_data(DupliApplyData *apply_data);
|
||||
|
@@ -28,7 +28,7 @@
|
||||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 280
|
||||
#define BLENDER_SUBVERSION 17
|
||||
#define BLENDER_SUBVERSION 16
|
||||
/* Several breakages with 270, e.g. constraint deg vs rad */
|
||||
#define BLENDER_MINVERSION 270
|
||||
#define BLENDER_MINSUBVERSION 6
|
||||
|
@@ -91,6 +91,7 @@ bool BKE_collection_is_in_scene(struct Collection *collection);
|
||||
void BKE_collections_after_lib_link(struct Main *bmain);
|
||||
bool BKE_collection_object_cyclic_check(struct Main *bmain, struct Object *object, struct Collection *collection);
|
||||
bool BKE_collection_is_animated(struct Collection *collection, struct Object *parent);
|
||||
void BKE_collection_handle_recalc_and_update(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *parent, struct Collection *collection);
|
||||
|
||||
/* Object list cache. */
|
||||
|
||||
|
@@ -182,9 +182,6 @@ struct BlendThumbnail *BKE_main_thumbnail_from_imbuf(struct Main *bmain, struct
|
||||
struct ImBuf *BKE_main_thumbnail_to_imbuf(struct Main *bmain, struct BlendThumbnail *data);
|
||||
void BKE_main_thumbnail_create(struct Main *bmain);
|
||||
|
||||
const char *BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL();
|
||||
const char *BKE_main_blendfile_path_from_global(void);
|
||||
|
||||
void BKE_main_id_tag_idcode(struct Main *mainvar, const short type, const int tag, const bool value);
|
||||
void BKE_main_id_tag_listbase(struct ListBase *lb, const int tag, const bool value);
|
||||
void BKE_main_id_tag_all(struct Main *mainvar, const int tag, const bool value);
|
||||
|
@@ -76,6 +76,8 @@ void BKE_mball_select_swap(struct MetaBall *mb);
|
||||
|
||||
struct Depsgraph;
|
||||
|
||||
void BKE_mball_eval_geometry(struct Depsgraph *depsgraph,
|
||||
struct MetaBall *mball);
|
||||
/* Draw Cache */
|
||||
|
||||
enum {
|
||||
|
@@ -178,9 +178,9 @@ struct Mesh *BKE_mesh_create_derived_for_modifier(
|
||||
struct ModifierData *md, int build_shapekey_layers);
|
||||
|
||||
/* Copies a nomain-Mesh into an existing Mesh. */
|
||||
void BKE_mesh_nomain_to_mesh(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct Object *ob,
|
||||
void BKE_nomain_mesh_to_mesh(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct Object *ob,
|
||||
CustomDataMask mask, bool take_ownership);
|
||||
void BKE_mesh_nomain_to_meshkey(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct KeyBlock *kb);
|
||||
void BKE_nomain_mesh_to_meshkey(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct KeyBlock *kb);
|
||||
|
||||
|
||||
/* vertex level transformations & checks (no derived mesh) */
|
||||
@@ -206,10 +206,23 @@ void BKE_mesh_mselect_active_set(struct Mesh *me, int index, int type);
|
||||
|
||||
void BKE_mesh_apply_vert_coords(struct Mesh *mesh, float (*vertCoords)[3]);
|
||||
|
||||
/* *** mesh_runtime.c *** */
|
||||
void BKE_mesh_runtime_reset(struct Mesh *mesh);
|
||||
int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh);
|
||||
void BKE_mesh_runtime_looptri_recalc(struct Mesh *mesh);
|
||||
const struct MLoopTri *BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh);
|
||||
bool BKE_mesh_runtime_ensure_edit_data(struct Mesh *mesh);
|
||||
bool BKE_mesh_runtime_clear_edit_data(struct Mesh *mesh);
|
||||
void BKE_mesh_runtime_clear_geometry(struct Mesh *mesh);
|
||||
void BKE_mesh_runtime_clear_cache(struct Mesh *mesh);
|
||||
|
||||
void BKE_mesh_runtime_verttri_from_looptri(
|
||||
struct MVertTri *r_verttri,
|
||||
const struct MLoop *mloop, const struct MLoopTri *looptri, int looptri_num);
|
||||
|
||||
|
||||
/* *** mesh_evaluate.c *** */
|
||||
|
||||
void BKE_mesh_calc_normals_mapping_simple(struct Mesh *me);
|
||||
void BKE_mesh_calc_normals_mapping(
|
||||
struct MVert *mverts, int numVerts,
|
||||
const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float (*r_polyNors)[3],
|
||||
|
@@ -1,85 +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) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef __BKE_MESH_RUNTIME_H__
|
||||
#define __BKE_MESH_RUNTIME_H__
|
||||
|
||||
/** \file BKE_mesh_runtime.h
|
||||
* \ingroup bke
|
||||
*
|
||||
* This file contains access functions for the Mesh.runtime struct.
|
||||
*/
|
||||
|
||||
#include "BKE_customdata.h" /* for CustomDataMask */
|
||||
|
||||
struct Depsgraph;
|
||||
struct Mesh;
|
||||
struct MLoop;
|
||||
struct MLoopTri;
|
||||
struct MVertTri;
|
||||
struct Object;
|
||||
struct Scene;
|
||||
|
||||
/* Undefine to hide DerivedMesh-based function declarations */
|
||||
#define USE_DERIVEDMESH
|
||||
|
||||
#ifdef USE_DERIVEDMESH
|
||||
struct DerivedMesh;
|
||||
#endif
|
||||
|
||||
void BKE_mesh_runtime_reset(struct Mesh *mesh);
|
||||
int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh);
|
||||
void BKE_mesh_runtime_looptri_recalc(struct Mesh *mesh);
|
||||
const struct MLoopTri *BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh);
|
||||
bool BKE_mesh_runtime_ensure_edit_data(struct Mesh *mesh);
|
||||
bool BKE_mesh_runtime_clear_edit_data(struct Mesh *mesh);
|
||||
void BKE_mesh_runtime_clear_geometry(struct Mesh *mesh);
|
||||
void BKE_mesh_runtime_clear_cache(struct Mesh *mesh);
|
||||
|
||||
void BKE_mesh_runtime_verttri_from_looptri(
|
||||
struct MVertTri *r_verttri,
|
||||
const struct MLoop *mloop, const struct MLoopTri *looptri, int looptri_num);
|
||||
|
||||
/* NOTE: the functions below are defined in DerivedMesh.c, and are intended to be moved
|
||||
* to a more suitable location when that file is removed. */
|
||||
#ifdef USE_DERIVEDMESH
|
||||
struct DerivedMesh *mesh_get_derived_final(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene,
|
||||
struct Object *ob, CustomDataMask dataMask);
|
||||
#endif
|
||||
struct Mesh *mesh_get_eval_final(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, CustomDataMask dataMask);
|
||||
|
||||
#ifdef USE_DERIVEDMESH
|
||||
struct DerivedMesh *mesh_get_derived_deform(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene,
|
||||
struct Object *ob, CustomDataMask dataMask);
|
||||
#endif
|
||||
struct Mesh *mesh_get_eval_deform(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene,
|
||||
struct Object *ob, CustomDataMask dataMask);
|
||||
|
||||
#endif /* __BKE_MESH_RUNTIME_H__ */
|
@@ -49,7 +49,7 @@ void BKE_movieclip_make_local(struct Main *bmain, struct MovieClip *clip, const
|
||||
struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name);
|
||||
struct MovieClip *BKE_movieclip_file_add_exists_ex(struct Main *bmain, const char *name, bool *r_exists);
|
||||
struct MovieClip *BKE_movieclip_file_add_exists(struct Main *bmain, const char *name);
|
||||
void BKE_movieclip_reload(struct Main *bmain, struct MovieClip *clip);
|
||||
void BKE_movieclip_reload(struct MovieClip *clip);
|
||||
void BKE_movieclip_clear_cache(struct MovieClip *clip);
|
||||
void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip);
|
||||
|
||||
|
@@ -274,9 +274,6 @@ void BKE_object_sculpt_modifiers_changed(struct Object *ob);
|
||||
int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot);
|
||||
|
||||
struct Mesh *BKE_object_get_evaluated_mesh(const struct Depsgraph *depsgraph, struct Object *ob);
|
||||
struct Mesh *BKE_object_get_final_mesh(struct Object *object);
|
||||
struct Mesh *BKE_object_get_pre_modified_mesh(struct Object *object);
|
||||
struct Mesh *BKE_object_get_original_mesh(struct Object *object);
|
||||
|
||||
int BKE_object_insert_ptcache(struct Object *ob);
|
||||
void BKE_object_delete_ptcache(struct Object *ob, int index);
|
||||
|
@@ -303,13 +303,15 @@ void psys_set_current_num(Object *ob, int index);
|
||||
struct LatticeDeformData *psys_create_lattice_deform_data(struct ParticleSimulationData *sim);
|
||||
|
||||
struct ParticleSystem *psys_orig_get(struct ParticleSystem *psys);
|
||||
struct ParticleSystem *psys_eval_get(struct Depsgraph *depsgraph,
|
||||
struct Object *object,
|
||||
struct ParticleSystem *psys);
|
||||
bool psys_in_edit_mode(struct Depsgraph *depsgraph, struct ParticleSystem *psys);
|
||||
bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, const bool use_render_params);
|
||||
bool psys_check_edited(struct ParticleSystem *psys);
|
||||
|
||||
void psys_check_group_weights(struct ParticleSettings *part);
|
||||
int psys_uses_gravity(struct ParticleSimulationData *sim);
|
||||
void BKE_particlesettings_fluid_default_settings(struct ParticleSettings *part);
|
||||
|
||||
/* free */
|
||||
void BKE_particlesettings_free(struct ParticleSettings *part);
|
||||
|
@@ -79,29 +79,29 @@ typedef struct SpaceType {
|
||||
|
||||
/* Initial allocation, after this WM will call init() too. Some editors need
|
||||
* area and scene data (e.g. frame range) to set their initial scrolling. */
|
||||
struct SpaceLink *(*new)(const struct ScrArea *sa, const struct Scene *scene);
|
||||
struct SpaceLink *(*new)(const struct ScrArea *, const struct Scene *);
|
||||
/* not free spacelink itself */
|
||||
void (*free)(struct SpaceLink *sl);
|
||||
void (*free)(struct SpaceLink *);
|
||||
|
||||
/* init is to cope with file load, screen (size) changes, check handlers */
|
||||
void (*init)(struct wmWindowManager *wm, struct ScrArea *sa);
|
||||
void (*init)(struct wmWindowManager *, struct ScrArea *);
|
||||
/* exit is called when the area is hidden or removed */
|
||||
void (*exit)(struct wmWindowManager *wm, struct ScrArea *sa);
|
||||
void (*exit)(struct wmWindowManager *, struct ScrArea *);
|
||||
/* Listeners can react to bContext changes */
|
||||
void (*listener)(struct bScreen *sc, struct ScrArea *sa,
|
||||
struct wmNotifier *wmn, struct Scene *scene,
|
||||
void (*listener)(struct bScreen *sc, struct ScrArea *,
|
||||
struct wmNotifier *, struct Scene *scene,
|
||||
struct WorkSpace *workspace);
|
||||
|
||||
/* refresh context, called after filereads, ED_area_tag_refresh() */
|
||||
void (*refresh)(const struct bContext *C, struct ScrArea *sa);
|
||||
void (*refresh)(const struct bContext *, struct ScrArea *);
|
||||
|
||||
/* after a spacedata copy, an init should result in exact same situation */
|
||||
struct SpaceLink *(*duplicate)(struct SpaceLink *sl);
|
||||
struct SpaceLink *(*duplicate)(struct SpaceLink *);
|
||||
|
||||
/* register operator types on startup */
|
||||
void (*operatortypes)(void);
|
||||
/* add default items to WM keymap */
|
||||
void (*keymap)(struct wmKeyConfig *keyconf);
|
||||
void (*keymap)(struct wmKeyConfig *);
|
||||
/* on startup, define dropboxes for spacetype+regions */
|
||||
void (*dropboxes)(void);
|
||||
|
||||
@@ -109,10 +109,10 @@ typedef struct SpaceType {
|
||||
void (*manipulators)(void);
|
||||
|
||||
/* return context data */
|
||||
int (*context)(const struct bContext *C, const char *member, struct bContextDataResult *result);
|
||||
int (*context)(const struct bContext *, const char *, struct bContextDataResult *);
|
||||
|
||||
/* Used when we want to replace an ID by another (or NULL). */
|
||||
void (*id_remap)(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id);
|
||||
void (*id_remap)(struct ScrArea *, struct SpaceLink *, struct ID *, struct ID *);
|
||||
|
||||
int (*space_subtype_get)(struct ScrArea *sa);
|
||||
void (*space_subtype_set)(struct ScrArea *sa, int value);
|
||||
@@ -139,18 +139,18 @@ typedef struct ARegionType {
|
||||
int regionid; /* unique identifier within this space, defines RGN_TYPE_xxxx */
|
||||
|
||||
/* add handlers, stuff you only do once or on area/region type/size changes */
|
||||
void (*init)(struct wmWindowManager *wm, struct ARegion *ar);
|
||||
void (*init)(struct wmWindowManager *, struct ARegion *);
|
||||
/* exit is called when the region is hidden or removed */
|
||||
void (*exit)(struct wmWindowManager *wm, struct ARegion *ar);
|
||||
void (*exit)(struct wmWindowManager *, struct ARegion *);
|
||||
/* draw entirely, view changes should be handled here */
|
||||
void (*draw)(const struct bContext *C, struct ARegion *ar);
|
||||
void (*draw)(const struct bContext *, struct ARegion *);
|
||||
/* optional, compute button layout before drawing for dynamic size */
|
||||
void (*layout)(const struct bContext *C, struct ARegion *ar);
|
||||
void (*layout)(const struct bContext *, struct ARegion *);
|
||||
/* snap the size of the region (can be NULL for no snapping). */
|
||||
int (*snap_size)(const struct ARegion *ar, int size, int axis);
|
||||
/* contextual changes should be handled here */
|
||||
void (*listener)(struct bScreen *sc, struct ScrArea *sa, struct ARegion *ar,
|
||||
struct wmNotifier *wmn, const struct Scene *scene);
|
||||
void (*listener)(struct bScreen *, struct ScrArea *, struct ARegion *,
|
||||
struct wmNotifier *, const struct Scene *scene);
|
||||
/* Optional callback to generate subscriptions. */
|
||||
void (*message_subscribe)(
|
||||
const struct bContext *C,
|
||||
@@ -161,18 +161,18 @@ typedef struct ARegionType {
|
||||
void (*free)(struct ARegion *);
|
||||
|
||||
/* split region, copy data optionally */
|
||||
void *(*duplicate)(void *poin);
|
||||
void *(*duplicate)(void *);
|
||||
|
||||
|
||||
/* register operator types on startup */
|
||||
void (*operatortypes)(void);
|
||||
/* add own items to keymap */
|
||||
void (*keymap)(struct wmKeyConfig *keyconf);
|
||||
void (*keymap)(struct wmKeyConfig *);
|
||||
/* allows default cursor per region */
|
||||
void (*cursor)(struct wmWindow *win, struct ScrArea *sa, struct ARegion *ar);
|
||||
void (*cursor)(struct wmWindow *, struct ScrArea *, struct ARegion *ar);
|
||||
|
||||
/* return context data */
|
||||
int (*context)(const struct bContext *C, const char *member, struct bContextDataResult *result);
|
||||
int (*context)(const struct bContext *, const char *, struct bContextDataResult *);
|
||||
|
||||
/* custom drawing callbacks */
|
||||
ListBase drawcalls;
|
||||
@@ -206,22 +206,17 @@ typedef struct PanelType {
|
||||
char context[BKE_ST_MAXNAME]; /* for buttons window */
|
||||
char category[BKE_ST_MAXNAME]; /* for category tabs */
|
||||
char owner_id[BKE_ST_MAXNAME]; /* for work-spaces to selectively show. */
|
||||
char parent_id[BKE_ST_MAXNAME]; /* parent idname for subpanels */
|
||||
int space_type;
|
||||
int region_type;
|
||||
|
||||
int flag;
|
||||
|
||||
/* verify if the panel should draw or not */
|
||||
int (*poll)(const struct bContext *C, struct PanelType *pt);
|
||||
int (*poll)(const struct bContext *, struct PanelType *);
|
||||
/* draw header (optional) */
|
||||
void (*draw_header)(const struct bContext *C, struct Panel *pa);
|
||||
void (*draw_header)(const struct bContext *, struct Panel *);
|
||||
/* draw entirely, view changes should be handled here */
|
||||
void (*draw)(const struct bContext *C, struct Panel *pa);
|
||||
|
||||
/* sub panels */
|
||||
struct PanelType *parent;
|
||||
ListBase children;
|
||||
void (*draw)(const struct bContext *, struct Panel *);
|
||||
|
||||
/* RNA integration */
|
||||
ExtensionRNA ext;
|
||||
@@ -230,18 +225,14 @@ typedef struct PanelType {
|
||||
/* uilist types */
|
||||
|
||||
/* Draw an item in the uiList */
|
||||
typedef void (*uiListDrawItemFunc)(
|
||||
struct uiList *ui_list, struct bContext *C, struct uiLayout *layout, struct PointerRNA *dataptr,
|
||||
struct PointerRNA *itemptr, int icon, struct PointerRNA *active_dataptr, const char *active_propname,
|
||||
int index, int flt_flag);
|
||||
typedef void (*uiListDrawItemFunc)(struct uiList *, struct bContext *, struct uiLayout *, struct PointerRNA *,
|
||||
struct PointerRNA *, int, struct PointerRNA *, const char *, int, int);
|
||||
|
||||
/* Draw the filtering part of an uiList */
|
||||
typedef void (*uiListDrawFilterFunc)(
|
||||
struct uiList *ui_list, struct bContext *C, struct uiLayout *layout);
|
||||
typedef void (*uiListDrawFilterFunc)(struct uiList *, struct bContext *, struct uiLayout *);
|
||||
|
||||
/* Filter items of an uiList */
|
||||
typedef void (*uiListFilterItemsFunc)(
|
||||
struct uiList *ui_list, struct bContext *C, struct PointerRNA *, const char *propname);
|
||||
typedef void (*uiListFilterItemsFunc)(struct uiList *, struct bContext *, struct PointerRNA *, const char *);
|
||||
|
||||
typedef struct uiListType {
|
||||
struct uiListType *next, *prev;
|
||||
@@ -266,7 +257,7 @@ typedef struct HeaderType {
|
||||
int region_type;
|
||||
|
||||
/* draw entirely, view changes should be handled here */
|
||||
void (*draw)(const struct bContext *C, struct Header *header);
|
||||
void (*draw)(const struct bContext *, struct Header *);
|
||||
|
||||
/* RNA integration */
|
||||
ExtensionRNA ext;
|
||||
@@ -290,9 +281,9 @@ typedef struct MenuType {
|
||||
const char *description;
|
||||
|
||||
/* verify if the menu should draw or not */
|
||||
int (*poll)(const struct bContext *C, struct MenuType *mt);
|
||||
int (*poll)(const struct bContext *, struct MenuType *);
|
||||
/* draw entirely, view changes should be handled here */
|
||||
void (*draw)(const struct bContext *C, struct Menu *menu);
|
||||
void (*draw)(const struct bContext *, struct Menu *);
|
||||
|
||||
/* RNA integration */
|
||||
ExtensionRNA ext;
|
||||
@@ -316,8 +307,7 @@ void BKE_spacedata_freelist(ListBase *lb);
|
||||
void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2);
|
||||
void BKE_spacedata_draw_locks(int set);
|
||||
|
||||
void BKE_spacedata_callback_id_remap_set(
|
||||
void (*func)(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id));
|
||||
void BKE_spacedata_callback_id_remap_set(void (*func)(struct ScrArea *, struct SpaceLink *, struct ID *, struct ID *));
|
||||
void BKE_spacedata_id_unref(struct ScrArea *sa, struct SpaceLink *sl, struct ID *id);
|
||||
|
||||
/* area/regions */
|
||||
@@ -366,3 +356,4 @@ void BKE_screen_remove_unused_scredges(struct bScreen *sc);
|
||||
void BKE_screen_remove_unused_scrverts(struct bScreen *sc);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -59,21 +59,15 @@ struct GPUTexture;
|
||||
enum StudioLightFlag {
|
||||
STUDIOLIGHT_DIFFUSE_LIGHT_CALCULATED = (1 << 0),
|
||||
STUDIOLIGHT_LIGHT_DIRECTION_CALCULATED = (1 << 1),
|
||||
STUDIOLIGHT_INTERNAL = (1 << 2),
|
||||
STUDIOLIGHT_EXTERNAL_FILE = (1 << 3),
|
||||
STUDIOLIGHT_ORIENTATION_CAMERA = (1 << 4),
|
||||
STUDIOLIGHT_ORIENTATION_WORLD = (1 << 5),
|
||||
STUDIOLIGHT_ORIENTATION_VIEWNORMAL = (1 << 6),
|
||||
STUDIOLIGHT_EXTERNAL_IMAGE_LOADED = (1 << 7),
|
||||
STUDIOLIGHT_EQUIRECTANGULAR_IRRADIANCE_IMAGE_CALCULATED = (1 << 8),
|
||||
STUDIOLIGHT_EQUIRECTANGULAR_RADIANCE_GPUTEXTURE = (1 << 9),
|
||||
STUDIOLIGHT_EQUIRECTANGULAR_IRRADIANCE_GPUTEXTURE = (1 << 10),
|
||||
STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED = (1 << 11),
|
||||
STUDIOLIGHT_EXTERNAL_FILE = (1 << 2),
|
||||
STUDIOLIGHT_ORIENTATION_CAMERA = (1 << 3),
|
||||
STUDIOLIGHT_ORIENTATION_WORLD = (1 << 4),
|
||||
STUDIOLIGHT_EQUIRECTANGULAR_IMAGE_LOADED = (1 << 5),
|
||||
STUDIOLIGHT_EQUIRECTANGULAR_IRRADIANCE_IMAGE_CALCULATED = (1 << 6),
|
||||
STUDIOLIGHT_EQUIRECTANGULAR_RADIANCE_GPUTEXTURE = (1 << 7),
|
||||
STUDIOLIGHT_EQUIRECTANGULAR_IRRADIANCE_GPUTEXTURE = (1 << 8),
|
||||
STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED = (1 << 9),
|
||||
} StudioLightFlag;
|
||||
#define STUDIOLIGHT_FLAG_ALL (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_EXTERNAL_FILE)
|
||||
#define STUDIOLIGHT_FLAG_ORIENTATIONS (STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD | STUDIOLIGHT_ORIENTATION_VIEWNORMAL)
|
||||
#define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_WORLD)
|
||||
#define STUDIOLIGHT_ORIENTATIONS_SOLID (STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD)
|
||||
|
||||
typedef struct StudioLight {
|
||||
struct StudioLight *next, *prev;
|
||||
@@ -95,8 +89,7 @@ typedef struct StudioLight {
|
||||
void BKE_studiolight_init(void);
|
||||
void BKE_studiolight_free(void);
|
||||
struct StudioLight *BKE_studiolight_find(const char *name, int flag);
|
||||
struct StudioLight *BKE_studiolight_findindex(int index, int flag);
|
||||
struct StudioLight *BKE_studiolight_find_first(int flag);
|
||||
struct StudioLight *BKE_studiolight_findindex(int index);
|
||||
unsigned int *BKE_studiolight_preview(StudioLight *sl, int icon_size, int icon_id_type);
|
||||
const struct ListBase *BKE_studiolight_listbase(void);
|
||||
void BKE_studiolight_ensure_flag(StudioLight *sl, int flag);
|
||||
|
@@ -61,7 +61,6 @@
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_mesh_mapping.h"
|
||||
#include "BKE_mesh_runtime.h"
|
||||
#include "BKE_mesh_tangent.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_object_deform.h"
|
||||
@@ -95,6 +94,7 @@
|
||||
static ThreadRWMutex loops_cache_lock = PTHREAD_RWLOCK_INITIALIZER;
|
||||
|
||||
|
||||
static void add_shapekey_layers(DerivedMesh *dm, Mesh *me, Object *ob);
|
||||
static void shapekey_layers_to_keyblocks(DerivedMesh *dm, Mesh *me, int actshape_uid);
|
||||
|
||||
static void mesh_init_origspace(Mesh *mesh);
|
||||
@@ -1157,8 +1157,6 @@ DerivedMesh *mesh_create_derived(Mesh *me, float (*vertCos)[3])
|
||||
return dm;
|
||||
}
|
||||
|
||||
/* XXX2.8(Sybren): can be removed once DerivedMesh port is done */
|
||||
#ifdef WITH_DERIVEDMESH_DEPRECATED_FUNCS
|
||||
DerivedMesh *mesh_create_derived_for_modifier(
|
||||
struct Depsgraph *depsgraph, Scene *scene, Object *ob,
|
||||
ModifierData *md, int build_shapekey_layers)
|
||||
@@ -1209,7 +1207,6 @@ DerivedMesh *mesh_create_derived_for_modifier(
|
||||
|
||||
return dm;
|
||||
}
|
||||
#endif
|
||||
|
||||
static float (*get_editbmesh_orco_verts(BMEditMesh *em))[3]
|
||||
{
|
||||
@@ -1923,7 +1920,7 @@ static void shapekey_layers_to_keyblocks(DerivedMesh *dm, Mesh *me, int actshape
|
||||
}
|
||||
}
|
||||
|
||||
static void UNUSED_FUNCTION(add_shapekey_layers)(DerivedMesh *dm, Mesh *me, Object *UNUSED(ob))
|
||||
static void add_shapekey_layers(DerivedMesh *dm, Mesh *me, Object *UNUSED(ob))
|
||||
{
|
||||
KeyBlock *kb;
|
||||
Key *key = me->key;
|
||||
@@ -2793,7 +2790,7 @@ static void editbmesh_calc_modifiers(
|
||||
}
|
||||
else {
|
||||
struct Mesh *mesh = ob->data;
|
||||
if (mesh->id.tag & LIB_TAG_COPIED_ON_WRITE) {
|
||||
if (mesh->id.tag & LIB_TAG_COPY_ON_WRITE) {
|
||||
BKE_mesh_runtime_ensure_edit_data(mesh);
|
||||
mesh->runtime.edit_data->vertexCos = MEM_dupallocN(deformedVerts);
|
||||
}
|
||||
@@ -2835,7 +2832,7 @@ static void editbmesh_calc_modifiers(
|
||||
else {
|
||||
/* this is just a copy of the editmesh, no need to calc normals */
|
||||
struct Mesh *mesh = ob->data;
|
||||
if (mesh->id.tag & LIB_TAG_COPIED_ON_WRITE) {
|
||||
if (mesh->id.tag & LIB_TAG_COPY_ON_WRITE) {
|
||||
BKE_mesh_runtime_ensure_edit_data(mesh);
|
||||
if (mesh->runtime.edit_data->vertexCos != NULL)
|
||||
MEM_freeN((void *)mesh->runtime.edit_data->vertexCos);
|
||||
@@ -2946,14 +2943,18 @@ static void mesh_finalize_eval(Object *object)
|
||||
if (mesh_eval->mat != NULL) {
|
||||
MEM_freeN(mesh_eval->mat);
|
||||
}
|
||||
/* Set flag which makes it easier to see what's going on in a debugger. */
|
||||
mesh_eval->id.tag |= LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT;
|
||||
mesh_eval->mat = MEM_dupallocN(mesh->mat);
|
||||
mesh_eval->totcol = mesh->totcol;
|
||||
/* Make evaluated mesh to share same edit mesh pointer as original
|
||||
* and copied meshes.
|
||||
*/
|
||||
mesh_eval->edit_btmesh = mesh->edit_btmesh;
|
||||
/* Special flags to help debugging and also to allow copy-on-write core
|
||||
* to understand that on re-evaluation this mesh is to be preserved and
|
||||
* to be remapped back to copied original mesh when used as object data.
|
||||
*/
|
||||
mesh_eval->id.tag |= LIB_TAG_COPY_ON_WRITE_EVAL;
|
||||
mesh_eval->id.orig_id = &mesh->id;
|
||||
/* Copy autosmooth settings from original mesh.
|
||||
* This is not done by BKE_mesh_new_nomain_from_template(), so need to take
|
||||
* extra care here.
|
||||
@@ -2969,7 +2970,7 @@ static void mesh_finalize_eval(Object *object)
|
||||
|
||||
/* Object is sometimes not evaluated!
|
||||
* TODO(sergey): BAD TEMPORARY HACK FOR UNTIL WE ARE SMARTER */
|
||||
if (object->id.tag & LIB_TAG_COPIED_ON_WRITE) {
|
||||
if (object->id.tag & LIB_TAG_COPY_ON_WRITE) {
|
||||
object->data = mesh_eval;
|
||||
}
|
||||
else {
|
||||
@@ -3107,7 +3108,6 @@ void makeDerivedMesh(
|
||||
|
||||
/***/
|
||||
|
||||
#ifdef USE_DERIVEDMESH
|
||||
/* Deprecated DM, use: 'mesh_get_eval_final'. */
|
||||
DerivedMesh *mesh_get_derived_final(
|
||||
struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
|
||||
@@ -3128,7 +3128,6 @@ DerivedMesh *mesh_get_derived_final(
|
||||
if (ob->derivedFinal) { BLI_assert(!(ob->derivedFinal->dirty & DM_DIRTY_NORMALS)); }
|
||||
return ob->derivedFinal;
|
||||
}
|
||||
#endif
|
||||
Mesh *mesh_get_eval_final(
|
||||
struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
|
||||
{
|
||||
@@ -3149,7 +3148,6 @@ Mesh *mesh_get_eval_final(
|
||||
return ob->runtime.mesh_eval;
|
||||
}
|
||||
|
||||
#ifdef USE_DERIVEDMESH
|
||||
/* Deprecated DM, use: 'mesh_get_eval_deform' instead. */
|
||||
DerivedMesh *mesh_get_derived_deform(struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
|
||||
{
|
||||
@@ -3169,7 +3167,6 @@ DerivedMesh *mesh_get_derived_deform(struct Depsgraph *depsgraph, Scene *scene,
|
||||
|
||||
return ob->derivedDeform;
|
||||
}
|
||||
#endif
|
||||
Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
|
||||
{
|
||||
/* if there's no derived mesh or the last data mask used doesn't include
|
||||
|