Compare commits
206 Commits
temp-multi
...
tmp-Collec
Author | SHA1 | Date | |
---|---|---|---|
d1e3ba22a0 | |||
6de656b4f2 | |||
58efa7d686 | |||
0de0cee9a2 | |||
9cd2e4fa3f | |||
b608133075 | |||
a08a8aa928 | |||
c140f11946 | |||
![]() |
bb8770b976 | ||
8433ed76b2 | |||
d18cd768bb | |||
bfe1d0e0dc | |||
75fc1c3507 | |||
297bf7235b | |||
c0dd355926 | |||
4fccb8a023 | |||
e44743736f | |||
e4a727626e | |||
56dc2bf0c5 | |||
9e09900a30 | |||
![]() |
15e5dbc2c3 | ||
0706b410bd | |||
eef18d39cb | |||
051e186d5c | |||
b3be71e07a | |||
72a360827b | |||
44a8070db3 | |||
06c4106d03 | |||
75b2729488 | |||
50afc430fd | |||
![]() |
27881e9948 | ||
13ca63d2ad | |||
3b05034935 | |||
ddf2a58282 | |||
82b8fd8eaf | |||
32c12d057f | |||
be8016908d | |||
4faf9bfbe9 | |||
b85d5b6d52 | |||
83a41ccd0a | |||
cfdadc7d61 | |||
4eb47c303d | |||
0c18024a8d | |||
c771bbc27e | |||
01c75c3765 | |||
719e782f2c | |||
bcbee4b9a3 | |||
1bc801e020 | |||
14c55a5828 | |||
![]() |
e35dab0fec | ||
0bddf5315f | |||
8f24d404fe | |||
e614a8290c | |||
e8142ad7dc | |||
4683091369 | |||
d5a359b1d4 | |||
c450966e95 | |||
3b2d3a3cd1 | |||
7bdc67f5f3 | |||
fe09aa602a | |||
c338ac9454 | |||
3cefb27830 | |||
266fc1c1ff | |||
5736157b5e | |||
a6395cebb7 | |||
c87cfcc8de | |||
63785a889c | |||
35efa1d3d3 | |||
![]() |
a63b55f642 | ||
![]() |
a4bb1a5881 | ||
995fa1f4c0 | |||
14dee6d7a5 | |||
7c75c2db4f | |||
![]() |
e51cbce646 | ||
bf4ce5755f | |||
712885c30e | |||
f43e3d0b6b | |||
494470ba23 | |||
8789490f96 | |||
71c904433c | |||
2feed9bdef | |||
f71efafe8f | |||
cfea9c261c | |||
df22cd9ce1 | |||
3352dd3a3f | |||
126e6c8e1d | |||
59a516913e | |||
b5b1f9d11c | |||
7a4b0ff358 | |||
d4daf9c00d | |||
cd702db338 | |||
48ea2131aa | |||
cb614107d3 | |||
5a82aee9e6 | |||
8d53e8cd02 | |||
da11e33b26 | |||
361b3eb88e | |||
eb1feb9f4a | |||
0b396bc15b | |||
16100f8261 | |||
b809340960 | |||
b53d358261 | |||
3248ac5e83 | |||
![]() |
25e5ec245c | ||
![]() |
d0af8edcd1 | ||
![]() |
eaad4caa56 | ||
54e92bbd29 | |||
4e96bff938 | |||
f56a9fbad5 | |||
9b4e56c091 | |||
d41bf6b8e8 | |||
46508430f8 | |||
28369f725c | |||
23e375a281 | |||
24b03729ae | |||
9948e26e14 | |||
1e6108e972 | |||
46cfa605c3 | |||
17f458ff32 | |||
24d1829243 | |||
fcfe1963a6 | |||
5cbad89637 | |||
12ab59a2d6 | |||
84a9647f22 | |||
d9324b61d5 | |||
e4afccf388 | |||
e910765ad0 | |||
81bf9a41e1 | |||
![]() |
6c0705009e | ||
fbd614f1fa | |||
16d3f4db4c | |||
264a4a8f97 | |||
84e5c981dc | |||
f5f25b843e | |||
eb0fcd4574 | |||
1f693aefca | |||
61fc9fcffa | |||
0b6603d9b6 | |||
c0f42a7526 | |||
c86437cc83 | |||
cce16df10f | |||
17ce968c59 | |||
08862b8246 | |||
85ce4d957c | |||
9fabe3ef53 | |||
efd0333a9c | |||
1272936773 | |||
7661f8a65b | |||
41fac4fa76 | |||
25d4d43491 | |||
cdfa517760 | |||
23b455a891 | |||
92e3b3839b | |||
10a2562bc5 | |||
f1f1c32849 | |||
![]() |
5b8fe8324b | ||
38957c1838 | |||
5954a5c465 | |||
375c1eab65 | |||
d0d2fc9819 | |||
30fb455977 | |||
35a6d9ec55 | |||
acaf46db0e | |||
29f9a19708 | |||
da16cb1511 | |||
f03953ae06 | |||
ccb7f1d4f1 | |||
26f42a1928 | |||
5c17dbd991 | |||
8ed723745e | |||
292125bfd3 | |||
9c2db1455f | |||
eb24c9a1e1 | |||
03ec3a6141 | |||
48ceeead10 | |||
10c0bba28e | |||
7e8fd563c6 | |||
93de6ca2db | |||
0488b728eb | |||
10f6450ef2 | |||
501c0b1df8 | |||
328f8dc21c | |||
2faef3473c | |||
e0e3038b1e | |||
ec6da3d72e | |||
201952aed2 | |||
3bc0cb08b8 | |||
7b9a0ed8c4 | |||
08d325805f | |||
72f4ac99c7 | |||
e55c1a9b5a | |||
edc1e65809 | |||
6afa0a7a50 | |||
9abbf73d3f | |||
a01244cade | |||
47a8d3b880 | |||
e054b7f251 | |||
01f9e13c30 | |||
d709705203 | |||
301a27187c | |||
b54cc68365 | |||
0ed2e254bb | |||
cb22caa8c7 | |||
18c12803bd | |||
0e0502cbdf | |||
2c03d6a12b |
@@ -523,9 +523,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
-fsanitize=enum \
|
||||
-fsanitize=float-cast-overflow \
|
||||
-fsanitize=float-divide-by-zero \
|
||||
-fsanitize=leak \
|
||||
-fsanitize=nonnull-attribute \
|
||||
-fsanitize=object-size \
|
||||
-fsanitize=returns-nonnull-attribute \
|
||||
-fsanitize=signed-integer-overflow \
|
||||
-fsanitize=undefined \
|
||||
@@ -533,6 +531,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
-fno-sanitize=alignment \
|
||||
")
|
||||
|
||||
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
|
||||
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
|
||||
endif()
|
||||
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
|
||||
mark_as_advanced(COMPILER_ASAN_CFLAGS)
|
||||
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
|
||||
@@ -540,9 +541,15 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
unset(_asan_defaults)
|
||||
|
||||
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
if(NOT MSVC)
|
||||
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
else()
|
||||
find_library( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
|
||||
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
|
||||
)
|
||||
endif()
|
||||
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -816,8 +823,12 @@ if(WITH_COMPILER_ASAN)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY}")
|
||||
if(MSVC)
|
||||
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
|
||||
endif()
|
||||
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
|
||||
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@@ -32,6 +32,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
|
||||
${EXTRA_LIBS}
|
||||
${PLATFORM_LINKLIBS}
|
||||
bf_testing_main
|
||||
bf_intern_eigen
|
||||
bf_intern_guardedalloc
|
||||
extern_gtest
|
||||
extern_gmock
|
||||
|
@@ -352,6 +352,11 @@ function(SETUP_LIBDIRS)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(setup_platform_linker_flags)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||
endmacro()
|
||||
|
||||
function(setup_liblinks
|
||||
target
|
||||
)
|
||||
|
@@ -149,7 +149,7 @@ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
|
||||
|
||||
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
|
||||
|
||||
# Ignore meaningless for us linker warnings.
|
||||
@@ -162,7 +162,7 @@ else()
|
||||
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
||||
endif()
|
||||
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
||||
|
||||
if(NOT DEFINED LIBDIR)
|
||||
|
||||
|
@@ -12,6 +12,14 @@ if "%BUILD_ARCH%"=="x64" (
|
||||
|
||||
if "%WITH_CLANG%"=="1" (
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -T"LLVM-vs2017"
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
|
||||
)
|
||||
) else (
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
echo ASAN is only supported with clang.
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
if NOT EXIST %BUILD_DIR%\nul (
|
||||
|
@@ -27,6 +27,16 @@ set LLVM_DIR=
|
||||
rem build and tested against 2017 15.7
|
||||
set CFLAGS=-m64 -fmsc-version=1914
|
||||
set CXXFLAGS=-m64 -fmsc-version=1914
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
|
||||
)
|
||||
)
|
||||
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
if "%WITH_CLANG%" == "" (
|
||||
echo ASAN is only supported with clang.
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
if NOT "%verbose%" == "" (
|
||||
|
@@ -12,7 +12,7 @@ if not exist "%vs_where%" (
|
||||
goto FAIL
|
||||
)
|
||||
)
|
||||
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
|
||||
)
|
||||
|
||||
|
@@ -42,6 +42,8 @@ if NOT "%1" == "" (
|
||||
) else if "%1" == "release" (
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
|
||||
set TARGET=Release
|
||||
) else if "%1" == "asan" (
|
||||
set WITH_ASAN=1
|
||||
) else if "%1" == "x86" (
|
||||
set BUILD_ARCH=x86
|
||||
) else if "%1" == "x64" (
|
||||
|
@@ -21,4 +21,5 @@ set BUILD_UPDATE=
|
||||
set BUILD_SHOW_HASHES=
|
||||
set SHOW_HELP=
|
||||
set BUILD_WITH_NINJA=
|
||||
set WITH_CLANG=
|
||||
set WITH_CLANG=
|
||||
set WITH_ASAN=
|
@@ -78,7 +78,7 @@ class CyclesRender(bpy.types.RenderEngine):
|
||||
|
||||
engine.reset(self, data, depsgraph)
|
||||
|
||||
def render_to_image(self, depsgraph):
|
||||
def render(self, depsgraph):
|
||||
engine.render(self, depsgraph)
|
||||
|
||||
def bake(self, depsgraph, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
|
||||
@@ -93,7 +93,7 @@ class CyclesRender(bpy.types.RenderEngine):
|
||||
engine.reset(self, context.blend_data, context.depsgraph)
|
||||
engine.sync(self, context.depsgraph, context.blend_data)
|
||||
|
||||
def render_to_view(self, context):
|
||||
def view_draw(self, context):
|
||||
engine.draw(self, context.depsgraph, context.region, context.space_data, context.region_data)
|
||||
|
||||
def update_script_node(self, node):
|
||||
|
@@ -1154,7 +1154,7 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
||||
default='THICK',
|
||||
)
|
||||
cls.cull_backfacing = BoolProperty(
|
||||
name="Cull back-faces",
|
||||
name="Cull Back-faces",
|
||||
description="Do not test the back-face of each strand",
|
||||
default=True,
|
||||
)
|
||||
@@ -1330,49 +1330,6 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||
del bpy.types.ViewLayer.cycles
|
||||
|
||||
|
||||
class CyclesCurveSettings(bpy.types.PropertyGroup):
|
||||
@classmethod
|
||||
def register(cls):
|
||||
bpy.types.ParticleSettings.cycles = PointerProperty(
|
||||
name="Cycles Hair Settings",
|
||||
description="Cycles hair settings",
|
||||
type=cls,
|
||||
)
|
||||
cls.radius_scale = FloatProperty(
|
||||
name="Radius Scaling",
|
||||
description="Multiplier of width properties",
|
||||
min=0.0, max=1000.0,
|
||||
default=0.01,
|
||||
)
|
||||
cls.root_width = FloatProperty(
|
||||
name="Root Size",
|
||||
description="Strand's width at root",
|
||||
min=0.0, max=1000.0,
|
||||
default=1.0,
|
||||
)
|
||||
cls.tip_width = FloatProperty(
|
||||
name="Tip Multiplier",
|
||||
description="Strand's width at tip",
|
||||
min=0.0, max=1000.0,
|
||||
default=0.0,
|
||||
)
|
||||
cls.shape = FloatProperty(
|
||||
name="Strand Shape",
|
||||
description="Strand shape parameter",
|
||||
min=-1.0, max=1.0,
|
||||
default=0.0,
|
||||
)
|
||||
cls.use_closetip = BoolProperty(
|
||||
name="Close tip",
|
||||
description="Set tip radius to zero",
|
||||
default=True,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def unregister(cls):
|
||||
del bpy.types.ParticleSettings.cycles
|
||||
|
||||
|
||||
class CyclesDeviceSettings(bpy.types.PropertyGroup):
|
||||
@classmethod
|
||||
def register(cls):
|
||||
@@ -1503,7 +1460,6 @@ def register():
|
||||
bpy.utils.register_class(CyclesMeshSettings)
|
||||
bpy.utils.register_class(CyclesObjectSettings)
|
||||
bpy.utils.register_class(CyclesCurveRenderSettings)
|
||||
bpy.utils.register_class(CyclesCurveSettings)
|
||||
bpy.utils.register_class(CyclesDeviceSettings)
|
||||
bpy.utils.register_class(CyclesPreferences)
|
||||
bpy.utils.register_class(CyclesRenderLayerSettings)
|
||||
@@ -1519,7 +1475,6 @@ def unregister():
|
||||
bpy.utils.unregister_class(CyclesObjectSettings)
|
||||
bpy.utils.unregister_class(CyclesVisibilitySettings)
|
||||
bpy.utils.unregister_class(CyclesCurveRenderSettings)
|
||||
bpy.utils.unregister_class(CyclesCurveSettings)
|
||||
bpy.utils.unregister_class(CyclesDeviceSettings)
|
||||
bpy.utils.unregister_class(CyclesPreferences)
|
||||
bpy.utils.unregister_class(CyclesRenderLayerSettings)
|
||||
|
@@ -20,10 +20,10 @@ import bpy
|
||||
from bpy_extras.node_utils import find_node_input, find_output_node
|
||||
|
||||
from bpy.types import (
|
||||
Panel,
|
||||
Menu,
|
||||
Operator,
|
||||
)
|
||||
Panel,
|
||||
Menu,
|
||||
Operator,
|
||||
)
|
||||
|
||||
|
||||
class CYCLES_MT_sampling_presets(Menu):
|
||||
@@ -86,6 +86,7 @@ def use_sample_all_lights(context):
|
||||
|
||||
return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
|
||||
|
||||
|
||||
def show_device_active(context):
|
||||
cscene = context.scene.cycles
|
||||
if cscene.device != 'GPU':
|
||||
@@ -145,6 +146,7 @@ class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
@@ -154,56 +156,52 @@ class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
|
||||
row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMIN")
|
||||
row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True
|
||||
|
||||
row = layout.row()
|
||||
sub = row.row()
|
||||
sub.prop(cscene, "progressive", text="")
|
||||
row.prop(cscene, "use_square_samples")
|
||||
layout.use_property_split = True
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label("Settings:")
|
||||
|
||||
seed_sub = sub.row(align=True)
|
||||
seed_sub.prop(cscene, "seed")
|
||||
seed_sub.prop(cscene, "use_animated_seed", text="", icon="TIME")
|
||||
|
||||
sub.prop(cscene, "sample_clamp_direct")
|
||||
sub.prop(cscene, "sample_clamp_indirect")
|
||||
sub.prop(cscene, "light_sampling_threshold")
|
||||
layout.prop(cscene, "progressive")
|
||||
|
||||
if cscene.progressive == 'PATH' or use_branched_path(context) is False:
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Samples:")
|
||||
sub.prop(cscene, "samples", text="Render")
|
||||
sub.prop(cscene, "preview_samples", text="Preview")
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "samples", text="Render Samples")
|
||||
col.prop(cscene, "preview_samples", text="Preview Samples")
|
||||
col.prop(cscene, "use_square_samples") # Duplicate below.
|
||||
else:
|
||||
sub.label(text="AA Samples:")
|
||||
sub.prop(cscene, "aa_samples", text="Render")
|
||||
sub.prop(cscene, "preview_aa_samples", text="Preview")
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "aa_samples", text="Render Samples")
|
||||
col.prop(cscene, "preview_aa_samples", text="Preview Samples")
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Samples:")
|
||||
sub.prop(cscene, "diffuse_samples", text="Diffuse")
|
||||
sub.prop(cscene, "glossy_samples", text="Glossy")
|
||||
sub.prop(cscene, "transmission_samples", text="Transmission")
|
||||
sub.prop(cscene, "ao_samples", text="AO")
|
||||
col = layout.column(align=True)
|
||||
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")
|
||||
|
||||
subsub = sub.row(align=True)
|
||||
subsub.active = use_sample_all_lights(context)
|
||||
subsub.prop(cscene, "mesh_light_samples", text="Mesh Light")
|
||||
sub = col.row(align=True)
|
||||
sub.active = use_sample_all_lights(context)
|
||||
sub.prop(cscene, "mesh_light_samples", text="Mesh Light Samples")
|
||||
|
||||
sub.prop(cscene, "subsurface_samples", text="Subsurface")
|
||||
sub.prop(cscene, "volume_samples", text="Volume")
|
||||
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")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "light_sampling_threshold", text="Light Threshold")
|
||||
|
||||
col = layout.column(align=True)
|
||||
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)
|
||||
|
||||
|
||||
@@ -213,56 +211,48 @@ class CYCLES_RENDER_PT_geometry(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
ccscene = scene.cycles_curves
|
||||
|
||||
row = layout.row()
|
||||
row.label("Volume Sampling:")
|
||||
row = layout.row()
|
||||
row.prop(cscene, "volume_step_size")
|
||||
row.prop(cscene, "volume_max_steps")
|
||||
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")
|
||||
|
||||
layout.separator()
|
||||
col.separator()
|
||||
|
||||
if cscene.feature_set == 'EXPERIMENTAL':
|
||||
layout.label("Subdivision Rate:")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cscene, "dicing_rate", text="Render")
|
||||
sub.prop(cscene, "preview_dicing_rate", text="Preview")
|
||||
sub.prop(cscene, "dicing_rate", text="Dicing Rate Render")
|
||||
sub.prop(cscene, "preview_dicing_rate", text="Dicing Rate Preview")
|
||||
|
||||
col = split.column()
|
||||
col.prop(cscene, "offscreen_dicing_scale", text="Offscreen Scale")
|
||||
col.prop(cscene, "max_subdivisions")
|
||||
|
||||
layout.prop(cscene, "dicing_camera")
|
||||
col.prop(cscene, "dicing_camera")
|
||||
|
||||
layout.separator()
|
||||
col.separator()
|
||||
|
||||
layout.label("Hair:")
|
||||
layout.prop(ccscene, "use_curves", text="Use Hair")
|
||||
layout.prop(ccscene, "use_curves", text="Hair Rendering")
|
||||
col = layout.column()
|
||||
col.active = ccscene.use_curves
|
||||
|
||||
col.prop(ccscene, "primitive", text="Primitive")
|
||||
col.prop(ccscene, "minimum_width", text="Min Pixels")
|
||||
col.prop(ccscene, "maximum_width", text="Max Extension")
|
||||
col.prop(ccscene, "shape", text="Shape")
|
||||
|
||||
if not (ccscene.primitive in {'CURVE_SEGMENTS', 'LINE_SEGMENTS'} and ccscene.shape == 'RIBBONS'):
|
||||
col.prop(ccscene, "cull_backfacing", text="Cull back-faces")
|
||||
col.prop(ccscene, "primitive", text="Primitive")
|
||||
|
||||
if ccscene.primitive == 'TRIANGLES' and ccscene.shape == 'THICK':
|
||||
col.prop(ccscene, "resolution", text="Resolution")
|
||||
elif ccscene.primitive == 'CURVE_SEGMENTS':
|
||||
col.prop(ccscene, "subdivisions", text="Curve subdivisions")
|
||||
|
||||
row = col.row()
|
||||
row.prop(ccscene, "minimum_width", text="Min Pixels")
|
||||
row.prop(ccscene, "maximum_width", text="Max Extension")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_light_paths(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Light Paths"
|
||||
@@ -270,6 +260,7 @@ class CYCLES_RENDER_PT_light_paths(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
@@ -279,31 +270,18 @@ 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
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.label("Transparency:")
|
||||
sub.prop(cscene, "transparent_max_bounces", text="Max")
|
||||
|
||||
col.separator()
|
||||
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, "transmission_bounces", text="Transmission")
|
||||
col.prop(cscene, "volume_bounces", text="Volume")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "blur_glossy")
|
||||
col.prop(cscene, "caustics_reflective")
|
||||
col.prop(cscene, "caustics_refractive")
|
||||
col.prop(cscene, "blur_glossy")
|
||||
|
||||
col = split.column()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Bounces:")
|
||||
sub.prop(cscene, "max_bounces", text="Max")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cscene, "diffuse_bounces", text="Diffuse")
|
||||
sub.prop(cscene, "glossy_bounces", text="Glossy")
|
||||
sub.prop(cscene, "transmission_bounces", text="Transmission")
|
||||
sub.prop(cscene, "volume_bounces", text="Volume")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||
@@ -317,6 +295,7 @@ class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
@@ -349,31 +328,35 @@ class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||
|
||||
class CYCLES_RENDER_PT_film(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Film"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(cscene, "film_exposure")
|
||||
col.separator()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cscene, "pixel_filter_type", text="")
|
||||
if cscene.pixel_filter_type != 'BOX':
|
||||
sub.prop(cscene, "filter_width", text="Width")
|
||||
|
||||
col = split.column()
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "pixel_filter_type")
|
||||
if cscene.pixel_filter_type != 'BOX':
|
||||
col.prop(cscene, "filter_width")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "film_transparent")
|
||||
sub = col.row()
|
||||
sub = col.column()
|
||||
sub.prop(cscene, "film_transparent_glass", text="Transparent Glass")
|
||||
sub.active = cscene.film_transparent
|
||||
sub = col.row()
|
||||
sub.prop(cscene, "film_transparent_roughness", text="Roughness Threshold")
|
||||
sub.active = cscene.film_transparent and cscene.film_transparent_glass
|
||||
|
||||
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):
|
||||
@@ -382,58 +365,58 @@ class CYCLES_RENDER_PT_performance(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
cscene = scene.cycles
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col = split.column(align=True)
|
||||
|
||||
col.label(text="Threads:")
|
||||
col.row(align=True).prop(rd, "threads_mode", expand=True)
|
||||
col.row(align=True).prop(rd, "threads_mode")
|
||||
sub = col.column(align=True)
|
||||
sub.enabled = rd.threads_mode == 'FIXED'
|
||||
sub.prop(rd, "threads")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = layout.column()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Tiles:")
|
||||
sub.prop(cscene, "tile_order", text="")
|
||||
|
||||
sub.prop(rd, "tile_x", text="X")
|
||||
sub.prop(rd, "tile_x", text="Tiles X")
|
||||
sub.prop(rd, "tile_y", text="Y")
|
||||
col.prop(cscene, "tile_order", text="Order")
|
||||
|
||||
subsub = sub.column()
|
||||
subsub.active = not rd.use_save_buffers
|
||||
sub = col.column()
|
||||
sub.active = not rd.use_save_buffers
|
||||
for view_layer in scene.view_layers:
|
||||
if view_layer.cycles.use_denoising:
|
||||
subsub.active = False
|
||||
subsub.prop(cscene, "use_progressive_refine")
|
||||
sub.active = False
|
||||
sub.prop(cscene, "use_progressive_refine")
|
||||
|
||||
col = split.column()
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.label(text="Final Render:")
|
||||
col.prop(rd, "use_save_buffers")
|
||||
col.prop(rd, "use_persistent_data", text="Persistent Images")
|
||||
|
||||
col.separator()
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.label(text="Acceleration structure:")
|
||||
col.prop(cscene, "debug_use_spatial_splits")
|
||||
col.prop(cscene, "debug_use_hair_bvh")
|
||||
|
||||
row = col.row()
|
||||
row.active = not cscene.debug_use_spatial_splits
|
||||
row.prop(cscene, "debug_bvh_time_steps")
|
||||
sub = col.column()
|
||||
sub.active = not cscene.debug_use_spatial_splits
|
||||
sub.prop(cscene, "debug_bvh_time_steps")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="Viewport Resolution:")
|
||||
split = col.split()
|
||||
split.prop(rd, "preview_pixel_size", text="")
|
||||
split.prop(cscene, "preview_start_resolution")
|
||||
col.prop(rd, "preview_pixel_size", text="Viewport Pixel Size")
|
||||
col.prop(cscene, "preview_start_resolution", text="Start Pixels")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_filter(CyclesButtonsPanel, Panel):
|
||||
@@ -450,7 +433,7 @@ class CYCLES_RENDER_PT_filter(CyclesButtonsPanel, Panel):
|
||||
|
||||
col = layout.column()
|
||||
col.prop(view_layer, "use_sky", "Use Environment")
|
||||
col.prop(view_layer, "use_ao", "Use AO")
|
||||
col.prop(view_layer, "use_ao", "Use Ambient Occlusion")
|
||||
col.prop(view_layer, "use_solid", "Use Surfaces")
|
||||
col.prop(view_layer, "use_strand", "Use Hair")
|
||||
if with_freestyle:
|
||||
@@ -489,7 +472,7 @@ class CYCLES_RENDER_PT_layer_passes(CyclesButtonsPanel, Panel):
|
||||
col.prop(view_layer, "use_pass_material_index")
|
||||
col.separator()
|
||||
col.prop(view_layer, "use_pass_shadow")
|
||||
col.prop(view_layer, "use_pass_ambient_occlusion")
|
||||
col.prop(view_layer, "use_pass_ambient_occlusion", text="Ambient Occlusion")
|
||||
col.separator()
|
||||
col.prop(view_layer, "pass_alpha_threshold")
|
||||
|
||||
@@ -554,6 +537,7 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
@@ -562,43 +546,66 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
|
||||
|
||||
layout.active = cycles_view_layer.use_denoising
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.prop(cycles_view_layer, "denoising_radius", text="Radius")
|
||||
sub.prop(cycles_view_layer, "denoising_strength", slider=True, text="Strength")
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cycles_view_layer, "denoising_feature_strength", slider=True, text="Feature Strength")
|
||||
sub.prop(cycles_view_layer, "denoising_relative_pca")
|
||||
|
||||
# layout.use_property_split = False
|
||||
|
||||
"""
|
||||
layout.separator()
|
||||
|
||||
row = layout.row()
|
||||
row.label(text="Diffuse:")
|
||||
sub = row.row(align=True)
|
||||
sub.prop(cycles_view_layer, "denoising_diffuse_direct", text="Direct", toggle=True)
|
||||
sub.prop(cycles_view_layer, "denoising_diffuse_indirect", text="Indirect", toggle=True)
|
||||
col = layout.column(align=True)
|
||||
col.prop(cycles_view_layer, "denoising_diffuse_direct", text="Diffuse Direct")
|
||||
col.prop(cycles_view_layer, "denoising_diffuse_indirect", text="Indirect")
|
||||
|
||||
row = layout.row()
|
||||
row.label(text="Glossy:")
|
||||
sub = row.row(align=True)
|
||||
sub.prop(cycles_view_layer, "denoising_glossy_direct", text="Direct", toggle=True)
|
||||
sub.prop(cycles_view_layer, "denoising_glossy_indirect", text="Indirect", toggle=True)
|
||||
col = layout.column(align=True)
|
||||
col.prop(cycles_view_layer, "denoising_glossy_direct", text="Glossy Direct")
|
||||
col.prop(cycles_view_layer, "denoising_glossy_indirect", text="Indirect")
|
||||
|
||||
row = layout.row()
|
||||
row.label(text="Transmission:")
|
||||
sub = row.row(align=True)
|
||||
sub.prop(cycles_view_layer, "denoising_transmission_direct", text="Direct", toggle=True)
|
||||
sub.prop(cycles_view_layer, "denoising_transmission_indirect", text="Indirect", toggle=True)
|
||||
col = layout.column(align=True)
|
||||
col.prop(cycles_view_layer, "denoising_transmission_direct", text="Transmission Direct")
|
||||
col.prop(cycles_view_layer, "denoising_transmission_indirect", text="Indirect")
|
||||
|
||||
row = layout.row()
|
||||
row.label(text="Subsurface:")
|
||||
sub = row.row(align=True)
|
||||
sub.prop(cycles_view_layer, "denoising_subsurface_direct", text="Direct", toggle=True)
|
||||
sub.prop(cycles_view_layer, "denoising_subsurface_indirect", text="Indirect", toggle=True)
|
||||
col = layout.column(align=True)
|
||||
col.prop(cycles_view_layer, "denoising_subsurface_direct", text="Subsurface Direct")
|
||||
col.prop(cycles_view_layer, "denoising_subsurface_indirect", text="Indirect")
|
||||
"""
|
||||
|
||||
layout.use_property_split = False
|
||||
|
||||
split = layout.split(percentage=0.5)
|
||||
split.label(text="Diffuse")
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
row.prop(cycles_view_layer, "denoising_diffuse_direct", text="Direct", toggle=True)
|
||||
row.prop(cycles_view_layer, "denoising_diffuse_indirect", text="Indirect", toggle=True)
|
||||
|
||||
split = layout.split(percentage=0.5)
|
||||
split.label(text="Glossy")
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
row.prop(cycles_view_layer, "denoising_glossy_direct", text="Direct", toggle=True)
|
||||
row.prop(cycles_view_layer, "denoising_glossy_indirect", text="Indirect", toggle=True)
|
||||
|
||||
split = layout.split(percentage=0.5)
|
||||
split.label(text="Transmission")
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
row.prop(cycles_view_layer, "denoising_transmission_direct", text="Direct", toggle=True)
|
||||
row.prop(cycles_view_layer, "denoising_transmission_indirect", text="Indirect", toggle=True)
|
||||
|
||||
split = layout.split(percentage=0.5)
|
||||
split.label(text="Subsurface")
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
row.prop(cycles_view_layer, "denoising_subsurface_direct", text="Direct", toggle=True)
|
||||
row.prop(cycles_view_layer, "denoising_subsurface_indirect", text="Indirect", toggle=True)
|
||||
|
||||
|
||||
class CYCLES_PT_post_processing(CyclesButtonsPanel, Panel):
|
||||
@@ -607,17 +614,15 @@ class CYCLES_PT_post_processing(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "use_compositing")
|
||||
col.prop(rd, "use_sequencer")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
layout.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
|
||||
class CYCLES_CAMERA_PT_dof(CyclesButtonsPanel, Panel):
|
||||
@@ -874,10 +879,14 @@ class CYCLES_LAMP_PT_preview(CyclesButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.lamp and \
|
||||
not (context.lamp.type == 'AREA' and
|
||||
context.lamp.cycles.is_portal) \
|
||||
and CyclesButtonsPanel.poll(context)
|
||||
return (
|
||||
context.lamp and
|
||||
not (
|
||||
context.lamp.type == 'AREA' and
|
||||
context.lamp.cycles.is_portal
|
||||
) and
|
||||
CyclesButtonsPanel.poll(context)
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
self.layout.template_preview(context.lamp)
|
||||
@@ -945,7 +954,7 @@ class CYCLES_LAMP_PT_nodes(CyclesButtonsPanel, Panel):
|
||||
def poll(cls, context):
|
||||
return context.lamp and not (context.lamp.type == 'AREA' and
|
||||
context.lamp.cycles.is_portal) and \
|
||||
CyclesButtonsPanel.poll(context)
|
||||
CyclesButtonsPanel.poll(context)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -1244,31 +1253,6 @@ class CYCLES_MATERIAL_PT_settings(CyclesButtonsPanel, Panel):
|
||||
col.prop(mat, "pass_index")
|
||||
|
||||
|
||||
class CYCLES_MATERIAL_PT_viewport(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Viewport"
|
||||
bl_context = "material"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.material and CyclesButtonsPanel.poll(context)
|
||||
|
||||
def draw(self, context):
|
||||
mat = context.material
|
||||
|
||||
layout = self.layout
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label("Color:")
|
||||
col.prop(mat, "diffuse_color", text="")
|
||||
col.prop(mat, "alpha")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label("Specular:")
|
||||
col.prop(mat, "specular_color", text="")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Bake"
|
||||
bl_context = "render"
|
||||
@@ -1277,31 +1261,27 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
cscene = scene.cycles
|
||||
cbk = scene.render.bake
|
||||
rd = scene.render
|
||||
|
||||
if rd.use_bake_multires:
|
||||
layout.operator("object.bake_image", icon='RENDER_STILL')
|
||||
else:
|
||||
layout.operator("object.bake", icon='RENDER_STILL').type = cscene.bake_type
|
||||
|
||||
col = layout.column()
|
||||
col.prop(rd, "use_bake_multires")
|
||||
if rd.use_bake_multires:
|
||||
col.prop(rd, "bake_type")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(rd, "bake_margin")
|
||||
col.prop(rd, "use_bake_clear")
|
||||
|
||||
col = split.column()
|
||||
if rd.bake_type == 'DISPLACEMENT':
|
||||
col.prop(rd, "use_bake_lores_mesh")
|
||||
|
||||
col.operator("object.bake_image", icon='RENDER_STILL')
|
||||
|
||||
else:
|
||||
col.prop(cscene, "bake_type")
|
||||
|
||||
@@ -1310,26 +1290,22 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
|
||||
if cscene.bake_type == 'NORMAL':
|
||||
col.prop(cbk, "normal_space", text="Space")
|
||||
|
||||
row = col.row(align=True)
|
||||
row.label(text="Swizzle:")
|
||||
row.prop(cbk, "normal_r", text="")
|
||||
row.prop(cbk, "normal_g", text="")
|
||||
row.prop(cbk, "normal_b", text="")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(cbk, "normal_r", text="Swizzle R")
|
||||
sub.prop(cbk, "normal_g", text="G")
|
||||
sub.prop(cbk, "normal_b", text="B")
|
||||
|
||||
elif cscene.bake_type == 'COMBINED':
|
||||
row = col.row(align=True)
|
||||
row.use_property_split = False
|
||||
row.prop(cbk, "use_pass_direct", toggle=True)
|
||||
row.prop(cbk, "use_pass_indirect", toggle=True)
|
||||
|
||||
split = col.split()
|
||||
split.active = cbk.use_pass_direct or cbk.use_pass_indirect
|
||||
|
||||
col = split.column()
|
||||
col = col.column()
|
||||
col.active = cbk.use_pass_direct or cbk.use_pass_indirect
|
||||
col.prop(cbk, "use_pass_diffuse")
|
||||
col.prop(cbk, "use_pass_glossy")
|
||||
col.prop(cbk, "use_pass_transmission")
|
||||
|
||||
col = split.column()
|
||||
col.prop(cbk, "use_pass_subsurface")
|
||||
col.prop(cbk, "use_pass_ambient_occlusion")
|
||||
col.prop(cbk, "use_pass_emit")
|
||||
@@ -1342,13 +1318,12 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
|
||||
|
||||
layout.separator()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(cbk, "margin")
|
||||
col.prop(cbk, "use_clear")
|
||||
col.prop(cbk, "use_clear", text="Clear Image")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
col.prop(cbk, "use_selected_to_active")
|
||||
sub = col.column()
|
||||
sub.active = cbk.use_selected_to_active
|
||||
@@ -1359,6 +1334,9 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
|
||||
else:
|
||||
sub.prop(cbk, "cage_extrusion", text="Ray Distance")
|
||||
|
||||
layout.operator("object.bake", icon='RENDER_STILL').type = cscene.bake_type
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_debug(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Debug"
|
||||
bl_context = "render"
|
||||
@@ -1410,37 +1388,6 @@ class CYCLES_RENDER_PT_debug(CyclesButtonsPanel, Panel):
|
||||
col.prop(cscene, "debug_bvh_type")
|
||||
|
||||
|
||||
class CYCLES_PARTICLE_PT_curve_settings(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Cycles Hair Settings"
|
||||
bl_context = "particle"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
ccscene = scene.cycles_curves
|
||||
psys = context.particle_system
|
||||
use_curves = ccscene.use_curves and psys
|
||||
return CyclesButtonsPanel.poll(context) and use_curves and psys.settings.type == 'HAIR'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
psys = context.particle_settings
|
||||
cpsys = psys.cycles
|
||||
|
||||
row = layout.row()
|
||||
row.prop(cpsys, "shape", text="Shape")
|
||||
|
||||
layout.label(text="Thickness:")
|
||||
row = layout.row()
|
||||
row.prop(cpsys, "root_width", text="Root")
|
||||
row.prop(cpsys, "tip_width", text="Tip")
|
||||
|
||||
row = layout.row()
|
||||
row.prop(cpsys, "radius_scale", text="Scaling")
|
||||
row.prop(cpsys, "use_closetip", text="Close tip")
|
||||
|
||||
|
||||
class CYCLES_SCENE_PT_simplify(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Simplify"
|
||||
bl_context = "scene"
|
||||
@@ -1465,7 +1412,6 @@ class CYCLES_SCENE_PT_simplify(CyclesButtonsPanel, Panel):
|
||||
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)
|
||||
@@ -1501,23 +1447,22 @@ class CYCLES_SCENE_PT_simplify(CyclesButtonsPanel, Panel):
|
||||
col = split.column()
|
||||
col.prop(cscene, "ao_bounces_render")
|
||||
|
||||
|
||||
def draw_device(self, context):
|
||||
scene = context.scene
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
if context.engine == 'CYCLES':
|
||||
from . import engine
|
||||
cscene = scene.cycles
|
||||
|
||||
split = layout.split(percentage=1 / 3)
|
||||
split.label("Feature Set:")
|
||||
split.prop(cscene, "feature_set", text="")
|
||||
col = layout.column()
|
||||
col.prop(cscene, "feature_set")
|
||||
|
||||
split = layout.split(percentage=1 / 3)
|
||||
split.label("Device:")
|
||||
row = split.row()
|
||||
row.active = show_device_active(context)
|
||||
row.prop(cscene, "device", text="")
|
||||
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")
|
||||
@@ -1530,8 +1475,9 @@ def draw_pause(self, context):
|
||||
if context.engine == "CYCLES":
|
||||
view = context.space_data
|
||||
|
||||
cscene = scene.cycles
|
||||
layout.prop(cscene, "preview_pause", icon="PAUSE", text="")
|
||||
if view.shading.type == 'RENDERED':
|
||||
cscene = scene.cycles
|
||||
layout.prop(cscene, "preview_pause", icon="PAUSE", text="")
|
||||
|
||||
|
||||
def get_panels():
|
||||
@@ -1548,7 +1494,7 @@ def get_panels():
|
||||
'VIEWLAYER_PT_layer_passes',
|
||||
'RENDER_PT_post_processing',
|
||||
'SCENE_PT_simplify',
|
||||
}
|
||||
}
|
||||
|
||||
panels = []
|
||||
for panel in bpy.types.Panel.__subclasses__():
|
||||
@@ -1593,10 +1539,8 @@ classes = (
|
||||
CYCLES_MATERIAL_PT_volume,
|
||||
CYCLES_MATERIAL_PT_displacement,
|
||||
CYCLES_MATERIAL_PT_settings,
|
||||
CYCLES_MATERIAL_PT_viewport,
|
||||
CYCLES_RENDER_PT_bake,
|
||||
CYCLES_RENDER_PT_debug,
|
||||
CYCLES_PARTICLE_PT_curve_settings,
|
||||
CYCLES_SCENE_PT_simplify,
|
||||
)
|
||||
|
||||
|
@@ -433,3 +433,14 @@ def do_versions(self):
|
||||
(bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 4)):
|
||||
# Switch to squared roughness convention
|
||||
square_roughness_nodes_insert()
|
||||
|
||||
if bpy.data.version <= (2, 80, 15):
|
||||
# Copy cycles hair settings to internal settings
|
||||
for part in bpy.data.particles:
|
||||
cpart = part.get("cycles", None)
|
||||
if cpart:
|
||||
part.shape = cpart.get("shape", 0.0)
|
||||
part.root_radius = cpart.get("root_width", 1.0)
|
||||
part.tip_radius = cpart.get("tip_width", 0.0)
|
||||
part.radius_scale = cpart.get("radius_scale", 0.01)
|
||||
part.use_close_tip = cpart.get("use_closetip", True)
|
||||
|
@@ -149,18 +149,16 @@ static bool ObtainCacheParticleData(Mesh *mesh,
|
||||
if(b_part.kink() == BL::ParticleSettings::kink_SPIRAL)
|
||||
ren_step += b_part.kink_extra_steps();
|
||||
|
||||
PointerRNA cpsys = RNA_pointer_get(&b_part.ptr, "cycles");
|
||||
|
||||
CData->psys_firstcurve.push_back_slow(curvenum);
|
||||
CData->psys_curvenum.push_back_slow(totcurves);
|
||||
CData->psys_shader.push_back_slow(shader);
|
||||
|
||||
float radius = get_float(cpsys, "radius_scale") * 0.5f;
|
||||
float radius = b_part.radius_scale() * 0.5f;
|
||||
|
||||
CData->psys_rootradius.push_back_slow(radius * get_float(cpsys, "root_width"));
|
||||
CData->psys_tipradius.push_back_slow(radius * get_float(cpsys, "tip_width"));
|
||||
CData->psys_shape.push_back_slow(get_float(cpsys, "shape"));
|
||||
CData->psys_closetip.push_back_slow(get_boolean(cpsys, "use_closetip"));
|
||||
CData->psys_rootradius.push_back_slow(radius * b_part.root_radius());
|
||||
CData->psys_tipradius.push_back_slow(radius * b_part.tip_radius());
|
||||
CData->psys_shape.push_back_slow(b_part.shape());
|
||||
CData->psys_closetip.push_back_slow(b_part.use_close_tip());
|
||||
|
||||
int pa_no = 0;
|
||||
if(!(b_part.child_type() == 0) && totchild != 0)
|
||||
|
@@ -1173,7 +1173,7 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph,
|
||||
* freed data from the blender side.
|
||||
*/
|
||||
if(preview && b_ob.type() != BL::Object::type_MESH)
|
||||
b_ob.update_from_editmode();
|
||||
b_ob.update_from_editmode(b_data);
|
||||
|
||||
bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
|
||||
|
||||
|
@@ -278,25 +278,25 @@ void BlenderSync::sync_background_light(bool use_portal)
|
||||
/* Object */
|
||||
|
||||
Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
BL::Depsgraph::duplis_iterator& b_dupli_iter,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
uint layer_flag,
|
||||
float motion_time,
|
||||
bool hide_tris,
|
||||
BlenderObjectCulling& culling,
|
||||
bool *use_portal)
|
||||
{
|
||||
const bool is_instance = b_dupli_iter->is_instance();
|
||||
BL::Object b_ob = b_dupli_iter->object();
|
||||
BL::Object b_parent = is_instance ? b_dupli_iter->parent()
|
||||
: b_dupli_iter->object();
|
||||
BL::Object b_ob_instance = is_instance ? b_dupli_iter->instance_object()
|
||||
const bool is_instance = b_instance.is_instance();
|
||||
BL::Object b_ob = b_instance.object();
|
||||
BL::Object b_parent = is_instance ? b_instance.parent()
|
||||
: b_instance.object();
|
||||
BL::Object b_ob_instance = is_instance ? b_instance.instance_object()
|
||||
: b_ob;
|
||||
const bool motion = motion_time != 0.0f;
|
||||
/*const*/ Transform tfm = get_transform(b_ob.matrix_world());
|
||||
int *persistent_id = NULL;
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id_array;
|
||||
if(is_instance) {
|
||||
persistent_id_array = b_dupli_iter->persistent_id();
|
||||
persistent_id_array = b_instance.persistent_id();
|
||||
persistent_id = persistent_id_array.data;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
persistent_id,
|
||||
b_ob,
|
||||
b_ob_instance,
|
||||
is_instance ? b_dupli_iter->random_id() : 0,
|
||||
is_instance ? b_instance.random_id() : 0,
|
||||
tfm,
|
||||
use_portal);
|
||||
}
|
||||
@@ -448,12 +448,12 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
|
||||
/* dupli texture coordinates and random_id */
|
||||
if(is_instance) {
|
||||
object->dupli_generated = 0.5f*get_float3(b_dupli_iter->orco()) - make_float3(0.5f, 0.5f, 0.5f);
|
||||
object->dupli_uv = get_float2(b_dupli_iter->uv());
|
||||
object->random_id = b_dupli_iter->random_id();
|
||||
object->dupli_generated = 0.5f*get_float3(b_instance.orco()) - make_float3(0.5f, 0.5f, 0.5f);
|
||||
object->dupli_uv = get_float2(b_instance.uv());
|
||||
object->random_id = b_instance.random_id();
|
||||
|
||||
/* Sync possible particle data. */
|
||||
sync_dupli_particle(b_ob, *b_dupli_iter, object);
|
||||
sync_dupli_particle(b_ob, b_instance, object);
|
||||
}
|
||||
else {
|
||||
object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f);
|
||||
@@ -563,12 +563,13 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
|
||||
bool cancel = false;
|
||||
bool use_portal = false;
|
||||
|
||||
BL::Depsgraph::duplis_iterator b_dupli_iter;
|
||||
for(b_depsgraph.duplis.begin(b_dupli_iter);
|
||||
b_dupli_iter != b_depsgraph.duplis.end() && !cancel;
|
||||
++b_dupli_iter)
|
||||
BL::Depsgraph::object_instances_iterator b_instance_iter;
|
||||
for(b_depsgraph.object_instances.begin(b_instance_iter);
|
||||
b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
|
||||
++b_instance_iter)
|
||||
{
|
||||
BL::Object b_ob = b_dupli_iter->object();
|
||||
BL::DepsgraphObjectInstance b_instance = *b_instance_iter;
|
||||
BL::Object b_ob = b_instance.object();
|
||||
if(!b_ob.is_visible()) {
|
||||
continue;
|
||||
}
|
||||
@@ -584,7 +585,7 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
|
||||
if(!object_render_hide(b_ob, true, true, hide_tris)) {
|
||||
/* object itself */
|
||||
sync_object(b_depsgraph,
|
||||
b_dupli_iter,
|
||||
b_instance,
|
||||
~(0), /* until we get rid of layers */
|
||||
motion_time,
|
||||
hide_tris,
|
||||
|
@@ -28,11 +28,11 @@ CCL_NAMESPACE_BEGIN
|
||||
/* Utilities */
|
||||
|
||||
bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
BL::DepsgraphIter& b_dup,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
Object *object)
|
||||
{
|
||||
/* test if this dupli was generated from a particle sytem */
|
||||
BL::ParticleSystem b_psys = b_dup.particle_system();
|
||||
BL::ParticleSystem b_psys = b_instance.particle_system();
|
||||
if(!b_psys)
|
||||
return false;
|
||||
|
||||
@@ -43,7 +43,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
return false;
|
||||
|
||||
/* don't handle child particles yet */
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_dup.persistent_id();
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_instance.persistent_id();
|
||||
|
||||
if(persistent_id[0] >= b_psys.particles.length())
|
||||
return false;
|
||||
@@ -53,7 +53,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
ParticleSystem *psys;
|
||||
|
||||
bool first_use = !particle_system_map.is_used(key);
|
||||
bool need_update = particle_system_map.sync(&psys, b_ob, b_dup.object(), key);
|
||||
bool need_update = particle_system_map.sync(&psys, b_ob, b_instance.object(), key);
|
||||
|
||||
/* no update needed? */
|
||||
if(!need_update && !object->mesh->need_update && !scene->object_manager->need_update)
|
||||
|
@@ -773,7 +773,7 @@ void BlenderSession::synchronize(BL::Depsgraph& b_depsgraph_)
|
||||
|
||||
/* copy recalc flags, outside of mutex so we can decide to do the real
|
||||
* synchronization at a later time to not block on running updates */
|
||||
sync->sync_recalc();
|
||||
sync->sync_recalc(b_depsgraph_);
|
||||
|
||||
/* don't do synchronization if on pause */
|
||||
if(session_pause) {
|
||||
|
@@ -659,7 +659,9 @@ static ShaderNode *add_node(Scene *scene,
|
||||
image->animated = b_image_node.image_user().use_auto_refresh();
|
||||
image->use_alpha = b_image.use_alpha();
|
||||
|
||||
/* TODO: restore */
|
||||
/* TODO(sergey): Does not work properly when we change builtin type. */
|
||||
#if 0
|
||||
if(b_image.is_updated()) {
|
||||
scene->image_manager->tag_reload_image(
|
||||
image->filename.string(),
|
||||
@@ -668,6 +670,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
get_image_extension(b_image_node),
|
||||
image->use_alpha);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
image->color_space = (NodeImageColorSpace)b_image_node.color_space();
|
||||
image->projection = (NodeImageProjection)b_image_node.projection();
|
||||
@@ -707,7 +710,9 @@ static ShaderNode *add_node(Scene *scene,
|
||||
env->animated = b_env_node.image_user().use_auto_refresh();
|
||||
env->use_alpha = b_image.use_alpha();
|
||||
|
||||
/* TODO: restore */
|
||||
/* TODO(sergey): Does not work properly when we change builtin type. */
|
||||
#if 0
|
||||
if(b_image.is_updated()) {
|
||||
scene->image_manager->tag_reload_image(
|
||||
env->filename.string(),
|
||||
@@ -716,6 +721,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
EXTENSION_REPEAT,
|
||||
env->use_alpha);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
env->color_space = (NodeImageColorSpace)b_env_node.color_space();
|
||||
env->interpolation = get_image_interpolation(b_env_node);
|
||||
@@ -1238,33 +1244,32 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
TaskPool pool;
|
||||
set<Shader*> updated_shaders;
|
||||
|
||||
/* material loop */
|
||||
BL::BlendData::materials_iterator b_mat_orig;
|
||||
for(b_data.materials.begin(b_mat_orig);
|
||||
b_mat_orig != b_data.materials.end();
|
||||
++b_mat_orig)
|
||||
{
|
||||
/* TODO(sergey): Iterate over evaluated data rather than using mapping. */
|
||||
BL::Material b_mat_(b_depsgraph.id_eval_get(*b_mat_orig));
|
||||
BL::Material *b_mat = &b_mat_;
|
||||
BL::Depsgraph::ids_iterator b_id;
|
||||
for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) {
|
||||
if (!b_id->is_a(&RNA_Material)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
BL::Material b_mat(*b_id);
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if(shader_map.sync(&shader, *b_mat) || update_all) {
|
||||
if(shader_map.sync(&shader, b_mat) || shader->need_sync_object || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
shader->name = b_mat->name().c_str();
|
||||
shader->pass_id = b_mat->pass_index();
|
||||
shader->name = b_mat.name().c_str();
|
||||
shader->pass_id = b_mat.pass_index();
|
||||
shader->need_sync_object = false;
|
||||
|
||||
/* create nodes */
|
||||
if(b_mat->use_nodes() && b_mat->node_tree()) {
|
||||
BL::ShaderNodeTree b_ntree(b_mat->node_tree());
|
||||
if(b_mat.use_nodes() && b_mat.node_tree()) {
|
||||
BL::ShaderNodeTree b_ntree(b_mat.node_tree());
|
||||
|
||||
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
DiffuseBsdfNode *diffuse = new DiffuseBsdfNode();
|
||||
diffuse->color = get_float3(b_mat->diffuse_color());
|
||||
diffuse->color = get_float3(b_mat.diffuse_color());
|
||||
graph->add(diffuse);
|
||||
|
||||
ShaderNode *out = graph->output();
|
||||
@@ -1272,7 +1277,7 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
}
|
||||
|
||||
/* settings */
|
||||
PointerRNA cmat = RNA_pointer_get(&b_mat->ptr, "cycles");
|
||||
PointerRNA cmat = RNA_pointer_get(&b_mat.ptr, "cycles");
|
||||
shader->use_mis = get_boolean(cmat, "sample_as_light");
|
||||
shader->use_transparent_shadow = get_boolean(cmat, "use_transparent_shadow");
|
||||
shader->heterogeneous_volume = !get_boolean(cmat, "homogeneous_volume");
|
||||
@@ -1412,41 +1417,39 @@ void BlenderSync::sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
{
|
||||
shader_map.set_default(scene->default_light);
|
||||
|
||||
/* lamp loop */
|
||||
BL::BlendData::lamps_iterator b_lamp_orig;
|
||||
for(b_data.lamps.begin(b_lamp_orig);
|
||||
b_lamp_orig != b_data.lamps.end();
|
||||
++b_lamp_orig)
|
||||
{
|
||||
/* TODO(sergey): Iterate over evaluated data rather than using mapping. */
|
||||
BL::Lamp b_lamp_(b_depsgraph.id_eval_get(*b_lamp_orig));
|
||||
BL::Lamp *b_lamp = &b_lamp_;
|
||||
BL::Depsgraph::ids_iterator b_id;
|
||||
for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) {
|
||||
if (!b_id->is_a(&RNA_Lamp)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
BL::Lamp b_lamp(*b_id);
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if(shader_map.sync(&shader, *b_lamp) || update_all) {
|
||||
if(shader_map.sync(&shader, b_lamp) || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
/* create nodes */
|
||||
if(b_lamp->use_nodes() && b_lamp->node_tree()) {
|
||||
shader->name = b_lamp->name().c_str();
|
||||
if(b_lamp.use_nodes() && b_lamp.node_tree()) {
|
||||
shader->name = b_lamp.name().c_str();
|
||||
|
||||
BL::ShaderNodeTree b_ntree(b_lamp->node_tree());
|
||||
BL::ShaderNodeTree b_ntree(b_lamp.node_tree());
|
||||
|
||||
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
float strength = 1.0f;
|
||||
|
||||
if(b_lamp->type() == BL::Lamp::type_POINT ||
|
||||
b_lamp->type() == BL::Lamp::type_SPOT ||
|
||||
b_lamp->type() == BL::Lamp::type_AREA)
|
||||
if(b_lamp.type() == BL::Lamp::type_POINT ||
|
||||
b_lamp.type() == BL::Lamp::type_SPOT ||
|
||||
b_lamp.type() == BL::Lamp::type_AREA)
|
||||
{
|
||||
strength = 100.0f;
|
||||
}
|
||||
|
||||
EmissionNode *emission = new EmissionNode();
|
||||
emission->color = get_float3(b_lamp->color());
|
||||
emission->color = get_float3(b_lamp.color());
|
||||
emission->strength = strength;
|
||||
graph->add(emission);
|
||||
|
||||
|
@@ -76,31 +76,12 @@ BlenderSync::~BlenderSync()
|
||||
|
||||
/* Sync */
|
||||
|
||||
bool BlenderSync::sync_recalc()
|
||||
void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph)
|
||||
{
|
||||
/* sync recalc flags from blender to cycles. actual update is done separate,
|
||||
* so we can do it later on if doing it immediate is not suitable */
|
||||
|
||||
BL::BlendData::materials_iterator b_mat;
|
||||
bool has_updated_objects = b_data.objects.is_updated();
|
||||
for(b_data.materials.begin(b_mat); b_mat != b_data.materials.end(); ++b_mat) {
|
||||
if(b_mat->is_updated() || (b_mat->node_tree() && b_mat->node_tree().is_updated())) {
|
||||
shader_map.set_recalc(*b_mat);
|
||||
}
|
||||
else {
|
||||
Shader *shader = shader_map.find(*b_mat);
|
||||
if(has_updated_objects && shader != NULL && shader->has_object_dependency) {
|
||||
shader_map.set_recalc(*b_mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::lamps_iterator b_lamp;
|
||||
|
||||
for(b_data.lamps.begin(b_lamp); b_lamp != b_data.lamps.end(); ++b_lamp)
|
||||
if(b_lamp->is_updated() || (b_lamp->node_tree() && b_lamp->node_tree().is_updated()))
|
||||
shader_map.set_recalc(*b_lamp);
|
||||
/* Sync recalc flags from blender to cycles. Actual update is done separate,
|
||||
* so we can do it later on if doing it immediate is not suitable. */
|
||||
|
||||
bool has_updated_objects = b_depsgraph.id_type_updated(BL::DriverTarget::id_type_OBJECT);
|
||||
bool dicing_prop_changed = false;
|
||||
|
||||
if(experimental) {
|
||||
@@ -122,70 +103,77 @@ bool BlenderSync::sync_recalc()
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::objects_iterator b_ob;
|
||||
/* Iterate over all IDs in this depsgraph. */
|
||||
BL::Depsgraph::updates_iterator b_update;
|
||||
for(b_depsgraph.updates.begin(b_update); b_update != b_depsgraph.updates.end(); ++b_update) {
|
||||
BL::ID b_id(b_update->id());
|
||||
|
||||
for(b_data.objects.begin(b_ob); b_ob != b_data.objects.end(); ++b_ob) {
|
||||
if(b_ob->is_updated()) {
|
||||
object_map.set_recalc(*b_ob);
|
||||
light_map.set_recalc(*b_ob);
|
||||
/* Material */
|
||||
if (b_id.is_a(&RNA_Material)) {
|
||||
BL::Material b_mat(b_id);
|
||||
shader_map.set_recalc(b_mat);
|
||||
}
|
||||
/* Lamp */
|
||||
else if (b_id.is_a(&RNA_Lamp)) {
|
||||
BL::Lamp b_lamp(b_id);
|
||||
shader_map.set_recalc(b_lamp);
|
||||
}
|
||||
/* Object */
|
||||
else if (b_id.is_a(&RNA_Object)) {
|
||||
BL::Object b_ob(b_id);
|
||||
const bool updated_geometry = b_update->updated_geometry();
|
||||
|
||||
if(object_is_mesh(*b_ob)) {
|
||||
if(b_ob->is_updated_data() || b_ob->data().is_updated() ||
|
||||
(dicing_prop_changed && object_subdivision_type(*b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
|
||||
{
|
||||
BL::ID key = BKE_object_is_modified(*b_ob)? *b_ob: b_ob->data();
|
||||
mesh_map.set_recalc(key);
|
||||
if (b_update->updated_transform()) {
|
||||
object_map.set_recalc(b_ob);
|
||||
light_map.set_recalc(b_ob);
|
||||
}
|
||||
}
|
||||
else if(object_is_light(*b_ob)) {
|
||||
if(b_ob->is_updated_data() || b_ob->data().is_updated())
|
||||
light_map.set_recalc(*b_ob);
|
||||
}
|
||||
|
||||
if(b_ob->is_updated_data()) {
|
||||
BL::Object::particle_systems_iterator b_psys;
|
||||
for(b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys)
|
||||
particle_system_map.set_recalc(*b_ob);
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::meshes_iterator b_mesh;
|
||||
|
||||
for(b_data.meshes.begin(b_mesh); b_mesh != b_data.meshes.end(); ++b_mesh) {
|
||||
if(b_mesh->is_updated()) {
|
||||
mesh_map.set_recalc(*b_mesh);
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::worlds_iterator b_world;
|
||||
|
||||
for(b_data.worlds.begin(b_world); b_world != b_data.worlds.end(); ++b_world) {
|
||||
if(world_map == b_world->ptr.data) {
|
||||
if(b_world->is_updated() ||
|
||||
(b_world->node_tree() && b_world->node_tree().is_updated()))
|
||||
{
|
||||
world_recalc = true;
|
||||
}
|
||||
else if(b_world->node_tree() && b_world->use_nodes()) {
|
||||
Shader *shader = scene->default_background;
|
||||
if(has_updated_objects && shader->has_object_dependency) {
|
||||
world_recalc = true;
|
||||
if(object_is_mesh(b_ob)) {
|
||||
if(updated_geometry ||
|
||||
(dicing_prop_changed && object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
|
||||
{
|
||||
BL::ID key = BKE_object_is_modified(b_ob)? b_ob: b_ob.data();
|
||||
mesh_map.set_recalc(key);
|
||||
}
|
||||
}
|
||||
else if(object_is_light(b_ob)) {
|
||||
if(updated_geometry) {
|
||||
light_map.set_recalc(b_ob);
|
||||
}
|
||||
}
|
||||
|
||||
if(updated_geometry) {
|
||||
BL::Object::particle_systems_iterator b_psys;
|
||||
for(b_ob.particle_systems.begin(b_psys); b_psys != b_ob.particle_systems.end(); ++b_psys)
|
||||
particle_system_map.set_recalc(b_ob);
|
||||
}
|
||||
}
|
||||
/* Mesh */
|
||||
else if (b_id.is_a(&RNA_Mesh)) {
|
||||
BL::Mesh b_mesh(b_id);
|
||||
mesh_map.set_recalc(b_mesh);
|
||||
}
|
||||
/* World */
|
||||
else if (b_id.is_a(&RNA_World)) {
|
||||
BL::World b_world(b_id);
|
||||
if(world_map == b_world.ptr.data) {
|
||||
world_recalc = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool recalc =
|
||||
shader_map.has_recalc() ||
|
||||
object_map.has_recalc() ||
|
||||
light_map.has_recalc() ||
|
||||
mesh_map.has_recalc() ||
|
||||
particle_system_map.has_recalc() ||
|
||||
BlendDataObjects_is_updated_get(&b_data.ptr) ||
|
||||
world_recalc;
|
||||
/* Updates shader with object dependency if objects changed. */
|
||||
if (has_updated_objects) {
|
||||
if(scene->default_background->has_object_dependency) {
|
||||
world_recalc = true;
|
||||
}
|
||||
|
||||
return recalc;
|
||||
foreach(Shader *shader, scene->shaders) {
|
||||
if (shader->has_object_dependency) {
|
||||
shader->need_sync_object = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BlenderSync::sync_data(BL::RenderSettings& b_render,
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
~BlenderSync();
|
||||
|
||||
/* sync */
|
||||
bool sync_recalc();
|
||||
void sync_recalc(BL::Depsgraph& b_depsgraph);
|
||||
void sync_data(BL::RenderSettings& b_render,
|
||||
BL::Depsgraph& b_depsgraph,
|
||||
BL::SpaceView3D& b_v3d,
|
||||
@@ -126,7 +126,7 @@ private:
|
||||
bool motion,
|
||||
int motion_step = 0);
|
||||
Object *sync_object(BL::Depsgraph& b_depsgraph,
|
||||
BL::Depsgraph::duplis_iterator& b_dupli_iter,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
uint layer_flag,
|
||||
float motion_time,
|
||||
bool hide_tris,
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
|
||||
/* particles */
|
||||
bool sync_dupli_particle(BL::Object& b_ob,
|
||||
BL::DepsgraphIter& b_dup,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
Object *object);
|
||||
|
||||
/* Images. */
|
||||
|
@@ -59,12 +59,15 @@ ccl_device_inline void kernel_split_path_end(KernelGlobals *kg, int ray_index)
|
||||
ccl_global char *ray_state = kernel_split_state.ray_state;
|
||||
|
||||
#ifdef __BRANCHED_PATH__
|
||||
# ifdef __SUBSURFACE__
|
||||
ccl_addr_space SubsurfaceIndirectRays *ss_indirect = &kernel_split_state.ss_rays[ray_index];
|
||||
|
||||
if(ss_indirect->num_rays) {
|
||||
ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER);
|
||||
}
|
||||
else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) {
|
||||
else
|
||||
# endif /* __SUBSURFACE__ */
|
||||
if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) {
|
||||
int orig_ray = kernel_split_state.branched_state[ray_index].original_ray;
|
||||
|
||||
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];
|
||||
|
@@ -202,6 +202,7 @@ Shader::Shader()
|
||||
|
||||
need_update = true;
|
||||
need_update_mesh = true;
|
||||
need_sync_object = false;
|
||||
}
|
||||
|
||||
Shader::~Shader()
|
||||
|
@@ -99,6 +99,7 @@ public:
|
||||
/* synchronization */
|
||||
bool need_update;
|
||||
bool need_update_mesh;
|
||||
bool need_sync_object;
|
||||
|
||||
/* If the shader has only volume components, the surface is assumed to
|
||||
* be transparent.
|
||||
|
@@ -36,10 +36,12 @@ set(SRC
|
||||
|
||||
intern/eigenvalues.cc
|
||||
intern/linear_solver.cc
|
||||
intern/matrix.cc
|
||||
intern/svd.cc
|
||||
|
||||
intern/eigenvalues.h
|
||||
intern/linear_solver.h
|
||||
intern/matrix.h
|
||||
intern/svd.h
|
||||
)
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "intern/eigenvalues.h"
|
||||
#include "intern/linear_solver.h"
|
||||
#include "intern/matrix.h"
|
||||
#include "intern/svd.h"
|
||||
|
||||
#endif /* __EIGEN_C_API_H__ */
|
||||
|
55
intern/eigen/intern/matrix.cc
Normal file
55
intern/eigen/intern/matrix.cc
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2018 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_MATRIX_C_API_CC__
|
||||
#define __EIGEN3_MATRIX_C_API_CC__
|
||||
|
||||
/* Eigen gives annoying huge amount of warnings here, silence them! */
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
# pragma GCC diagnostic ignored "-Wlogical-op"
|
||||
#endif
|
||||
|
||||
#ifdef __EIGEN3_MATRIX_C_API_CC__ /* quiet warning */
|
||||
#endif
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
#include "matrix.h"
|
||||
|
||||
using Eigen::Map;
|
||||
using Eigen::Matrix4f;
|
||||
|
||||
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4])
|
||||
{
|
||||
Map<Matrix4f> M = Map<Matrix4f>((float*)matrix);
|
||||
Matrix4f R;
|
||||
bool invertible = true;
|
||||
M.computeInverseWithCheck(R, invertible, 0.0f);
|
||||
memcpy(inverse, R.data(), sizeof(float)*4*4);
|
||||
return invertible;
|
||||
}
|
||||
|
||||
#endif /* __EIGEN3_MATRIX_C_API_CC__ */
|
40
intern/eigen/intern/matrix.h
Normal file
40
intern/eigen/intern/matrix.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_MATRIX_C_API_H__
|
||||
#define __EIGEN3_MATRIX_C_API_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __EIGEN3_MATRIX_C_API_H__ */
|
@@ -37,6 +37,7 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/SVD>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
#include "svd.h"
|
||||
|
||||
@@ -51,6 +52,8 @@ using Eigen::MatrixXf;
|
||||
using Eigen::VectorXf;
|
||||
using Eigen::Map;
|
||||
|
||||
using Eigen::Matrix4f;
|
||||
|
||||
void EIG_svd_square_matrix(const int size, const float *matrix, float *r_U, float *r_S, float *r_V)
|
||||
{
|
||||
/* Since our matrix is squared, we can use thinU/V. */
|
||||
|
@@ -59,13 +59,19 @@ using namespace OCIO_NAMESPACE;
|
||||
#include "ocio_impl.h"
|
||||
|
||||
static const int LUT3D_EDGE_SIZE = 64;
|
||||
static const int SHADER_CACHE_SIZE = 4;
|
||||
|
||||
extern "C" char datatoc_gpu_shader_display_transform_glsl[];
|
||||
extern "C" char datatoc_gpu_shader_display_transform_vertex_glsl[];
|
||||
|
||||
/* **** OpenGL drawing routines using GLSL for color space transform ***** */
|
||||
|
||||
typedef struct OCIO_GLSLDrawState {
|
||||
typedef struct OCIO_GLSLShader {
|
||||
/* Cache ID */
|
||||
std::string lut3dCacheID;
|
||||
std::string shaderCacheID;
|
||||
|
||||
/* LUT */
|
||||
bool lut3d_texture_allocated; /* boolean flag indicating whether
|
||||
* lut texture is allocated
|
||||
*/
|
||||
@@ -75,25 +81,29 @@ typedef struct OCIO_GLSLDrawState {
|
||||
|
||||
float *lut3d; /* 3D LUT table */
|
||||
|
||||
bool dither_used;
|
||||
/* Dither */
|
||||
bool use_dither;
|
||||
|
||||
bool curve_mapping_used;
|
||||
/* Curve Mapping */
|
||||
bool use_curve_mapping;
|
||||
bool curve_mapping_texture_allocated;
|
||||
bool curve_mapping_texture_valid;
|
||||
GLuint curve_mapping_texture;
|
||||
size_t curve_mapping_cache_id;
|
||||
|
||||
bool predivide_used;
|
||||
|
||||
/* Cache */
|
||||
std::string lut3dcacheid;
|
||||
std::string shadercacheid;
|
||||
/* Alpha Predivide */
|
||||
bool use_predivide;
|
||||
|
||||
/* GLSL stuff */
|
||||
GLuint ocio_shader;
|
||||
GLuint vert_shader;
|
||||
GLuint program;
|
||||
Gwn_ShaderInterface *shader_interface;
|
||||
} GLSLDrawState;
|
||||
|
||||
typedef struct OCIO_GLSLDrawState {
|
||||
/* Shader Cache */
|
||||
OCIO_GLSLShader *shader_cache[SHADER_CACHE_SIZE];
|
||||
|
||||
/* Previous OpenGL state. */
|
||||
GLint last_texture, last_texture_unit;
|
||||
@@ -150,33 +160,24 @@ static GLuint linkShaders(GLuint ocio_shader, GLuint vert_shader)
|
||||
|
||||
static OCIO_GLSLDrawState *allocateOpenGLState(void)
|
||||
{
|
||||
OCIO_GLSLDrawState *state;
|
||||
|
||||
/* Allocate memory for state. */
|
||||
state = (OCIO_GLSLDrawState *) MEM_callocN(sizeof(OCIO_GLSLDrawState),
|
||||
"OCIO OpenGL State struct");
|
||||
|
||||
/* Call constructors on new memory. */
|
||||
new (&state->lut3dcacheid) std::string("");
|
||||
new (&state->shadercacheid) std::string("");
|
||||
|
||||
return state;
|
||||
return (OCIO_GLSLDrawState *) MEM_callocN(sizeof(OCIO_GLSLDrawState),
|
||||
"OCIO OpenGL State struct");
|
||||
}
|
||||
|
||||
/* Ensure LUT texture and array are allocated */
|
||||
static bool ensureLUT3DAllocated(OCIO_GLSLDrawState *state)
|
||||
static bool ensureLUT3DAllocated(OCIO_GLSLShader *shader)
|
||||
{
|
||||
int num_3d_entries = 3 * LUT3D_EDGE_SIZE * LUT3D_EDGE_SIZE * LUT3D_EDGE_SIZE;
|
||||
|
||||
if (state->lut3d_texture_allocated)
|
||||
return state->lut3d_texture_valid;
|
||||
if (shader->lut3d_texture_allocated)
|
||||
return shader->lut3d_texture_valid;
|
||||
|
||||
glGenTextures(1, &state->lut3d_texture);
|
||||
glGenTextures(1, &shader->lut3d_texture);
|
||||
|
||||
state->lut3d = (float *) MEM_callocN(sizeof(float) * num_3d_entries, "OCIO GPU 3D LUT");
|
||||
shader->lut3d = (float *) MEM_callocN(sizeof(float) * num_3d_entries, "OCIO GPU 3D LUT");
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -188,27 +189,27 @@ static bool ensureLUT3DAllocated(OCIO_GLSLDrawState *state)
|
||||
|
||||
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16F_ARB,
|
||||
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
|
||||
0, GL_RGB, GL_FLOAT, state->lut3d);
|
||||
0, GL_RGB, GL_FLOAT, shader->lut3d);
|
||||
|
||||
state->lut3d_texture_allocated = true;
|
||||
shader->lut3d_texture_allocated = true;
|
||||
|
||||
/* GL_RGB16F_ARB could be not supported at some drivers
|
||||
* in this case we could not use GLSL display
|
||||
*/
|
||||
state->lut3d_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
shader->lut3d_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
|
||||
return state->lut3d_texture_valid;
|
||||
return shader->lut3d_texture_valid;
|
||||
}
|
||||
|
||||
static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMappingSettings *curve_mapping_settings)
|
||||
static bool ensureCurveMappingAllocated(OCIO_GLSLShader *shader, OCIO_CurveMappingSettings *curve_mapping_settings)
|
||||
{
|
||||
if (state->curve_mapping_texture_allocated)
|
||||
return state->curve_mapping_texture_valid;
|
||||
if (shader->curve_mapping_texture_allocated)
|
||||
return shader->curve_mapping_texture_valid;
|
||||
|
||||
glGenTextures(1, &state->curve_mapping_texture);
|
||||
glGenTextures(1, &shader->curve_mapping_texture);
|
||||
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -221,16 +222,51 @@ static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMap
|
||||
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16F, curve_mapping_settings->lut_size,
|
||||
0, GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
|
||||
|
||||
state->curve_mapping_texture_allocated = true;
|
||||
shader->curve_mapping_texture_allocated = true;
|
||||
|
||||
/* GL_RGB16F_ARB could be not supported at some drivers
|
||||
* in this case we could not use GLSL display
|
||||
*/
|
||||
state->curve_mapping_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
shader->curve_mapping_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
|
||||
return state->curve_mapping_texture_valid;
|
||||
return shader->curve_mapping_texture_valid;
|
||||
}
|
||||
|
||||
static void freeGLSLShader(OCIO_GLSLShader *shader)
|
||||
{
|
||||
if (shader->curve_mapping_texture_allocated) {
|
||||
glDeleteTextures(1, &shader->curve_mapping_texture);
|
||||
}
|
||||
|
||||
if (shader->lut3d_texture_allocated) {
|
||||
glDeleteTextures(1, &shader->lut3d_texture);
|
||||
}
|
||||
|
||||
if (shader->lut3d) {
|
||||
MEM_freeN(shader->lut3d);
|
||||
}
|
||||
|
||||
if (shader->program) {
|
||||
glDeleteProgram(shader->program);
|
||||
}
|
||||
|
||||
if (shader->shader_interface) {
|
||||
GWN_shaderinterface_discard(shader->shader_interface);
|
||||
}
|
||||
|
||||
if (shader->ocio_shader) {
|
||||
glDeleteShader(shader->ocio_shader);
|
||||
}
|
||||
|
||||
using std::string;
|
||||
shader->lut3dCacheID.~string();
|
||||
shader->shaderCacheID.~string();
|
||||
|
||||
MEM_freeN(shader);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Detect if we can support GLSL drawing */
|
||||
bool OCIOImpl::supportGLSLDraw()
|
||||
{
|
||||
@@ -265,135 +301,154 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &state->last_texture);
|
||||
glGetIntegerv(GL_ACTIVE_TEXTURE, &state->last_texture_unit);
|
||||
|
||||
if (!ensureLUT3DAllocated(state)) {
|
||||
glActiveTexture(state->last_texture_unit);
|
||||
glBindTexture(GL_TEXTURE_2D, state->last_texture);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (use_curve_mapping) {
|
||||
if (!ensureCurveMappingAllocated(state, curve_mapping_settings)) {
|
||||
glActiveTexture(state->last_texture_unit);
|
||||
glBindTexture(GL_TEXTURE_2D, state->last_texture);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state->curve_mapping_texture_allocated) {
|
||||
glDeleteTextures(1, &state->curve_mapping_texture);
|
||||
state->curve_mapping_texture_allocated = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 1: Create a GPU Shader Description */
|
||||
/* Compute cache IDs. */
|
||||
GpuShaderDesc shaderDesc;
|
||||
shaderDesc.setLanguage(GPU_LANGUAGE_GLSL_1_3);
|
||||
shaderDesc.setFunctionName("OCIODisplay");
|
||||
shaderDesc.setLut3DEdgeLen(LUT3D_EDGE_SIZE);
|
||||
|
||||
if (use_curve_mapping) {
|
||||
if (state->curve_mapping_cache_id != curve_mapping_settings->cache_id) {
|
||||
std::string lut3dCacheID = ocio_processor->getGpuLut3DCacheID(shaderDesc);
|
||||
std::string shaderCacheID = ocio_processor->getGpuShaderTextCacheID(shaderDesc);
|
||||
|
||||
/* Find matching cached shader. */
|
||||
OCIO_GLSLShader *shader = NULL;
|
||||
for (int i = 0; i < SHADER_CACHE_SIZE; i++) {
|
||||
OCIO_GLSLShader *cached_shader = state->shader_cache[i];
|
||||
if (cached_shader == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cached_shader->lut3dCacheID == lut3dCacheID &&
|
||||
cached_shader->shaderCacheID == shaderCacheID &&
|
||||
cached_shader->use_predivide == use_predivide &&
|
||||
cached_shader->use_curve_mapping == use_curve_mapping &&
|
||||
cached_shader->use_dither == use_dither)
|
||||
{
|
||||
/* LRU cache, so move to front. */
|
||||
for (int j = i; j > 0; j--) {
|
||||
state->shader_cache[j] = state->shader_cache[j - 1];
|
||||
}
|
||||
state->shader_cache[0] = cached_shader;
|
||||
|
||||
shader = cached_shader;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (shader == NULL) {
|
||||
/* LRU cache, shift other items back so we can insert at the front. */
|
||||
OCIO_GLSLShader *last_shader = state->shader_cache[SHADER_CACHE_SIZE - 1];
|
||||
if (last_shader) {
|
||||
freeGLSLShader(last_shader);
|
||||
}
|
||||
for (int j = SHADER_CACHE_SIZE - 1; j > 0; j--) {
|
||||
state->shader_cache[j] = state->shader_cache[j - 1];
|
||||
}
|
||||
|
||||
/* Allocate memory for shader. */
|
||||
shader = (OCIO_GLSLShader *) MEM_callocN(sizeof(OCIO_GLSLShader),
|
||||
"OCIO GLSL Shader");
|
||||
state->shader_cache[0] = shader;
|
||||
|
||||
new (&shader->lut3dCacheID) std::string();
|
||||
new (&shader->shaderCacheID) std::string();
|
||||
|
||||
shader->lut3dCacheID = lut3dCacheID;
|
||||
shader->shaderCacheID = shaderCacheID;
|
||||
shader->use_curve_mapping = use_curve_mapping;
|
||||
shader->use_dither = use_dither;
|
||||
shader->use_predivide = use_predivide;
|
||||
|
||||
bool valid = true;
|
||||
|
||||
/* Compute 3D LUT. */
|
||||
if (valid && ensureLUT3DAllocated(shader)) {
|
||||
ocio_processor->getGpuLut3D(shader->lut3d, shaderDesc);
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0,
|
||||
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
|
||||
GL_RGB, GL_FLOAT, shader->lut3d);
|
||||
}
|
||||
else {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
/* Allocate curve mapping texture. */
|
||||
if (valid && use_curve_mapping) {
|
||||
if (!ensureCurveMappingAllocated(shader, curve_mapping_settings)) {
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
/* Vertex shader */
|
||||
std::ostringstream osv;
|
||||
|
||||
osv << "#version 330\n";
|
||||
osv << datatoc_gpu_shader_display_transform_vertex_glsl;
|
||||
|
||||
shader->vert_shader = compileShaderText(GL_VERTEX_SHADER, osv.str().c_str());
|
||||
|
||||
/* Fragment shader */
|
||||
std::ostringstream os;
|
||||
|
||||
os << "#version 330\n";
|
||||
|
||||
/* Work around OpenColorIO not supporting latest GLSL yet. */
|
||||
os << "#define texture2D texture\n";
|
||||
os << "#define texture3D texture\n";
|
||||
|
||||
if (use_predivide) {
|
||||
os << "#define USE_PREDIVIDE\n";
|
||||
}
|
||||
|
||||
if (use_dither) {
|
||||
os << "#define USE_DITHER\n";
|
||||
}
|
||||
|
||||
if (use_curve_mapping) {
|
||||
os << "#define USE_CURVE_MAPPING\n";
|
||||
}
|
||||
|
||||
os << ocio_processor->getGpuShaderText(shaderDesc) << "\n";
|
||||
os << datatoc_gpu_shader_display_transform_glsl;
|
||||
|
||||
shader->ocio_shader = compileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
|
||||
|
||||
/* Program */
|
||||
if (shader->ocio_shader && shader->vert_shader) {
|
||||
shader->program = linkShaders(shader->ocio_shader, shader->vert_shader);
|
||||
}
|
||||
|
||||
if (shader->program) {
|
||||
if (shader->shader_interface) {
|
||||
GWN_shaderinterface_discard(shader->shader_interface);
|
||||
}
|
||||
shader->shader_interface = GWN_shaderinterface_create(shader->program);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Update curve mapping texture. */
|
||||
if (use_curve_mapping && shader->curve_mapping_texture_allocated) {
|
||||
if (shader->curve_mapping_cache_id != curve_mapping_settings->cache_id) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, curve_mapping_settings->lut_size,
|
||||
GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 2: Compute the 3D LUT */
|
||||
std::string lut3dCacheID = ocio_processor->getGpuLut3DCacheID(shaderDesc);
|
||||
if (lut3dCacheID != state->lut3dcacheid) {
|
||||
state->lut3dcacheid = lut3dCacheID;
|
||||
ocio_processor->getGpuLut3D(state->lut3d, shaderDesc);
|
||||
|
||||
/* Bind Shader. */
|
||||
if (shader->program) {
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0,
|
||||
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
|
||||
GL_RGB, GL_FLOAT, state->lut3d);
|
||||
}
|
||||
|
||||
/* Step 3: Compute the Shader */
|
||||
std::string shaderCacheID = ocio_processor->getGpuShaderTextCacheID(shaderDesc);
|
||||
if (state->program == 0 ||
|
||||
shaderCacheID != state->shadercacheid ||
|
||||
use_predivide != state->predivide_used ||
|
||||
use_curve_mapping != state->curve_mapping_used ||
|
||||
use_dither != state->dither_used)
|
||||
{
|
||||
state->shadercacheid = shaderCacheID;
|
||||
|
||||
if (state->program) {
|
||||
glDeleteProgram(state->program);
|
||||
}
|
||||
|
||||
if (state->ocio_shader) {
|
||||
glDeleteShader(state->ocio_shader);
|
||||
}
|
||||
|
||||
if (state->vert_shader) {
|
||||
glDeleteShader(state->vert_shader);
|
||||
}
|
||||
|
||||
/* Vertex shader */
|
||||
std::ostringstream osv;
|
||||
|
||||
osv << "#version 330\n";
|
||||
osv << datatoc_gpu_shader_display_transform_vertex_glsl;
|
||||
|
||||
state->vert_shader = compileShaderText(GL_VERTEX_SHADER, osv.str().c_str());
|
||||
|
||||
/* Fragment shader */
|
||||
std::ostringstream os;
|
||||
|
||||
os << "#version 330\n";
|
||||
|
||||
/* Work around OpenColorIO not supporting latest GLSL yet. */
|
||||
os << "#define texture2D texture\n";
|
||||
os << "#define texture3D texture\n";
|
||||
|
||||
if (use_predivide) {
|
||||
os << "#define USE_PREDIVIDE\n";
|
||||
}
|
||||
|
||||
if (use_dither) {
|
||||
os << "#define USE_DITHER\n";
|
||||
}
|
||||
|
||||
if (use_curve_mapping) {
|
||||
os << "#define USE_CURVE_MAPPING\n";
|
||||
}
|
||||
|
||||
os << ocio_processor->getGpuShaderText(shaderDesc) << "\n";
|
||||
os << datatoc_gpu_shader_display_transform_glsl;
|
||||
|
||||
state->ocio_shader = compileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
|
||||
|
||||
if (state->ocio_shader && state->vert_shader) {
|
||||
state->program = linkShaders(state->ocio_shader, state->vert_shader);
|
||||
}
|
||||
|
||||
if (state->program) {
|
||||
if (state->shader_interface) {
|
||||
GWN_shaderinterface_discard(state->shader_interface);
|
||||
}
|
||||
state->shader_interface = GWN_shaderinterface_create(state->program);
|
||||
}
|
||||
|
||||
state->curve_mapping_used = use_curve_mapping;
|
||||
state->dither_used = use_dither;
|
||||
state->predivide_used = use_predivide;
|
||||
}
|
||||
|
||||
if (state->program) {
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
|
||||
if (use_curve_mapping) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
}
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
@@ -409,7 +464,7 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
|
||||
Gwn_VertFormat *format = immVertexFormat();
|
||||
GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
immBindProgram(state->program, state->shader_interface);
|
||||
immBindProgram(shader->program, shader->shader_interface);
|
||||
|
||||
immUniform1i("image_texture", 0);
|
||||
immUniform1i("lut3d_texture", 1);
|
||||
@@ -453,27 +508,13 @@ void OCIOImpl::finishGLSLDraw(OCIO_GLSLDrawState *state)
|
||||
immUnbindProgram();
|
||||
}
|
||||
|
||||
void OCIOImpl::freeGLState(struct OCIO_GLSLDrawState *state)
|
||||
void OCIOImpl::freeGLState(OCIO_GLSLDrawState *state)
|
||||
{
|
||||
using std::string;
|
||||
|
||||
if (state->lut3d_texture_allocated)
|
||||
glDeleteTextures(1, &state->lut3d_texture);
|
||||
|
||||
if (state->lut3d)
|
||||
MEM_freeN(state->lut3d);
|
||||
|
||||
if (state->program)
|
||||
glDeleteProgram(state->program);
|
||||
|
||||
if (state->shader_interface)
|
||||
GWN_shaderinterface_discard(state->shader_interface);
|
||||
|
||||
if (state->ocio_shader)
|
||||
glDeleteShader(state->ocio_shader);
|
||||
|
||||
state->lut3dcacheid.~string();
|
||||
state->shadercacheid.~string();
|
||||
for (int i = 0; i < SHADER_CACHE_SIZE; i++) {
|
||||
if (state->shader_cache[i]) {
|
||||
freeGLSLShader(state->shader_cache[i]);
|
||||
}
|
||||
}
|
||||
|
||||
MEM_freeN(state);
|
||||
}
|
||||
|
Submodule release/scripts/addons updated: f6e3238de3...4b91309b12
Submodule release/scripts/addons_contrib updated: 4747021578...cd57934bd0
@@ -153,8 +153,10 @@ def get_transform_generators_base_info(data):
|
||||
# no path in this case
|
||||
path = ""
|
||||
|
||||
# data on ID-blocks directly should get grouped by the KeyingSet
|
||||
grouping = None
|
||||
# transform data on ID-blocks directly should get grouped under a
|
||||
# hardcoded label ("Object Transforms") so that they get grouped
|
||||
# consistently when keyframed directly
|
||||
grouping = "Object Transforms"
|
||||
else:
|
||||
# get the path to the ID-block
|
||||
path = data.path_from_id()
|
||||
|
@@ -160,8 +160,8 @@
|
||||
</ThemeWidgetColors>
|
||||
</wcol_menu>
|
||||
<wcol_pulldown>
|
||||
<ThemeWidgetColors outline="#000000"
|
||||
inner="#29282eff"
|
||||
<ThemeWidgetColors outline="#29282e"
|
||||
inner="#29282e99"
|
||||
inner_sel="#505158ff"
|
||||
item="#ffffffff"
|
||||
text="#eeeeee"
|
||||
@@ -936,18 +936,18 @@
|
||||
</ThemeUserPreferences>
|
||||
</user_preferences>
|
||||
<console>
|
||||
<ThemeConsole line_output="#6080ff"
|
||||
<ThemeConsole line_output="#b3c2ff"
|
||||
line_input="#ffffff"
|
||||
line_info="#00aa00"
|
||||
line_error="#dc6060"
|
||||
cursor="#dc6060"
|
||||
line_info="#47b347"
|
||||
line_error="#de6f6f"
|
||||
cursor="#de5959"
|
||||
select="#ffffff30">
|
||||
<space>
|
||||
<ThemeSpaceGeneric back="#2f3035"
|
||||
title="#ffffff"
|
||||
text="#ffffff"
|
||||
text_hi="#ffffff"
|
||||
header="#29282eff"
|
||||
header="#2f3035ff"
|
||||
header_text="#eeeeee"
|
||||
header_text_hi="#ffffff"
|
||||
button="#2f303599"
|
||||
|
@@ -161,7 +161,7 @@
|
||||
</wcol_menu>
|
||||
<wcol_pulldown>
|
||||
<ThemeWidgetColors outline="#000000"
|
||||
inner="#3f3f3fff"
|
||||
inner="#e6e6e699"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#ffffffff"
|
||||
text="#000000"
|
||||
@@ -169,7 +169,7 @@
|
||||
show_shaded="FALSE"
|
||||
shadetop="25"
|
||||
shadedown="-20"
|
||||
roundness="0.4">
|
||||
roundness="0.3">
|
||||
</ThemeWidgetColors>
|
||||
</wcol_pulldown>
|
||||
<wcol_menu_back>
|
||||
|
@@ -865,7 +865,7 @@ class TransformsToDeltasAnim(Operator):
|
||||
|
||||
|
||||
class DupliOffsetFromCursor(Operator):
|
||||
"""Set offset used for DupliGroup based on cursor position"""
|
||||
"""Set offset used for collection instances based on cursor position"""
|
||||
bl_idname = "object.dupli_offset_from_cursor"
|
||||
bl_label = "Set Offset From Cursor"
|
||||
bl_options = {'INTERNAL', 'UNDO'}
|
||||
@@ -876,9 +876,9 @@ class DupliOffsetFromCursor(Operator):
|
||||
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
group = context.group
|
||||
collection = context.collection
|
||||
|
||||
group.dupli_offset = scene.cursor_location
|
||||
collection.dupli_offset = scene.cursor_location
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@@ -55,6 +55,15 @@ rna_relative_prop = BoolProperty(
|
||||
default=False,
|
||||
)
|
||||
|
||||
rna_space_type_prop = EnumProperty(
|
||||
name="Type",
|
||||
items=tuple(
|
||||
(e.identifier, e.name, "", e. value)
|
||||
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
|
||||
),
|
||||
default='EMPTY',
|
||||
)
|
||||
|
||||
|
||||
def context_path_validate(context, data_path):
|
||||
try:
|
||||
@@ -2335,21 +2344,29 @@ class WM_OT_tool_set_by_name(Operator):
|
||||
name="Text",
|
||||
description="Display name of the tool",
|
||||
)
|
||||
space_type = EnumProperty(
|
||||
name="Type",
|
||||
items=tuple(
|
||||
(e.identifier, e.name, "", e. value)
|
||||
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
|
||||
),
|
||||
default='EMPTY',
|
||||
|
||||
cycle = BoolProperty(
|
||||
name="Cycle",
|
||||
description="Cycle through tools in this group",
|
||||
default=False,
|
||||
options={'SKIP_SAVE'},
|
||||
)
|
||||
|
||||
space_type = rna_space_type_prop
|
||||
|
||||
def execute(self, context):
|
||||
from bl_ui.space_toolsystem_common import activate_by_name
|
||||
space_type = self.space_type
|
||||
if space_type == 'EMPTY':
|
||||
from bl_ui.space_toolsystem_common import (
|
||||
activate_by_name,
|
||||
activate_by_name_or_cycle,
|
||||
)
|
||||
|
||||
if self.properties.is_property_set("space_type"):
|
||||
space_type = self.space_type
|
||||
else:
|
||||
space_type = context.space_data.type
|
||||
if activate_by_name(context, space_type, self.name):
|
||||
|
||||
fn = activate_by_name_or_cycle if self.cycle else activate_by_name
|
||||
if fn(context, space_type, self.name):
|
||||
return {'FINISHED'}
|
||||
else:
|
||||
self.report({'WARNING'}, f"Tool {self.name!r} not found.")
|
||||
|
@@ -77,15 +77,13 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(arm, "draw_type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(arm, "show_names", text="Names")
|
||||
col.prop(arm, "show_axes", text="Axes")
|
||||
col.prop(arm, "show_bone_custom_shapes", text="Shapes")
|
||||
|
||||
col = split.column()
|
||||
col.prop(arm, "show_group_colors", text="Colors")
|
||||
col.prop(arm, "show_group_colors", text="Group Colors")
|
||||
if ob:
|
||||
col.prop(ob, "show_x_ray", text="X-Ray")
|
||||
col.prop(arm, "use_deform_delay", text="Delay Refresh")
|
||||
@@ -149,7 +147,8 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
|
||||
|
||||
sub = row.row(align=True)
|
||||
sub.operator("pose.group_assign", text="Assign")
|
||||
sub.operator("pose.group_unassign", text="Remove") # row.operator("pose.bone_group_remove_from", text="Remove")
|
||||
# row.operator("pose.bone_group_remove_from", text="Remove")
|
||||
sub.operator("pose.group_unassign", text="Remove")
|
||||
|
||||
sub = row.row(align=True)
|
||||
sub.operator("pose.group_select", text="Select")
|
||||
@@ -196,7 +195,11 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
|
||||
|
||||
if pose_marker_active is not None:
|
||||
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="")
|
||||
col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
|
||||
col.operator(
|
||||
"poselib.apply_pose",
|
||||
icon='ZOOM_SELECTED',
|
||||
text="",
|
||||
).pose_index = poselib.pose_markers.active_index
|
||||
|
||||
col.operator("poselib.action_sanitize", icon='HELP', text="") # XXX: put in menu?
|
||||
|
||||
@@ -216,21 +219,19 @@ class DATA_PT_ghost(ArmatureButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(arm, "ghost_type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column(align=True)
|
||||
col = layout.column(align=True)
|
||||
|
||||
if arm.ghost_type == 'RANGE':
|
||||
col.prop(arm, "ghost_frame_start", text="Start")
|
||||
col.prop(arm, "ghost_frame_start", text="Frame Start")
|
||||
col.prop(arm, "ghost_frame_end", text="End")
|
||||
col.prop(arm, "ghost_size", text="Step")
|
||||
elif arm.ghost_type == 'CURRENT_FRAME':
|
||||
col.prop(arm, "ghost_step", text="Range")
|
||||
col.prop(arm, "ghost_step", text="Frame Range")
|
||||
col.prop(arm, "ghost_size", text="Step")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Display:")
|
||||
col.prop(arm, "show_only_ghost_selected", text="Selected Only")
|
||||
col.prop(arm, "show_only_ghost_selected", text="Display Selected Only")
|
||||
|
||||
|
||||
class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
@@ -244,6 +245,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
itasc = ob.pose.ik_param
|
||||
@@ -251,34 +253,37 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
layout.prop(ob.pose, "ik_solver")
|
||||
|
||||
if itasc:
|
||||
layout.use_property_split = False
|
||||
layout.row().prop(itasc, "mode", expand=True)
|
||||
layout.use_property_split = True
|
||||
simulation = (itasc.mode == 'SIMULATION')
|
||||
if simulation:
|
||||
layout.label(text="Reiteration:")
|
||||
layout.row().prop(itasc, "reiteration_method", expand=True)
|
||||
layout.prop(itasc, "reiteration_method", expand=False)
|
||||
|
||||
row = layout.row()
|
||||
row.active = not simulation or itasc.reiteration_method != 'NEVER'
|
||||
row.prop(itasc, "precision")
|
||||
row.prop(itasc, "iterations")
|
||||
col = layout.column()
|
||||
col.active = not simulation or itasc.reiteration_method != 'NEVER'
|
||||
col.prop(itasc, "precision")
|
||||
col.prop(itasc, "iterations")
|
||||
|
||||
if simulation:
|
||||
layout.prop(itasc, "use_auto_step")
|
||||
row = layout.row()
|
||||
col = layout.column(align=True)
|
||||
if itasc.use_auto_step:
|
||||
row.prop(itasc, "step_min", text="Min")
|
||||
row.prop(itasc, "step_max", text="Max")
|
||||
col.prop(itasc, "step_min", text="Steps Min")
|
||||
col.prop(itasc, "step_max", text="Max")
|
||||
else:
|
||||
row.prop(itasc, "step_count")
|
||||
col.prop(itasc, "step_count", text="Steps")
|
||||
|
||||
layout.prop(itasc, "solver")
|
||||
if simulation:
|
||||
layout.prop(itasc, "feedback")
|
||||
layout.prop(itasc, "velocity_max")
|
||||
if itasc.solver == 'DLS':
|
||||
row = layout.row()
|
||||
row.prop(itasc, "damping_max", text="Damp", slider=True)
|
||||
row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
col.prop(itasc, "damping_max", text="Damping Max", slider=True)
|
||||
col.prop(itasc, "damping_epsilon", text="Damping Epsilon", slider=True)
|
||||
|
||||
|
||||
from .properties_animviz import (
|
||||
MotionPathButtonsPanel,
|
||||
|
@@ -62,88 +62,63 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
|
||||
col = layout.column()
|
||||
|
||||
if bone and ob:
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.prop(pchan, "location")
|
||||
col.active = not (bone.parent and bone.use_connect)
|
||||
|
||||
col = row.column()
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "location")
|
||||
sub.prop(pchan, "lock_location", text="")
|
||||
|
||||
col = layout.column()
|
||||
if pchan.rotation_mode == 'QUATERNION':
|
||||
col.prop(pchan, "rotation_quaternion", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_quaternion", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(pchan, "lock_rotation_w", text="")
|
||||
subsub.prop(pchan, "lock_rotation", text="")
|
||||
elif pchan.rotation_mode == 'AXIS_ANGLE':
|
||||
#col.label(text="Rotation")
|
||||
# col.label(text="Rotation")
|
||||
#col.prop(pchan, "rotation_angle", text="Angle")
|
||||
#col.prop(pchan, "rotation_axis", text="Axis")
|
||||
col.prop(pchan, "rotation_axis_angle", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_axis_angle", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(pchan, "lock_rotation_w", text="")
|
||||
subsub.prop(pchan, "lock_rotation", text="")
|
||||
else:
|
||||
col.prop(pchan, "rotation_euler", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_euler", text="Rotation")
|
||||
sub.prop(pchan, "lock_rotation", text="")
|
||||
|
||||
row.column().prop(pchan, "scale")
|
||||
col = layout.column()
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "scale")
|
||||
sub.prop(pchan, "lock_scale", text="")
|
||||
|
||||
layout.prop(pchan, "rotation_mode")
|
||||
col = layout.column()
|
||||
col.prop(pchan, "rotation_mode")
|
||||
|
||||
elif context.edit_bone:
|
||||
bone = context.edit_bone
|
||||
row = layout.row()
|
||||
row.column().prop(bone, "head")
|
||||
row.column().prop(bone, "tail")
|
||||
col = layout.column()
|
||||
col.prop(bone, "head")
|
||||
col.prop(bone, "tail")
|
||||
|
||||
col = row.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Roll:")
|
||||
sub.prop(bone, "roll", text="")
|
||||
sub.label()
|
||||
sub.prop(bone, "lock")
|
||||
col = layout.column()
|
||||
col.prop(bone, "roll")
|
||||
col.prop(bone, "lock")
|
||||
|
||||
|
||||
class BONE_PT_transform_locks(BoneButtonsPanel, Panel):
|
||||
bl_label = "Transform Locks"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
return ob and ob.mode == 'POSE' and context.bone
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
split = layout.split(percentage=0.1)
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="")
|
||||
col.label(text="X:")
|
||||
col.label(text="Y:")
|
||||
col.label(text="Z:")
|
||||
|
||||
col = split.column()
|
||||
col.active = not (bone.parent and bone.use_connect)
|
||||
col.prop(pchan, "lock_location", text="Location")
|
||||
|
||||
col = split.column()
|
||||
col.prop(pchan, "lock_rotation", text="Rotation")
|
||||
|
||||
col = split.column()
|
||||
col.prop(pchan, "lock_scale", text="Scale")
|
||||
|
||||
if pchan.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
|
||||
row = layout.row()
|
||||
row.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
|
||||
|
||||
sub = row.row()
|
||||
sub.active = pchan.lock_rotations_4d
|
||||
sub.prop(pchan, "lock_rotation_w", text="W")
|
||||
col = layout.column()
|
||||
col.prop(bone, "tail_radius")
|
||||
col.prop(bone, "envelope_distance")
|
||||
|
||||
|
||||
class BONE_PT_curved(BoneButtonsPanel, Panel):
|
||||
@@ -166,54 +141,52 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
|
||||
bbone = bone
|
||||
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
layout.prop(bone, "bbone_segments", text="Segments")
|
||||
|
||||
col = layout.column()
|
||||
col.active = bone.bbone_segments > 1
|
||||
|
||||
row = col.row()
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Curve XY Offsets:")
|
||||
sub.prop(bbone, "bbone_curveinx", text="In X")
|
||||
sub.prop(bbone, "bbone_curveoutx", text="Out X")
|
||||
sub.prop(bbone, "bbone_curveiny", text="In Y")
|
||||
sub.prop(bbone, "bbone_curveouty", text="Out Y")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_curveinx", text="Curve In X")
|
||||
col.prop(bbone, "bbone_curveiny", text="In Y")
|
||||
|
||||
sub = row.column(align=True)
|
||||
sub.label("Roll:")
|
||||
sub.prop(bbone, "bbone_rollin", text="In")
|
||||
sub.prop(bbone, "bbone_rollout", text="Out")
|
||||
sub.prop(bone, "use_endroll_as_inroll")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_curveoutx", text="Curve Out X")
|
||||
col.prop(bbone, "bbone_curveouty", text="Out Y")
|
||||
|
||||
row = col.row()
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Scale:")
|
||||
sub.prop(bbone, "bbone_scalein", text="In")
|
||||
sub.prop(bbone, "bbone_scaleout", text="Out")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_rollin", text="Roll In")
|
||||
col.prop(bbone, "bbone_rollout", text="Out")
|
||||
col.prop(bone, "use_endroll_as_inroll")
|
||||
|
||||
sub = row.column(align=True)
|
||||
sub.label("Easing:")
|
||||
sub.prop(bbone, "bbone_easein", text="In")
|
||||
sub.prop(bbone, "bbone_easeout", text="Out")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_scalein", text="Scale In")
|
||||
col.prop(bbone, "bbone_scaleout", text="Out")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_easein", text="Ease In")
|
||||
col.prop(bbone, "bbone_easeout", text="Out")
|
||||
|
||||
if pchan:
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.use_property_split = False
|
||||
col.prop(pchan, "use_bbone_custom_handles")
|
||||
|
||||
row = col.row()
|
||||
row.active = pchan.use_bbone_custom_handles
|
||||
col = layout.column(align=True)
|
||||
col.active = pchan.use_bbone_custom_handles
|
||||
col.use_property_split = True
|
||||
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="In:")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="")
|
||||
sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative")
|
||||
sub = col.column()
|
||||
sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="Custom Handle Start")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="End")
|
||||
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Out:")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="")
|
||||
sub.prop(pchan, "use_bbone_relative_end_handle", text="Relative")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative Handle Start")
|
||||
sub.prop(pchan, "use_bbone_relative_end_handle", text="End")
|
||||
|
||||
|
||||
class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
@@ -221,6 +194,7 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
@@ -232,26 +206,22 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
elif bone is None:
|
||||
bone = context.edit_bone
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Layers:")
|
||||
col = layout.column()
|
||||
col.use_property_split = False
|
||||
col.prop(bone, "layers", text="")
|
||||
col.use_property_split = True
|
||||
col = layout.column()
|
||||
|
||||
col.separator()
|
||||
|
||||
if ob and pchan:
|
||||
col.label(text="Bone Group:")
|
||||
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="")
|
||||
col.label(text="Object Children:")
|
||||
col.prop(bone, "use_relative_parent")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Parent:")
|
||||
if context.bone:
|
||||
col.prop(bone, "parent", text="")
|
||||
col.prop(bone, "parent")
|
||||
else:
|
||||
col.prop_search(bone, "parent", arm, "edit_bones", text="")
|
||||
col.prop_search(bone, "parent", arm, "edit_bones")
|
||||
|
||||
if ob and pchan:
|
||||
col.prop(bone, "use_relative_parent")
|
||||
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="Bone Group")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (bone.parent is not None)
|
||||
@@ -274,6 +244,7 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
|
||||
# note. this works ok in edit-mode but isn't
|
||||
# all that useful so disabling for now.
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
@@ -285,23 +256,20 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
|
||||
bone = context.edit_bone
|
||||
|
||||
if bone:
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(bone, "hide", text="Hide")
|
||||
sub = col.column()
|
||||
sub.active = bool(pchan and pchan.custom_shape)
|
||||
sub.prop(bone, "show_wire", text="Wireframe")
|
||||
|
||||
if pchan:
|
||||
col = split.column()
|
||||
|
||||
col.label(text="Custom Shape:")
|
||||
col.prop(pchan, "custom_shape", text="")
|
||||
col = layout.column()
|
||||
col.prop(pchan, "custom_shape")
|
||||
if pchan.custom_shape:
|
||||
col.prop(pchan, "use_custom_shape_bone_size", text="Bone Size")
|
||||
col.prop(pchan, "custom_shape_scale", text="Scale")
|
||||
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
|
||||
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones")
|
||||
|
||||
|
||||
class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
@@ -315,80 +283,82 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
row = layout.row()
|
||||
|
||||
active = pchan.is_in_ik_chain
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_x", text="X")
|
||||
split.active = active
|
||||
row = split.row()
|
||||
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
|
||||
row.active = pchan.lock_ik_x is False and active
|
||||
col = layout.column()
|
||||
col.prop(pchan, "ik_stretch", slider=True)
|
||||
col.active = active
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
layout.separator()
|
||||
|
||||
sub.prop(pchan, "use_ik_limit_x", text="Limit")
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.prop(pchan, "lock_ik_x", text="Lock IK X")
|
||||
col.prop(pchan, "lock_ik_y", text="Y")
|
||||
col.prop(pchan, "lock_ik_z", text="Z")
|
||||
|
||||
col = layout.column(align=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_x is False and active
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_x", text="")
|
||||
sub.prop(pchan, "ik_max_x", text="")
|
||||
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_y", text="Y")
|
||||
split.active = active
|
||||
row = split.row()
|
||||
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
|
||||
row.active = pchan.lock_ik_y is False and active
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
|
||||
sub.prop(pchan, "use_ik_limit_y", text="Limit")
|
||||
sub.prop(pchan, "ik_stiffness_x", text="Stiffness X", slider=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_y is False and active
|
||||
sub.prop(pchan, "ik_stiffness_y", text="Y", slider=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub.prop(pchan, "ik_stiffness_z", text="Z", slider=True)
|
||||
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_y", text="")
|
||||
sub.prop(pchan, "ik_max_y", text="")
|
||||
col = layout.column(align=True)
|
||||
|
||||
sub = col.column()
|
||||
sub.active = pchan.lock_ik_x is False and active
|
||||
sub.prop(pchan, "use_ik_limit_x", text="Limit X")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
|
||||
sub.prop(pchan, "ik_min_x", text="Min")
|
||||
sub.prop(pchan, "ik_max_x", text="Max")
|
||||
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.active = pchan.lock_ik_y is False and active
|
||||
sub.prop(pchan, "use_ik_limit_y", text="Limit Y")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active
|
||||
sub.prop(pchan, "ik_min_y", text="Min")
|
||||
sub.prop(pchan, "ik_max_y", text="Max")
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_z", text="Z")
|
||||
split.active = active
|
||||
sub = split.row()
|
||||
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub.prop(pchan, "use_ik_limit_z", text="Limit Z")
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
|
||||
sub.prop(pchan, "use_ik_limit_z", text="Limit")
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_z", text="")
|
||||
sub.prop(pchan, "ik_max_z", text="")
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and active
|
||||
sub.prop(pchan, "ik_min_z", text="Min")
|
||||
sub.prop(pchan, "ik_max_z", text="Max")
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.label(text="Stretch:")
|
||||
sub = split.row()
|
||||
sub.prop(pchan, "ik_stretch", text="", slider=True)
|
||||
sub.active = active
|
||||
col.separator()
|
||||
|
||||
if ob.pose.ik_solver == 'ITASC':
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(pchan, "use_ik_rotation_control", text="Control Rotation")
|
||||
col.active = active
|
||||
col = split.column()
|
||||
col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True)
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(pchan, "ik_rotation_weight", text="IK Rotation Weight", slider=True)
|
||||
col.active = active
|
||||
# not supported yet
|
||||
#row = layout.row()
|
||||
@@ -410,6 +380,7 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
bone = context.bone
|
||||
|
||||
@@ -418,17 +389,15 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
|
||||
|
||||
layout.active = bone.use_deform
|
||||
|
||||
row = layout.row()
|
||||
col = layout.column()
|
||||
col.prop(bone, "envelope_distance", text="Envelope Distance")
|
||||
col.prop(bone, "envelope_weight", text="Envelope Weight")
|
||||
col.prop(bone, "use_envelope_multiply", text="Envelope Multiply")
|
||||
|
||||
col = row.column(align=True)
|
||||
col.label(text="Envelope:")
|
||||
col.prop(bone, "envelope_distance", text="Distance")
|
||||
col.prop(bone, "envelope_weight", text="Weight")
|
||||
col.prop(bone, "use_envelope_multiply", text="Multiply")
|
||||
col.separator()
|
||||
|
||||
col = row.column(align=True)
|
||||
col.label(text="Envelope Radius:")
|
||||
col.prop(bone, "head_radius", text="Head")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bone, "head_radius", text="Radius Head")
|
||||
col.prop(bone, "tail_radius", text="Tail")
|
||||
|
||||
|
||||
@@ -448,7 +417,6 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
|
||||
classes = (
|
||||
BONE_PT_context_bone,
|
||||
BONE_PT_transform,
|
||||
BONE_PT_transform_locks,
|
||||
BONE_PT_curved,
|
||||
BONE_PT_relations,
|
||||
BONE_PT_display,
|
||||
|
@@ -76,21 +76,22 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
|
||||
layout.row().prop(cam, "type", expand=True)
|
||||
layout.prop(cam, "type")
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
if cam.type == 'PERSP':
|
||||
row = col.row()
|
||||
col = layout.column()
|
||||
if cam.lens_unit == 'MILLIMETERS':
|
||||
row.prop(cam, "lens")
|
||||
col.prop(cam, "lens")
|
||||
elif cam.lens_unit == 'FOV':
|
||||
row.prop(cam, "angle")
|
||||
row.prop(cam, "lens_unit", text="")
|
||||
col.prop(cam, "lens_unit")
|
||||
|
||||
elif cam.type == 'ORTHO':
|
||||
col.prop(cam, "ortho_scale")
|
||||
@@ -99,40 +100,37 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
|
||||
engine = context.engine
|
||||
if engine == 'CYCLES':
|
||||
ccam = cam.cycles
|
||||
col.prop(ccam, "panorama_type", text="Type")
|
||||
col.prop(ccam, "panorama_type")
|
||||
if ccam.panorama_type == 'FISHEYE_EQUIDISTANT':
|
||||
col.prop(ccam, "fisheye_fov")
|
||||
elif ccam.panorama_type == 'FISHEYE_EQUISOLID':
|
||||
row = layout.row()
|
||||
row.prop(ccam, "fisheye_lens", text="Lens")
|
||||
row.prop(ccam, "fisheye_fov")
|
||||
col.prop(ccam, "fisheye_lens", text="Lens")
|
||||
col.prop(ccam, "fisheye_fov")
|
||||
elif ccam.panorama_type == 'EQUIRECTANGULAR':
|
||||
row = layout.row()
|
||||
sub = row.column(align=True)
|
||||
sub.prop(ccam, "latitude_min")
|
||||
sub.prop(ccam, "latitude_max")
|
||||
sub = row.column(align=True)
|
||||
sub.prop(ccam, "longitude_min")
|
||||
sub.prop(ccam, "longitude_max")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(ccam, "latitude_min", text="Latitute Min")
|
||||
sub.prop(ccam, "latitude_max", text="Max")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(ccam, "longitude_min", text="Longiture Min")
|
||||
sub.prop(ccam, "longitude_max", text="Max")
|
||||
elif engine in {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}:
|
||||
row = col.row()
|
||||
if cam.lens_unit == 'MILLIMETERS':
|
||||
row.prop(cam, "lens")
|
||||
col.prop(cam, "lens")
|
||||
elif cam.lens_unit == 'FOV':
|
||||
row.prop(cam, "angle")
|
||||
row.prop(cam, "lens_unit", text="")
|
||||
col.prop(cam, "angle")
|
||||
col.prop(cam, "lens_unit")
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Shift:")
|
||||
col.prop(cam, "shift_x", text="X")
|
||||
col.prop(cam, "shift_y", text="Y")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cam, "shift_x", text="Shift X")
|
||||
sub.prop(cam, "shift_y", text="Y")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Clipping:")
|
||||
col.prop(cam, "clip_start", text="Start")
|
||||
col.prop(cam, "clip_end", text="End")
|
||||
col.separator()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cam, "clip_start", text="Clip Start")
|
||||
sub.prop(cam, "clip_end", text="End")
|
||||
|
||||
|
||||
class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
@@ -147,6 +145,8 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
render = context.scene.render
|
||||
st = context.camera.stereo
|
||||
cam = context.camera
|
||||
@@ -154,9 +154,9 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
is_spherical_stereo = cam.type != 'ORTHO' and render.use_spherical_stereo
|
||||
use_spherical_stereo = is_spherical_stereo and st.use_spherical_stereo
|
||||
|
||||
col = layout.column()
|
||||
col.row().prop(st, "convergence_mode", expand=True)
|
||||
layout.prop(st, "convergence_mode")
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.active = st.convergence_mode != 'PARALLEL'
|
||||
sub.prop(st, "convergence_distance")
|
||||
@@ -165,20 +165,20 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
|
||||
if is_spherical_stereo:
|
||||
col.separator()
|
||||
row = col.row()
|
||||
row.prop(st, "use_spherical_stereo")
|
||||
sub = row.row()
|
||||
col.prop(st, "use_spherical_stereo")
|
||||
sub = col.column()
|
||||
sub.active = st.use_spherical_stereo
|
||||
sub.prop(st, "use_pole_merge")
|
||||
row = col.row(align=True)
|
||||
row.active = st.use_pole_merge
|
||||
row.prop(st, "pole_merge_angle_from")
|
||||
row.prop(st, "pole_merge_angle_to")
|
||||
|
||||
col.label(text="Pivot:")
|
||||
row = col.row()
|
||||
row.active = not use_spherical_stereo
|
||||
row.prop(st, "pivot", expand=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = st.use_pole_merge
|
||||
sub.prop(st, "pole_merge_angle_from", text="Pole Merge Angle Start")
|
||||
sub.prop(st, "pole_merge_angle_to", text="End")
|
||||
|
||||
col = layout.column()
|
||||
col.active = not use_spherical_stereo
|
||||
col.separator()
|
||||
col.prop(st, "pivot")
|
||||
|
||||
|
||||
class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
@@ -196,57 +196,55 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
row.operator("camera.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("camera.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
layout.label(text="Sensor:")
|
||||
layout.use_property_split = True
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.prop(cam, "sensor_fit")
|
||||
|
||||
col = split.column(align=True)
|
||||
if cam.sensor_fit == 'AUTO':
|
||||
col.prop(cam, "sensor_width", text="Size")
|
||||
col.prop(cam, "sensor_width")
|
||||
else:
|
||||
sub = col.column(align=True)
|
||||
sub.active = cam.sensor_fit == 'HORIZONTAL'
|
||||
sub.prop(cam, "sensor_width", text="Width")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = cam.sensor_fit == 'VERTICAL'
|
||||
sub.prop(cam, "sensor_height", text="Height")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(cam, "sensor_fit", text="")
|
||||
|
||||
|
||||
class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
|
||||
bl_label = "Depth of Field"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
dof_options = cam.gpu_dof
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Focus:")
|
||||
col.prop(cam, "dof_object", text="")
|
||||
col = layout.column()
|
||||
col.prop(cam, "dof_object", text="Focus on Object")
|
||||
sub = col.column()
|
||||
sub.active = (cam.dof_object is None)
|
||||
sub.prop(cam, "dof_distance", text="Distance")
|
||||
sub.prop(cam, "dof_distance", text="Focus Distance")
|
||||
|
||||
col.separator()
|
||||
|
||||
if context.engine == 'BLENDER_EEVEE':
|
||||
col = split.column(align=True)
|
||||
col.label("Aperture:")
|
||||
col = layout.column()
|
||||
col.label("Aperture")
|
||||
engine = context.engine
|
||||
sub = col.column(align=True)
|
||||
sub.prop(dof_options, "fstop")
|
||||
sub.prop(dof_options, "blades")
|
||||
sub.prop(dof_options, "rotation")
|
||||
sub.prop(dof_options, "ratio")
|
||||
col.prop(dof_options, "fstop")
|
||||
col.prop(dof_options, "blades")
|
||||
col.prop(dof_options, "rotation")
|
||||
col.prop(dof_options, "ratio")
|
||||
else:
|
||||
hq_support = dof_options.is_hq_supported
|
||||
col = split.column(align=True)
|
||||
col.label("Viewport:")
|
||||
col = layout.column()
|
||||
col.label("Viewport")
|
||||
sub = col.column()
|
||||
sub.active = hq_support
|
||||
sub.prop(dof_options, "use_high_quality")
|
||||
@@ -358,24 +356,21 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
|
||||
|
||||
class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
bl_label = "Display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
|
||||
split = layout.split()
|
||||
split.label()
|
||||
split.prop_menu_enum(cam, "show_guide")
|
||||
|
||||
col = split.column()
|
||||
col.prop(cam, "show_limits", text="Limits")
|
||||
col.prop(cam, "show_mist", text="Mist")
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.prop(cam, "show_sensor", text="Sensor")
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
|
||||
col = split.column()
|
||||
col.prop_menu_enum(cam, "show_guide")
|
||||
col.separator()
|
||||
col.prop(cam, "draw_size", text="Size")
|
||||
col.separator()
|
||||
@@ -384,6 +379,13 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
sub.active = cam.show_passepartout
|
||||
sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(cam, "show_limits", text="Limits")
|
||||
col.prop(cam, "show_mist", text="Mist")
|
||||
col.prop(cam, "show_sensor", text="Sensor")
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
|
||||
|
||||
class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
||||
bl_label = "Safe Areas"
|
||||
@@ -413,27 +415,30 @@ def draw_display_safe_settings(layout, safe_data, settings):
|
||||
show_safe_areas = settings.show_safe_areas
|
||||
show_safe_center = settings.show_safe_center
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
row = layout.row(align=True)
|
||||
row.menu("SAFE_AREAS_MT_presets", text=bpy.types.SAFE_AREAS_MT_presets.bl_label)
|
||||
row.operator("safe_areas.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("safe_areas.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
col = split.column()
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.active = show_safe_areas
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(safe_data, "title", slider=True)
|
||||
sub.prop(safe_data, "action", slider=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(settings, "show_safe_center", text="Center-Cut Safe Areas")
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.active = show_safe_areas
|
||||
col.prop(safe_data, "title", slider=True)
|
||||
col.prop(safe_data, "action", slider=True)
|
||||
|
||||
col = split.column()
|
||||
col.active = show_safe_areas and show_safe_center
|
||||
col.prop(safe_data, "title_center", slider=True)
|
||||
col.prop(safe_data, "action_center", slider=True)
|
||||
sub = col.column()
|
||||
sub.active = show_safe_areas and show_safe_center
|
||||
sub.prop(safe_data, "title_center", slider=True)
|
||||
sub.prop(safe_data, "action_center", slider=True)
|
||||
|
||||
|
||||
classes = (
|
||||
@@ -445,8 +450,8 @@ classes = (
|
||||
DATA_PT_camera_stereoscopy,
|
||||
DATA_PT_camera_dof,
|
||||
DATA_PT_camera_display,
|
||||
DATA_PT_camera_background_image,
|
||||
DATA_PT_camera_safe_areas,
|
||||
DATA_PT_camera_background_image,
|
||||
DATA_PT_custom_props_camera,
|
||||
)
|
||||
|
||||
|
@@ -93,43 +93,42 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
|
||||
row = layout.row()
|
||||
row.prop(curve, "dimensions", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_u", text="Resolution Preview U")
|
||||
if is_surf:
|
||||
sub.prop(curve, "resolution_v", text="V")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Resolution:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_u", text="Preview U")
|
||||
sub.prop(curve, "render_resolution_u", text="Render U")
|
||||
if is_surf:
|
||||
sub.prop(curve, "render_resolution_v", text="V")
|
||||
col.separator()
|
||||
|
||||
if is_curve:
|
||||
col.label(text="Twisting:")
|
||||
col.prop(curve, "twist_mode", text="")
|
||||
col.prop(curve, "twist_mode")
|
||||
col.prop(curve, "twist_smooth", text="Smooth")
|
||||
elif is_text:
|
||||
col.label(text="Display:")
|
||||
col.prop(curve, "use_fast_edit", text="Fast Editing")
|
||||
|
||||
col = split.column()
|
||||
|
||||
if is_surf:
|
||||
sub = col.column()
|
||||
sub.label(text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_v", text="Preview V")
|
||||
sub.prop(curve, "render_resolution_v", text="Render V")
|
||||
|
||||
if is_curve or is_text:
|
||||
col.label(text="Fill:")
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
|
||||
sub.prop(curve, "fill_mode", text="")
|
||||
sub.prop(curve, "fill_mode")
|
||||
col.prop(curve, "use_fill_deform")
|
||||
|
||||
if is_curve:
|
||||
col.label(text="Path/Curve-Deform:")
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
subsub = sub.row()
|
||||
subsub.prop(curve, "use_radius")
|
||||
subsub.prop(curve, "use_stretch")
|
||||
sub.prop(curve, "use_radius")
|
||||
sub.prop(curve, "use_stretch")
|
||||
sub.prop(curve, "use_deform_bounds")
|
||||
|
||||
|
||||
@@ -140,16 +139,17 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
row = layout.row()
|
||||
row.prop(curve, "use_auto_texspace")
|
||||
row.prop(curve, "use_uv_as_generated")
|
||||
col = layout.column()
|
||||
col.prop(curve, "use_uv_as_generated")
|
||||
col.prop(curve, "use_auto_texspace")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(curve, "texspace_location", text="Location")
|
||||
row.column().prop(curve, "texspace_size", text="Size")
|
||||
col = layout.column()
|
||||
col.prop(curve, "texspace_location")
|
||||
col.prop(curve, "texspace_size")
|
||||
|
||||
layout.operator("curve.match_texture_space")
|
||||
|
||||
@@ -163,49 +163,54 @@ class DATA_PT_geometry_curve(CurveButtonsPanelCurve, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Modification:")
|
||||
col = layout.column()
|
||||
col.prop(curve, "offset")
|
||||
col.prop(curve, "extrude")
|
||||
col.label(text="Taper Object:")
|
||||
col.prop(curve, "taper_object", text="")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Bevel:")
|
||||
col.prop(curve, "bevel_depth", text="Depth")
|
||||
col.prop(curve, "bevel_resolution", text="Resolution")
|
||||
col.label(text="Bevel Object:")
|
||||
col.prop(curve, "bevel_object", text="")
|
||||
sub = col.column()
|
||||
sub.active = (curve.bevel_object is None)
|
||||
sub.prop(curve, "extrude")
|
||||
|
||||
col.prop(curve, "taper_object")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = curve.taper_object is not None
|
||||
sub.prop(curve, "use_map_taper")
|
||||
|
||||
col.separator()
|
||||
|
||||
layout.label(text="Bevel")
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.active = (curve.bevel_object is None)
|
||||
sub.prop(curve, "bevel_depth", text="Depth")
|
||||
sub.prop(curve, "bevel_resolution", text="Resolution")
|
||||
|
||||
col.prop(curve, "bevel_object", text="Object")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = curve.bevel_object is not None
|
||||
sub.prop(curve, "use_fill_caps")
|
||||
|
||||
if type(curve) is not TextCurve:
|
||||
col = layout.column(align=True)
|
||||
row = col.row()
|
||||
row.label(text="Bevel Factor:")
|
||||
|
||||
col = layout.column()
|
||||
col.active = (
|
||||
(curve.bevel_depth > 0.0) or
|
||||
(curve.extrude > 0.0) or
|
||||
(curve.bevel_object is not None))
|
||||
row = col.row(align=True)
|
||||
row.prop(curve, "bevel_factor_mapping_start", text="")
|
||||
row.prop(curve, "bevel_factor_start", text="Start")
|
||||
row = col.row(align=True)
|
||||
row.prop(curve, "bevel_factor_mapping_end", text="")
|
||||
row.prop(curve, "bevel_factor_end", text="End")
|
||||
(curve.bevel_depth > 0.0) or
|
||||
(curve.extrude > 0.0) or
|
||||
(curve.bevel_object is not None)
|
||||
)
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "bevel_factor_start", text="Bevel Start")
|
||||
sub.prop(curve, "bevel_factor_end", text="End")
|
||||
|
||||
row = layout.row()
|
||||
sub = row.row()
|
||||
sub.active = curve.taper_object is not None
|
||||
sub.prop(curve, "use_map_taper")
|
||||
sub = row.row()
|
||||
sub.active = curve.bevel_object is not None
|
||||
sub.prop(curve, "use_fill_caps")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "bevel_factor_mapping_start", text="Bevel Mapping Start")
|
||||
sub.prop(curve, "bevel_factor_mapping_end", text="End")
|
||||
|
||||
|
||||
class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
@@ -218,6 +223,7 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
@@ -228,8 +234,9 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
col.prop(curve, "eval_time")
|
||||
|
||||
# these are for paths only
|
||||
row = layout.row()
|
||||
row.prop(curve, "use_path_follow")
|
||||
col.separator()
|
||||
|
||||
col.prop(curve, "use_path_follow")
|
||||
|
||||
|
||||
class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
|
||||
@@ -237,65 +244,64 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
act_spline = curve.splines.active
|
||||
is_surf = type(curve) is SurfaceCurve
|
||||
is_poly = (act_spline.type == 'POLY')
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
if is_poly:
|
||||
# These settings are below but its easier to have
|
||||
# polys set aside since they use so few settings
|
||||
row = layout.row()
|
||||
row.label(text="Cyclic:")
|
||||
row.prop(act_spline, "use_cyclic_u", text="U")
|
||||
|
||||
layout.prop(act_spline, "use_smooth")
|
||||
col.prop(act_spline, "use_cyclic_u")
|
||||
col.prop(act_spline, "use_smooth")
|
||||
else:
|
||||
col = split.column()
|
||||
col.label(text="Cyclic:")
|
||||
if act_spline.type == 'NURBS':
|
||||
col.label(text="Bezier:")
|
||||
col.label(text="Endpoint:")
|
||||
col.label(text="Order:")
|
||||
|
||||
col.label(text="Resolution:")
|
||||
|
||||
col = split.column()
|
||||
col.prop(act_spline, "use_cyclic_u", text="U")
|
||||
|
||||
if act_spline.type == 'NURBS':
|
||||
sub = col.column()
|
||||
# sub.active = (not act_spline.use_cyclic_u)
|
||||
sub.prop(act_spline, "use_bezier_u", text="U")
|
||||
sub.prop(act_spline, "use_endpoint_u", text="U")
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(act_spline, "order_u", text="U")
|
||||
col.prop(act_spline, "resolution_u", text="U")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "use_cyclic_u")
|
||||
if is_surf:
|
||||
col = split.column()
|
||||
col.prop(act_spline, "use_cyclic_v", text="V")
|
||||
sub.prop(act_spline, "use_cyclic_v", text="V")
|
||||
|
||||
# its a surface, assume its a nurbs
|
||||
sub = col.column()
|
||||
sub.active = (not act_spline.use_cyclic_v)
|
||||
sub.prop(act_spline, "use_bezier_v", text="V")
|
||||
sub.prop(act_spline, "use_endpoint_v", text="V")
|
||||
sub = col.column()
|
||||
sub.prop(act_spline, "order_v", text="V")
|
||||
if act_spline.type == 'NURBS':
|
||||
sub = col.column(align=True)
|
||||
# sub.active = (not act_spline.use_cyclic_u)
|
||||
sub.prop(act_spline, "use_bezier_u", text="Bezier U")
|
||||
|
||||
if is_surf:
|
||||
subsub = sub.column()
|
||||
subsub.active = (not act_spline.use_cyclic_v)
|
||||
subsub.prop(act_spline, "use_bezier_v", text="V")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "use_endpoint_u", text="Endpoint U")
|
||||
|
||||
if is_surf:
|
||||
subsub = sub.column()
|
||||
subsub.active = (not act_spline.use_cyclic_v)
|
||||
subsub.prop(act_spline, "use_endpoint_v", text="V")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "order_u", text="Order U")
|
||||
|
||||
if is_surf:
|
||||
sub.prop(act_spline, "order_v", text="V")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "resolution_u", text="Resolution U")
|
||||
if is_surf:
|
||||
sub.prop(act_spline, "resolution_v", text="V")
|
||||
|
||||
if act_spline.type == 'BEZIER':
|
||||
col = layout.column()
|
||||
col.label(text="Interpolation:")
|
||||
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (curve.dimensions == '3D')
|
||||
sub.prop(act_spline, "tilt_interpolation", text="Tilt")
|
||||
sub.prop(act_spline, "tilt_interpolation", text="Interpolation Tilt")
|
||||
|
||||
col.prop(act_spline, "radius_interpolation", text="Radius")
|
||||
|
||||
@@ -324,42 +330,36 @@ class DATA_PT_font(CurveButtonsPanelText, Panel):
|
||||
row.label(text="Bold & Italic")
|
||||
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
|
||||
|
||||
layout.separator()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(char, "use_bold", toggle=True)
|
||||
row.prop(char, "use_italic", toggle=True)
|
||||
row.prop(char, "use_underline", toggle=True)
|
||||
row.prop(char, "use_small_caps", toggle=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
# layout.prop(text, "font")
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
col.prop(text, "size", text="Size")
|
||||
col = split.column()
|
||||
col.prop(text, "shear")
|
||||
|
||||
split = layout.split()
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Object Font:")
|
||||
col.prop(text, "family", text="")
|
||||
col.prop(text, "family")
|
||||
col.prop(text, "follow_curve")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Text on Curve:")
|
||||
col.prop(text, "follow_curve", text="")
|
||||
col.separator()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Underline:")
|
||||
sub.prop(text, "underline_position", text="Position")
|
||||
sub.prop(text, "underline_height", text="Thickness")
|
||||
sub.prop(text, "underline_position", text="Underline Position")
|
||||
sub.prop(text, "underline_height", text="Underline Thickness")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Character:")
|
||||
col.prop(char, "use_bold")
|
||||
col.prop(char, "use_italic")
|
||||
col.prop(char, "use_underline")
|
||||
|
||||
row = layout.row()
|
||||
row.prop(text, "small_caps_scale", text="Small Caps")
|
||||
row.prop(char, "use_small_caps")
|
||||
col.prop(text, "small_caps_scale", text="Small Caps Scale")
|
||||
|
||||
|
||||
class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
|
||||
@@ -370,23 +370,21 @@ class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
|
||||
|
||||
text = context.curve
|
||||
|
||||
layout.label(text="Horizontal Alignment:")
|
||||
layout.label(text="Alignment")
|
||||
layout.row().prop(text, "align_x", expand=True)
|
||||
|
||||
layout.label(text="Vertical Alignment:")
|
||||
layout.row().prop(text, "align_y", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Spacing:")
|
||||
col.prop(text, "space_character", text="Letter")
|
||||
col.prop(text, "space_word", text="Word")
|
||||
col.prop(text, "space_line", text="Line")
|
||||
col = layout.column(align=True)
|
||||
col.prop(text, "space_character", text="Character Spacing")
|
||||
col.prop(text, "space_word", text="Word Spacing")
|
||||
col.prop(text, "space_line", text="Line Spacing")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Offset:")
|
||||
col.prop(text, "offset_x", text="X")
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(text, "offset_x", text="Offset X")
|
||||
col.prop(text, "offset_y", text="Y")
|
||||
|
||||
|
||||
@@ -398,10 +396,7 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
|
||||
|
||||
text = context.curve
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.operator("font.textbox_add", icon='ZOOMIN')
|
||||
col = split.column()
|
||||
layout.operator("font.textbox_add", icon='ZOOMIN')
|
||||
|
||||
for i, box in enumerate(text.text_boxes):
|
||||
|
||||
@@ -409,19 +404,16 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
|
||||
|
||||
row = boxy.row()
|
||||
|
||||
split = row.split()
|
||||
col = row.column()
|
||||
col.use_property_split = True
|
||||
|
||||
col = split.column(align=True)
|
||||
sub = col.column(align=True)
|
||||
sub.prop(box, "width", text="Size X")
|
||||
sub.prop(box, "height", text="Y")
|
||||
|
||||
col.label(text="Dimensions:")
|
||||
col.prop(box, "width", text="Width")
|
||||
col.prop(box, "height", text="Height")
|
||||
|
||||
col = split.column(align=True)
|
||||
|
||||
col.label(text="Offset:")
|
||||
col.prop(box, "x", text="X")
|
||||
col.prop(box, "y", text="Y")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(box, "x", text="Offset X")
|
||||
sub.prop(box, "y", text="Y")
|
||||
|
||||
row.operator("font.textbox_remove", text="", icon='X', emboss=False).index = i
|
||||
|
||||
|
@@ -36,10 +36,11 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
layout.prop(ob, "empty_draw_type", text="Display")
|
||||
layout.prop(ob, "empty_draw_type", text="Display As")
|
||||
|
||||
if ob.empty_draw_type == 'IMAGE':
|
||||
layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data")
|
||||
@@ -49,9 +50,11 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
|
||||
row = layout.row(align=True)
|
||||
|
||||
layout.prop(ob, "color", text="Transparency", index=3, slider=True)
|
||||
row = layout.row(align=True)
|
||||
row.prop(ob, "empty_image_offset", text="Offset X", index=0)
|
||||
row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
|
||||
col = layout.col(align=True)
|
||||
col.prop(ob, "empty_image_offset", text="Offset X", index=0)
|
||||
col.prop(ob, "empty_image_offset", text="Y", index=1)
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(ob, "empty_draw_size", text="Size")
|
||||
|
||||
|
@@ -80,27 +80,27 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(lamp, "type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "color", text="")
|
||||
sub.prop(lamp, "energy")
|
||||
col = col.column()
|
||||
col.prop(lamp, "color")
|
||||
col.prop(lamp, "energy")
|
||||
|
||||
if lamp.type in {'POINT', 'SPOT'}:
|
||||
sub.label(text="Falloff:")
|
||||
sub.prop(lamp, "falloff_type", text="")
|
||||
sub.prop(lamp, "distance")
|
||||
sub.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
|
||||
col = col.column()
|
||||
col.label(text="Falloff")
|
||||
col.prop(lamp, "falloff_type")
|
||||
col.prop(lamp, "distance")
|
||||
col.prop(lamp, "shadow_soft_size")
|
||||
|
||||
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
|
||||
col.label(text="Attenuation Factors:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "linear_attenuation", slider=True, text="Linear")
|
||||
sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
|
||||
|
||||
elif lamp.falloff_type == 'INVERSE_COEFFICIENTS':
|
||||
col.label(text="Inverse Coefficients:")
|
||||
col.label(text="Inverse Coefficients")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "constant_coefficient", text="Constant")
|
||||
sub.prop(lamp, "linear_coefficient", text="Linear")
|
||||
@@ -119,31 +119,31 @@ class DATA_PT_EEVEE_lamp(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
layout.row().prop(lamp, "type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "color", text="")
|
||||
sub.prop(lamp, "energy")
|
||||
col = layout.column()
|
||||
col.prop(lamp, "color")
|
||||
col.prop(lamp, "energy")
|
||||
col.prop(lamp, "specular_factor", text="Specular")
|
||||
|
||||
col.separator()
|
||||
|
||||
if lamp.type in {'POINT', 'SPOT', 'SUN'}:
|
||||
sub.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
col.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
elif lamp.type == 'AREA':
|
||||
sub = sub.column(align=True)
|
||||
sub.prop(lamp, "shape", text="")
|
||||
if lamp.shape in {'SQUARE', 'DISK'}:
|
||||
col.prop(lamp, "shape")
|
||||
|
||||
sub = col.column(align=True)
|
||||
|
||||
if lamp.shape in {'SQUARE', 'DISK'}:
|
||||
sub.prop(lamp, "size")
|
||||
elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}:
|
||||
sub.prop(lamp, "size", text="Size X")
|
||||
sub.prop(lamp, "size_y", text="Size Y")
|
||||
|
||||
col = split.column()
|
||||
col.prop(lamp, "specular_factor", text="Specular")
|
||||
sub.prop(lamp, "size_y", text="Y")
|
||||
|
||||
|
||||
class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
|
||||
@@ -162,49 +162,45 @@ class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
split = layout.split()
|
||||
split.active = lamp.use_shadow
|
||||
layout.active = lamp.use_shadow
|
||||
|
||||
sub = split.column()
|
||||
col = sub.column(align=True)
|
||||
col.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
|
||||
col.prop(lamp, "shadow_buffer_clip_end", text="Clip End")
|
||||
col = sub.column()
|
||||
col.prop(lamp, "shadow_buffer_soft", text="Soft")
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
|
||||
sub.prop(lamp, "shadow_buffer_clip_end", text="End")
|
||||
|
||||
col.prop(lamp, "shadow_buffer_soft", text="Softness")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(lamp, "shadow_buffer_bias", text="Bias")
|
||||
col.prop(lamp, "shadow_buffer_exp", text="Exponent")
|
||||
col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
|
||||
|
||||
col.separator()
|
||||
|
||||
if lamp.type == 'SUN':
|
||||
col = layout.column()
|
||||
col.active = lamp.use_shadow
|
||||
col.label("Cascaded Shadow Map:")
|
||||
col.label("Cascaded Shadow Map")
|
||||
|
||||
split = col.split()
|
||||
col.prop(lamp, "shadow_cascade_count", text="Count")
|
||||
col.prop(lamp, "shadow_cascade_fade", text="Fade")
|
||||
|
||||
sub = split.column()
|
||||
sub.prop(lamp, "shadow_cascade_count", text="Count")
|
||||
sub.prop(lamp, "shadow_cascade_fade", text="Fade")
|
||||
|
||||
sub = split.column()
|
||||
sub.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
|
||||
sub.prop(lamp, "shadow_cascade_exponent", text="Distribution")
|
||||
col.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
|
||||
col.prop(lamp, "shadow_cascade_exponent", text="Distribution")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(lamp, "use_contact_shadow")
|
||||
split = layout.split()
|
||||
split.active = lamp.use_contact_shadow
|
||||
col = split.column()
|
||||
col.prop(lamp, "contact_shadow_distance", text="Distance")
|
||||
col.prop(lamp, "contact_shadow_soft_size", text="Soft")
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.active = lamp.use_contact_shadow
|
||||
|
||||
col.prop(lamp, "contact_shadow_distance", text="Distance")
|
||||
col.prop(lamp, "contact_shadow_soft_size", text="Softness")
|
||||
col.prop(lamp, "contact_shadow_bias", text="Bias")
|
||||
col.prop(lamp, "contact_shadow_thickness", text="Thickness")
|
||||
|
||||
@@ -282,16 +278,15 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col.prop(lamp, "spot_size", text="Size")
|
||||
col.prop(lamp, "spot_blend", text="Blend", slider=True)
|
||||
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "spot_size", text="Size")
|
||||
sub.prop(lamp, "spot_blend", text="Blend", slider=True)
|
||||
col = split.column()
|
||||
col.prop(lamp, "show_cone")
|
||||
|
||||
|
||||
|
@@ -57,24 +57,31 @@ class DATA_PT_lattice(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lat = context.lattice
|
||||
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_u")
|
||||
row.prop(lat, "interpolation_type_u", text="")
|
||||
col = layout.column()
|
||||
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_v")
|
||||
row.prop(lat, "interpolation_type_v", text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lat, "points_u", text="Resolution U")
|
||||
sub.prop(lat, "points_v", text="V")
|
||||
sub.prop(lat, "points_w", text="W")
|
||||
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_w")
|
||||
row.prop(lat, "interpolation_type_w", text="")
|
||||
col.separator()
|
||||
|
||||
row = layout.row()
|
||||
row.prop(lat, "use_outside")
|
||||
row.prop_search(lat, "vertex_group", context.object, "vertex_groups", text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lat, "interpolation_type_u", text="Interpolation U")
|
||||
sub.prop(lat, "interpolation_type_v", text="V")
|
||||
sub.prop(lat, "interpolation_type_w", text="W")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(lat, "use_outside")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop_search(lat, "vertex_group", context.object, "vertex_groups")
|
||||
|
||||
|
||||
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -56,34 +56,32 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
probe = context.lightprobe
|
||||
|
||||
split = layout.split()
|
||||
# layout.prop(probe, "type")
|
||||
|
||||
if probe.type == 'GRID':
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col = layout.column()
|
||||
col.prop(probe, "influence_distance", "Distance")
|
||||
col.prop(probe, "falloff")
|
||||
col.prop(probe, "intensity")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.label("Resolution:")
|
||||
col.prop(probe, "grid_resolution_x", text="X")
|
||||
col.prop(probe, "grid_resolution_x", text="Resolution X")
|
||||
col.prop(probe, "grid_resolution_y", text="Y")
|
||||
col.prop(probe, "grid_resolution_z", text="Z")
|
||||
|
||||
elif probe.type == 'PLANAR':
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col = layout.column()
|
||||
col.prop(probe, "influence_distance", "Distance")
|
||||
col.prop(probe, "falloff")
|
||||
else:
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col.prop(probe, "influence_type", text="")
|
||||
col = layout.column()
|
||||
col.prop(probe, "influence_type")
|
||||
|
||||
if probe.influence_type == 'ELIPSOID':
|
||||
col.prop(probe, "influence_distance", "Radius")
|
||||
@@ -93,27 +91,24 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
|
||||
col.prop(probe, "falloff")
|
||||
col.prop(probe, "intensity")
|
||||
|
||||
col = split.column(align=True)
|
||||
|
||||
col.label("Clipping:")
|
||||
col.prop(probe, "clip_start", text="Start")
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.prop(probe, "clip_start", text="Clipping Start")
|
||||
|
||||
if probe.type != "PLANAR":
|
||||
col.prop(probe, "clip_end", text="End")
|
||||
sub.prop(probe, "clip_end", text="End")
|
||||
|
||||
if probe.type == 'GRID':
|
||||
col.separator()
|
||||
|
||||
col.label("Visibility:")
|
||||
col.label("Visibility")
|
||||
col.prop(probe, "visibility_buffer_bias", "Bias")
|
||||
col.prop(probe, "visibility_bleed_bias", "Bleed Bias")
|
||||
col.prop(probe, "visibility_blur", "Blur")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.label("Visibility Collection:")
|
||||
row = col.row(align=True)
|
||||
row.prop(probe, "visibility_collection", text="")
|
||||
row.prop(probe, "visibility_collection")
|
||||
row.prop(probe, "invert_visibility_collection", text="", icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
@@ -132,14 +127,14 @@ class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
probe = context.lightprobe
|
||||
|
||||
col = layout.column()
|
||||
col.active = probe.use_custom_parallax
|
||||
|
||||
row = col.row()
|
||||
row.prop(probe, "parallax_type", expand=True)
|
||||
col.prop(probe, "parallax_type")
|
||||
|
||||
if probe.parallax_type == 'ELIPSOID':
|
||||
col.prop(probe, "parallax_distance", "Radius")
|
||||
@@ -153,31 +148,28 @@ class DATA_PT_lightprobe_display(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
probe = context.lightprobe
|
||||
|
||||
row = layout.row()
|
||||
row.prop(probe, "show_data")
|
||||
col = layout.column()
|
||||
|
||||
if probe.type != "PLANAR":
|
||||
row.prop(probe, "data_draw_size", text="Size")
|
||||
col.prop(probe, "data_draw_size", text="Size")
|
||||
else:
|
||||
row.prop(ob, "empty_draw_size", text="Arrow Size")
|
||||
col.prop(ob, "empty_draw_size", text="Arrow Size")
|
||||
|
||||
split = layout.split()
|
||||
col.prop(probe, "show_data")
|
||||
|
||||
if probe.type in {'GRID', 'CUBEMAP'}:
|
||||
col = split.column()
|
||||
col.prop(probe, "show_influence")
|
||||
|
||||
col = split.column()
|
||||
col.prop(probe, "show_clip")
|
||||
|
||||
if probe.type == 'CUBEMAP':
|
||||
col = split.column()
|
||||
col.active = probe.use_custom_parallax
|
||||
col.prop(probe, "show_parallax")
|
||||
sub = col.column()
|
||||
sub.active = probe.use_custom_parallax
|
||||
sub.prop(probe, "show_parallax")
|
||||
|
||||
|
||||
classes = (
|
||||
|
@@ -158,19 +158,18 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mesh = context.mesh
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.prop(mesh, "show_double_sided")
|
||||
|
||||
col = split.column()
|
||||
col.prop(mesh, "use_auto_smooth")
|
||||
sub = col.column()
|
||||
sub.active = mesh.use_auto_smooth and not mesh.has_custom_normals
|
||||
sub.prop(mesh, "auto_smooth_angle", text="Angle")
|
||||
|
||||
split.prop(mesh, "show_double_sided")
|
||||
|
||||
|
||||
class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
bl_label = "Texture Space"
|
||||
@@ -179,6 +178,7 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mesh = context.mesh
|
||||
|
||||
@@ -187,9 +187,9 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
layout.separator()
|
||||
|
||||
layout.prop(mesh, "use_auto_texspace")
|
||||
row = layout.row()
|
||||
row.column().prop(mesh, "texspace_location", text="Location")
|
||||
row.column().prop(mesh, "texspace_size", text="Size")
|
||||
|
||||
layout.prop(mesh, "texspace_location", text="Location")
|
||||
layout.prop(mesh, "texspace_size", text="Size")
|
||||
|
||||
|
||||
class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
|
||||
@@ -280,6 +280,7 @@ class DATA_PT_face_maps(MeshButtonsPanel, Panel):
|
||||
sub.operator("object.face_map_select", text="Select")
|
||||
sub.operator("object.face_map_deselect", text="Deselect")
|
||||
|
||||
|
||||
class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
|
||||
bl_label = "Shape Keys"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
@@ -54,23 +54,18 @@ class DATA_PT_metaball(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mball = context.meta_ball
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.label(text="Resolution:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(mball, "resolution", text="View")
|
||||
sub.prop(mball, "resolution", text="Resolution View")
|
||||
sub.prop(mball, "render_resolution", text="Render")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Settings:")
|
||||
col.prop(mball, "threshold", text="Threshold")
|
||||
|
||||
layout.label(text="Update:")
|
||||
layout.row().prop(mball, "update_method", expand=True)
|
||||
col.prop(mball, "update_method")
|
||||
|
||||
|
||||
class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
|
||||
@@ -80,14 +75,15 @@ class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mball = context.meta_ball
|
||||
|
||||
layout.prop(mball, "use_auto_texspace")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(mball, "texspace_location", text="Location")
|
||||
row.column().prop(mball, "texspace_size", text="Size")
|
||||
col = layout.column()
|
||||
col.prop(mball, "texspace_location")
|
||||
col.prop(mball, "texspace_size")
|
||||
|
||||
|
||||
class DATA_PT_metaball_element(DataButtonsPanel, Panel):
|
||||
@@ -99,35 +95,33 @@ class DATA_PT_metaball_element(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
metaelem = context.meta_ball.elements.active
|
||||
|
||||
layout.prop(metaelem, "type")
|
||||
col = layout.column()
|
||||
|
||||
split = layout.split()
|
||||
col.prop(metaelem, "type")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Settings:")
|
||||
col.prop(metaelem, "stiffness", text="Stiffness")
|
||||
col.prop(metaelem, "use_negative", text="Negative")
|
||||
col.prop(metaelem, "hide", text="Hide")
|
||||
|
||||
col = split.column(align=True)
|
||||
sub = col.column(align=True)
|
||||
|
||||
if metaelem.type in {'CUBE', 'ELLIPSOID'}:
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
col.prop(metaelem, "size_y", text="Y")
|
||||
col.prop(metaelem, "size_z", text="Z")
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
sub.prop(metaelem, "size_y", text="Y")
|
||||
sub.prop(metaelem, "size_z", text="Z")
|
||||
|
||||
elif metaelem.type == 'TUBE':
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
|
||||
elif metaelem.type == 'PLANE':
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
col.prop(metaelem, "size_y", text="Y")
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
sub.prop(metaelem, "size_y", text="Y")
|
||||
|
||||
|
||||
class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -168,7 +168,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
if bpy.app.debug:
|
||||
layout.prop(md, "debug_options")
|
||||
|
||||
|
||||
def BUILD(self, layout, ob, md):
|
||||
split = layout.split()
|
||||
|
||||
@@ -328,8 +327,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
row.prop(md, "delimit")
|
||||
layout_info = layout
|
||||
|
||||
layout_info.label(text=iface_("Face Count: {:,}".format(md.face_count)),
|
||||
translate=False)
|
||||
layout_info.label(
|
||||
text=iface_("Face Count: {:,}".format(md.face_count)),
|
||||
translate=False,
|
||||
)
|
||||
|
||||
def DISPLACE(self, layout, ob, md):
|
||||
has_texture = (md.texture is not None)
|
||||
|
@@ -62,14 +62,16 @@ class DATA_PT_speaker(DataButtonsPanel, Panel):
|
||||
|
||||
speaker = context.speaker
|
||||
|
||||
split = layout.split(percentage=0.75)
|
||||
layout.template_ID(speaker, "sound", open="sound.open_mono")
|
||||
|
||||
split.template_ID(speaker, "sound", open="sound.open_mono")
|
||||
split.prop(speaker, "muted")
|
||||
layout.use_property_split = True
|
||||
|
||||
row = layout.row()
|
||||
row.prop(speaker, "volume")
|
||||
row.prop(speaker, "pitch")
|
||||
layout.prop(speaker, "muted")
|
||||
|
||||
col = layout.column()
|
||||
col.active = not speaker.muted
|
||||
col.prop(speaker, "volume", slider=True)
|
||||
col.prop(speaker, "pitch")
|
||||
|
||||
|
||||
class DATA_PT_distance(DataButtonsPanel, Panel):
|
||||
@@ -79,20 +81,20 @@ class DATA_PT_distance(DataButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
speaker = context.speaker
|
||||
layout.active = not speaker.muted
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label("Volume:")
|
||||
col.prop(speaker, "volume_min", text="Minimum")
|
||||
col.prop(speaker, "volume_max", text="Maximum")
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(speaker, "volume_min", slider=True, text="Volume Min")
|
||||
sub.prop(speaker, "volume_max", slider=True, text="Max")
|
||||
col.prop(speaker, "attenuation")
|
||||
|
||||
col = split.column()
|
||||
col.label("Distance:")
|
||||
col.prop(speaker, "distance_max", text="Maximum")
|
||||
col.prop(speaker, "distance_reference", text="Reference")
|
||||
col.separator()
|
||||
col.prop(speaker, "distance_max", text="Max Distance")
|
||||
col.prop(speaker, "distance_reference", text="Distance Reference")
|
||||
|
||||
|
||||
class DATA_PT_cone(DataButtonsPanel, Panel):
|
||||
@@ -102,18 +104,20 @@ class DATA_PT_cone(DataButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
speaker = context.speaker
|
||||
layout.active = not speaker.muted
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col = split.column()
|
||||
col.label("Angle:")
|
||||
col.prop(speaker, "cone_angle_outer", text="Outer")
|
||||
col.prop(speaker, "cone_angle_inner", text="Inner")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(speaker, "cone_angle_outer", text="Angle Outer")
|
||||
sub.prop(speaker, "cone_angle_inner", text="Inner")
|
||||
|
||||
col = split.column()
|
||||
col.label("Volume:")
|
||||
col.prop(speaker, "cone_volume_outer", text="Outer")
|
||||
col.separator()
|
||||
|
||||
col.prop(speaker, "cone_volume_outer", slider=True)
|
||||
|
||||
|
||||
class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -19,8 +19,8 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
from bpy.types import (
|
||||
Panel,
|
||||
)
|
||||
Panel,
|
||||
)
|
||||
|
||||
from rna_prop_ui import PropertyPanel
|
||||
|
||||
@@ -51,7 +51,7 @@ class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
|
||||
|
||||
import addon_utils
|
||||
addon_map = {mod.__name__: mod for mod in addon_utils.modules()}
|
||||
owner_ids = {owner_id.name for owner_id in workspace.owner_ids}
|
||||
owner_ids = {owner_id.name for owner_id in workspace.owner_ids}
|
||||
|
||||
for addon in userpref.addons:
|
||||
module_name = addon.module
|
||||
@@ -85,7 +85,6 @@ class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
|
||||
row.label(module_name)
|
||||
|
||||
|
||||
|
||||
class WORKSPACE_PT_custom_props(WorkSpaceButtonsPanel, PropertyPanel, Panel):
|
||||
_context_path = "workspace"
|
||||
_property_type = bpy.types.WorkSpace
|
||||
@@ -100,4 +99,3 @@ if __name__ == "__main__": # only for live edit.
|
||||
from bpy.utils import register_class
|
||||
for cls in classes:
|
||||
register_class(cls)
|
||||
|
||||
|
@@ -172,11 +172,10 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
|
||||
if mat.use_nodes:
|
||||
panel_node_draw(layout, mat.node_tree, ('OUTPUT_EEVEE_MATERIAL', 'OUTPUT_MATERIAL'))
|
||||
else:
|
||||
raym = mat.raytrace_mirror
|
||||
layout.prop(mat, "diffuse_color", text="Base Color")
|
||||
layout.prop(raym, "reflect_factor", text="Metallic")
|
||||
layout.prop(mat, "metallic")
|
||||
layout.prop(mat, "specular_intensity", text="Specular")
|
||||
layout.prop(raym, "gloss_factor", text="Roughness")
|
||||
layout.prop(mat, "roughness")
|
||||
|
||||
|
||||
class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
@@ -215,6 +214,27 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
row.prop(mat, "use_sss_translucency")
|
||||
|
||||
|
||||
class MATERIAL_PT_viewport(MaterialButtonsPanel, Panel):
|
||||
bl_label = "Viewport Display"
|
||||
bl_context = "material"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.material
|
||||
|
||||
def draw(self, context):
|
||||
mat = context.material
|
||||
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
col.prop(mat, "diffuse_color")
|
||||
col.prop(mat, "specular_color")
|
||||
col.prop(mat, "roughness")
|
||||
|
||||
|
||||
classes = (
|
||||
MATERIAL_MT_specials,
|
||||
MATERIAL_UL_matslots,
|
||||
@@ -223,8 +243,10 @@ classes = (
|
||||
EEVEE_MATERIAL_PT_context_material,
|
||||
EEVEE_MATERIAL_PT_surface,
|
||||
EEVEE_MATERIAL_PT_options,
|
||||
MATERIAL_PT_viewport,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
from bpy.utils import register_class
|
||||
for cls in classes:
|
||||
|
@@ -48,25 +48,40 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
col = layout.column()
|
||||
|
||||
ob = context.object
|
||||
|
||||
row = layout.row()
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "location")
|
||||
sub.prop(ob, "lock_location", text="")
|
||||
|
||||
row.column().prop(ob, "location")
|
||||
if ob.rotation_mode == 'QUATERNION':
|
||||
row.column().prop(ob, "rotation_quaternion", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_quaternion", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(ob, "lock_rotation_w", text="")
|
||||
subsub.prop(ob, "lock_rotation", text="")
|
||||
elif ob.rotation_mode == 'AXIS_ANGLE':
|
||||
#row.column().label(text="Rotation")
|
||||
# row.column().label(text="Rotation")
|
||||
#row.column().prop(pchan, "rotation_angle", text="Angle")
|
||||
#row.column().prop(pchan, "rotation_axis", text="Axis")
|
||||
row.column().prop(ob, "rotation_axis_angle", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_axis_angle", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(ob, "lock_rotation_w", text="")
|
||||
subsub.prop(ob, "lock_rotation", text="")
|
||||
else:
|
||||
row.column().prop(ob, "rotation_euler", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_euler", text="Rotation")
|
||||
sub.prop(ob, "lock_rotation", text="")
|
||||
|
||||
row.column().prop(ob, "scale")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "scale")
|
||||
sub.prop(ob, "lock_scale", text="")
|
||||
|
||||
layout.prop(ob, "rotation_mode")
|
||||
col.prop(ob, "rotation_mode")
|
||||
|
||||
|
||||
class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
|
||||
@@ -75,102 +90,65 @@ class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
row = layout.row()
|
||||
col = layout.column()
|
||||
|
||||
row.column().prop(ob, "delta_location")
|
||||
col.column().prop(ob, "delta_location")
|
||||
if ob.rotation_mode == 'QUATERNION':
|
||||
row.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
|
||||
col.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
|
||||
elif ob.rotation_mode == 'AXIS_ANGLE':
|
||||
#row.column().label(text="Rotation")
|
||||
# row.column().label(text="Rotation")
|
||||
#row.column().prop(pchan, "delta_rotation_angle", text="Angle")
|
||||
#row.column().prop(pchan, "delta_rotation_axis", text="Axis")
|
||||
#row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation")
|
||||
row.column().label(text="Not for Axis-Angle")
|
||||
col.column().label(text="Not for Axis-Angle")
|
||||
else:
|
||||
row.column().prop(ob, "delta_rotation_euler", text="Delta Rotation")
|
||||
col.column().prop(ob, "delta_rotation_euler", text="Delta Rotation")
|
||||
|
||||
row.column().prop(ob, "delta_scale")
|
||||
|
||||
|
||||
class OBJECT_PT_transform_locks(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Transform Locks"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split(percentage=0.1)
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="")
|
||||
col.label(text="X:")
|
||||
col.label(text="Y:")
|
||||
col.label(text="Z:")
|
||||
|
||||
split.column().prop(ob, "lock_location", text="Location")
|
||||
split.column().prop(ob, "lock_rotation", text="Rotation")
|
||||
split.column().prop(ob, "lock_scale", text="Scale")
|
||||
|
||||
if ob.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
|
||||
row = layout.row()
|
||||
row.prop(ob, "lock_rotations_4d", text="Lock Rotation")
|
||||
|
||||
sub = row.row()
|
||||
sub.active = ob.lock_rotations_4d
|
||||
sub.prop(ob, "lock_rotation_w", text="W")
|
||||
col.column().prop(ob, "delta_scale")
|
||||
|
||||
|
||||
class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Relations"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(ob, "pass_index")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Parent:")
|
||||
col.prop(ob, "parent", text="")
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(ob, "parent_type", text="")
|
||||
parent = ob.parent
|
||||
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
|
||||
sub.prop_search(ob, "parent_bone", parent.data, "bones", text="")
|
||||
sub.active = (parent is not None)
|
||||
|
||||
|
||||
class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Relations Extras"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Tracking Axes:")
|
||||
col.prop(ob, "track_axis", text="Axis")
|
||||
col.prop(ob, "parent")
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(ob, "parent_type")
|
||||
parent = ob.parent
|
||||
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
|
||||
sub.prop_search(ob, "parent_bone", parent.data, "bones")
|
||||
sub.active = (parent is not None)
|
||||
|
||||
col = col.column()
|
||||
col.active = (ob.parent is not None)
|
||||
col.prop(ob, "use_slow_parent")
|
||||
sub = col.column()
|
||||
sub.active = (ob.use_slow_parent)
|
||||
sub.prop(ob, "slow_parent_offset", text="Offset")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(ob, "track_axis", text="Tracking Axis")
|
||||
col.prop(ob, "up_axis", text="Up Axis")
|
||||
|
||||
col = split.column()
|
||||
col.prop(ob, "use_slow_parent")
|
||||
row = col.row()
|
||||
row.active = ((ob.parent is not None) and (ob.use_slow_parent))
|
||||
row.prop(ob, "slow_parent_offset", text="Offset")
|
||||
col.separator()
|
||||
|
||||
col.prop(ob, "pass_index")
|
||||
|
||||
|
||||
class COLLECTION_MT_specials(Menu):
|
||||
@@ -221,10 +199,12 @@ class OBJECT_PT_collections(ObjectButtonsPanel, Panel):
|
||||
|
||||
|
||||
class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Display"
|
||||
bl_label = "Viewport Display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
obj = context.object
|
||||
obj_type = obj.type
|
||||
@@ -233,9 +213,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
is_empty_image = (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE')
|
||||
is_dupli = (obj.dupli_type != 'NONE')
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
col.prop(obj, "show_name", text="Name")
|
||||
col.prop(obj, "show_axis", text="Axis")
|
||||
# Makes no sense for cameras, armatures, etc.!
|
||||
@@ -245,48 +223,39 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
if obj_type == 'MESH' or is_dupli:
|
||||
col.prop(obj, "show_all_edges")
|
||||
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
row.prop(obj, "show_bounds", text="Bounds")
|
||||
sub = row.row()
|
||||
sub.active = obj.show_bounds
|
||||
sub.prop(obj, "draw_bounds_type", text="")
|
||||
col = layout.column()
|
||||
col.prop(obj, "show_bounds", text="Bounds")
|
||||
col = layout.column()
|
||||
col.active = obj.show_bounds
|
||||
col.prop(obj, "draw_bounds_type")
|
||||
|
||||
col = layout.column()
|
||||
if is_geometry:
|
||||
col.prop(obj, "show_texture_space", text="Texture Space")
|
||||
col.prop(obj.display, "show_shadows")
|
||||
col.prop(obj.display, "show_shadows", text="Shadow")
|
||||
|
||||
col.prop(obj, "show_x_ray", text="X-Ray")
|
||||
if obj_type == 'MESH' or is_empty_image:
|
||||
col.prop(obj, "show_transparent", text="Transparency")
|
||||
# if obj_type == 'MESH' or is_empty_image:
|
||||
# col.prop(obj, "show_transparent", text="Transparency")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
if is_wire:
|
||||
# wire objects only use the max. draw type for duplis
|
||||
col.active = is_dupli
|
||||
col.label(text="Maximum Dupli Draw Type:")
|
||||
else:
|
||||
col.label(text="Maximum Draw Type:")
|
||||
col.prop(obj, "draw_type", text="")
|
||||
|
||||
col = split.column()
|
||||
if is_geometry or is_empty_image:
|
||||
# Only useful with object having faces/materials...
|
||||
col.label(text="Object Color:")
|
||||
col.prop(obj, "color", text="")
|
||||
col.prop(
|
||||
obj, "draw_type",
|
||||
text="Maximum Dupli Draw Type" if is_wire else "Maximum Dupli Draw Type",
|
||||
)
|
||||
|
||||
col = layout.column()
|
||||
col.active = bool(is_dupli or obj.particle_systems)
|
||||
col.label(text="Duplicator Visibility:")
|
||||
row = col.row(align=True)
|
||||
row.prop(obj, "show_duplicator_for_viewport", text="Viewport")
|
||||
row.prop(obj, "show_duplicator_for_render", text="Render")
|
||||
if is_geometry or is_empty_image:
|
||||
# Only useful with object having faces/materials...
|
||||
col.prop(obj, "color")
|
||||
|
||||
|
||||
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Duplication"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -295,14 +264,15 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(ob, "dupli_type", expand=True)
|
||||
|
||||
if ob.dupli_type == 'FRAMES':
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column(align=True)
|
||||
if ob.dupli_type == 'FRAMES':
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(ob, "dupli_frames_start", text="Start")
|
||||
col.prop(ob, "dupli_frames_end", text="End")
|
||||
|
||||
col = split.column(align=True)
|
||||
col = layout.column(align=True)
|
||||
col.prop(ob, "dupli_frames_on", text="On")
|
||||
col.prop(ob, "dupli_frames_off", text="Off")
|
||||
|
||||
@@ -312,15 +282,22 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
|
||||
|
||||
elif ob.dupli_type == 'FACES':
|
||||
row = layout.row()
|
||||
row.prop(ob, "use_dupli_faces_scale", text="Scale")
|
||||
sub = row.row()
|
||||
col = layout.column()
|
||||
col.prop(ob, "use_dupli_faces_scale", text="Scale")
|
||||
sub = col.column()
|
||||
sub.active = ob.use_dupli_faces_scale
|
||||
sub.prop(ob, "dupli_faces_scale", text="Inherit Scale")
|
||||
|
||||
elif ob.dupli_type == 'COLLECTION':
|
||||
layout.prop(ob, "dupli_group", text="Collection")
|
||||
|
||||
if ob.dupli_type != 'NONE' or len(ob.particle_systems):
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(ob, "show_duplicator_for_viewport")
|
||||
col.prop(ob, "show_duplicator_for_render")
|
||||
|
||||
|
||||
from .properties_animviz import (
|
||||
MotionPathButtonsPanel,
|
||||
@@ -370,9 +347,7 @@ classes = (
|
||||
OBJECT_PT_context_object,
|
||||
OBJECT_PT_transform,
|
||||
OBJECT_PT_delta_transform,
|
||||
OBJECT_PT_transform_locks,
|
||||
OBJECT_PT_relations,
|
||||
OBJECT_PT_relations_extras,
|
||||
COLLECTION_MT_specials,
|
||||
OBJECT_PT_collections,
|
||||
OBJECT_PT_display,
|
||||
|
@@ -1428,6 +1428,36 @@ class PARTICLE_PT_textures(ParticleButtonsPanel, Panel):
|
||||
layout.template_ID(slot, "texture", new="texture.new")
|
||||
|
||||
|
||||
class PARTICLE_PT_hair_shape(ParticleButtonsPanel, Panel):
|
||||
bl_label = "Hair Shape"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if context.particle_system is None:
|
||||
return False
|
||||
return particle_panel_poll(cls, context)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
psys = context.particle_system
|
||||
part = psys.settings
|
||||
|
||||
row = layout.row()
|
||||
row.prop(part, "shape", text="Shape")
|
||||
|
||||
layout.label(text="Thickness:")
|
||||
row = layout.row()
|
||||
row.prop(part, "root_radius", text="Root")
|
||||
row.prop(part, "tip_radius", text="Tip")
|
||||
|
||||
row = layout.row()
|
||||
row.prop(part, "radius_scale", text="Scaling")
|
||||
row.prop(part, "use_close_tip")
|
||||
|
||||
|
||||
class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
_context_path = "particle_system.settings"
|
||||
@@ -1449,6 +1479,7 @@ classes = (
|
||||
PARTICLE_PT_render,
|
||||
PARTICLE_PT_draw,
|
||||
PARTICLE_PT_children,
|
||||
PARTICLE_PT_hair_shape,
|
||||
PARTICLE_PT_field_weights,
|
||||
PARTICLE_PT_force_fields,
|
||||
PARTICLE_PT_vertexgroups,
|
||||
|
@@ -67,12 +67,13 @@ class RENDER_PT_context(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
if rd.has_multiple_engines:
|
||||
layout.prop(rd, "engine", text="")
|
||||
layout.prop(rd, "engine", text="Render Engine")
|
||||
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
@@ -125,6 +126,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
@@ -134,41 +136,34 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
row.operator("render.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "resolution_x", text="Resolution X")
|
||||
col.prop(rd, "resolution_y", text="Y")
|
||||
col.prop(rd, "resolution_percentage", text="%")
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "pixel_aspect_x", text="Aspect X")
|
||||
col.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "use_border", text="Border")
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Resolution:")
|
||||
sub.prop(rd, "resolution_x", text="X")
|
||||
sub.prop(rd, "resolution_y", text="Y")
|
||||
sub.prop(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.label(text="Aspect Ratio:")
|
||||
sub.prop(rd, "pixel_aspect_x", text="X")
|
||||
sub.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
row = col.row()
|
||||
row.prop(rd, "use_border", text="Border")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_border
|
||||
sub.prop(rd, "use_crop_to_border", text="Crop")
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Frame Range:")
|
||||
sub.prop(scene, "frame_start")
|
||||
sub.prop(scene, "frame_end")
|
||||
sub.prop(scene, "frame_step")
|
||||
col = layout.column(align=True)
|
||||
col.prop(scene, "frame_start", text="Frame Range Start")
|
||||
col.prop(scene, "frame_end", text="End")
|
||||
col.prop(scene, "frame_step", text="Step")
|
||||
|
||||
sub.label(text="Frame Rate:")
|
||||
col = layout.split(percentage=0.5)
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(text="Frame Rate")
|
||||
self.draw_framerate(col, rd)
|
||||
|
||||
self.draw_framerate(sub, rd)
|
||||
|
||||
subrow = sub.row(align=True)
|
||||
subrow.label(text="Time Remapping:")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.prop(rd, "frame_map_old", text="Old")
|
||||
subrow.prop(rd, "frame_map_new", text="New")
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "frame_map_old", text="Time Remapping Old")
|
||||
col.prop(rd, "frame_map_new", text="New")
|
||||
|
||||
|
||||
class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
|
||||
@@ -178,16 +173,15 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "use_compositing")
|
||||
col.prop(rd, "use_sequencer")
|
||||
|
||||
split.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
col.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
@@ -197,24 +191,13 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.prop(rd, "use_stamp")
|
||||
col = layout.column()
|
||||
col.active = rd.use_stamp
|
||||
row = col.row()
|
||||
row.prop(rd, "stamp_font_size", text="Font Size")
|
||||
row.prop(rd, "use_stamp_labels", text="Draw Labels")
|
||||
|
||||
row = col.row()
|
||||
row.column().prop(rd, "stamp_foreground", slider=True)
|
||||
row.column().prop(rd, "stamp_background", slider=True)
|
||||
|
||||
layout.label("Enabled Metadata")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = split.column(align=True)
|
||||
col.prop(rd, "use_stamp_time", text="Time")
|
||||
col.prop(rd, "use_stamp_date", text="Date")
|
||||
col.prop(rd, "use_stamp_render_time", text="RenderTime")
|
||||
@@ -222,7 +205,7 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
col.prop(rd, "use_stamp_scene", text="Scene")
|
||||
col.prop(rd, "use_stamp_memory", text="Memory")
|
||||
|
||||
col = split.column()
|
||||
col = split.column(align=True)
|
||||
col.prop(rd, "use_stamp_camera", text="Camera")
|
||||
col.prop(rd, "use_stamp_lens", text="Lens")
|
||||
col.prop(rd, "use_stamp_filename", text="Filename")
|
||||
@@ -230,14 +213,26 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
col.prop(rd, "use_stamp_marker", text="Marker")
|
||||
col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
|
||||
|
||||
row = layout.split(percentage=0.2)
|
||||
if rd.use_sequencer:
|
||||
col.prop(rd, "use_stamp_strip_meta", text="Sequence Strip")
|
||||
|
||||
row = layout.split(percentage=0.3)
|
||||
row.prop(rd, "use_stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_stamp_note
|
||||
sub.prop(rd, "stamp_note_text", text="")
|
||||
if rd.use_sequencer:
|
||||
layout.label("Sequencer:")
|
||||
layout.prop(rd, "use_stamp_strip_meta")
|
||||
|
||||
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")
|
||||
col.prop(rd, "use_stamp_labels", text="Draw Labels")
|
||||
col.column().prop(rd, "stamp_foreground", slider=True)
|
||||
col.column().prop(rd, "stamp_background", slider=True)
|
||||
|
||||
|
||||
class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
@@ -246,6 +241,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
rd = context.scene.render
|
||||
image_settings = rd.image_settings
|
||||
@@ -253,17 +249,17 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
|
||||
layout.prop(rd, "filepath", text="")
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
col.active = not rd.is_movie_format
|
||||
col.prop(rd, "use_overwrite")
|
||||
col.prop(rd, "use_placeholder")
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = not rd.is_movie_format
|
||||
sub.prop(rd, "use_overwrite")
|
||||
sub.prop(rd, "use_placeholder")
|
||||
col.prop(rd, "use_file_extension")
|
||||
col.prop(rd, "use_render_cache")
|
||||
|
||||
layout.use_property_split = False
|
||||
layout.template_image_settings(image_settings, color_management=False)
|
||||
if rd.use_multiview:
|
||||
layout.template_image_views(image_settings)
|
||||
@@ -447,6 +443,7 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -475,6 +472,7 @@ class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -500,6 +498,7 @@ class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -525,6 +524,8 @@ class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -554,20 +555,32 @@ class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
layout.active = props.use_volumetric
|
||||
col = layout.column()
|
||||
col.prop(props, "volumetric_start")
|
||||
col.prop(props, "volumetric_end")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(props, "volumetric_start")
|
||||
sub.prop(props, "volumetric_end")
|
||||
col.prop(props, "volumetric_tile_size")
|
||||
col.separator()
|
||||
col.prop(props, "volumetric_samples")
|
||||
col.prop(props, "volumetric_sample_distribution")
|
||||
sub.prop(props, "volumetric_sample_distribution")
|
||||
col.separator()
|
||||
col.prop(props, "use_volumetric_lights")
|
||||
col.prop(props, "volumetric_light_clamp")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = props.use_volumetric_lights
|
||||
sub.prop(props, "volumetric_light_clamp", text="Light Clamping")
|
||||
col.separator()
|
||||
col.prop(props, "use_volumetric_shadows")
|
||||
col.prop(props, "volumetric_shadow_samples")
|
||||
sub = col.column()
|
||||
sub.active = props.use_volumetric_shadows
|
||||
sub.prop(props, "volumetric_shadow_samples", text="Shadow Samples")
|
||||
col.separator()
|
||||
col.prop(props, "use_volumetric_colored_transmittance")
|
||||
|
||||
|
||||
@@ -587,9 +600,13 @@ class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
layout.active = props.use_sss
|
||||
|
||||
col = layout.column()
|
||||
col.prop(props, "sss_samples")
|
||||
col.prop(props, "sss_jitter_threshold")
|
||||
@@ -612,12 +629,14 @@ class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
col = layout.column()
|
||||
col.active = props.use_ssr
|
||||
col.prop(props, "use_ssr_refraction")
|
||||
col.prop(props, "use_ssr_refraction", text="Refraction")
|
||||
col.prop(props, "use_ssr_halfres")
|
||||
col.prop(props, "ssr_quality")
|
||||
col.prop(props, "ssr_max_roughness")
|
||||
@@ -637,6 +656,8 @@ class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -658,6 +679,8 @@ class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -678,6 +701,8 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -698,18 +723,36 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(rd, "filter_size")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "alpha_mode", text="Alpha")
|
||||
|
||||
|
||||
class RENDER_PT_hair(RenderButtonsPanel, Panel):
|
||||
bl_label = "Hair"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
row = layout.row()
|
||||
row.prop(rd, "hair_type", expand=True)
|
||||
|
||||
layout.prop(rd, "hair_subdiv")
|
||||
|
||||
|
||||
classes = (
|
||||
RENDER_MT_presets,
|
||||
RENDER_MT_ffmpeg_presets,
|
||||
@@ -717,11 +760,12 @@ classes = (
|
||||
RENDER_PT_context,
|
||||
RENDER_PT_dimensions,
|
||||
RENDER_PT_post_processing,
|
||||
RENDER_PT_stamp,
|
||||
RENDER_PT_output,
|
||||
RENDER_PT_encoding,
|
||||
RENDER_PT_stamp,
|
||||
RENDER_UL_renderviews,
|
||||
RENDER_PT_stereoscopy,
|
||||
RENDER_PT_hair,
|
||||
RENDER_PT_clay_settings,
|
||||
RENDER_PT_eevee_sampling,
|
||||
RENDER_PT_eevee_film,
|
||||
|
@@ -19,10 +19,10 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
from bpy.types import (
|
||||
Menu,
|
||||
Panel,
|
||||
UIList,
|
||||
)
|
||||
Menu,
|
||||
Panel,
|
||||
UIList,
|
||||
)
|
||||
|
||||
from rna_prop_ui import PropertyPanel
|
||||
|
||||
@@ -69,12 +69,12 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
|
||||
layout.prop(scene, "camera")
|
||||
layout.prop(scene, "background_set", text="Background")
|
||||
layout.prop(scene, "active_clip", text="Active Clip")
|
||||
layout.prop(scene, "background_set")
|
||||
layout.prop(scene, "active_clip")
|
||||
|
||||
|
||||
class SCENE_PT_unit(SceneButtonsPanel, Panel):
|
||||
@@ -91,23 +91,18 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
|
||||
row.operator("scene.units_length_preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("scene.units_length_preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
layout.separator()
|
||||
layout.use_property_split = True
|
||||
|
||||
split = layout.split(percentage=0.35)
|
||||
split.label("Length:")
|
||||
split.prop(unit, "system", text="")
|
||||
split = layout.split(percentage=0.35)
|
||||
split.label("Angle:")
|
||||
split.prop(unit, "system_rotation", text="")
|
||||
col = layout.column()
|
||||
col.prop(unit, "system")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(unit, "system_rotation")
|
||||
|
||||
col = layout.column()
|
||||
col.enabled = unit.system != 'NONE'
|
||||
split = col.split(percentage=0.35)
|
||||
split.label("Unit Scale:")
|
||||
split.prop(unit, "scale_length", text="")
|
||||
split = col.split(percentage=0.35)
|
||||
split.row()
|
||||
split.prop(unit, "use_separate")
|
||||
col.prop(unit, "scale_length")
|
||||
col.prop(unit, "use_separate")
|
||||
|
||||
|
||||
class SceneKeyingSetsPanel:
|
||||
@@ -115,18 +110,19 @@ class SceneKeyingSetsPanel:
|
||||
@staticmethod
|
||||
def draw_keyframing_settings(context, layout, ks, ksp):
|
||||
SceneKeyingSetsPanel._draw_keyframing_setting(
|
||||
context, layout, ks, ksp, "Needed",
|
||||
"use_insertkey_override_needed", "use_insertkey_needed",
|
||||
userpref_fallback="use_keyframe_insert_needed")
|
||||
|
||||
context, layout, ks, ksp, "Needed",
|
||||
"use_insertkey_override_needed", "use_insertkey_needed",
|
||||
userpref_fallback="use_keyframe_insert_needed",
|
||||
)
|
||||
SceneKeyingSetsPanel._draw_keyframing_setting(
|
||||
context, layout, ks, ksp, "Visual",
|
||||
"use_insertkey_override_visual", "use_insertkey_visual",
|
||||
userpref_fallback="use_visual_keying")
|
||||
|
||||
context, layout, ks, ksp, "Visual",
|
||||
"use_insertkey_override_visual", "use_insertkey_visual",
|
||||
userpref_fallback="use_visual_keying",
|
||||
)
|
||||
SceneKeyingSetsPanel._draw_keyframing_setting(
|
||||
context, layout, ks, ksp, "XYZ to RGB",
|
||||
"use_insertkey_override_xyz_to_rgb", "use_insertkey_xyz_to_rgb")
|
||||
context, layout, ks, ksp, "XYZ to RGB",
|
||||
"use_insertkey_override_xyz_to_rgb", "use_insertkey_xyz_to_rgb",
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _draw_keyframing_setting(context, layout, ks, ksp, label, toggle_prop, prop, userpref_fallback=None):
|
||||
@@ -197,6 +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_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
@@ -258,22 +255,21 @@ class SCENE_PT_color_management(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="Display:")
|
||||
col.prop(scene.display_settings, "display_device")
|
||||
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
col.label(text="Render:")
|
||||
col.template_colormanaged_view_settings(scene, "view_settings")
|
||||
|
||||
col = layout.column()
|
||||
col.template_colormanaged_view_settings(scene, "view_settings")
|
||||
|
||||
col.separator()
|
||||
col.label(text="Sequencer:")
|
||||
col.prop(scene.sequencer_colorspace_settings, "name")
|
||||
col = layout.column()
|
||||
col.prop(scene.sequencer_colorspace_settings, "name", text="Sequencer Color Space")
|
||||
|
||||
|
||||
class SCENE_PT_audio(SceneButtonsPanel, Panel):
|
||||
@@ -283,28 +279,30 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = context.scene.render
|
||||
ffmpeg = rd.ffmpeg
|
||||
|
||||
layout.prop(scene, "audio_volume")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(scene, "audio_distance_model")
|
||||
|
||||
col.prop(ffmpeg, "audio_channels")
|
||||
col.prop(ffmpeg, "audio_mixrate", text="Sample Rate")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(scene, "audio_doppler_speed", text="Doppler Speed")
|
||||
col.prop(scene, "audio_doppler_factor", text="Doppler Factor")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("sound.bake_animation")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label("Distance Model:")
|
||||
col.prop(scene, "audio_distance_model", text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(scene, "audio_doppler_speed", text="Speed")
|
||||
sub.prop(scene, "audio_doppler_factor", text="Doppler")
|
||||
|
||||
col = split.column()
|
||||
col.label("Format:")
|
||||
col.prop(ffmpeg, "audio_channels", text="")
|
||||
col.prop(ffmpeg, "audio_mixrate", text="Rate")
|
||||
|
||||
|
||||
class SCENE_PT_physics(SceneButtonsPanel, Panel):
|
||||
bl_label = "Gravity"
|
||||
@@ -315,16 +313,18 @@ class SCENE_PT_physics(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
|
||||
layout.active = scene.use_gravity
|
||||
|
||||
layout.prop(scene, "gravity", text="")
|
||||
layout.prop(scene, "gravity")
|
||||
|
||||
|
||||
class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
|
||||
bl_label = "Rigid Body World"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
@@ -403,6 +403,7 @@ class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel):
|
||||
|
||||
class SCENE_PT_simplify(SceneButtonsPanel, Panel):
|
||||
bl_label = "Simplify"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header(self, context):
|
||||
@@ -411,22 +412,21 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.active = rd.use_simplify
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.prop(rd, "simplify_subdivision", text="Max Viewport Subdivision")
|
||||
col.prop(rd, "simplify_child_particles", text="Max Child Particles")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Viewport:")
|
||||
col.prop(rd, "simplify_subdivision", text="Subdivision")
|
||||
col.prop(rd, "simplify_child_particles", text="Child Particles")
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Render:")
|
||||
col.prop(rd, "simplify_subdivision_render", text="Subdivision")
|
||||
col.prop(rd, "simplify_child_particles_render", text="Child Particles")
|
||||
col = layout.column()
|
||||
col.prop(rd, "simplify_subdivision_render", text="Max Render Subdivision")
|
||||
col.prop(rd, "simplify_child_particles_render", text="Max Child Particles")
|
||||
|
||||
|
||||
class SCENE_PT_viewport_display(SceneButtonsPanel, Panel):
|
||||
@@ -439,9 +439,11 @@ class SCENE_PT_viewport_display(SceneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
layout.prop(scene.display, "light_direction", text="")
|
||||
layout.prop(scene.display, "shadow_shift")
|
||||
col = layout.column()
|
||||
col.prop(scene.display, "light_direction")
|
||||
col.prop(scene.display, "shadow_shift")
|
||||
|
||||
|
||||
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -31,7 +31,9 @@ class PROPERTIES_HT_header(Header):
|
||||
|
||||
row = layout.row()
|
||||
row.template_header()
|
||||
row.prop(view, "context", expand=True, icon_only=True)
|
||||
|
||||
if view.mode == 'DATA_PROPERTIES':
|
||||
row.prop(view, "context", expand=True, icon_only=True)
|
||||
|
||||
|
||||
classes = (
|
||||
|
@@ -262,8 +262,8 @@ class ToolSelectPanelHelper:
|
||||
for item, index in ToolSelectPanelHelper._tools_flatten_with_tool_index(cls.tools_from_context(context)):
|
||||
if item is not None:
|
||||
if item.text == text:
|
||||
return (item, index)
|
||||
return None, -1
|
||||
return (cls, item, index)
|
||||
return None, None, -1
|
||||
|
||||
@staticmethod
|
||||
def _tool_active_from_context(context, space_type, mode=None, create=False):
|
||||
@@ -564,20 +564,60 @@ class WM_MT_toolsystem_submenu(Menu):
|
||||
).name = item.text
|
||||
|
||||
|
||||
def _activate_by_item(context, space_type, item, index):
|
||||
tool = ToolSelectPanelHelper._tool_active_from_context(context, space_type, create=True)
|
||||
tool.setup(
|
||||
name=item.text,
|
||||
keymap=item.keymap[0].name if item.keymap is not None else "",
|
||||
cursor=item.cursor or 'DEFAULT',
|
||||
manipulator_group=item.widget or "",
|
||||
data_block=item.data_block or "",
|
||||
index=index,
|
||||
)
|
||||
|
||||
|
||||
def activate_by_name(context, space_type, text):
|
||||
item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
|
||||
if item is not None:
|
||||
tool = ToolSelectPanelHelper._tool_active_from_context(context, space_type, create=True)
|
||||
tool.setup(
|
||||
name=text,
|
||||
keymap=item.keymap[0].name if item.keymap is not None else "",
|
||||
cursor=item.cursor or 'DEFAULT',
|
||||
manipulator_group=item.widget or "",
|
||||
data_block=item.data_block or "",
|
||||
index=index,
|
||||
)
|
||||
return True
|
||||
return False
|
||||
cls, item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
|
||||
if item is None:
|
||||
return False
|
||||
_activate_by_item(context, space_type, item, index)
|
||||
return True
|
||||
|
||||
|
||||
def activate_by_name_or_cycle(context, space_type, text, offset=1):
|
||||
|
||||
# Only cycle when the active tool is activated again.
|
||||
cls, item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
|
||||
if item is None:
|
||||
return False
|
||||
|
||||
tool_active = ToolSelectPanelHelper._tool_active_from_context(context, space_type)
|
||||
text_active = getattr(tool_active, "name", None)
|
||||
|
||||
text_current = ""
|
||||
for item_group in cls.tools_from_context(context):
|
||||
if type(item_group) is tuple:
|
||||
index_current = cls._tool_group_active.get(item_group[0].text, 0)
|
||||
ok = False
|
||||
for i, sub_item in enumerate(item_group):
|
||||
if sub_item.text == text:
|
||||
text_current = item_group[index_current].text
|
||||
break
|
||||
if text_current:
|
||||
break
|
||||
|
||||
if text_current == "":
|
||||
return activate_by_name(context, space_type, text)
|
||||
if text_active != text_current:
|
||||
return activate_by_name(context, space_type, text_current)
|
||||
|
||||
index_found = (tool_active.index + offset) % len(item_group)
|
||||
|
||||
cls._tool_group_active[item_group[0].text] = index_found
|
||||
|
||||
item_found = item_group[index_found]
|
||||
_activate_by_item(context, space_type, item_found, index_found)
|
||||
return True
|
||||
|
||||
|
||||
def keymap_from_context(context, space_type):
|
||||
|
@@ -125,13 +125,13 @@ class TOPBAR_HT_lower_bar(Header):
|
||||
|
||||
# Note: general mode options should be added to 'draw_right'.
|
||||
if mode == 'SCULPT':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
|
||||
elif mode == 'PAINT_VERTEX':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
|
||||
elif mode == 'PAINT_WEIGHT':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
|
||||
elif mode == 'PAINT_TEXTURE':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
|
||||
elif mode == 'EDIT_ARMATURE':
|
||||
pass
|
||||
elif mode == 'EDIT_CURVE':
|
||||
@@ -139,9 +139,9 @@ class TOPBAR_HT_lower_bar(Header):
|
||||
elif mode == 'EDIT_MESH':
|
||||
pass
|
||||
elif mode == 'POSE':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".posemode", category="")
|
||||
pass
|
||||
elif mode == 'PARTICLE':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
|
||||
pass
|
||||
|
||||
def draw_right(self, context):
|
||||
layout = self.layout
|
||||
@@ -151,23 +151,23 @@ class TOPBAR_HT_lower_bar(Header):
|
||||
mode = context.mode
|
||||
|
||||
if mode == 'SCULPT':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".sculpt_mode", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".sculpt_mode", category="")
|
||||
elif mode == 'PAINT_VERTEX':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".vertexpaint", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".vertexpaint", category="")
|
||||
elif mode == 'PAINT_WEIGHT':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".weightpaint", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".weightpaint", category="")
|
||||
elif mode == 'PAINT_TEXTURE':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".imagepaint", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".imagepaint", category="")
|
||||
elif mode == 'EDIT_ARMATURE':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".armature_edit", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".armature_edit", category="")
|
||||
elif mode == 'EDIT_CURVE':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".curve_edit", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".curve_edit", category="")
|
||||
elif mode == 'EDIT_MESH':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".mesh_edit", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".mesh_edit", category="")
|
||||
elif mode == 'POSE':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".posemode", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".posemode", category="")
|
||||
elif mode == 'PARTICLE':
|
||||
layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".particlemode", category="")
|
||||
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".particlemode", category="")
|
||||
|
||||
# 3D View Options, tsk. maybe users aren't always using 3D view?
|
||||
toolsettings = context.tool_settings
|
||||
|
@@ -52,7 +52,8 @@ class USERPREF_HT_header(Header):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.template_header()
|
||||
# No need to show type selector.
|
||||
# layout.template_header()
|
||||
|
||||
userpref = context.user_preferences
|
||||
|
||||
@@ -288,13 +289,14 @@ class USERPREF_PT_interface(Panel):
|
||||
#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")
|
||||
col.prop(view, "show_manipulator_navigate")
|
||||
## Currently not working
|
||||
# col.prop(view, "show_manipulator_shaded")
|
||||
sub = col.column()
|
||||
sub.active = view.show_manipulator
|
||||
sub.prop(view, "manipulator_size", text="Size")
|
||||
|
||||
col.prop(view, "show_manipulator_navigate")
|
||||
|
||||
col.separator()
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
@@ -1328,15 +1328,19 @@ class INFO_MT_add(Menu):
|
||||
layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_FORCE_FIELD')
|
||||
layout.separator()
|
||||
|
||||
if len(bpy.data.collections) > 10:
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
layout.operator(
|
||||
has_collections = bool(bpy.data.collections)
|
||||
col = layout.column()
|
||||
col.enabled = has_collections
|
||||
|
||||
if not has_collections or len(bpy.data.collections) > 10:
|
||||
col.operator_context = 'INVOKE_REGION_WIN'
|
||||
col.operator(
|
||||
"object.collection_instance_add",
|
||||
text="Collection Instance...",
|
||||
text="Collection Instance..." if has_collections else "No Collections to Instance",
|
||||
icon='OUTLINER_OB_GROUP_INSTANCE',
|
||||
)
|
||||
else:
|
||||
layout.operator_menu_enum(
|
||||
col.operator_menu_enum(
|
||||
"object.collection_instance_add",
|
||||
"collection",
|
||||
text="Collection Instance",
|
||||
@@ -1782,11 +1786,11 @@ class VIEW3D_MT_make_single_user(Menu):
|
||||
|
||||
props = layout.operator("object.make_single_user", text="Object")
|
||||
props.object = True
|
||||
props.obdata = props.material = props.texture = props.animation = False
|
||||
props.obdata = props.material = props.animation = False
|
||||
|
||||
props = layout.operator("object.make_single_user", text="Object & Data")
|
||||
props.object = props.obdata = True
|
||||
props.material = props.texture = props.animation = False
|
||||
props.material = props.animation = False
|
||||
|
||||
props = layout.operator("object.make_single_user", text="Object & Data & Materials")
|
||||
props.object = props.obdata = props.material = True
|
||||
@@ -3527,10 +3531,16 @@ class VIEW3D_PT_shading(Panel):
|
||||
if shading.studio_light_orientation == 'WORLD':
|
||||
col.row().prop(shading, "studiolight_rot_z")
|
||||
|
||||
row = col.row()
|
||||
row.prop(shading, "show_specular_highlight")
|
||||
|
||||
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.row()
|
||||
row.active = not shading.show_xray
|
||||
@@ -3545,12 +3555,14 @@ class VIEW3D_PT_shading(Panel):
|
||||
sub.active = shading.show_object_outline
|
||||
sub.prop(shading, "object_outline_color", text="")
|
||||
|
||||
col.prop(view, "show_world")
|
||||
|
||||
elif shading.type in ('MATERIAL'):
|
||||
col.row().template_icon_view(shading, "studio_light")
|
||||
if shading.studio_light_orientation == 'WORLD':
|
||||
col.row().prop(shading, "studiolight_rot_z")
|
||||
col.row().prop(shading, "studiolight_background")
|
||||
col.row().prop(shading, "use_scene_light")
|
||||
col.prop(shading, "use_scene_light")
|
||||
|
||||
|
||||
class VIEW3D_PT_overlay(Panel):
|
||||
@@ -3572,26 +3584,24 @@ class VIEW3D_PT_overlay(Panel):
|
||||
toolsettings = context.tool_settings
|
||||
display_all = overlay.show_overlays
|
||||
|
||||
col = layout.column()
|
||||
col.prop(view, "show_world")
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
col.prop(overlay, "show_cursor", text="3D Cursor")
|
||||
|
||||
col.prop(view, "show_manipulator", text="Manipulators")
|
||||
|
||||
if shading.type == "MATERIAL":
|
||||
col.prop(overlay, "show_look_dev")
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
col.prop(overlay, "show_text", text="Text")
|
||||
col.prop(overlay, "show_cursor", text="3D Cursor")
|
||||
col.prop(overlay, "show_outline_selected")
|
||||
col.prop(overlay, "show_all_objects_origin")
|
||||
col.prop(overlay, "show_relationship_lines")
|
||||
col.prop(overlay, "show_motion_paths")
|
||||
col.prop(overlay, "show_face_orientation")
|
||||
col.prop(overlay, "show_wireframes")
|
||||
col.prop(overlay, "show_backface_culling")
|
||||
|
||||
if shading.type == "MATERIAL":
|
||||
col.prop(overlay, "show_look_dev")
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
split = col.split(percentage=0.55)
|
||||
@@ -3606,11 +3616,8 @@ 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_lines", text="Lines")
|
||||
sub.prop(overlay, "grid_scale", text="Scale")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.active = scene.unit_settings.system == 'NONE'
|
||||
subsub.prop(overlay, "grid_subdivisions", text="Subdivisions")
|
||||
sub.prop(overlay, "grid_subdivisions", text="Subdivisions")
|
||||
|
||||
if context.mode == 'EDIT_MESH':
|
||||
col.separator()
|
||||
|
@@ -36,8 +36,8 @@ from .properties_paint_common import (
|
||||
|
||||
|
||||
class View3DPanel:
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'TOOLS'
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
|
||||
|
||||
# **************** standard tool clusters ******************
|
||||
@@ -69,7 +69,7 @@ def draw_vpaint_symmetry(layout, vpaint):
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
|
||||
bl_category = ""
|
||||
bl_category = "Options"
|
||||
bl_context = ".mesh_edit" # dot on purpose (access from topbar)
|
||||
bl_label = "Mesh Options"
|
||||
|
||||
@@ -188,8 +188,8 @@ class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel):
|
||||
|
||||
|
||||
class View3DPaintPanel(UnifiedPaintPanel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'TOOLS'
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
|
||||
|
||||
class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel):
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "abc_object.h"
|
||||
|
||||
class AbcMeshWriter;
|
||||
struct EvaluationContext;
|
||||
struct Main;
|
||||
struct MetaBall;
|
||||
struct Object;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
@@ -18,7 +18,7 @@
|
||||
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
@@ -124,7 +124,7 @@ void BLF_boundbox_ex(int fontid, const char *str, size_t len, struct rctf *box,
|
||||
void BLF_boundbox(int fontid, const char *str, size_t len, struct rctf *box) ATTR_NONNULL();
|
||||
|
||||
/* The next both function return the width and height
|
||||
* of the string, using the current font and both value
|
||||
* of the string, using the current font and both value
|
||||
* are multiplied by the aspect of the font.
|
||||
*/
|
||||
float BLF_width_ex(int fontid, const char *str, size_t len, struct ResultBLF *r_info) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
@@ -17,7 +17,7 @@
|
||||
*
|
||||
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
@@ -18,7 +18,7 @@
|
||||
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
@@ -18,7 +18,7 @@
|
||||
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
@@ -17,7 +17,7 @@
|
||||
*
|
||||
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
@@ -17,7 +17,7 @@
|
||||
*
|
||||
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
@@ -18,7 +18,7 @@
|
||||
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@@ -38,18 +38,18 @@
|
||||
* There are three main mesh data structures in Blender:
|
||||
* #Mesh, #CDDerivedMesh and #BMesh.
|
||||
*
|
||||
* These, and a few others, all implement DerivedMesh interfaces,
|
||||
* which contains unified drawing interfaces, a few utility interfaces,
|
||||
* and a bunch of read-only interfaces intended mostly for conversion from
|
||||
* These, and a few others, all implement DerivedMesh interfaces,
|
||||
* which contains unified drawing interfaces, a few utility interfaces,
|
||||
* and a bunch of read-only interfaces intended mostly for conversion from
|
||||
* one format to another.
|
||||
*
|
||||
* All Mesh structures in blender make use of CustomData, which is used to store
|
||||
* per-element attributes and interpolate them (e.g. uvs, vcols, vgroups, etc).
|
||||
*
|
||||
*
|
||||
* Mesh is the "serialized" structure, used for storing object-mode mesh data
|
||||
* and also for saving stuff to disk. It's interfaces are also what DerivedMesh
|
||||
* uses to communicate with.
|
||||
*
|
||||
*
|
||||
* CDDM is a little mesh library, that uses Mesh data structures in the backend.
|
||||
* It's mostly used for modifiers, and has the advantages of not taking much
|
||||
* resources.
|
||||
@@ -398,19 +398,19 @@ void DM_set_only_copy(DerivedMesh *dm, CustomDataMask mask);
|
||||
* freed, see BKE_customdata.h for the different options
|
||||
*/
|
||||
void DM_add_vert_layer(
|
||||
struct DerivedMesh *dm, int type, int alloctype,
|
||||
struct DerivedMesh *dm, int type, eCDAllocType alloctype,
|
||||
void *layer);
|
||||
void DM_add_edge_layer(
|
||||
struct DerivedMesh *dm, int type, int alloctype,
|
||||
struct DerivedMesh *dm, int type, eCDAllocType alloctype,
|
||||
void *layer);
|
||||
void DM_add_tessface_layer(
|
||||
struct DerivedMesh *dm, int type, int alloctype,
|
||||
struct DerivedMesh *dm, int type, eCDAllocType alloctype,
|
||||
void *layer);
|
||||
void DM_add_loop_layer(
|
||||
DerivedMesh *dm, int type, int alloctype,
|
||||
DerivedMesh *dm, int type, eCDAllocType alloctype,
|
||||
void *layer);
|
||||
void DM_add_poly_layer(
|
||||
struct DerivedMesh *dm, int type, int alloctype,
|
||||
struct DerivedMesh *dm, int type, eCDAllocType alloctype,
|
||||
void *layer);
|
||||
|
||||
/* custom data access functions
|
||||
@@ -534,9 +534,15 @@ void mesh_get_mapped_verts_coords(DerivedMesh *dm, float (*r_cos)[3], const int
|
||||
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,
|
||||
|
@@ -48,6 +48,8 @@ struct Main;
|
||||
|
||||
void animviz_settings_init(struct bAnimVizSettings *avs);
|
||||
|
||||
struct bMotionPath *animviz_copy_motionpath(const struct bMotionPath *mpath_src);
|
||||
|
||||
void animviz_free_motionpath_cache(struct bMotionPath *mpath);
|
||||
void animviz_free_motionpath(struct bMotionPath *mpath);
|
||||
|
||||
|
@@ -33,6 +33,8 @@
|
||||
|
||||
struct AnimData;
|
||||
struct AnimMapper;
|
||||
struct ChannelDriver;
|
||||
struct Depsgraph;
|
||||
struct FCurve;
|
||||
struct ID;
|
||||
struct KS_Path;
|
||||
@@ -173,24 +175,24 @@ void BKE_fcurves_main_cb(struct Main *bmain, ID_FCurve_Edit_Callback func, void
|
||||
/* In general, these ones should be called to do all animation evaluation */
|
||||
|
||||
/* Evaluation loop for evaluating animation data */
|
||||
void BKE_animsys_evaluate_animdata(struct Scene *scene, struct ID *id, struct AnimData *adt, float ctime, short recalc);
|
||||
void BKE_animsys_evaluate_animdata(struct Depsgraph *depsgraph, struct Scene *scene, struct ID *id, struct AnimData *adt, float ctime, short recalc);
|
||||
|
||||
/* Evaluation of all ID-blocks with Animation Data blocks - Animation Data Only */
|
||||
void BKE_animsys_evaluate_all_animation(struct Main *main, struct Scene *scene, float ctime);
|
||||
void BKE_animsys_evaluate_all_animation(struct Main *main, struct Depsgraph *depsgraph, struct Scene *scene, float ctime);
|
||||
|
||||
/* TODO(sergey): This is mainly a temp public function. */
|
||||
bool BKE_animsys_execute_fcurve(struct PointerRNA *ptr, struct AnimMapper *remap, struct FCurve *fcu, float curval);
|
||||
|
||||
/* ------------ Specialized API --------------- */
|
||||
/* There are a few special tools which require these following functions. They are NOT to be used
|
||||
* for standard animation evaluation UNDER ANY CIRCUMSTANCES!
|
||||
* for standard animation evaluation UNDER ANY CIRCUMSTANCES!
|
||||
*
|
||||
* i.e. Pose Library (PoseLib) uses some of these for selectively applying poses, but
|
||||
* i.e. Pose Library (PoseLib) uses some of these for selectively applying poses, but
|
||||
* Particles/Sequencer performing funky time manipulation is not ok.
|
||||
*/
|
||||
|
||||
/* Evaluate Action (F-Curve Bag) */
|
||||
void animsys_evaluate_action(struct PointerRNA *ptr, struct bAction *act, struct AnimMapper *remap, float ctime);
|
||||
void animsys_evaluate_action(struct Depsgraph *depsgraph, struct PointerRNA *ptr, struct bAction *act, struct AnimMapper *remap, float ctime);
|
||||
|
||||
/* Evaluate Action Group */
|
||||
void animsys_evaluate_action_group(struct PointerRNA *ptr, struct bAction *act, struct bActionGroup *agrp, struct AnimMapper *remap, float ctime);
|
||||
@@ -202,7 +204,9 @@ void animsys_evaluate_action_group(struct PointerRNA *ptr, struct bAction *act,
|
||||
struct Depsgraph;
|
||||
|
||||
void BKE_animsys_eval_animdata(struct Depsgraph *depsgraph, struct ID *id);
|
||||
void BKE_animsys_eval_driver(struct Depsgraph *depsgraph, struct ID *id, struct FCurve *fcurve);
|
||||
void BKE_animsys_eval_driver(struct Depsgraph *depsgraph, struct ID *id, int driver_index, struct ChannelDriver *driver_orig);
|
||||
|
||||
void BKE_animsys_update_driver_array(struct ID *id);
|
||||
|
||||
/* ************************************* */
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 280
|
||||
#define BLENDER_SUBVERSION 15
|
||||
#define BLENDER_SUBVERSION 16
|
||||
/* Several breakages with 270, e.g. constraint deg vs rad */
|
||||
#define BLENDER_MINVERSION 270
|
||||
#define BLENDER_MINSUBVERSION 6
|
||||
|
@@ -35,6 +35,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct CacheFile;
|
||||
struct Depsgraph;
|
||||
struct Main;
|
||||
struct Scene;
|
||||
|
||||
@@ -57,7 +58,7 @@ void BKE_cachefile_reload(const struct Main *bmain, struct CacheFile *cache_file
|
||||
|
||||
void BKE_cachefile_ensure_handle(const struct Main *bmain, struct CacheFile *cache_file);
|
||||
|
||||
void BKE_cachefile_update_frame(struct Main *bmain, struct Scene *scene, const float ctime, const float fps);
|
||||
void BKE_cachefile_update_frame(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, const float ctime, const float fps);
|
||||
|
||||
bool BKE_cachefile_filepath_get(
|
||||
const struct Main *bmain, const struct CacheFile *cache_file, float frame,
|
||||
|
@@ -55,7 +55,7 @@ struct DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces,
|
||||
struct DerivedMesh *CDDM_from_mesh(struct Mesh *mesh);
|
||||
|
||||
/* creates a CDDerivedMesh from the given Mesh with custom allocation type. */
|
||||
struct DerivedMesh *CDDM_from_mesh_ex(struct Mesh *mesh, int alloctype, CustomDataMask mask);
|
||||
struct DerivedMesh *CDDM_from_mesh_ex(struct Mesh *mesh, eCDAllocType alloctype, CustomDataMask mask);
|
||||
|
||||
|
||||
struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, const bool use_mdisps);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
|
@@ -67,12 +67,14 @@ extern const CustomDataMask CD_MASK_EVERYTHING;
|
||||
* CD_NUMTYPES elements, that indicate if a layer can be copied. */
|
||||
|
||||
/* add/copy/merge allocation types */
|
||||
#define CD_ASSIGN 0 /* use the data pointer */
|
||||
#define CD_CALLOC 1 /* allocate blank memory */
|
||||
#define CD_DEFAULT 2 /* allocate and set to default */
|
||||
#define CD_REFERENCE 3 /* use data pointers, set layer flag NOFREE */
|
||||
#define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source
|
||||
* has same number of elements */
|
||||
typedef enum eCDAllocType {
|
||||
CD_ASSIGN = 0, /* use the data pointer */
|
||||
CD_CALLOC = 1, /* allocate blank memory */
|
||||
CD_DEFAULT = 2, /* allocate and set to default */
|
||||
CD_REFERENCE = 3, /* use data pointers, set layer flag NOFREE */
|
||||
CD_DUPLICATE = 4, /* do a full copy of all layers, only allowed if source
|
||||
* has same number of elements */
|
||||
} eCDAllocType;
|
||||
|
||||
#define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type))
|
||||
|
||||
@@ -120,16 +122,18 @@ void CustomData_data_add(int type, void *data1, const void *data2);
|
||||
/* initializes a CustomData object with the same layer setup as source.
|
||||
* mask is a bitfield where (mask & (1 << (layer type))) indicates
|
||||
* if a layer should be copied or not. alloctype must be one of the above. */
|
||||
void CustomData_copy(const struct CustomData *source, struct CustomData *dest,
|
||||
CustomDataMask mask, int alloctype, int totelem);
|
||||
void CustomData_copy(
|
||||
const struct CustomData *source, struct CustomData *dest,
|
||||
CustomDataMask mask, eCDAllocType alloctype, int totelem);
|
||||
|
||||
/* BMESH_TODO, not really a public function but readfile.c needs it */
|
||||
void CustomData_update_typemap(struct CustomData *data);
|
||||
|
||||
/* same as the above, except that this will preserve existing layers, and only
|
||||
* add the layers that were not there yet */
|
||||
bool CustomData_merge(const struct CustomData *source, struct CustomData *dest,
|
||||
CustomDataMask mask, int alloctype, int totelem);
|
||||
bool CustomData_merge(
|
||||
const struct CustomData *source, struct CustomData *dest,
|
||||
CustomDataMask mask, eCDAllocType alloctype, int totelem);
|
||||
|
||||
/* Reallocate custom data to a new element count.
|
||||
* Only affects on data layers which are owned by the CustomData itself,
|
||||
@@ -144,7 +148,7 @@ void CustomData_realloc(struct CustomData *data, int totelem);
|
||||
* consistent with the new layout.*/
|
||||
bool CustomData_bmesh_merge(
|
||||
const struct CustomData *source, struct CustomData *dest,
|
||||
CustomDataMask mask, int alloctype, struct BMesh *bm, const char htype);
|
||||
CustomDataMask mask, eCDAllocType alloctype, struct BMesh *bm, const char htype);
|
||||
|
||||
/** NULL's all members and resets the typemap. */
|
||||
void CustomData_reset(struct CustomData *data);
|
||||
@@ -164,11 +168,13 @@ void CustomData_free_temporary(struct CustomData *data, int totelem);
|
||||
* backed by an external data array. the different allocation types are
|
||||
* defined above. returns the data of the layer.
|
||||
*/
|
||||
void *CustomData_add_layer(struct CustomData *data, int type, int alloctype,
|
||||
void *layer, int totelem);
|
||||
void *CustomData_add_layer(
|
||||
struct CustomData *data, int type, eCDAllocType alloctype,
|
||||
void *layer, int totelem);
|
||||
/*same as above but accepts a name */
|
||||
void *CustomData_add_layer_named(struct CustomData *data, int type, int alloctype,
|
||||
void *layer, int totelem, const char *name);
|
||||
void *CustomData_add_layer_named(
|
||||
struct CustomData *data, int type, eCDAllocType alloctype,
|
||||
void *layer, int totelem, const char *name);
|
||||
|
||||
/* frees the active or first data layer with the give type.
|
||||
* returns 1 on success, 0 if no layer with the given type is found
|
||||
|
@@ -84,6 +84,7 @@ enum {
|
||||
LIB_ID_COPY_KEEP_LIB = 1 << 20, /* Keep the library pointer when copying datablock outside of bmain. */
|
||||
LIB_ID_COPY_NO_ANIMDATA = 1 << 21, /* Don't copy id->adt, used by ID datablock localization routines. */
|
||||
LIB_ID_COPY_SHAPEKEY = 1 << 22, /* EXCEPTION! Deep-copy shapekeys used by copied obdata ID. */
|
||||
LIB_ID_COPY_CD_REFERENCE = 1 << 23,
|
||||
};
|
||||
|
||||
void BKE_libblock_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag);
|
||||
@@ -94,8 +95,7 @@ void *BKE_libblock_copy_nolib(const struct ID *id, const bool do_action) ATTR_NO
|
||||
void BKE_libblock_rename(struct Main *bmain, struct ID *id, const char *name) ATTR_NONNULL();
|
||||
void BLI_libblock_ensure_unique_name(struct Main *bmain, const char *name) ATTR_NONNULL();
|
||||
|
||||
struct ID *BKE_libblock_find_name_ex(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
struct ID *BKE_libblock_find_name(const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
struct ID *BKE_libblock_find_name(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
|
||||
/* library_remap.c (keep here since they're general functions) */
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ void BKE_libblock_free_data(struct ID *id, const bool do_id_user) ATTR_NONNULL(
|
||||
|
||||
void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id);
|
||||
void id_lib_extern(struct ID *id);
|
||||
void BKE_library_filepath_set(struct Library *lib, const char *filepath);
|
||||
void BKE_library_filepath_set(struct Main *bmain, struct Library *lib, const char *filepath);
|
||||
void id_us_ensure_real(struct ID *id);
|
||||
void id_us_clear_real(struct ID *id);
|
||||
void id_us_plus_no_lib(struct ID *id);
|
||||
|
@@ -128,8 +128,6 @@ typedef struct Main {
|
||||
ListBase cachefiles;
|
||||
ListBase workspaces;
|
||||
|
||||
char id_tag_update[MAX_LIBARRAY];
|
||||
|
||||
/* Must be generated, used and freed by same code - never assume this is valid data unless you know
|
||||
* when, who and how it was created.
|
||||
* Used by code doing a lot of remapping etc. at once to speed things up. */
|
||||
|
@@ -34,6 +34,9 @@
|
||||
/* defines BLI_INLINE */
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
/* defines CustomDataMask */
|
||||
#include "BKE_customdata.h"
|
||||
|
||||
struct ID;
|
||||
struct BMeshCreateParams;
|
||||
struct BMeshFromMeshParams;
|
||||
@@ -46,9 +49,11 @@ struct LinkNode;
|
||||
struct BLI_Stack;
|
||||
struct MemArena;
|
||||
struct BMesh;
|
||||
struct KeyBlock;
|
||||
struct MLoopTri;
|
||||
struct Main;
|
||||
struct Mesh;
|
||||
struct ModifierData;
|
||||
struct MPoly;
|
||||
struct MLoop;
|
||||
struct MFace;
|
||||
@@ -140,9 +145,9 @@ int BKE_mesh_nurbs_displist_to_mdata(
|
||||
struct MLoop **r_allloop, struct MPoly **r_allpoly,
|
||||
struct MLoopUV **r_alluv, int *r_totloop, int *r_totpoly);
|
||||
void BKE_mesh_from_nurbs_displist(
|
||||
struct Object *ob, struct ListBase *dispbase, const bool use_orco_uv, const char *obdata_name);
|
||||
struct Object *ob, struct ListBase *dispbase, const bool use_orco_uv, const char *obdata_name, bool temporary);
|
||||
void BKE_mesh_from_nurbs(struct Object *ob);
|
||||
void BKE_mesh_to_curve_nurblist(struct DerivedMesh *dm, struct ListBase *nurblist, const int edge_users_test);
|
||||
void BKE_mesh_to_curve_nurblist(const struct Mesh *me, struct ListBase *nurblist, const int edge_users_test);
|
||||
void BKE_mesh_to_curve(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
|
||||
void BKE_mesh_material_index_remove(struct Mesh *me, short index);
|
||||
void BKE_mesh_material_index_clear(struct Mesh *me);
|
||||
@@ -168,6 +173,15 @@ void BKE_mesh_split_faces(struct Mesh *mesh, bool free_loop_normals);
|
||||
struct Mesh *BKE_mesh_new_from_object(
|
||||
struct Depsgraph *depsgraph, struct Main *bmain, struct Scene *sce, struct Object *ob,
|
||||
const bool apply_modifiers, const bool calc_tessface, const bool calc_undeformed);
|
||||
struct Mesh *BKE_mesh_create_derived_for_modifier(
|
||||
struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob,
|
||||
struct ModifierData *md, int build_shapekey_layers);
|
||||
|
||||
/* Copies a nomain-Mesh into an existing Mesh. */
|
||||
void BKE_nomain_mesh_to_mesh(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct Object *ob,
|
||||
CustomDataMask mask, bool take_ownership);
|
||||
void BKE_nomain_mesh_to_meshkey(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct KeyBlock *kb);
|
||||
|
||||
|
||||
/* vertex level transformations & checks (no derived mesh) */
|
||||
|
||||
|
@@ -467,7 +467,7 @@ void test_object_modifiers(struct Object *ob);
|
||||
void modifier_mdef_compact_influences(struct ModifierData *md);
|
||||
|
||||
void modifier_path_init(char *path, int path_maxlen, const char *name);
|
||||
const char *modifier_path_relbase(struct Object *ob);
|
||||
const char *modifier_path_relbase(struct Main *bmain, struct Object *ob);
|
||||
|
||||
|
||||
/* wrappers for modifier callbacks that ensure valid normals */
|
||||
@@ -557,9 +557,8 @@ struct DerivedMesh *modifier_applyModifierEM_DM_deprecated(
|
||||
struct ModifierData *md, const struct ModifierEvalContext *ctx,
|
||||
struct BMEditMesh *editData, struct DerivedMesh *dm);
|
||||
|
||||
struct Mesh *BKE_modifier_get_evaluated_mesh_from_object(
|
||||
const struct ModifierEvalContext *ctx,
|
||||
struct Object *ob);
|
||||
struct Mesh *BKE_modifier_get_evaluated_mesh_from_evaluated_object(
|
||||
struct Object *ob_eval, bool *r_free_mesh);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifndef __BKE_MULTIRES_H__
|
||||
#define __BKE_MULTIRES_H__
|
||||
|
@@ -87,7 +87,7 @@ struct bNodeInstanceHash;
|
||||
|
||||
/** Compact definition of a node socket.
|
||||
* Can be used to quickly define a list of static sockets for a node,
|
||||
* which are added to each new node of that type.
|
||||
* which are added to each new node of that type.
|
||||
*
|
||||
* \deprecated This struct is used by C nodes to define templates as simple
|
||||
* static struct lists. These are converted to the new template collections
|
||||
@@ -345,7 +345,7 @@ void ntreeUserIncrefID(struct bNodeTree *ntree);
|
||||
void ntreeUserDecrefID(struct bNodeTree *ntree);
|
||||
|
||||
|
||||
struct bNodeTree *ntreeFromID(struct ID *id);
|
||||
struct bNodeTree *ntreeFromID(const struct ID *id);
|
||||
|
||||
void ntreeMakeLocal(struct Main *bmain, struct bNodeTree *ntree, bool id_in_mainlist, const bool lib_local);
|
||||
struct bNode *ntreeFindType(const struct bNodeTree *ntree, int type);
|
||||
|
@@ -78,13 +78,15 @@ void BKE_object_free_modifiers(struct Object *ob, const int flag);
|
||||
void BKE_object_make_proxy(struct Object *ob, struct Object *target, struct Object *gob);
|
||||
void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target);
|
||||
|
||||
bool BKE_object_exists_check(const struct Object *obtest);
|
||||
bool BKE_object_exists_check(struct Main *bmain, const struct Object *obtest);
|
||||
bool BKE_object_is_in_editmode(const struct Object *ob);
|
||||
bool BKE_object_is_in_editmode_vgroup(const struct Object *ob);
|
||||
bool BKE_object_is_in_wpaint_select_vert(const struct Object *ob);
|
||||
bool BKE_object_has_mode_data(const struct Object *ob, eObjectMode object_mode);
|
||||
bool BKE_object_is_mode_compat(const struct Object *ob, eObjectMode object_mode);
|
||||
|
||||
bool BKE_object_data_is_in_editmode(const struct ID *id);
|
||||
|
||||
typedef enum eObjectVisibilityCheck {
|
||||
OB_VISIBILITY_CHECK_FOR_VIEWPORT,
|
||||
OB_VISIBILITY_CHECK_FOR_RENDER,
|
||||
@@ -293,6 +295,8 @@ void BKE_object_data_relink(struct Object *ob);
|
||||
|
||||
struct MovieClip *BKE_object_movieclip_get(struct Scene *scene, struct Object *ob, bool use_default);
|
||||
|
||||
void BKE_object_runtime_reset(struct Object *object);
|
||||
|
||||
/* this function returns a superset of the scenes selection based on relationships */
|
||||
|
||||
typedef enum eObRelationTypes {
|
||||
|
@@ -52,21 +52,25 @@ void packAll(struct Main *bmain, struct ReportList *reports, bool verbose);
|
||||
void packLibraries(struct Main *bmain, struct ReportList *reports);
|
||||
|
||||
/* unpack */
|
||||
char *unpackFile(struct ReportList *reports, const char *abs_name, const char *local_name, struct PackedFile *pf, int how);
|
||||
int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how);
|
||||
char *unpackFile(
|
||||
struct ReportList *reports, const char *ref_file_name,
|
||||
const char *abs_name, const char *local_name, struct PackedFile *pf, int how);
|
||||
int unpackVFont(struct Main *bmain, struct ReportList *reports, struct VFont *vfont, int how);
|
||||
int unpackSound(struct Main *bmain, struct ReportList *reports, struct bSound *sound, int how);
|
||||
int unpackImage(struct ReportList *reports, struct Image *ima, int how);
|
||||
int unpackImage(struct Main *bmain, struct ReportList *reports, struct Image *ima, int how);
|
||||
void unpackAll(struct Main *bmain, struct ReportList *reports, int how);
|
||||
int unpackLibraries(struct Main *bmain, struct ReportList *reports);
|
||||
|
||||
int writePackedFile(struct ReportList *reports, const char *filename, struct PackedFile *pf, int guimode);
|
||||
int writePackedFile(
|
||||
struct ReportList *reports, const char *ref_file_name,
|
||||
const char *filename, struct PackedFile *pf, const bool guimode);
|
||||
|
||||
/* free */
|
||||
void freePackedFile(struct PackedFile *pf);
|
||||
|
||||
/* info */
|
||||
int countPackedFiles(struct Main *bmain);
|
||||
int checkPackedFile(const char *filename, struct PackedFile *pf);
|
||||
int checkPackedFile(const char *ref_file_name, const char *filename, struct PackedFile *pf);
|
||||
|
||||
/* read */
|
||||
int seekPackedFile(struct PackedFile *pf, int offset, int whence);
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifndef __BKE_PAINT_H__
|
||||
#define __BKE_PAINT_H__
|
||||
|
@@ -94,6 +94,7 @@ void BKE_sequence_iterator_end(SeqIterator *iter);
|
||||
|
||||
typedef struct SeqRenderData {
|
||||
struct Main *bmain;
|
||||
struct Depsgraph *depsgraph;
|
||||
struct Scene *scene;
|
||||
int rectx;
|
||||
int recty;
|
||||
@@ -113,7 +114,7 @@ typedef struct SeqRenderData {
|
||||
} SeqRenderData;
|
||||
|
||||
void BKE_sequencer_new_render_data(
|
||||
struct Main *bmain, struct Scene *scene,
|
||||
struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene,
|
||||
int rectx, int recty, int preview_render_size,
|
||||
int for_render,
|
||||
SeqRenderData *r_context);
|
||||
@@ -251,7 +252,7 @@ struct StripElem *BKE_sequencer_give_stripelem(struct Sequence *seq, int cfra);
|
||||
void BKE_sequencer_update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_seq, int len_change, int ibuf_change);
|
||||
bool BKE_sequencer_input_have_to_preprocess(const SeqRenderData *context, struct Sequence *seq, float cfra);
|
||||
|
||||
void BKE_sequencer_proxy_rebuild_context(struct Main *bmain, struct Scene *scene, struct Sequence *seq, struct GSet *file_list, ListBase *queue);
|
||||
void BKE_sequencer_proxy_rebuild_context(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Sequence *seq, struct GSet *file_list, ListBase *queue);
|
||||
void BKE_sequencer_proxy_rebuild(struct SeqIndexBuildContext *context, short *stop, short *do_update, float *progress);
|
||||
void BKE_sequencer_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop);
|
||||
|
||||
|
@@ -78,7 +78,7 @@ typedef struct ShrinkwrapCalcData {
|
||||
} ShrinkwrapCalcData;
|
||||
|
||||
void shrinkwrapModifier_deform(struct ShrinkwrapModifierData *smd, struct Object *ob, struct Mesh *mesh,
|
||||
float (*vertexCos)[3], int numVerts, const struct ModifierEvalContext *ctx);
|
||||
float (*vertexCos)[3], int numVerts);
|
||||
|
||||
/*
|
||||
* This function casts a ray in the given BVHTree.. but it takes into consideration the space_transform, that is:
|
||||
|
@@ -716,7 +716,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob, CustomDataMask mask, bool
|
||||
Mesh tmp = *me;
|
||||
int totvert, totedge /*, totface */ /* UNUSED */, totloop, totpoly;
|
||||
int did_shapekeys = 0;
|
||||
int alloctype = CD_DUPLICATE;
|
||||
eCDAllocType alloctype = CD_DUPLICATE;
|
||||
|
||||
if (take_ownership && dm->type == DM_TYPE_CDDM && dm->needsFree) {
|
||||
bool has_any_referenced_layers =
|
||||
@@ -911,27 +911,27 @@ static void mesh_set_only_copy(Mesh *mesh, CustomDataMask mask)
|
||||
#endif
|
||||
}
|
||||
|
||||
void DM_add_vert_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_vert_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->vertData, type, alloctype, layer, dm->numVertData);
|
||||
}
|
||||
|
||||
void DM_add_edge_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_edge_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->edgeData, type, alloctype, layer, dm->numEdgeData);
|
||||
}
|
||||
|
||||
void DM_add_tessface_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_tessface_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->faceData, type, alloctype, layer, dm->numTessFaceData);
|
||||
}
|
||||
|
||||
void DM_add_loop_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_loop_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->loopData, type, alloctype, layer, dm->numLoopData);
|
||||
}
|
||||
|
||||
void DM_add_poly_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_poly_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->polyData, type, alloctype, layer, dm->numPolyData);
|
||||
}
|
||||
@@ -1294,7 +1294,11 @@ static Mesh *create_orco_mesh(Object *ob, Mesh *me, BMEditMesh *em, int layer)
|
||||
else {
|
||||
BKE_id_copy_ex(
|
||||
NULL, &me->id, (ID **)&mesh,
|
||||
LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG, false);
|
||||
(LIB_ID_CREATE_NO_MAIN |
|
||||
LIB_ID_CREATE_NO_USER_REFCOUNT |
|
||||
LIB_ID_CREATE_NO_DEG_TAG |
|
||||
LIB_ID_COPY_CD_REFERENCE),
|
||||
false);
|
||||
}
|
||||
|
||||
orco = get_orco_coords_dm(ob, em, layer, &free);
|
||||
@@ -2125,7 +2129,11 @@ static void mesh_calc_modifiers(
|
||||
if (r_deform_mesh) {
|
||||
BKE_id_copy_ex(
|
||||
NULL, &me->id, (ID **)r_deform_mesh,
|
||||
LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG, false);
|
||||
(LIB_ID_CREATE_NO_MAIN |
|
||||
LIB_ID_CREATE_NO_USER_REFCOUNT |
|
||||
LIB_ID_CREATE_NO_DEG_TAG |
|
||||
LIB_ID_COPY_CD_REFERENCE),
|
||||
false);
|
||||
|
||||
/* XXX: Is build_shapekey_layers ever even true? This should have crashed long ago... */
|
||||
BLI_assert(!build_shapekey_layers);
|
||||
@@ -2268,7 +2276,11 @@ static void mesh_calc_modifiers(
|
||||
else {
|
||||
BKE_id_copy_ex(
|
||||
NULL, &me->id, (ID **)&mesh,
|
||||
LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG, false);
|
||||
(LIB_ID_CREATE_NO_MAIN |
|
||||
LIB_ID_CREATE_NO_USER_REFCOUNT |
|
||||
LIB_ID_CREATE_NO_DEG_TAG |
|
||||
LIB_ID_COPY_CD_REFERENCE),
|
||||
false);
|
||||
ASSERT_IS_VALID_MESH(mesh);
|
||||
|
||||
// XXX: port to Mesh if build_shapekey_layers can ever be true
|
||||
@@ -2439,7 +2451,11 @@ static void mesh_calc_modifiers(
|
||||
else {
|
||||
BKE_id_copy_ex(
|
||||
NULL, &me->id, (ID **)&final_mesh,
|
||||
LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG, false);
|
||||
(LIB_ID_CREATE_NO_MAIN |
|
||||
LIB_ID_CREATE_NO_USER_REFCOUNT |
|
||||
LIB_ID_CREATE_NO_DEG_TAG |
|
||||
LIB_ID_COPY_CD_REFERENCE),
|
||||
false);
|
||||
|
||||
//if (build_shapekey_layers) {
|
||||
// add_shapekey_layers(final_mesh, me, ob);
|
||||
@@ -2916,6 +2932,52 @@ static bool calc_modifiers_skip_orco(Depsgraph *depsgraph,
|
||||
}
|
||||
#endif
|
||||
|
||||
static void mesh_finalize_eval(Object *object)
|
||||
{
|
||||
Mesh *mesh = (Mesh *)object->data;
|
||||
Mesh *mesh_eval = object->runtime.mesh_eval;
|
||||
/* Special Tweaks for cases when evaluated mesh came from
|
||||
* BKE_mesh_new_nomain_from_template().
|
||||
*/
|
||||
BLI_strncpy(mesh_eval->id.name, mesh->id.name, sizeof(mesh_eval->id.name));
|
||||
if (mesh_eval->mat != NULL) {
|
||||
MEM_freeN(mesh_eval->mat);
|
||||
}
|
||||
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.
|
||||
*/
|
||||
mesh_eval->flag |= (mesh->flag & ME_AUTOSMOOTH);
|
||||
mesh_eval->smoothresh = mesh->smoothresh;
|
||||
/* Replace evaluated object's data with fully evaluated mesh. */
|
||||
/* TODO(sergey): There was statement done by Sybren and Mai that this
|
||||
* caused modifiers to be applied twice. which is weirtd and shouldn't
|
||||
* really happen. But since there is no reference to the report, can not
|
||||
* do much about this.
|
||||
*/
|
||||
|
||||
/* Object is sometimes not evaluated!
|
||||
* TODO(sergey): BAD TEMPORARY HACK FOR UNTIL WE ARE SMARTER */
|
||||
if (object->id.tag & LIB_TAG_COPY_ON_WRITE) {
|
||||
object->data = mesh_eval;
|
||||
}
|
||||
else {
|
||||
/* evaluated will be available via: 'object->runtime.mesh_eval' */
|
||||
}
|
||||
}
|
||||
|
||||
static void mesh_build_data(
|
||||
struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask,
|
||||
const bool build_shapekey_layers, const bool need_mapping)
|
||||
@@ -2931,12 +2993,21 @@ static void mesh_build_data(
|
||||
}
|
||||
#endif
|
||||
|
||||
mesh_calc_modifiers_dm(
|
||||
mesh_calc_modifiers(
|
||||
depsgraph, scene, ob, NULL, 1, need_mapping, dataMask, -1, true, build_shapekey_layers,
|
||||
true,
|
||||
&ob->derivedDeform, &ob->derivedFinal);
|
||||
&ob->runtime.mesh_deform_eval, &ob->runtime.mesh_eval);
|
||||
|
||||
mesh_finalize_eval(ob);
|
||||
|
||||
ob->derivedDeform = CDDM_from_mesh_ex(ob->runtime.mesh_deform_eval, CD_REFERENCE, CD_MASK_MESH);
|
||||
ob->derivedFinal = CDDM_from_mesh_ex(ob->runtime.mesh_eval, CD_REFERENCE, CD_MASK_MESH);
|
||||
|
||||
DM_set_object_boundbox(ob, ob->derivedFinal);
|
||||
/* TODO(sergey): Convert bounding box calculation to use mesh, then
|
||||
* we can skip this copy.
|
||||
*/
|
||||
BKE_mesh_texspace_copy_from_object(ob->runtime.mesh_eval, ob);
|
||||
|
||||
ob->derivedFinal->needsFree = 0;
|
||||
ob->derivedDeform->needsFree = 0;
|
||||
@@ -3037,6 +3108,7 @@ void makeDerivedMesh(
|
||||
|
||||
/***/
|
||||
|
||||
/* Deprecated DM, use: 'mesh_get_eval_final'. */
|
||||
DerivedMesh *mesh_get_derived_final(
|
||||
struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
|
||||
{
|
||||
@@ -3056,7 +3128,27 @@ DerivedMesh *mesh_get_derived_final(
|
||||
if (ob->derivedFinal) { BLI_assert(!(ob->derivedFinal->dirty & DM_DIRTY_NORMALS)); }
|
||||
return ob->derivedFinal;
|
||||
}
|
||||
Mesh *mesh_get_eval_final(
|
||||
struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
|
||||
{
|
||||
/* if there's no evaluated mesh or the last data mask used doesn't include
|
||||
* the data we need, rebuild the derived mesh
|
||||
*/
|
||||
bool need_mapping;
|
||||
dataMask |= object_get_datamask(depsgraph, ob, &need_mapping);
|
||||
|
||||
if (!ob->derivedFinal ||
|
||||
((dataMask & ob->lastDataMask) != dataMask) ||
|
||||
(need_mapping != ob->lastNeedMapping))
|
||||
{
|
||||
mesh_build_data(depsgraph, scene, ob, dataMask, false, need_mapping);
|
||||
}
|
||||
|
||||
if (ob->runtime.mesh_eval) { BLI_assert(!(ob->runtime.mesh_eval->runtime.cd_dirty_vert & CD_MASK_NORMAL)); }
|
||||
return ob->runtime.mesh_eval;
|
||||
}
|
||||
|
||||
/* Deprecated DM, use: 'mesh_get_eval_deform' instead. */
|
||||
DerivedMesh *mesh_get_derived_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
|
||||
@@ -3075,6 +3167,25 @@ DerivedMesh *mesh_get_derived_deform(struct Depsgraph *depsgraph, Scene *scene,
|
||||
|
||||
return ob->derivedDeform;
|
||||
}
|
||||
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
|
||||
* the data we need, rebuild the derived mesh
|
||||
*/
|
||||
bool need_mapping;
|
||||
|
||||
dataMask |= object_get_datamask(depsgraph, ob, &need_mapping);
|
||||
|
||||
if (!ob->runtime.mesh_deform_eval ||
|
||||
((dataMask & ob->lastDataMask) != dataMask) ||
|
||||
(need_mapping != ob->lastNeedMapping))
|
||||
{
|
||||
mesh_build_data(depsgraph, scene, ob, dataMask, false, need_mapping);
|
||||
}
|
||||
|
||||
return ob->runtime.mesh_deform_eval;
|
||||
}
|
||||
|
||||
|
||||
DerivedMesh *mesh_create_derived_render(struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
|
||||
{
|
||||
|
@@ -265,7 +265,7 @@ bActionGroup *action_groups_add_new(bAction *act, const char name[])
|
||||
|
||||
/* Add given channel into (active) group
|
||||
* - assumes that channel is not linked to anything anymore
|
||||
* - always adds at the end of the group
|
||||
* - always adds at the end of the group
|
||||
*/
|
||||
void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve)
|
||||
{
|
||||
@@ -582,7 +582,9 @@ void BKE_pose_copy_data_ex(bPose **dst, const bPose *src, const int flag, const
|
||||
if (copy_constraints) {
|
||||
BKE_constraints_copy_ex(&listb, &pchan->constraints, flag, true); // BKE_constraints_copy NULLs listb
|
||||
pchan->constraints = listb;
|
||||
pchan->mpath = NULL; /* motion paths should not get copied yet... */
|
||||
|
||||
/* XXX: This is needed for motionpath drawing to work. Dunno why it was setting to null before... */
|
||||
pchan->mpath = animviz_copy_motionpath(pchan->mpath);
|
||||
}
|
||||
|
||||
if (pchan->prop) {
|
||||
@@ -912,7 +914,7 @@ void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_f
|
||||
|
||||
|
||||
/* checks for IK constraint, Spline IK, and also for Follow-Path constraint.
|
||||
* can do more constraints flags later
|
||||
* can do more constraints flags later
|
||||
*/
|
||||
/* pose should be entirely OK */
|
||||
void BKE_pose_update_constraint_flags(bPose *pose)
|
||||
@@ -1386,7 +1388,7 @@ void BKE_pose_tag_recalc(Main *bmain, bPose *pose)
|
||||
}
|
||||
|
||||
/* For the calculation of the effects of an Action at the given frame on an object
|
||||
* This is currently only used for the Action Constraint
|
||||
* This is currently only used for the Action Constraint
|
||||
*/
|
||||
void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, char groupname[], float cframe)
|
||||
{
|
||||
@@ -1452,7 +1454,7 @@ void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, c
|
||||
adt.action = act;
|
||||
|
||||
/* execute effects of Action on to workob (or it's PoseChannels) */
|
||||
BKE_animsys_evaluate_animdata(NULL, &workob->id, &adt, cframe, ADT_RECALC_ANIM);
|
||||
BKE_animsys_evaluate_animdata(NULL, NULL, &workob->id, &adt, cframe, ADT_RECALC_ANIM);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_dlrbTree.h"
|
||||
|
||||
#include "BLT_translation.h"
|
||||
|
||||
@@ -44,6 +45,7 @@
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
#include "BKE_anim.h"
|
||||
#include "BKE_animsys.h"
|
||||
#include "BKE_action.h"
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_curve.h"
|
||||
@@ -59,7 +61,12 @@
|
||||
#include "DEG_depsgraph_query.h"
|
||||
#include "DEG_depsgraph_build.h"
|
||||
|
||||
#include "GPU_batch.h"
|
||||
|
||||
// XXX bad level call...
|
||||
extern short compare_ak_cfraPtr(void *node, void *data);
|
||||
extern void agroup_to_keylist(struct AnimData *adt, struct bActionGroup *agrp, struct DLRBT_Tree *keys, struct DLRBT_Tree *blocks);
|
||||
extern void action_to_keylist(struct AnimData *adt, struct bAction *act, struct DLRBT_Tree *keys, struct DLRBT_Tree *blocks);
|
||||
|
||||
/* --------------------- */
|
||||
/* forward declarations */
|
||||
@@ -106,6 +113,10 @@ void animviz_free_motionpath_cache(bMotionPath *mpath)
|
||||
/* free the path if necessary */
|
||||
if (mpath->points)
|
||||
MEM_freeN(mpath->points);
|
||||
|
||||
GWN_VERTBUF_DISCARD_SAFE(mpath->points_vbo);
|
||||
GWN_BATCH_DISCARD_SAFE(mpath->batch_line);
|
||||
GWN_BATCH_DISCARD_SAFE(mpath->batch_points);
|
||||
|
||||
/* reset the relevant parameters */
|
||||
mpath->points = NULL;
|
||||
@@ -130,6 +141,27 @@ void animviz_free_motionpath(bMotionPath *mpath)
|
||||
|
||||
/* ------------------- */
|
||||
|
||||
/* Make a copy of motionpath data, so that viewing with copy on write works */
|
||||
bMotionPath *animviz_copy_motionpath(const bMotionPath *mpath_src)
|
||||
{
|
||||
bMotionPath *mpath_dst;
|
||||
|
||||
if (mpath_src == NULL)
|
||||
return NULL;
|
||||
|
||||
mpath_dst = MEM_dupallocN(mpath_src);
|
||||
mpath_dst->points = MEM_dupallocN(mpath_src->points);
|
||||
|
||||
/* should get recreated on draw... */
|
||||
mpath_dst->points_vbo = NULL;
|
||||
mpath_dst->batch_line = NULL;
|
||||
mpath_dst->batch_points = NULL;
|
||||
|
||||
return mpath_dst;
|
||||
}
|
||||
|
||||
/* ------------------- */
|
||||
|
||||
/**
|
||||
* Setup motion paths for the given data.
|
||||
* \note Only used when explicitly calculating paths on bones which may/may not be consider already
|
||||
@@ -212,7 +244,7 @@ bMotionPath *animviz_verify_motionpaths(ReportList *reports, Scene *scene, Objec
|
||||
mpath->color[1] = 0.0;
|
||||
mpath->color[2] = 0.0;
|
||||
|
||||
mpath->line_thickness = 1;
|
||||
mpath->line_thickness = 2;
|
||||
mpath->flag |= MOTIONPATH_FLAG_LINES; /* draw lines by default */
|
||||
|
||||
/* allocate a cache */
|
||||
@@ -232,6 +264,8 @@ typedef struct MPathTarget {
|
||||
struct MPathTarget *next, *prev;
|
||||
|
||||
bMotionPath *mpath; /* motion path in question */
|
||||
|
||||
DLRBT_Tree keys; /* temp, to know where the keyframes are */
|
||||
|
||||
/* Original (Source Objects) */
|
||||
Object *ob; /* source object */
|
||||
@@ -344,6 +378,13 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
|
||||
/* worldspace object location */
|
||||
copy_v3_v3(mpv->co, ob_eval->obmat[3]);
|
||||
}
|
||||
|
||||
float mframe = (float)(CFRA);
|
||||
|
||||
/* Tag if it's a keyframe */
|
||||
if (BLI_dlrbTree_search_exact(&mpt->keys, compare_ak_cfraPtr, &mframe)) {
|
||||
mpv->flag |= MOTIONPATH_VERT_KEY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,13 +428,44 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
|
||||
if (mpt->pchan) {
|
||||
mpt->pchan_eval = BKE_pose_channel_find_name(mpt->ob_eval->pose, mpt->pchan->name);
|
||||
}
|
||||
|
||||
AnimData *adt = BKE_animdata_from_id(&mpt->ob_eval->id);
|
||||
|
||||
/* build list of all keyframes in active action for object or pchan */
|
||||
BLI_dlrbTree_init(&mpt->keys);
|
||||
|
||||
if (adt) {
|
||||
bAnimVizSettings *avs;
|
||||
|
||||
/* get pointer to animviz settings for each target */
|
||||
if (mpt->pchan)
|
||||
avs = &mpt->ob->pose->avs;
|
||||
else
|
||||
avs = &mpt->ob->avs;
|
||||
|
||||
/* it is assumed that keyframes for bones are all grouped in a single group
|
||||
* unless an option is set to always use the whole action
|
||||
*/
|
||||
if ((mpt->pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT) == 0) {
|
||||
bActionGroup *agrp = BKE_action_group_find_name(adt->action, mpt->pchan->name);
|
||||
|
||||
if (agrp) {
|
||||
agroup_to_keylist(adt, agrp, &mpt->keys, NULL);
|
||||
BLI_dlrbTree_linkedlist_sync(&mpt->keys);
|
||||
}
|
||||
}
|
||||
else {
|
||||
action_to_keylist(adt, adt->action, &mpt->keys, NULL);
|
||||
BLI_dlrbTree_linkedlist_sync(&mpt->keys);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* calculate path over requested range */
|
||||
for (CFRA = sfra; CFRA <= efra; CFRA++) {
|
||||
/* update relevant data for new frame */
|
||||
motionpaths_calc_update_scene(bmain, depsgraph);
|
||||
|
||||
|
||||
/* perform baking for targets */
|
||||
motionpaths_calc_bake_targets(scene, targets);
|
||||
}
|
||||
@@ -406,6 +478,7 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
|
||||
/* clear recalc flags from targets */
|
||||
for (mpt = targets->first; mpt; mpt = mpt->next) {
|
||||
bAnimVizSettings *avs;
|
||||
bMotionPath *mpath = mpt->mpath;
|
||||
|
||||
/* get pointer to animviz settings for each target */
|
||||
if (mpt->pchan)
|
||||
@@ -415,6 +488,14 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
|
||||
|
||||
/* clear the flag requesting recalculation of targets */
|
||||
avs->recalc &= ~ANIMVIZ_RECALC_PATHS;
|
||||
|
||||
/* Clean temp data */
|
||||
BLI_dlrbTree_free(&mpt->keys);
|
||||
|
||||
/* Free previous batches to force update. */
|
||||
GWN_VERTBUF_DISCARD_SAFE(mpath->points_vbo);
|
||||
GWN_BATCH_DISCARD_SAFE(mpath->batch_line);
|
||||
GWN_BATCH_DISCARD_SAFE(mpath->batch_points);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -104,6 +104,7 @@ bool id_type_can_have_animdata(const short id_type)
|
||||
case ID_MSK:
|
||||
case ID_GD:
|
||||
case ID_CF:
|
||||
case ID_GR:
|
||||
return true;
|
||||
|
||||
/* no AnimData */
|
||||
@@ -141,7 +142,7 @@ AnimData *BKE_animdata_from_id(ID *id)
|
||||
|
||||
/* Add AnimData to the given ID-block. In order for this to work, we assume that
|
||||
* the AnimData pointer is stored immediately after the given ID-block in the struct,
|
||||
* as per IdAdtTemplate. Also note that
|
||||
* as per IdAdtTemplate. Also note that
|
||||
*/
|
||||
AnimData *BKE_animdata_add_id(ID *id)
|
||||
{
|
||||
@@ -250,6 +251,9 @@ void BKE_animdata_free(ID *id, const bool do_id_user)
|
||||
|
||||
/* free drivers - stored as a list of F-Curves */
|
||||
free_fcurves(&adt->drivers);
|
||||
|
||||
/* free driver array cache */
|
||||
MEM_SAFE_FREE(adt->driver_array);
|
||||
|
||||
/* free overrides */
|
||||
/* TODO... */
|
||||
@@ -289,6 +293,7 @@ AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const bool do_action, co
|
||||
|
||||
/* duplicate drivers (F-Curves) */
|
||||
copy_fcurves(&dadt->drivers, &adt->drivers);
|
||||
dadt->driver_array = NULL;
|
||||
|
||||
/* don't copy overrides */
|
||||
BLI_listbase_clear(&dadt->overrides);
|
||||
@@ -419,8 +424,8 @@ static bool animpath_matches_basepath(const char path[], const char basepath[])
|
||||
}
|
||||
|
||||
/* Move F-Curves in src action to dst action, setting up all the necessary groups
|
||||
* for this to happen, but only if the F-Curves being moved have the appropriate
|
||||
* "base path".
|
||||
* for this to happen, but only if the F-Curves being moved have the appropriate
|
||||
* "base path".
|
||||
* - This is used when data moves from one datablock to another, causing the
|
||||
* F-Curves to need to be moved over too
|
||||
*/
|
||||
@@ -1131,6 +1136,9 @@ void BKE_animdata_main_cb(Main *mainptr, ID_AnimData_Edit_Callback func, void *u
|
||||
/* masks */
|
||||
ANIMDATA_IDS_CB(mainptr->mask.first);
|
||||
|
||||
/* collections */
|
||||
ANIMDATA_IDS_CB(mainptr->collection.first);
|
||||
|
||||
/* worlds */
|
||||
ANIMDATA_NODETREE_IDS_CB(mainptr->world.first, World);
|
||||
|
||||
@@ -1230,6 +1238,9 @@ void BKE_animdata_fix_paths_rename_all(ID *ref_id, const char *prefix, const cha
|
||||
/* worlds */
|
||||
RENAMEFIX_ANIM_NODETREE_IDS(mainptr->world.first, World);
|
||||
|
||||
/* collections */
|
||||
RENAMEFIX_ANIM_IDS(mainptr->collection.first);
|
||||
|
||||
/* linestyles */
|
||||
RENAMEFIX_ANIM_IDS(mainptr->linestyle.first);
|
||||
|
||||
@@ -1698,60 +1709,46 @@ bool BKE_animsys_execute_fcurve(PointerRNA *ptr, AnimMapper *remap, FCurve *fcu,
|
||||
return ok;
|
||||
}
|
||||
|
||||
/* Evaluate all the F-Curves in the given list
|
||||
* This performs a set of standard checks. If extra checks are required, separate code should be used
|
||||
*/
|
||||
static void animsys_evaluate_fcurves(PointerRNA *ptr, ListBase *list, AnimMapper *remap, float ctime, short recalc)
|
||||
static void animsys_write_orig_anim_rna(
|
||||
PointerRNA *ptr,
|
||||
AnimMapper *remap,
|
||||
FCurve *fcu,
|
||||
float value)
|
||||
{
|
||||
FCurve *fcu;
|
||||
|
||||
/* Pointer is expected to be an ID pointer, if it's not -- we are doomed. */
|
||||
PointerRNA orig_ptr = *ptr;
|
||||
orig_ptr.id.data = ((ID *)orig_ptr.id.data)->orig_id;
|
||||
orig_ptr.data = orig_ptr.id.data;
|
||||
PathResolvedRNA orig_anim_rna;
|
||||
/* TODO(sergey): Is there a faster way to get anim_rna of original ID? */
|
||||
if (animsys_store_rna_setting(&orig_ptr, remap, fcu->rna_path, fcu->array_index, &orig_anim_rna)) {
|
||||
animsys_write_rna_setting(&orig_anim_rna, value);
|
||||
}
|
||||
}
|
||||
|
||||
const bool copy_on_write = orig_ptr.id.data != NULL;
|
||||
|
||||
/* calculate then execute each curve */
|
||||
for (fcu = list->first; fcu; fcu = fcu->next) {
|
||||
/* check if this F-Curve doesn't belong to a muted group */
|
||||
if ((fcu->grp == NULL) || (fcu->grp->flag & AGRP_MUTED) == 0) {
|
||||
/* check if this curve should be skipped */
|
||||
if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) {
|
||||
PathResolvedRNA anim_rna;
|
||||
/* Read current value from original datablock. */
|
||||
float dna_val;
|
||||
|
||||
if (copy_on_write) {
|
||||
if (animsys_store_rna_setting(&orig_ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
|
||||
if (!animsys_read_rna_setting(&anim_rna, &dna_val)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (animsys_store_rna_setting(ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
|
||||
if (copy_on_write) {
|
||||
const bool check_orig_dna = ((recalc & ADT_RECALC_CHECK_ORIG_DNA) != 0);
|
||||
/* If we are tweaking DNA without changing frame, we don't write f-curves,
|
||||
* since otherwise we will not be able to change properties which has animation.
|
||||
*/
|
||||
if (check_orig_dna && fcu->orig_dna_val != dna_val) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const float curval = calculate_fcurve(&anim_rna, fcu, ctime);
|
||||
animsys_write_rna_setting(&anim_rna, curval);
|
||||
|
||||
if (copy_on_write) {
|
||||
/* Store original DNA value f-curve was written for. */
|
||||
fcu->orig_dna_val = dna_val;
|
||||
}
|
||||
}
|
||||
/* Evaluate all the F-Curves in the given list
|
||||
* This performs a set of standard checks. If extra checks are required, separate code should be used
|
||||
*/
|
||||
static void animsys_evaluate_fcurves(
|
||||
Depsgraph *depsgraph, PointerRNA *ptr, ListBase *list, AnimMapper *remap, float ctime)
|
||||
{
|
||||
const bool is_active_depsgraph = DEG_is_active(depsgraph);
|
||||
/* Calculate then execute each curve. */
|
||||
for (FCurve *fcu = list->first; fcu; fcu = fcu->next) {
|
||||
/* Check if this F-Curve doesn't belong to a muted group. */
|
||||
if ((fcu->grp != NULL) && (fcu->grp->flag & AGRP_MUTED)) {
|
||||
continue;
|
||||
}
|
||||
/* Check if this curve should be skipped. */
|
||||
if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED))) {
|
||||
continue;
|
||||
}
|
||||
PathResolvedRNA anim_rna;
|
||||
if (animsys_store_rna_setting(ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
|
||||
const float curval = calculate_fcurve(&anim_rna, fcu, ctime);
|
||||
animsys_write_rna_setting(&anim_rna, curval);
|
||||
if (is_active_depsgraph) {
|
||||
animsys_write_orig_anim_rna(ptr, remap, fcu, curval);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1863,7 +1860,8 @@ void animsys_evaluate_action_group(PointerRNA *ptr, bAction *act, bActionGroup *
|
||||
}
|
||||
|
||||
/* Evaluate Action (F-Curve Bag) */
|
||||
static void animsys_evaluate_action_ex(PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime, short recalc)
|
||||
static void animsys_evaluate_action_ex(
|
||||
Depsgraph *depsgraph, PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime)
|
||||
{
|
||||
/* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */
|
||||
if (act == NULL) return;
|
||||
@@ -1872,12 +1870,12 @@ static void animsys_evaluate_action_ex(PointerRNA *ptr, bAction *act, AnimMapper
|
||||
action_idcode_patch_check(ptr->id.data, act);
|
||||
|
||||
/* calculate then execute each curve */
|
||||
animsys_evaluate_fcurves(ptr, &act->curves, remap, ctime, recalc);
|
||||
animsys_evaluate_fcurves(depsgraph, ptr, &act->curves, remap, ctime);
|
||||
}
|
||||
|
||||
void animsys_evaluate_action(PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime)
|
||||
void animsys_evaluate_action(Depsgraph *depsgraph, PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime)
|
||||
{
|
||||
animsys_evaluate_action_ex(ptr, act, remap, ctime, 0);
|
||||
animsys_evaluate_action_ex(depsgraph, ptr, act, remap, ctime);
|
||||
}
|
||||
|
||||
/* ***************************************** */
|
||||
@@ -1906,7 +1904,7 @@ static float nlastrip_get_influence(NlaStrip *strip, float cframe)
|
||||
}
|
||||
|
||||
/* evaluate the evaluation time and influence for the strip, storing the results in the strip */
|
||||
static void nlastrip_evaluate_controls(NlaStrip *strip, float ctime)
|
||||
static void nlastrip_evaluate_controls(Depsgraph *depsgraph, NlaStrip *strip, float ctime)
|
||||
{
|
||||
/* now strip's evaluate F-Curves for these settings (if applicable) */
|
||||
if (strip->fcurves.first) {
|
||||
@@ -1916,7 +1914,7 @@ static void nlastrip_evaluate_controls(NlaStrip *strip, float ctime)
|
||||
RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr);
|
||||
|
||||
/* execute these settings as per normal */
|
||||
animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime, 0);
|
||||
animsys_evaluate_fcurves(depsgraph, &strip_ptr, &strip->fcurves, NULL, ctime);
|
||||
}
|
||||
|
||||
/* analytically generate values for influence and time (if applicable)
|
||||
@@ -1938,7 +1936,7 @@ static void nlastrip_evaluate_controls(NlaStrip *strip, float ctime)
|
||||
}
|
||||
|
||||
/* gets the strip active at the current time for a list of strips for evaluation purposes */
|
||||
NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short index, float ctime)
|
||||
NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, ListBase *strips, short index, float ctime)
|
||||
{
|
||||
NlaStrip *strip, *estrip = NULL;
|
||||
NlaEvalStrip *nes;
|
||||
@@ -2015,7 +2013,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short
|
||||
* - negative influence is not supported yet... how would that be defined?
|
||||
*/
|
||||
/* TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... */
|
||||
nlastrip_evaluate_controls(estrip, ctime);
|
||||
nlastrip_evaluate_controls(depsgraph, estrip, ctime);
|
||||
if (estrip->influence <= 0.0f)
|
||||
return NULL;
|
||||
|
||||
@@ -2034,8 +2032,8 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short
|
||||
return NULL;
|
||||
|
||||
/* evaluate controls for the relevant extents of the bordering strips... */
|
||||
nlastrip_evaluate_controls(estrip->prev, estrip->start);
|
||||
nlastrip_evaluate_controls(estrip->next, estrip->end);
|
||||
nlastrip_evaluate_controls(depsgraph, estrip->prev, estrip->start);
|
||||
nlastrip_evaluate_controls(depsgraph, estrip->next, estrip->end);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2381,7 +2379,8 @@ static void nlastrip_evaluate_actionclip(PointerRNA *ptr, ListBase *channels, Li
|
||||
}
|
||||
|
||||
/* evaluate transition strip */
|
||||
static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
|
||||
static void nlastrip_evaluate_transition(
|
||||
Depsgraph *depsgraph, PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
|
||||
{
|
||||
ListBase tmp_channels = {NULL, NULL};
|
||||
ListBase tmp_modifiers = {NULL, NULL};
|
||||
@@ -2421,12 +2420,12 @@ static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, Li
|
||||
/* first strip */
|
||||
tmp_nes.strip_mode = NES_TIME_TRANSITION_START;
|
||||
tmp_nes.strip = s1;
|
||||
nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
|
||||
nlastrip_evaluate(depsgraph, ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
|
||||
|
||||
/* second strip */
|
||||
tmp_nes.strip_mode = NES_TIME_TRANSITION_END;
|
||||
tmp_nes.strip = s2;
|
||||
nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
|
||||
nlastrip_evaluate(depsgraph, ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
|
||||
|
||||
|
||||
/* accumulate temp-buffer and full-buffer, using the 'real' strip */
|
||||
@@ -2437,7 +2436,8 @@ static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, Li
|
||||
}
|
||||
|
||||
/* evaluate meta-strip */
|
||||
static void nlastrip_evaluate_meta(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
|
||||
static void nlastrip_evaluate_meta(
|
||||
Depsgraph *depsgraph, PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
|
||||
{
|
||||
ListBase tmp_modifiers = {NULL, NULL};
|
||||
NlaStrip *strip = nes->strip;
|
||||
@@ -2457,13 +2457,13 @@ static void nlastrip_evaluate_meta(PointerRNA *ptr, ListBase *channels, ListBase
|
||||
|
||||
/* find the child-strip to evaluate */
|
||||
evaltime = (nes->strip_time * (strip->end - strip->start)) + strip->start;
|
||||
tmp_nes = nlastrips_ctime_get_strip(NULL, &strip->strips, -1, evaltime);
|
||||
tmp_nes = nlastrips_ctime_get_strip(depsgraph, NULL, &strip->strips, -1, evaltime);
|
||||
|
||||
/* directly evaluate child strip into accumulation buffer...
|
||||
* - there's no need to use a temporary buffer (as it causes issues [T40082])
|
||||
*/
|
||||
if (tmp_nes) {
|
||||
nlastrip_evaluate(ptr, channels, &tmp_modifiers, tmp_nes);
|
||||
nlastrip_evaluate(depsgraph, ptr, channels, &tmp_modifiers, tmp_nes);
|
||||
|
||||
/* free temp eval-strip */
|
||||
MEM_freeN(tmp_nes);
|
||||
@@ -2474,7 +2474,7 @@ static void nlastrip_evaluate_meta(PointerRNA *ptr, ListBase *channels, ListBase
|
||||
}
|
||||
|
||||
/* evaluates the given evaluation strip */
|
||||
void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
|
||||
void nlastrip_evaluate(Depsgraph *depsgraph, PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
|
||||
{
|
||||
NlaStrip *strip = nes->strip;
|
||||
|
||||
@@ -2492,10 +2492,10 @@ void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, ListBase *modifiers,
|
||||
nlastrip_evaluate_actionclip(ptr, channels, modifiers, nes);
|
||||
break;
|
||||
case NLASTRIP_TYPE_TRANSITION: /* transition */
|
||||
nlastrip_evaluate_transition(ptr, channels, modifiers, nes);
|
||||
nlastrip_evaluate_transition(depsgraph, ptr, channels, modifiers, nes);
|
||||
break;
|
||||
case NLASTRIP_TYPE_META: /* meta */
|
||||
nlastrip_evaluate_meta(ptr, channels, modifiers, nes);
|
||||
nlastrip_evaluate_meta(depsgraph, ptr, channels, modifiers, nes);
|
||||
break;
|
||||
|
||||
default: /* do nothing */
|
||||
@@ -2561,7 +2561,7 @@ void nladata_flush_channels(ListBase *channels)
|
||||
*
|
||||
* \param[out] echannels Evaluation channels with calculated values
|
||||
*/
|
||||
static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData *adt, float ctime)
|
||||
static void animsys_evaluate_nla(Depsgraph *depsgraph, ListBase *echannels, PointerRNA *ptr, AnimData *adt, float ctime)
|
||||
{
|
||||
NlaTrack *nlt;
|
||||
short track_index = 0;
|
||||
@@ -2599,7 +2599,7 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
|
||||
has_strips = true;
|
||||
|
||||
/* otherwise, get strip to evaluate for this channel */
|
||||
nes = nlastrips_ctime_get_strip(&estrips, &nlt->strips, track_index, ctime);
|
||||
nes = nlastrips_ctime_get_strip(depsgraph, &estrips, &nlt->strips, track_index, ctime);
|
||||
if (nes) nes->track = nlt;
|
||||
}
|
||||
|
||||
@@ -2640,14 +2640,14 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
|
||||
}
|
||||
|
||||
/* add this to our list of evaluation strips */
|
||||
nlastrips_ctime_get_strip(&estrips, &dummy_trackslist, -1, ctime);
|
||||
nlastrips_ctime_get_strip(depsgraph, &estrips, &dummy_trackslist, -1, ctime);
|
||||
}
|
||||
else {
|
||||
/* special case - evaluate as if there isn't any NLA data */
|
||||
/* TODO: this is really just a stop-gap measure... */
|
||||
if (G.debug & G_DEBUG) printf("NLA Eval: Stopgap for active action on NLA Stack - no strips case\n");
|
||||
|
||||
animsys_evaluate_action(ptr, adt->action, adt->remap, ctime);
|
||||
animsys_evaluate_action(depsgraph, ptr, adt->action, adt->remap, ctime);
|
||||
BLI_freelistN(&estrips);
|
||||
return;
|
||||
}
|
||||
@@ -2660,17 +2660,17 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
|
||||
|
||||
/* 2. for each strip, evaluate then accumulate on top of existing channels, but don't set values yet */
|
||||
for (nes = estrips.first; nes; nes = nes->next)
|
||||
nlastrip_evaluate(ptr, echannels, NULL, nes);
|
||||
nlastrip_evaluate(depsgraph, ptr, echannels, NULL, nes);
|
||||
|
||||
/* 3. free temporary evaluation data that's not used elsewhere */
|
||||
BLI_freelistN(&estrips);
|
||||
}
|
||||
|
||||
/* NLA Evaluation function (mostly for use through do_animdata)
|
||||
* - All channels that will be affected are not cleared anymore. Instead, we just evaluate into
|
||||
* - All channels that will be affected are not cleared anymore. Instead, we just evaluate into
|
||||
* some temp channels, where values can be accumulated in one go.
|
||||
*/
|
||||
static void animsys_calculate_nla(PointerRNA *ptr, AnimData *adt, float ctime)
|
||||
static void animsys_calculate_nla(Depsgraph *depsgraph, PointerRNA *ptr, AnimData *adt, float ctime)
|
||||
{
|
||||
ListBase echannels = {NULL, NULL};
|
||||
|
||||
@@ -2678,7 +2678,7 @@ static void animsys_calculate_nla(PointerRNA *ptr, AnimData *adt, float ctime)
|
||||
* and also when the user jumps between different times instead of moving sequentially... */
|
||||
|
||||
/* evaluate the NLA stack, obtaining a set of values to flush */
|
||||
animsys_evaluate_nla(&echannels, ptr, adt, ctime);
|
||||
animsys_evaluate_nla(depsgraph, &echannels, ptr, adt, ctime);
|
||||
|
||||
/* flush effects of accumulating channels in NLA to the actual data they affect */
|
||||
nladata_flush_channels(&echannels);
|
||||
@@ -2721,7 +2721,7 @@ static void animsys_evaluate_overrides(PointerRNA *ptr, AnimData *adt)
|
||||
/* Evaluation System - Public API */
|
||||
|
||||
/* Overview of how this system works:
|
||||
* 1) Depsgraph sorts data as necessary, so that data is in an order that means
|
||||
* 1) Depsgraph sorts data as necessary, so that data is in an order that means
|
||||
* that all dependencies are resolved before dependents.
|
||||
* 2) All normal animation is evaluated, so that drivers have some basis values to
|
||||
* work with
|
||||
@@ -2729,35 +2729,35 @@ static void animsys_evaluate_overrides(PointerRNA *ptr, AnimData *adt)
|
||||
* which modify the effects of the NLA-stacks
|
||||
* b. Active Action is evaluated as per normal, on top of the results of the NLA tracks
|
||||
*
|
||||
* --------------< often in a separate phase... >------------------
|
||||
* --------------< often in a separate phase... >------------------
|
||||
*
|
||||
* 3) Drivers/expressions are evaluated on top of this, in an order where dependencies are
|
||||
* resolved nicely.
|
||||
* resolved nicely.
|
||||
* Note: it may be necessary to have some tools to handle the cases where some higher-level
|
||||
* drivers are added and cause some problematic dependencies that didn't exist in the local levels...
|
||||
*
|
||||
* --------------< always executed >------------------
|
||||
* --------------< always executed >------------------
|
||||
*
|
||||
* Maintenance of editability of settings (XXX):
|
||||
* In order to ensure that settings that are animated can still be manipulated in the UI without requiring
|
||||
* that keyframes are added to prevent these values from being overwritten, we use 'overrides'.
|
||||
* that keyframes are added to prevent these values from being overwritten, we use 'overrides'.
|
||||
*
|
||||
* Unresolved things:
|
||||
* - Handling of multi-user settings (i.e. time-offset, group-instancing) -> big cache grids or nodal system? but stored where?
|
||||
* - Multiple-block dependencies (i.e. drivers for settings are in both local and higher levels) -> split into separate lists?
|
||||
* - Multiple-block dependencies (i.e. drivers for settings are in both local and higher levels) -> split into separate lists?
|
||||
*
|
||||
* Current Status:
|
||||
* - Currently (as of September 2009), overrides we haven't needed to (fully) implement overrides.
|
||||
* - Currently (as of September 2009), overrides we haven't needed to (fully) implement overrides.
|
||||
* However, the code for this is relatively harmless, so is left in the code for now.
|
||||
*/
|
||||
|
||||
/* Evaluation loop for evaluation animation data
|
||||
*
|
||||
* This assumes that the animation-data provided belongs to the ID block in question,
|
||||
* and that the flags for which parts of the anim-data settings need to be recalculated
|
||||
* have been set already by the depsgraph. Now, we use the recalc
|
||||
* and that the flags for which parts of the anim-data settings need to be recalculated
|
||||
* have been set already by the depsgraph. Now, we use the recalc
|
||||
*/
|
||||
void BKE_animsys_evaluate_animdata(Scene *scene, ID *id, AnimData *adt, float ctime, short recalc)
|
||||
void BKE_animsys_evaluate_animdata(Depsgraph *depsgraph, Scene *scene, ID *id, AnimData *adt, float ctime, short recalc)
|
||||
{
|
||||
PointerRNA id_ptr;
|
||||
|
||||
@@ -2779,11 +2779,11 @@ void BKE_animsys_evaluate_animdata(Scene *scene, ID *id, AnimData *adt, float ct
|
||||
/* evaluate NLA-stack
|
||||
* - active action is evaluated as part of the NLA stack as the last item
|
||||
*/
|
||||
animsys_calculate_nla(&id_ptr, adt, ctime);
|
||||
animsys_calculate_nla(depsgraph, &id_ptr, adt, ctime);
|
||||
}
|
||||
/* evaluate Active Action only */
|
||||
else if (adt->action)
|
||||
animsys_evaluate_action_ex(&id_ptr, adt->action, adt->remap, ctime, recalc);
|
||||
animsys_evaluate_action_ex(depsgraph, &id_ptr, adt->action, adt->remap, ctime);
|
||||
|
||||
/* reset tag */
|
||||
adt->recalc &= ~ADT_RECALC_ANIM;
|
||||
@@ -2827,7 +2827,7 @@ void BKE_animsys_evaluate_animdata(Scene *scene, ID *id, AnimData *adt, float ct
|
||||
* 'local' (i.e. belonging in the nearest ID-block that setting is related to, not a
|
||||
* standard 'root') block are overridden by a larger 'user'
|
||||
*/
|
||||
void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
|
||||
void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene *scene, float ctime)
|
||||
{
|
||||
ID *id;
|
||||
|
||||
@@ -2843,7 +2843,7 @@ void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
|
||||
for (id = first; id; id = id->next) { \
|
||||
if (ID_REAL_USERS(id) > 0) { \
|
||||
AnimData *adt = BKE_animdata_from_id(id); \
|
||||
BKE_animsys_evaluate_animdata(scene, id, adt, ctime, aflag); \
|
||||
BKE_animsys_evaluate_animdata(depsgraph, scene, id, adt, ctime, aflag); \
|
||||
} \
|
||||
} (void)0
|
||||
|
||||
@@ -2860,9 +2860,9 @@ void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
|
||||
NtId_Type *ntp = (NtId_Type *)id; \
|
||||
if (ntp->nodetree) { \
|
||||
AnimData *adt2 = BKE_animdata_from_id((ID *)ntp->nodetree); \
|
||||
BKE_animsys_evaluate_animdata(scene, (ID *)ntp->nodetree, adt2, ctime, ADT_RECALC_ANIM); \
|
||||
BKE_animsys_evaluate_animdata(depsgraph, scene, (ID *)ntp->nodetree, adt2, ctime, ADT_RECALC_ANIM); \
|
||||
} \
|
||||
BKE_animsys_evaluate_animdata(scene, id, adt, ctime, aflag); \
|
||||
BKE_animsys_evaluate_animdata(depsgraph, scene, id, adt, ctime, aflag); \
|
||||
} \
|
||||
} (void)0
|
||||
|
||||
@@ -2942,6 +2942,9 @@ void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
|
||||
/* masks */
|
||||
EVAL_ANIM_IDS(main->mask.first, ADT_RECALC_ANIM);
|
||||
|
||||
/* collections */
|
||||
EVAL_ANIM_IDS(main->collection.first, ADT_RECALC_ANIM);
|
||||
|
||||
/* worlds */
|
||||
EVAL_ANIM_NODETREE_IDS(main->world.first, World, ADT_RECALC_ANIM);
|
||||
|
||||
@@ -2963,44 +2966,48 @@ void BKE_animsys_eval_animdata(Depsgraph *depsgraph, ID *id)
|
||||
*/
|
||||
DEG_debug_print_eval_time(depsgraph, __func__, id->name, id, ctime);
|
||||
short recalc = ADT_RECALC_ANIM;
|
||||
const Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
|
||||
/* If animation component is directly tagged for update, we always apply f-curves. */
|
||||
if (((scene_eval->id.recalc & ID_RECALC_TIME) == 0) &&
|
||||
(id->recalc & ID_RECALC_TIME) == 0)
|
||||
{
|
||||
recalc |= ADT_RECALC_CHECK_ORIG_DNA;
|
||||
}
|
||||
BKE_animsys_evaluate_animdata(scene, id, adt, ctime, recalc);
|
||||
BKE_animsys_evaluate_animdata(depsgraph, scene, id, adt, ctime, recalc);
|
||||
}
|
||||
|
||||
/* TODO(sergey): This is slow lookup of driver from CoW datablock.
|
||||
* Keep this for until we've got something smarter for depsgraph
|
||||
* building.\
|
||||
*/
|
||||
static FCurve *find_driver_from_evaluated_id(ID *id, FCurve *fcu)
|
||||
void BKE_animsys_update_driver_array(ID *id)
|
||||
{
|
||||
/* We've got non-CoW datablock, can use f-curve as-is. */
|
||||
if (id->orig_id == NULL) {
|
||||
return fcu;
|
||||
AnimData *adt = BKE_animdata_from_id(id);
|
||||
|
||||
/* Runtime driver map to avoid O(n^2) lookups in BKE_animsys_eval_driver.
|
||||
* Ideally the depsgraph could pass a pointer to the COW driver directly,
|
||||
* but this is difficult in the current design. */
|
||||
if (adt && adt->drivers.first) {
|
||||
BLI_assert(!adt->driver_array);
|
||||
|
||||
int num_drivers = BLI_listbase_count(&adt->drivers);
|
||||
adt->driver_array = MEM_mallocN(sizeof(FCurve *) * num_drivers, "adt->driver_array");
|
||||
|
||||
int driver_index = 0;
|
||||
for (FCurve *fcu = adt->drivers.first; fcu; fcu = fcu->next) {
|
||||
adt->driver_array[driver_index++] = fcu;
|
||||
}
|
||||
}
|
||||
/*const*/ ID *id_orig = id->orig_id;
|
||||
const AnimData *adt_orig = BKE_animdata_from_id(id_orig);
|
||||
const AnimData *adt_cow = BKE_animdata_from_id(id);
|
||||
const int fcu_index = BLI_findindex(&adt_orig->drivers, fcu);
|
||||
BLI_assert(fcu_index != -1);
|
||||
return BLI_findlink(&adt_cow->drivers, fcu_index);
|
||||
}
|
||||
|
||||
void BKE_animsys_eval_driver(Depsgraph *depsgraph,
|
||||
ID *id,
|
||||
FCurve *fcu)
|
||||
int driver_index,
|
||||
ChannelDriver *driver_orig)
|
||||
{
|
||||
/* TODO(sergey): De-duplicate with BKE animsys. */
|
||||
ChannelDriver *driver = fcu->driver;
|
||||
PointerRNA id_ptr;
|
||||
bool ok = false;
|
||||
|
||||
fcu = find_driver_from_evaluated_id(id, fcu);
|
||||
/* Lookup driver, accelerated with driver array map. */
|
||||
const AnimData *adt = BKE_animdata_from_id(id);
|
||||
FCurve *fcu;
|
||||
|
||||
if (adt->driver_array) {
|
||||
fcu = adt->driver_array[driver_index];
|
||||
}
|
||||
else {
|
||||
fcu = BLI_findlink(&adt->drivers, driver_index);
|
||||
}
|
||||
|
||||
DEG_debug_print_eval_subdata_index(
|
||||
depsgraph, __func__, id->name, id, "fcu", fcu->rna_path, fcu, fcu->array_index);
|
||||
@@ -3011,7 +3018,7 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph,
|
||||
if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) {
|
||||
/* check if driver itself is tagged for recalculation */
|
||||
/* XXX driver recalc flag is not set yet by depsgraph! */
|
||||
if ((driver) && !(driver->flag & DRIVER_FLAG_INVALID) /*&& (driver->flag & DRIVER_FLAG_RECALC)*/) {
|
||||
if ((driver_orig) && !(driver_orig->flag & DRIVER_FLAG_INVALID) /*&& (driver_orig->flag & DRIVER_FLAG_RECALC)*/) {
|
||||
/* evaluate this using values set already in other places
|
||||
* NOTE: for 'layering' option later on, we should check if we should remove old value before adding
|
||||
* new to only be done when drivers only changed */
|
||||
@@ -3022,17 +3029,20 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph,
|
||||
const float ctime = DEG_get_ctime(depsgraph);
|
||||
const float curval = calculate_fcurve(&anim_rna, fcu, ctime);
|
||||
ok = animsys_write_rna_setting(&anim_rna, curval);
|
||||
if (ok && DEG_is_active(depsgraph)) {
|
||||
animsys_write_orig_anim_rna(&id_ptr, NULL, fcu, curval);
|
||||
}
|
||||
}
|
||||
|
||||
//printf("\tnew val = %f\n", fcu->curval);
|
||||
|
||||
/* clear recalc flag */
|
||||
driver->flag &= ~DRIVER_FLAG_RECALC;
|
||||
driver_orig->flag &= ~DRIVER_FLAG_RECALC;
|
||||
|
||||
/* set error-flag if evaluation failed */
|
||||
if (ok == 0) {
|
||||
printf("invalid driver - %s[%d]\n", fcu->rna_path, fcu->array_index);
|
||||
driver->flag |= DRIVER_FLAG_INVALID;
|
||||
driver_orig->flag |= DRIVER_FLAG_INVALID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -718,13 +718,13 @@ bool BKE_appdir_app_template_id_search(const char *app_template, char *path, siz
|
||||
/**
|
||||
* Gets the temp directory when blender first runs.
|
||||
* If the default path is not found, use try $TEMP
|
||||
*
|
||||
*
|
||||
* Also make sure the temp dir has a trailing slash
|
||||
*
|
||||
* \param fullname The full path to the temporary temp directory
|
||||
* \param basename The full path to the persistent temp directory (may be NULL)
|
||||
* \param maxlen The size of the fullname buffer
|
||||
* \param userdir Directory specified in user preferences
|
||||
* \param userdir Directory specified in user preferences
|
||||
*/
|
||||
static void where_is_temp(char *fullname, char *basename, const size_t maxlen, char *userdir)
|
||||
{
|
||||
|
@@ -688,6 +688,11 @@ void BKE_pose_bone_done(struct Depsgraph *depsgraph,
|
||||
invert_m4_m4(imat, pchan->bone->arm_mat);
|
||||
mul_m4_m4m4(pchan->chan_mat, pchan->pose_mat, imat);
|
||||
}
|
||||
if (DEG_is_active(depsgraph)) {
|
||||
bPoseChannel *pchan_orig = pchan->orig_pchan;
|
||||
copy_m4_m4(pchan_orig->pose_mat, pchan->pose_mat);
|
||||
copy_m4_m4(pchan_orig->chan_mat, pchan->chan_mat);
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_pose_iktree_evaluate(struct Depsgraph *depsgraph,
|
||||
|
@@ -643,7 +643,7 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
|
||||
/* keep packedfile paths always relative to the blend */
|
||||
if (lib->packedfile == NULL) {
|
||||
if (rewrite_path_fixed(lib->name, visit_cb, absbase, bpath_user_data)) {
|
||||
BKE_library_filepath_set(lib, lib->name);
|
||||
BKE_library_filepath_set(bmain, lib, lib->name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -159,14 +159,16 @@ void BKE_cachefile_ensure_handle(const Main *bmain, CacheFile *cache_file)
|
||||
BLI_mutex_unlock(cache_file->handle_mutex);
|
||||
}
|
||||
|
||||
void BKE_cachefile_update_frame(Main *bmain, Scene *scene, const float ctime, const float fps)
|
||||
void BKE_cachefile_update_frame(
|
||||
Main *bmain, struct Depsgraph *depsgraph, Scene *scene,
|
||||
const float ctime, const float fps)
|
||||
{
|
||||
CacheFile *cache_file;
|
||||
char filename[FILE_MAX];
|
||||
|
||||
for (cache_file = bmain->cachefiles.first; cache_file; cache_file = cache_file->id.next) {
|
||||
/* Execute drivers only, as animation has already been done. */
|
||||
BKE_animsys_evaluate_animdata(scene, &cache_file->id, cache_file->adt, ctime, ADT_RECALC_DRIVERS);
|
||||
BKE_animsys_evaluate_animdata(depsgraph, scene, &cache_file->id, cache_file->adt, ctime, ADT_RECALC_DRIVERS);
|
||||
|
||||
if (!cache_file->is_sequence) {
|
||||
continue;
|
||||
|
@@ -597,7 +597,7 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh)
|
||||
return CDDM_from_mesh_ex(mesh, CD_REFERENCE, CD_MASK_MESH);
|
||||
}
|
||||
|
||||
DerivedMesh *CDDM_from_mesh_ex(Mesh *mesh, int alloctype, CustomDataMask mask)
|
||||
DerivedMesh *CDDM_from_mesh_ex(Mesh *mesh, eCDAllocType alloctype, CustomDataMask mask)
|
||||
{
|
||||
CDDerivedMesh *cddm = cdDM_create(__func__);
|
||||
DerivedMesh *dm = &cddm->dm;
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "BLT_translation.h"
|
||||
#include "BLI_string_utils.h"
|
||||
|
||||
#include "BKE_animsys.h"
|
||||
#include "BKE_collection.h"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_idprop.h"
|
||||
@@ -112,7 +113,8 @@ Collection *BKE_collection_add(Main *bmain, Collection *collection_parent, const
|
||||
/** Free (or release) any data used by this collection (does not free the collection itself). */
|
||||
void BKE_collection_free(Collection *collection)
|
||||
{
|
||||
/* No animdata here. */
|
||||
BKE_animdata_free(&collection->id, false);
|
||||
|
||||
BKE_previewimg_free(&collection->preview);
|
||||
|
||||
BLI_freelistN(&collection->gobject);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* 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.
|
||||
* 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
|
||||
|
@@ -103,7 +103,7 @@
|
||||
|
||||
/* ************************ Constraints - General Utilities *************************** */
|
||||
/* These functions here don't act on any specific constraints, and are therefore should/will
|
||||
* not require any of the special function-pointers afforded by the relevant constraint
|
||||
* not require any of the special function-pointers afforded by the relevant constraint
|
||||
* type-info structs.
|
||||
*/
|
||||
|
||||
@@ -654,7 +654,7 @@ static void constraint_target_to_mat4(Object *ob, const char *substring, float m
|
||||
/* ************************* Specific Constraints ***************************** */
|
||||
/* Each constraint defines a set of functions, which will be called at the appropriate
|
||||
* times. In addition to this, each constraint should have a type-info struct, where
|
||||
* its functions are attached for use.
|
||||
* its functions are attached for use.
|
||||
*/
|
||||
|
||||
/* Template for type-info data:
|
||||
@@ -663,7 +663,7 @@ static void constraint_target_to_mat4(Object *ob, const char *substring, float m
|
||||
* - although the naming of functions doesn't matter, it would help for code
|
||||
* readability, to follow the same naming convention as is presented here
|
||||
* - any functions that a constraint doesn't need to define, don't define
|
||||
* for such cases, just use NULL
|
||||
* for such cases, just use NULL
|
||||
* - these should be defined after all the functions have been defined, so that
|
||||
* forward-definitions/prototypes don't need to be used!
|
||||
* - keep this copy #if-def'd so that future constraints can get based off this
|
||||
@@ -4456,7 +4456,7 @@ static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, bool is_re
|
||||
|
||||
/* Free data of a specific constraint if it has any info.
|
||||
* be sure to run BIK_clear_data() when freeing an IK constraint,
|
||||
* unless DAG_relations_tag_update is called.
|
||||
* unless DAG_relations_tag_update is called.
|
||||
*/
|
||||
void BKE_constraint_free_data_ex(bConstraint *con, bool do_id_user)
|
||||
{
|
||||
@@ -4805,7 +4805,7 @@ bool BKE_constraints_proxylocked_owner(Object *ob, bPoseChannel *pchan)
|
||||
|
||||
/* This function is a relic from the prior implementations of the constraints system, when all
|
||||
* constraints either had one or no targets. It used to be called during the main constraint solving
|
||||
* loop, but is now only used for the remaining cases for a few constraints.
|
||||
* loop, but is now only used for the remaining cases for a few constraints.
|
||||
*
|
||||
* None of the actual calculations of the matrices should be done here! Also, this function is
|
||||
* not to be used by any new constraints, particularly any that have multiple targets.
|
||||
@@ -4910,7 +4910,7 @@ void BKE_constraint_targets_for_solving_get(struct Depsgraph *depsgraph, bConstr
|
||||
/* This function is called whenever constraints need to be evaluated. Currently, all
|
||||
* constraints that can be evaluated are every time this gets run.
|
||||
*
|
||||
* BKE_constraints_make_evalob and BKE_constraints_clear_evalob should be called before and
|
||||
* BKE_constraints_make_evalob and BKE_constraints_clear_evalob should be called before and
|
||||
* after running this function, to sort out cob
|
||||
*/
|
||||
void BKE_constraints_solve(struct Depsgraph *depsgraph, ListBase *conlist, bConstraintOb *cob, float ctime)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user