Compare commits
250 Commits
tmp-eevee-
...
tmp-T80603
Author | SHA1 | Date | |
---|---|---|---|
960a005bab | |||
141eb92345 | |||
8289fc688b | |||
f575a14801 | |||
![]() |
91f07fbfd6 | ||
6e13cff487 | |||
68fae13d9b | |||
![]() |
e553408bee | ||
17ddb4c4ea | |||
dceaef92d7 | |||
465d5c018e | |||
3bbcc4f6e8 | |||
58533aca4d | |||
5f01048dcb | |||
945e18f037 | |||
293b00beb5 | |||
517f32045c | |||
4f3fdf7715 | |||
![]() |
554ed613ae | ||
783d3c675a | |||
![]() |
e21a903b98 | ||
0148059c68 | |||
d114288f90 | |||
3947cbf916 | |||
![]() |
37a07d8a75 | ||
8e555bf4e3 | |||
0178e7b393 | |||
42a517779a | |||
60bf482dba | |||
ce11640eef | |||
c26cd6e996 | |||
0a8eeae831 | |||
f649e5c418 | |||
5439f43e88 | |||
5fc252feae | |||
296e3ee62c | |||
c310bf4ebe | |||
548312ed82 | |||
56b345adc6 | |||
404c3adfcc | |||
9d5e5e282c | |||
7b754c8c99 | |||
1510c04d41 | |||
2c3ef36a0b | |||
0402cc7e9e | |||
09db0f2a34 | |||
e4ac4769f1 | |||
864f8cbb86 | |||
488bf53207 | |||
0849af4591 | |||
86385d7ebd | |||
![]() |
211b6c29f7 | ||
![]() |
82e3bd4bbb | ||
![]() |
3c9f80c898 | ||
![]() |
dc8475ec6a | ||
7fc0053c27 | |||
52cc412e0f | |||
eba3aa1837 | |||
0a00fbd265 | |||
ae2f21f378 | |||
6aef27602a | |||
428c0f9ad5 | |||
81f817e7b4 | |||
de6c935261 | |||
7881c251f3 | |||
![]() |
389d550412 | ||
31cf87a29e | |||
c204e3348c | |||
520f08aa56 | |||
f18ed7ad89 | |||
d5a92b188b | |||
ec26260132 | |||
691a1e3357 | |||
![]() |
a86b5df005 | ||
1d2b89304a | |||
ff1040c6fe | |||
79e529c5ec | |||
735119dd0f | |||
28d9368538 | |||
1c3b2b5dd8 | |||
f772a4b8fa | |||
18f33f293b | |||
9aea7dc7c6 | |||
9b0f65c4a6 | |||
5f63344e84 | |||
a1c9d42584 | |||
f3cf29ac96 | |||
4114e89020 | |||
d3275178fe | |||
2299f6b5a7 | |||
2a692e05c8 | |||
fc2bb44e94 | |||
5a1ab3e9ae | |||
2dd6d0ce4b | |||
ecc395e473 | |||
77fdd189e4 | |||
39aa122a0e | |||
4a9a8611f2 | |||
31cb4133b9 | |||
52c356c199 | |||
9f1f7ba2bb | |||
f53ae843b3 | |||
ce0db0d329 | |||
219ce574b5 | |||
ec0ba8e3b5 | |||
026eba8523 | |||
849f5bee19 | |||
7a37db6125 | |||
a8a6b3627a | |||
7e9480b6cd | |||
d65f60764b | |||
baa1886791 | |||
41bb0548b0 | |||
9b9f84b317 | |||
c15bb3b55f | |||
31f3e9082a | |||
f274b8c102 | |||
0d0df683d9 | |||
22462fed00 | |||
6f8d99322c | |||
b4613e0bca | |||
![]() |
e8dd8c2829 | ||
f27e122d95 | |||
98689f51c0 | |||
a76e804309 | |||
![]() |
0236863c6d | ||
69e331201e | |||
![]() |
59aed2a255 | ||
4066c921fb | |||
c4edc6f3f7 | |||
a1a333a1e9 | |||
![]() |
42f8d52401 | ||
1b994a37f4 | |||
8a8c61190b | |||
376b69cbff | |||
d15efbdc56 | |||
8d648e0972 | |||
fcfb87def9 | |||
f66bfb5a86 | |||
b4a6418e2b | |||
522e6c0c06 | |||
af3a55bb1b | |||
e4e31e4f14 | |||
93b5682444 | |||
e15ffc0c54 | |||
8fe448b44d | |||
ccf43fe605 | |||
b44101950d | |||
c1545c9a9d | |||
9897ef6a20 | |||
d33c27d68b | |||
eb57377f12 | |||
7d3bf5166d | |||
3360db83c4 | |||
db6e267bfc | |||
5fe7605f3d | |||
a296dff2c8 | |||
aa02a05bc7 | |||
dfe8195dfe | |||
8f050b6825 | |||
499c0229f7 | |||
59cfb20fa1 | |||
8d63d7337c | |||
20c30534aa | |||
42d77fbea1 | |||
13125e0948 | |||
a5a069c272 | |||
d6cc16831a | |||
5201bc9dd4 | |||
7bb3d9787e | |||
61280e5af3 | |||
fa270a37e8 | |||
a4cbacacbf | |||
059f79bdd7 | |||
cfb7664d5b | |||
7fcf2e7d4a | |||
0c20fce2f2 | |||
![]() |
03fa66d274 | ||
9ccc73ade8 | |||
![]() |
9ac4e4a1c7 | ||
a6646fb0d0 | |||
8c4965f86d | |||
14278cd932 | |||
30cbbccc60 | |||
675ba2073d | |||
82bda82ec4 | |||
25dea3e65e | |||
10528a5cd4 | |||
24e5c64ea2 | |||
cddfa7a449 | |||
b96ccb5126 | |||
f89b89fa7f | |||
291136eece | |||
888427cabb | |||
fc06c248ed | |||
ac8b36535e | |||
5fa58fb8a2 | |||
15bf81268c | |||
1afa97d547 | |||
ff7a30d928 | |||
7c9c8cee7b | |||
497cd3d7dd | |||
c4ee94328f | |||
0bdb827bdf | |||
e0ae229acb | |||
46a4a53824 | |||
20b94257dc | |||
9bc7ea5496 | |||
fa116a9bbe | |||
0d57ab611c | |||
6eb00fb02e | |||
cb8d8335b2 | |||
19413c4a82 | |||
121b2c0424 | |||
b487ef6116 | |||
b75ce05c3b | |||
008e964940 | |||
04d15f1625 | |||
52d8b3a014 | |||
98e18c41b6 | |||
2a3797b109 | |||
ff144edd8c | |||
cfea716128 | |||
9af72792a3 | |||
e5ace51295 | |||
abcb23f5a3 | |||
001d70eb2b | |||
9632a06201 | |||
0541906162 | |||
1cad0a627e | |||
a269761ec1 | |||
266caa1820 | |||
fe0036c586 | |||
0a32f6c868 | |||
0ae64a9945 | |||
7049d2dc58 | |||
19d822c677 | |||
3c0fd51cf4 | |||
6a850f3cc8 | |||
c361f911f9 | |||
4ce1829289 | |||
f716bb3b71 | |||
6716baa1f7 | |||
5f31e5031c | |||
![]() |
33ce0cb5a1 | ||
5940485369 | |||
16d8a683be | |||
72492eb2a2 | |||
78e3b7c28d | |||
e585257063 |
@@ -278,7 +278,7 @@ option(WITH_ALEMBIC "Enable Alembic Support" ON)
|
||||
option(WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF)
|
||||
|
||||
# Universal Scene Description support
|
||||
option(WITH_USD "Enable Universal Scene Description (USD) Support" OFF)
|
||||
option(WITH_USD "Enable Universal Scene Description (USD) Support" ON)
|
||||
|
||||
# 3D format support
|
||||
# Disable opencollada when we don't have precompiled libs
|
||||
@@ -608,12 +608,6 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
|
||||
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
|
||||
endif()
|
||||
|
||||
|
||||
# may as well build python module without a UI
|
||||
if(WITH_PYTHON_MODULE)
|
||||
set(WITH_HEADLESS ON)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_PYTHON)
|
||||
set(WITH_CYCLES OFF)
|
||||
set(WITH_DRACO OFF)
|
||||
|
@@ -8,7 +8,7 @@ Code signing is done as part of INSTALL target, which makes it possible to sign
|
||||
files which are aimed into a bundle and coming from a non-signed source (such as
|
||||
libraries SVN).
|
||||
|
||||
This is achieved by specifying `slave_codesign.cmake` as a post-install script
|
||||
This is achieved by specifying `worker_codesign.cmake` as a post-install script
|
||||
run by CMake. This CMake script simply involves an utility script written in
|
||||
Python which takes care of an actual signing.
|
||||
|
||||
|
@@ -40,8 +40,8 @@ class Builder:
|
||||
|
||||
# Buildbot runs from build/ directory
|
||||
self.blender_dir = os.path.abspath(os.path.join('..', 'blender.git'))
|
||||
self.build_dir = os.path.abspath(os.path.join('..', 'build', name))
|
||||
self.install_dir = os.path.abspath(os.path.join('..', 'install', name))
|
||||
self.build_dir = os.path.abspath(os.path.join('..', 'build'))
|
||||
self.install_dir = os.path.abspath(os.path.join('..', 'install'))
|
||||
self.upload_dir = os.path.abspath(os.path.join('..', 'install'))
|
||||
|
||||
# Detect platform
|
||||
@@ -78,27 +78,26 @@ class VersionInfo:
|
||||
blender_h = os.path.join(builder.blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
|
||||
|
||||
version_number = int(self._parse_header_file(blender_h, 'BLENDER_VERSION'))
|
||||
self.version = "%d.%d" % (version_number // 100, version_number % 100)
|
||||
self.version_char = self._parse_header_file(blender_h, 'BLENDER_VERSION_CHAR')
|
||||
version_number_patch = int(self._parse_header_file(blender_h, 'BLENDER_VERSION_PATCH'))
|
||||
version_numbers = (version_number // 100, version_number % 100, version_number_patch)
|
||||
self.short_version = "%d.%02d" % (version_numbers[0], version_numbers[1])
|
||||
self.version = "%d.%02d.%d" % version_numbers
|
||||
self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE')
|
||||
self.version_cycle_number = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE_NUMBER')
|
||||
self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
|
||||
|
||||
if self.version_cycle == "release":
|
||||
# Final release
|
||||
self.full_version = self.version + self.version_char
|
||||
self.full_version = self.version
|
||||
self.is_development_build = False
|
||||
elif self.version_cycle == "rc":
|
||||
# Release candidate
|
||||
version_cycle = self.version_cycle + self.version_cycle_number
|
||||
if len(self.version_char) == 0:
|
||||
self.full_version = self.version + version_cycle
|
||||
else:
|
||||
self.full_version = self.version + self.version_char + '-' + version_cycle
|
||||
self.full_version = self.version + version_cycle
|
||||
self.is_development_build = False
|
||||
else:
|
||||
# Development build
|
||||
self.full_version = self.version + self.version_char + '-' + self.hash
|
||||
self.full_version = self.version + '-' + self.hash
|
||||
self.is_development_build = True
|
||||
|
||||
def _parse_header_file(self, filename, define):
|
||||
|
@@ -48,6 +48,7 @@ import shutil
|
||||
import subprocess
|
||||
import time
|
||||
import tarfile
|
||||
import uuid
|
||||
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
@@ -121,21 +122,10 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
# Consider this an input of the code signing server.
|
||||
unsigned_storage_dir: Path
|
||||
|
||||
# Information about archive which contains files which are to be signed.
|
||||
#
|
||||
# This archive is created by the buildbot worked and acts as an input for
|
||||
# the code signing server.
|
||||
unsigned_archive_info: ArchiveWithIndicator
|
||||
|
||||
# Storage where signed files are stored.
|
||||
# Consider this an output of the code signer server.
|
||||
signed_storage_dir: Path
|
||||
|
||||
# Information about archive which contains signed files.
|
||||
#
|
||||
# This archive is created by the code signing server.
|
||||
signed_archive_info: ArchiveWithIndicator
|
||||
|
||||
# Platform the code is currently executing on.
|
||||
platform: util.Platform
|
||||
|
||||
@@ -146,50 +136,44 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
|
||||
# Unsigned (signing server input) configuration.
|
||||
self.unsigned_storage_dir = absolute_shared_storage_dir / 'unsigned'
|
||||
self.unsigned_archive_info = ArchiveWithIndicator(
|
||||
self.unsigned_storage_dir, 'unsigned_files.tar', 'ready.stamp')
|
||||
|
||||
# Signed (signing server output) configuration.
|
||||
self.signed_storage_dir = absolute_shared_storage_dir / 'signed'
|
||||
self.signed_archive_info = ArchiveWithIndicator(
|
||||
self.signed_storage_dir, 'signed_files.tar', 'ready.stamp')
|
||||
|
||||
self.platform = util.get_current_platform()
|
||||
|
||||
"""
|
||||
General note on cleanup environment functions.
|
||||
|
||||
It is expected that there is only one instance of the code signer server
|
||||
running for a given input/output directory, and that it serves a single
|
||||
buildbot worker.
|
||||
By its nature, a buildbot worker only produces one build at a time and
|
||||
never performs concurrent builds.
|
||||
This leads to a conclusion that when starting in a clean environment
|
||||
there shouldn't be any archives remaining from a previous build.
|
||||
|
||||
However, it is possible to have various failure scenarios which might
|
||||
leave the environment in a non-clean state:
|
||||
|
||||
- Network hiccup which makes buildbot worker to stop current build
|
||||
and re-start it after connection to server is re-established.
|
||||
|
||||
Note, this could also happen during buildbot server maintenance.
|
||||
|
||||
- Signing server might get restarted due to updates or other reasons.
|
||||
|
||||
Requiring manual interaction in such cases is not something good to
|
||||
require, so here we simply assume that the system is used the way it is
|
||||
intended to and restore environment to a prestine clean state.
|
||||
"""
|
||||
|
||||
def cleanup_environment_for_builder(self) -> None:
|
||||
self.unsigned_archive_info.clean()
|
||||
self.signed_archive_info.clean()
|
||||
# TODO(sergey): Revisit need of cleaning up the existing files.
|
||||
# In practice it wasn't so helpful, and with multiple clients
|
||||
# talking to the same server it becomes even mor etricky.
|
||||
pass
|
||||
|
||||
def cleanup_environment_for_signing_server(self) -> None:
|
||||
# Don't clear the requested to-be-signed archive since we might be
|
||||
# restarting signing machine while the buildbot is busy.
|
||||
self.signed_archive_info.clean()
|
||||
# TODO(sergey): Revisit need of cleaning up the existing files.
|
||||
# In practice it wasn't so helpful, and with multiple clients
|
||||
# talking to the same server it becomes even mor etricky.
|
||||
pass
|
||||
|
||||
def generate_request_id(self) -> str:
|
||||
"""
|
||||
Generate an unique identifier for code signing request.
|
||||
"""
|
||||
return str(uuid.uuid4())
|
||||
|
||||
def archive_info_for_request_id(
|
||||
self, path: Path, request_id: str) -> ArchiveWithIndicator:
|
||||
return ArchiveWithIndicator(
|
||||
path, f'{request_id}.tar', f'{request_id}.ready')
|
||||
|
||||
def signed_archive_info_for_request_id(
|
||||
self, request_id: str) -> ArchiveWithIndicator:
|
||||
return self.archive_info_for_request_id(
|
||||
self.signed_storage_dir, request_id);
|
||||
|
||||
def unsigned_archive_info_for_request_id(
|
||||
self, request_id: str) -> ArchiveWithIndicator:
|
||||
return self.archive_info_for_request_id(
|
||||
self.unsigned_storage_dir, request_id);
|
||||
|
||||
############################################################################
|
||||
# Buildbot worker side helpers.
|
||||
@@ -232,7 +216,7 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
if self.check_file_is_to_be_signed(file)]
|
||||
return files_to_be_signed
|
||||
|
||||
def wait_for_signed_archive_or_die(self) -> None:
|
||||
def wait_for_signed_archive_or_die(self, request_id) -> None:
|
||||
"""
|
||||
Wait until archive with signed files is available.
|
||||
|
||||
@@ -240,13 +224,19 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
is still no responce from the signing server the application will exit
|
||||
with a non-zero exit code.
|
||||
"""
|
||||
|
||||
signed_archive_info = self.signed_archive_info_for_request_id(
|
||||
request_id)
|
||||
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
|
||||
request_id)
|
||||
|
||||
timeout_in_seconds = self.config.TIMEOUT_IN_SECONDS
|
||||
time_start = time.monotonic()
|
||||
while not self.signed_archive_info.is_ready():
|
||||
while not signed_archive_info.is_ready():
|
||||
time.sleep(1)
|
||||
time_slept_in_seconds = time.monotonic() - time_start
|
||||
if time_slept_in_seconds > timeout_in_seconds:
|
||||
self.unsigned_archive_info.clean()
|
||||
unsigned_archive_info.clean()
|
||||
raise SystemExit("Signing server didn't finish signing in "
|
||||
f"{timeout_in_seconds} seconds, dying :(")
|
||||
|
||||
@@ -303,13 +293,19 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
return
|
||||
logger_builder.info('Found %d files to sign.', len(files))
|
||||
|
||||
request_id = self.generate_request_id()
|
||||
signed_archive_info = self.signed_archive_info_for_request_id(
|
||||
request_id)
|
||||
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
|
||||
request_id)
|
||||
|
||||
pack_files(files=files,
|
||||
archive_filepath=self.unsigned_archive_info.archive_filepath)
|
||||
self.unsigned_archive_info.tag_ready()
|
||||
archive_filepath=unsigned_archive_info.archive_filepath)
|
||||
unsigned_archive_info.tag_ready()
|
||||
|
||||
# Wait for the signing server to finish signing.
|
||||
logger_builder.info('Waiting signing server to sign the files...')
|
||||
self.wait_for_signed_archive_or_die()
|
||||
self.wait_for_signed_archive_or_die(request_id)
|
||||
|
||||
# Extract signed files from archive and move files to final location.
|
||||
with TemporaryDirectory(prefix='blender-buildbot-') as temp_dir_str:
|
||||
@@ -317,7 +313,7 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
|
||||
logger_builder.info('Extracting signed files from archive...')
|
||||
extract_files(
|
||||
archive_filepath=self.signed_archive_info.archive_filepath,
|
||||
archive_filepath=signed_archive_info.archive_filepath,
|
||||
extraction_dir=unpacked_signed_files_dir)
|
||||
|
||||
destination_dir = path
|
||||
@@ -327,19 +323,39 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
unpacked_signed_files_dir, destination_dir)
|
||||
|
||||
logger_builder.info('Removing archive with signed files...')
|
||||
self.signed_archive_info.clean()
|
||||
signed_archive_info.clean()
|
||||
|
||||
############################################################################
|
||||
# Signing server side helpers.
|
||||
|
||||
def wait_for_sign_request(self) -> None:
|
||||
def wait_for_sign_request(self) -> str:
|
||||
"""
|
||||
Wait for the buildbot to request signing of an archive.
|
||||
|
||||
Returns an identifier of signing request.
|
||||
"""
|
||||
|
||||
# TOOD(sergey): Support graceful shutdown on Ctrl-C.
|
||||
while not self.unsigned_archive_info.is_ready():
|
||||
|
||||
logger_server.info(
|
||||
'Waiting for a READY indicator of any signign request.')
|
||||
request_id = None
|
||||
while request_id is None:
|
||||
for file in self.unsigned_storage_dir.iterdir():
|
||||
if file.suffix != '.ready':
|
||||
continue
|
||||
request_id = file.stem
|
||||
logger_server.info(f'Found READY for request ID {request_id}.')
|
||||
if request_id is None:
|
||||
time.sleep(1)
|
||||
|
||||
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
|
||||
request_id)
|
||||
while not unsigned_archive_info.is_ready():
|
||||
time.sleep(1)
|
||||
|
||||
return request_id
|
||||
|
||||
@abc.abstractmethod
|
||||
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
|
||||
"""
|
||||
@@ -348,7 +364,7 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
NOTE: Signing should happen in-place.
|
||||
"""
|
||||
|
||||
def run_signing_pipeline(self):
|
||||
def run_signing_pipeline(self, request_id: str):
|
||||
"""
|
||||
Run the full signing pipeline starting from the point when buildbot
|
||||
worker have requested signing.
|
||||
@@ -360,9 +376,14 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
with TemporaryDirectory(prefix='blender-codesign-') as temp_dir_str:
|
||||
temp_dir = Path(temp_dir_str)
|
||||
|
||||
signed_archive_info = self.signed_archive_info_for_request_id(
|
||||
request_id)
|
||||
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
|
||||
request_id)
|
||||
|
||||
logger_server.info('Extracting unsigned files from archive...')
|
||||
extract_files(
|
||||
archive_filepath=self.unsigned_archive_info.archive_filepath,
|
||||
archive_filepath=unsigned_archive_info.archive_filepath,
|
||||
extraction_dir=temp_dir)
|
||||
|
||||
logger_server.info('Collecting all files which needs signing...')
|
||||
@@ -374,11 +395,11 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
|
||||
logger_server.info('Packing signed files...')
|
||||
pack_files(files=files,
|
||||
archive_filepath=self.signed_archive_info.archive_filepath)
|
||||
self.signed_archive_info.tag_ready()
|
||||
archive_filepath=signed_archive_info.archive_filepath)
|
||||
signed_archive_info.tag_ready()
|
||||
|
||||
logger_server.info('Removing signing request...')
|
||||
self.unsigned_archive_info.clean()
|
||||
unsigned_archive_info.clean()
|
||||
|
||||
logger_server.info('Signing is complete.')
|
||||
|
||||
@@ -389,11 +410,11 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
|
||||
while True:
|
||||
logger_server.info('Waiting for the signing request in %s...',
|
||||
self.unsigned_storage_dir)
|
||||
self.wait_for_sign_request()
|
||||
request_id = self.wait_for_sign_request()
|
||||
|
||||
logger_server.info(
|
||||
'Got signing request, beging signign procedure.')
|
||||
self.run_signing_pipeline()
|
||||
f'Beging signign procedure for request ID {request_id}.')
|
||||
self.run_signing_pipeline(request_id)
|
||||
|
||||
############################################################################
|
||||
# Command executing.
|
||||
|
@@ -1,37 +0,0 @@
|
||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Runs on buildbot slave, rsync zip directly to buildbot server rather
|
||||
# than using upload which is much slower
|
||||
|
||||
import buildbot_utils
|
||||
import os
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
builder = buildbot_utils.create_builder_from_arguments()
|
||||
|
||||
# rsync, this assumes ssh keys are setup so no password is needed
|
||||
local_zip = "buildbot_upload.zip"
|
||||
remote_folder = "builder.blender.org:/data/buildbot-master/uploaded/"
|
||||
remote_zip = remote_folder + "buildbot_upload_" + builder.name + ".zip"
|
||||
|
||||
command = ["rsync", "-avz", local_zip, remote_zip]
|
||||
buildbot_utils.call(command)
|
@@ -30,7 +30,7 @@ from tempfile import TemporaryDirectory, NamedTemporaryFile
|
||||
from typing import List
|
||||
|
||||
BUILDBOT_DIRECTORY = Path(__file__).absolute().parent
|
||||
CODESIGN_SCRIPT = BUILDBOT_DIRECTORY / 'slave_codesign.py'
|
||||
CODESIGN_SCRIPT = BUILDBOT_DIRECTORY / 'worker_codesign.py'
|
||||
BLENDER_GIT_ROOT_DIRECTORY = BUILDBOT_DIRECTORY.parent.parent
|
||||
DARWIN_DIRECTORY = BLENDER_GIT_ROOT_DIRECTORY / 'release' / 'darwin'
|
||||
|
@@ -33,7 +33,7 @@ else()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/slave_codesign.py"
|
||||
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/worker_codesign.py"
|
||||
"${CMAKE_INSTALL_PREFIX}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
RESULT_VARIABLE exit_code
|
@@ -25,7 +25,7 @@ import buildbot_utils
|
||||
|
||||
def get_cmake_options(builder):
|
||||
post_install_script = os.path.join(
|
||||
builder.blender_dir, 'build_files', 'buildbot', 'slave_codesign.cmake')
|
||||
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
|
||||
|
||||
config_file = "build_files/cmake/config/blender_release.cmake"
|
||||
options = ['-DCMAKE_BUILD_TYPE:STRING=Release',
|
@@ -18,7 +18,7 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Runs on buildbot slave, creating a release package using the build
|
||||
# Runs on buildbot worker, creating a release package using the build
|
||||
# system and zipping it into buildbot_upload.zip. This is then uploaded
|
||||
# to the master in the next buildbot step.
|
||||
|
||||
@@ -110,7 +110,7 @@ def pack_mac(builder):
|
||||
|
||||
release_dir = os.path.join(builder.blender_dir, 'release', 'darwin')
|
||||
buildbot_dir = os.path.join(builder.blender_dir, 'build_files', 'buildbot')
|
||||
bundle_script = os.path.join(buildbot_dir, 'slave_bundle_dmg.py')
|
||||
bundle_script = os.path.join(buildbot_dir, 'worker_bundle_dmg.py')
|
||||
|
||||
command = [bundle_script]
|
||||
command += ['--dmg', package_filepath]
|
||||
@@ -167,7 +167,7 @@ def pack_linux(builder):
|
||||
buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable])
|
||||
|
||||
print("Stripping python...")
|
||||
py_target = os.path.join(builder.install_dir, info.version)
|
||||
py_target = os.path.join(builder.install_dir, info.short_version)
|
||||
buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
|
||||
|
||||
# Construct package name
|
@@ -52,6 +52,7 @@ set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_QUADRIFLOW OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_SDL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_TBB OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_USD OFF CACHE BOOL "" FORCE)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -748,8 +748,7 @@ function(get_blender_version)
|
||||
# - BLENDER_VERSION (major.minor)
|
||||
# - BLENDER_VERSION_MAJOR
|
||||
# - BLENDER_VERSION_MINOR
|
||||
# - BLENDER_SUBVERSION (used for internal versioning mainly)
|
||||
# - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
|
||||
# - BLENDER_VERSION_PATCH
|
||||
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
|
||||
|
||||
# So cmake depends on BKE_blender.h, beware of inf-loops!
|
||||
@@ -759,25 +758,15 @@ function(get_blender_version)
|
||||
file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
|
||||
|
||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}")
|
||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_SUBVERSION[ \t]+([0-9]+).*" "\\1" _out_subversion "${_contents}")
|
||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CHAR[ \t]+([a-z]+).*" "\\1" _out_version_char "${_contents}")
|
||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" _out_version_patch "${_contents}")
|
||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}")
|
||||
|
||||
if(NOT ${_out_version} MATCHES "[0-9]+")
|
||||
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION")
|
||||
endif()
|
||||
|
||||
if(NOT ${_out_subversion} MATCHES "[0-9]+")
|
||||
message(FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION")
|
||||
endif()
|
||||
|
||||
# clumsy regex, only single char are ok but it could be unset
|
||||
|
||||
string(LENGTH "${_out_version_char}" _out_version_char_len)
|
||||
if(NOT _out_version_char_len EQUAL 1)
|
||||
set(_out_version_char "")
|
||||
elseif(NOT ${_out_version_char} MATCHES "[a-z]+")
|
||||
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR")
|
||||
if(NOT ${_out_version_patch} MATCHES "[0-9]+")
|
||||
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_PATCH")
|
||||
endif()
|
||||
|
||||
if(NOT ${_out_version_cycle} MATCHES "[a-z]+")
|
||||
@@ -787,23 +776,11 @@ function(get_blender_version)
|
||||
math(EXPR _out_version_major "${_out_version} / 100")
|
||||
math(EXPR _out_version_minor "${_out_version} % 100")
|
||||
|
||||
# for packaging, alpha to numbers
|
||||
string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty)
|
||||
if(${_out_version_char_empty})
|
||||
set(_out_version_char_index "0")
|
||||
else()
|
||||
set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
|
||||
list(FIND _char_ls ${_out_version_char} _out_version_char_index)
|
||||
math(EXPR _out_version_char_index "${_out_version_char_index} + 1")
|
||||
endif()
|
||||
|
||||
# output vars
|
||||
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE)
|
||||
set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_PATCH "${_out_version_patch}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
|
||||
|
||||
endfunction()
|
||||
|
@@ -7,7 +7,7 @@ set(PROJECT_VENDOR "Blender Foundation")
|
||||
|
||||
set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR})
|
||||
set(MINOR_VERSION ${BLENDER_VERSION_MINOR})
|
||||
set(PATCH_VERSION ${BLENDER_VERSION_CHAR_INDEX})
|
||||
set(PATCH_VERSION ${BLENDER_VERSION_PATCH})
|
||||
|
||||
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
||||
set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
|
||||
|
@@ -166,7 +166,7 @@ if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /JMC")
|
||||
endif()
|
||||
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152,70656 /INCREMENTAL:NO ")
|
||||
set(PLATFORM_LINKFLAGS_RELEASE "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib")
|
||||
|
||||
|
@@ -7,15 +7,14 @@ BASE_DIR="$PWD"
|
||||
|
||||
blender_srcdir=$(dirname -- $0)/../..
|
||||
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
blender_version_patch=$(grep "BLENDER_VERSION_PATCH\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
|
||||
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100).$blender_version_patch
|
||||
if [ "$blender_version_cycle" = "release" ] ; then
|
||||
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char
|
||||
SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$"
|
||||
else
|
||||
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion
|
||||
VERSION=$VERSION-$blender_version_cycle
|
||||
SUBMODULE_EXCLUDE="^$" # dummy regex
|
||||
fi
|
||||
|
||||
|
@@ -403,32 +403,21 @@ MODULE_GROUPING = {
|
||||
|
||||
# -------------------------------BLENDER----------------------------------------
|
||||
|
||||
blender_version_strings = [str(v) for v in bpy.app.version]
|
||||
is_release = bpy.app.version_cycle in {"rc", "release"}
|
||||
|
||||
# converting bytes to strings, due to T30154
|
||||
BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8')
|
||||
|
||||
if is_release:
|
||||
# '2.62a'
|
||||
BLENDER_VERSION_DOTS = ".".join(blender_version_strings[:2]) + bpy.app.version_char
|
||||
else:
|
||||
# '2.62.1'
|
||||
BLENDER_VERSION_DOTS = ".".join(blender_version_strings)
|
||||
# '2.83.0 Beta' or '2.83.0' or '2.83.1'
|
||||
BLENDER_VERSION_DOTS = bpy.app.version_string
|
||||
|
||||
if BLENDER_REVISION != "Unknown":
|
||||
# '2.62a SHA1' (release) or '2.62.1 SHA1' (non-release)
|
||||
# SHA1 Git hash
|
||||
BLENDER_VERSION_HASH = BLENDER_REVISION
|
||||
else:
|
||||
# Fallback: Should not be used
|
||||
BLENDER_VERSION_HASH = "Hash Unknown"
|
||||
|
||||
if is_release:
|
||||
# '2_62a_release'
|
||||
BLENDER_VERSION_PATH = "%s%s_release" % ("_".join(blender_version_strings[:2]), bpy.app.version_char)
|
||||
else:
|
||||
# '2_62_1'
|
||||
BLENDER_VERSION_PATH = "_".join(blender_version_strings)
|
||||
# '2_83'
|
||||
BLENDER_VERSION_PATH = "%d_%d" % (bpy.app.version[0], bpy.app.version[1])
|
||||
|
||||
# --------------------------DOWNLOADABLE FILES----------------------------------
|
||||
|
||||
|
@@ -36,16 +36,10 @@ fi
|
||||
blender_srcdir=$(dirname -- $0)/../..
|
||||
blender_version_header="$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h"
|
||||
blender_version=$(grep "BLENDER_VERSION\s" "$blender_version_header" | awk '{print $3}')
|
||||
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_version_header" | awk '{print $3}')
|
||||
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_version_header" | awk '{print $3}')
|
||||
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_version_header" | awk '{print $3}')
|
||||
unset blender_version_header
|
||||
|
||||
if [ "$blender_version_cycle" = "release" ] ; then
|
||||
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
|
||||
else
|
||||
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
|
||||
fi
|
||||
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)
|
||||
|
||||
SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
|
||||
|
||||
|
@@ -127,11 +127,10 @@ def main():
|
||||
" f.write('%d\\n' % is_release)\n"
|
||||
" f.write('%d\\n' % is_beta)\n"
|
||||
" f.write('%s\\n' % branch)\n"
|
||||
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char))\n"
|
||||
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
||||
" f.write('%d.%d\\n' % (bpy.app.version[0], bpy.app.version[1]))\n"
|
||||
" f.write('%d.%d\\n' % (bpy.app.version[0], bpy.app.version[1])\n"
|
||||
" if (is_release or is_beta) else '%s\\n' % branch)\n"
|
||||
" f.write('%d_%d%s_release' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
||||
" if is_release else '%d_%d_%d' % bpy.app.version)\n"
|
||||
" f.write('%d_%d' % (bpy.app.version[0], bpy.app.version[1]))\n"
|
||||
)
|
||||
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
||||
"--python-expr", getver_script, "--", getver_file)
|
||||
|
42
extern/audaspace/plugins/sdl/SDLDevice.cpp
vendored
42
extern/audaspace/plugins/sdl/SDLDevice.cpp
vendored
@@ -52,7 +52,7 @@ SDLDevice::SDLDevice(DeviceSpecs specs, int buffersize) :
|
||||
if(specs.channels == CHANNELS_INVALID)
|
||||
specs.channels = CHANNELS_STEREO;
|
||||
if(specs.format == FORMAT_INVALID)
|
||||
specs.format = FORMAT_S16;
|
||||
specs.format = FORMAT_FLOAT32;
|
||||
if(specs.rate == RATE_INVALID)
|
||||
specs.rate = RATE_48000;
|
||||
|
||||
@@ -61,10 +61,25 @@ SDLDevice::SDLDevice(DeviceSpecs specs, int buffersize) :
|
||||
SDL_AudioSpec format, obtained;
|
||||
|
||||
format.freq = m_specs.rate;
|
||||
if(m_specs.format == FORMAT_U8)
|
||||
switch(m_specs.format)
|
||||
{
|
||||
case FORMAT_U8:
|
||||
format.format = AUDIO_U8;
|
||||
else
|
||||
break;
|
||||
case FORMAT_S16:
|
||||
format.format = AUDIO_S16SYS;
|
||||
break;
|
||||
case FORMAT_S32:
|
||||
format.format = AUDIO_S32SYS;
|
||||
break;
|
||||
case FORMAT_FLOAT32:
|
||||
format.format = AUDIO_F32SYS;
|
||||
break;
|
||||
default:
|
||||
format.format = AUDIO_F32SYS;
|
||||
break;
|
||||
}
|
||||
|
||||
format.channels = m_specs.channels;
|
||||
format.samples = buffersize;
|
||||
format.callback = SDLDevice::SDL_mix;
|
||||
@@ -75,14 +90,25 @@ SDLDevice::SDLDevice(DeviceSpecs specs, int buffersize) :
|
||||
|
||||
m_specs.rate = (SampleRate)obtained.freq;
|
||||
m_specs.channels = (Channels)obtained.channels;
|
||||
if(obtained.format == AUDIO_U8)
|
||||
m_specs.format = FORMAT_U8;
|
||||
else if(obtained.format == AUDIO_S16LSB || obtained.format == AUDIO_S16MSB)
|
||||
m_specs.format = FORMAT_S16;
|
||||
else
|
||||
|
||||
switch(obtained.format)
|
||||
{
|
||||
case AUDIO_U8:
|
||||
m_specs.format = FORMAT_U8;
|
||||
break;
|
||||
case AUDIO_S16SYS:
|
||||
m_specs.format = FORMAT_S16;
|
||||
break;
|
||||
case AUDIO_S32SYS:
|
||||
m_specs.format = FORMAT_S32;
|
||||
break;
|
||||
case AUDIO_F32SYS:
|
||||
m_specs.format = FORMAT_FLOAT32;
|
||||
break;
|
||||
default:
|
||||
SDL_CloseAudio();
|
||||
AUD_THROW(DeviceException, "The sample format obtained from SDL is not supported.");
|
||||
break;
|
||||
}
|
||||
|
||||
create();
|
||||
|
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
@@ -1,3 +1,3 @@
|
||||
|
||||
|
||||
#define MANTA_GIT_VERSION "commit 21303fab2eda588ec22988bf9e5762d2001c131f"
|
||||
#define MANTA_GIT_VERSION "commit b61bf9efa7a1d8ca98635076a7e9f2c4dacb2914"
|
||||
|
62
extern/mantaflow/preprocessed/particle.h
vendored
62
extern/mantaflow/preprocessed/particle.h
vendored
@@ -469,6 +469,7 @@ template<class S> class ParticleSystem : public ParticleBase {
|
||||
const int integrationMode,
|
||||
const bool deleteInObstacle = true,
|
||||
const bool stopInObstacle = true,
|
||||
const bool skipNew = false,
|
||||
const ParticleDataImpl<int> *ptype = NULL,
|
||||
const int exclude = 0);
|
||||
static PyObject *_W_9(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
|
||||
@@ -486,13 +487,20 @@ template<class S> class ParticleSystem : public ParticleBase {
|
||||
const int integrationMode = _args.get<int>("integrationMode", 2, &_lock);
|
||||
const bool deleteInObstacle = _args.getOpt<bool>("deleteInObstacle", 3, true, &_lock);
|
||||
const bool stopInObstacle = _args.getOpt<bool>("stopInObstacle", 4, true, &_lock);
|
||||
const bool skipNew = _args.getOpt<bool>("skipNew", 5, false, &_lock);
|
||||
const ParticleDataImpl<int> *ptype = _args.getPtrOpt<ParticleDataImpl<int>>(
|
||||
"ptype", 5, NULL, &_lock);
|
||||
const int exclude = _args.getOpt<int>("exclude", 6, 0, &_lock);
|
||||
"ptype", 6, NULL, &_lock);
|
||||
const int exclude = _args.getOpt<int>("exclude", 7, 0, &_lock);
|
||||
pbo->_args.copy(_args);
|
||||
_retval = getPyNone();
|
||||
pbo->advectInGrid(
|
||||
flags, vel, integrationMode, deleteInObstacle, stopInObstacle, ptype, exclude);
|
||||
pbo->advectInGrid(flags,
|
||||
vel,
|
||||
integrationMode,
|
||||
deleteInObstacle,
|
||||
stopInObstacle,
|
||||
skipNew,
|
||||
ptype,
|
||||
exclude);
|
||||
pbo->_args.check();
|
||||
}
|
||||
pbFinalizePlugin(pbo->getParent(), "ParticleSystem::advectInGrid", !noTiming);
|
||||
@@ -1863,6 +1871,7 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
|
||||
const Real dt,
|
||||
const bool deleteInObstacle,
|
||||
const bool stopInObstacle,
|
||||
const bool skipNew,
|
||||
const ParticleDataImpl<int> *ptype,
|
||||
const int exclude,
|
||||
std::vector<Vec3> &u)
|
||||
@@ -1873,6 +1882,7 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
|
||||
dt(dt),
|
||||
deleteInObstacle(deleteInObstacle),
|
||||
stopInObstacle(stopInObstacle),
|
||||
skipNew(skipNew),
|
||||
ptype(ptype),
|
||||
exclude(exclude),
|
||||
u(u)
|
||||
@@ -1885,11 +1895,13 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
|
||||
const Real dt,
|
||||
const bool deleteInObstacle,
|
||||
const bool stopInObstacle,
|
||||
const bool skipNew,
|
||||
const ParticleDataImpl<int> *ptype,
|
||||
const int exclude,
|
||||
std::vector<Vec3> &u) const
|
||||
{
|
||||
if ((p[idx].flag & ParticleBase::PDELETE) || (ptype && ((*ptype)[idx] & exclude))) {
|
||||
if ((p[idx].flag & ParticleBase::PDELETE) || (ptype && ((*ptype)[idx] & exclude)) ||
|
||||
(skipNew && (p[idx].flag & ParticleBase::PNEW))) {
|
||||
u[idx] = 0.;
|
||||
return;
|
||||
}
|
||||
@@ -1910,7 +1922,7 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
|
||||
void operator()(const tbb::blocked_range<IndexInt> &__r) const
|
||||
{
|
||||
for (IndexInt idx = __r.begin(); idx != (IndexInt)__r.end(); idx++)
|
||||
op(idx, p, vel, flags, dt, deleteInObstacle, stopInObstacle, ptype, exclude, u);
|
||||
op(idx, p, vel, flags, dt, deleteInObstacle, stopInObstacle, skipNew, ptype, exclude, u);
|
||||
}
|
||||
void run()
|
||||
{
|
||||
@@ -1922,6 +1934,7 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
|
||||
const Real dt;
|
||||
const bool deleteInObstacle;
|
||||
const bool stopInObstacle;
|
||||
const bool skipNew;
|
||||
const ParticleDataImpl<int> *ptype;
|
||||
const int exclude;
|
||||
std::vector<Vec3> &u;
|
||||
@@ -1933,6 +1946,7 @@ template<class S> struct GridAdvectKernel : public KernelBase {
|
||||
const Real dt,
|
||||
const bool deleteInObstacle,
|
||||
const bool stopInObstacle,
|
||||
const bool skipNew,
|
||||
const ParticleDataImpl<int> *ptype,
|
||||
const int exclude)
|
||||
: KernelBase(p.size()),
|
||||
@@ -1943,6 +1957,7 @@ template<class S> struct GridAdvectKernel : public KernelBase {
|
||||
dt,
|
||||
deleteInObstacle,
|
||||
stopInObstacle,
|
||||
skipNew,
|
||||
ptype,
|
||||
exclude,
|
||||
u),
|
||||
@@ -1952,6 +1967,7 @@ template<class S> struct GridAdvectKernel : public KernelBase {
|
||||
dt(dt),
|
||||
deleteInObstacle(deleteInObstacle),
|
||||
stopInObstacle(stopInObstacle),
|
||||
skipNew(skipNew),
|
||||
ptype(ptype),
|
||||
exclude(exclude),
|
||||
u((size))
|
||||
@@ -2001,16 +2017,21 @@ template<class S> struct GridAdvectKernel : public KernelBase {
|
||||
return stopInObstacle;
|
||||
}
|
||||
typedef bool type5;
|
||||
inline const ParticleDataImpl<int> *getArg6()
|
||||
inline const bool &getArg6()
|
||||
{
|
||||
return skipNew;
|
||||
}
|
||||
typedef bool type6;
|
||||
inline const ParticleDataImpl<int> *getArg7()
|
||||
{
|
||||
return ptype;
|
||||
}
|
||||
typedef ParticleDataImpl<int> type6;
|
||||
inline const int &getArg7()
|
||||
typedef ParticleDataImpl<int> type7;
|
||||
inline const int &getArg8()
|
||||
{
|
||||
return exclude;
|
||||
}
|
||||
typedef int type7;
|
||||
typedef int type8;
|
||||
void runMessage()
|
||||
{
|
||||
debMsg("Executing kernel GridAdvectKernel ", 3);
|
||||
@@ -2025,6 +2046,7 @@ template<class S> struct GridAdvectKernel : public KernelBase {
|
||||
const Real dt;
|
||||
const bool deleteInObstacle;
|
||||
const bool stopInObstacle;
|
||||
const bool skipNew;
|
||||
const ParticleDataImpl<int> *ptype;
|
||||
const int exclude;
|
||||
std::vector<Vec3> u;
|
||||
@@ -2195,6 +2217,7 @@ void ParticleSystem<S>::advectInGrid(const FlagGrid &flags,
|
||||
const int integrationMode,
|
||||
const bool deleteInObstacle,
|
||||
const bool stopInObstacle,
|
||||
const bool skipNew,
|
||||
const ParticleDataImpl<int> *ptype,
|
||||
const int exclude)
|
||||
{
|
||||
@@ -2208,8 +2231,15 @@ void ParticleSystem<S>::advectInGrid(const FlagGrid &flags,
|
||||
}
|
||||
|
||||
// update positions
|
||||
GridAdvectKernel<S> kernel(
|
||||
mData, vel, flags, getParent()->getDt(), deleteInObstacle, stopInObstacle, ptype, exclude);
|
||||
GridAdvectKernel<S> kernel(mData,
|
||||
vel,
|
||||
flags,
|
||||
getParent()->getDt(),
|
||||
deleteInObstacle,
|
||||
stopInObstacle,
|
||||
skipNew,
|
||||
ptype,
|
||||
exclude);
|
||||
integratePointSet(kernel, integrationMode);
|
||||
|
||||
if (!deleteInObstacle) {
|
||||
@@ -2438,15 +2468,15 @@ template<class S> void ParticleSystem<S>::compress()
|
||||
//! insert buffered positions as new particles, update additional particle data
|
||||
template<class S> void ParticleSystem<S>::insertBufferedParticles()
|
||||
{
|
||||
// clear new flag everywhere
|
||||
for (IndexInt i = 0; i < (IndexInt)mData.size(); ++i)
|
||||
mData[i].flag &= ~PNEW;
|
||||
|
||||
if (mNewBufferPos.size() == 0)
|
||||
return;
|
||||
IndexInt newCnt = mData.size();
|
||||
resizeAll(newCnt + mNewBufferPos.size());
|
||||
|
||||
// clear new flag everywhere
|
||||
for (IndexInt i = 0; i < (IndexInt)mData.size(); ++i)
|
||||
mData[i].flag &= ~PNEW;
|
||||
|
||||
for (IndexInt i = 0; i < (IndexInt)mNewBufferPos.size(); ++i) {
|
||||
int flag = (mNewBufferFlag.size() > 0) ? mNewBufferFlag[i] : 0;
|
||||
// note, other fields are not initialized here...
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "util/util_args.h"
|
||||
#include "util/util_foreach.h"
|
||||
#include "util/util_function.h"
|
||||
#include "util/util_image.h"
|
||||
#include "util/util_logging.h"
|
||||
#include "util/util_path.h"
|
||||
#include "util/util_progress.h"
|
||||
|
@@ -84,7 +84,7 @@ def update_script_node(node, report):
|
||||
if script.is_in_memory or script.is_dirty or script.is_modified or not os.path.exists(osl_path):
|
||||
# write text datablock contents to temporary file
|
||||
osl_file = tempfile.NamedTemporaryFile(mode='w', suffix=".osl", delete=False)
|
||||
osl_file.write(script.as_string())
|
||||
osl_file.write(script.as_string() + "\n")
|
||||
osl_file.close()
|
||||
|
||||
ok, oso_path = osl_compile(osl_file.name, report)
|
||||
|
@@ -460,9 +460,12 @@ void BlenderSync::sync_motion(BL::RenderSettings &b_render,
|
||||
sync_objects(b_depsgraph, b_v3d, 0.0f);
|
||||
}
|
||||
|
||||
/* always sample these times for camera motion */
|
||||
motion_times.insert(-1.0f);
|
||||
motion_times.insert(1.0f);
|
||||
/* Insert motion times from camera. Motion times from other objects
|
||||
* have already been added in a sync_objects call. */
|
||||
uint camera_motion_steps = object_motion_steps(b_cam, b_cam);
|
||||
for (size_t step = 0; step < camera_motion_steps; step++) {
|
||||
motion_times.insert(scene->camera->motion_time(step));
|
||||
}
|
||||
|
||||
/* note iteration over motion_times set happens in sorted order */
|
||||
foreach (float relative_time, motion_times) {
|
||||
@@ -487,10 +490,8 @@ void BlenderSync::sync_motion(BL::RenderSettings &b_render,
|
||||
b_engine.frame_set(frame, subframe);
|
||||
python_thread_state_save(python_thread_state);
|
||||
|
||||
/* sync camera, only supports two times at the moment */
|
||||
if (relative_time == -1.0f || relative_time == 1.0f) {
|
||||
sync_camera_motion(b_render, b_cam, width, height, relative_time);
|
||||
}
|
||||
/* Syncs camera motion if relative_time is one of the camera's motion times. */
|
||||
sync_camera_motion(b_render, b_cam, width, height, relative_time);
|
||||
|
||||
/* sync object */
|
||||
sync_objects(b_depsgraph, b_v3d, relative_time);
|
||||
|
@@ -168,9 +168,13 @@ void BlenderSession::create_session()
|
||||
|
||||
void BlenderSession::reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
|
||||
{
|
||||
/* Update data, scene and depsgraph pointers. These can change after undo. */
|
||||
this->b_data = b_data;
|
||||
this->b_depsgraph = b_depsgraph;
|
||||
this->b_scene = b_depsgraph.scene_eval();
|
||||
if (sync) {
|
||||
sync->reset(this->b_data, this->b_scene);
|
||||
}
|
||||
|
||||
if (preview_osl) {
|
||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||
|
@@ -384,16 +384,16 @@ static ShaderNode *add_node(Scene *scene,
|
||||
|
||||
switch (b_aniso_node.distribution()) {
|
||||
case BL::ShaderNodeBsdfAnisotropic::distribution_BECKMANN:
|
||||
aniso->distribution = CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID;
|
||||
aniso->distribution = CLOSURE_BSDF_MICROFACET_BECKMANN_ID;
|
||||
break;
|
||||
case BL::ShaderNodeBsdfAnisotropic::distribution_GGX:
|
||||
aniso->distribution = CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID;
|
||||
aniso->distribution = CLOSURE_BSDF_MICROFACET_GGX_ID;
|
||||
break;
|
||||
case BL::ShaderNodeBsdfAnisotropic::distribution_MULTI_GGX:
|
||||
aniso->distribution = CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID;
|
||||
aniso->distribution = CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID;
|
||||
break;
|
||||
case BL::ShaderNodeBsdfAnisotropic::distribution_ASHIKHMIN_SHIRLEY:
|
||||
aniso->distribution = CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID;
|
||||
aniso->distribution = CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1231,12 +1231,11 @@ void BlenderSync::sync_materials(BL::Depsgraph &b_depsgraph, bool update_all)
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if (shader_map.add_or_update(&shader, b_mat) || shader->need_sync_object || update_all) {
|
||||
if (shader_map.add_or_update(&shader, b_mat) || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
shader->name = b_mat.name().c_str();
|
||||
shader->pass_id = b_mat.pass_index();
|
||||
shader->need_sync_object = false;
|
||||
|
||||
/* create nodes */
|
||||
if (b_mat.use_nodes() && b_mat.node_tree()) {
|
||||
|
@@ -78,6 +78,14 @@ BlenderSync::~BlenderSync()
|
||||
{
|
||||
}
|
||||
|
||||
void BlenderSync::reset(BL::BlendData &b_data, BL::Scene &b_scene)
|
||||
{
|
||||
/* Update data and scene pointers in case they change in session reset,
|
||||
* for example after undo. */
|
||||
this->b_data = b_data;
|
||||
this->b_scene = b_scene;
|
||||
}
|
||||
|
||||
/* Sync */
|
||||
|
||||
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
|
||||
@@ -85,8 +93,6 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
|
||||
/* 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);
|
||||
|
||||
if (experimental) {
|
||||
/* Mark all meshes as needing to be exported again if dicing changed. */
|
||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||
@@ -189,19 +195,6 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
|
||||
if (viewport_parameters.modified(new_viewport_parameters)) {
|
||||
world_recalc = true;
|
||||
}
|
||||
|
||||
/* Updates shader with object dependency if objects changed. */
|
||||
if (has_updated_objects) {
|
||||
if (scene->default_background->has_object_dependency) {
|
||||
world_recalc = true;
|
||||
}
|
||||
|
||||
foreach (Shader *shader, scene->shaders) {
|
||||
if (shader->has_object_dependency) {
|
||||
shader->need_sync_object = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BlenderSync::sync_data(BL::RenderSettings &b_render,
|
||||
|
@@ -61,6 +61,8 @@ class BlenderSync {
|
||||
Progress &progress);
|
||||
~BlenderSync();
|
||||
|
||||
void reset(BL::BlendData &b_data, BL::Scene &b_scene);
|
||||
|
||||
/* sync */
|
||||
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
|
||||
void sync_data(BL::RenderSettings &b_render,
|
||||
|
@@ -34,15 +34,13 @@ CCL_NAMESPACE_BEGIN
|
||||
/* TODO: verify this is not loading unnecessary attributes. */
|
||||
class BlenderSmokeLoader : public ImageLoader {
|
||||
public:
|
||||
BlenderSmokeLoader(const BL::Object &b_ob, AttributeStandard attribute)
|
||||
: b_ob(b_ob), attribute(attribute)
|
||||
BlenderSmokeLoader(BL::Object &b_ob, AttributeStandard attribute)
|
||||
: b_domain(object_fluid_gas_domain_find(b_ob)), b_mesh(b_ob.data()), attribute(attribute)
|
||||
{
|
||||
}
|
||||
|
||||
bool load_metadata(ImageMetaData &metadata) override
|
||||
{
|
||||
BL::FluidDomainSettings b_domain = object_fluid_gas_domain_find(b_ob);
|
||||
|
||||
if (!b_domain) {
|
||||
return false;
|
||||
}
|
||||
@@ -79,7 +77,6 @@ class BlenderSmokeLoader : public ImageLoader {
|
||||
/* Create a matrix to transform from object space to mesh texture space.
|
||||
* This does not work with deformations but that can probably only be done
|
||||
* well with a volume grid mapping of coordinates. */
|
||||
BL::Mesh b_mesh(b_ob.data());
|
||||
float3 loc, size;
|
||||
mesh_texture_space(b_mesh, loc, size);
|
||||
metadata.transform_3d = transform_translate(-loc) * transform_scale(size);
|
||||
@@ -90,9 +87,6 @@ class BlenderSmokeLoader : public ImageLoader {
|
||||
|
||||
bool load_pixels(const ImageMetaData &, void *pixels, const size_t, const bool) override
|
||||
{
|
||||
/* smoke volume data */
|
||||
BL::FluidDomainSettings b_domain = object_fluid_gas_domain_find(b_ob);
|
||||
|
||||
if (!b_domain) {
|
||||
return false;
|
||||
}
|
||||
@@ -179,10 +173,11 @@ class BlenderSmokeLoader : public ImageLoader {
|
||||
bool equals(const ImageLoader &other) const override
|
||||
{
|
||||
const BlenderSmokeLoader &other_loader = (const BlenderSmokeLoader &)other;
|
||||
return b_ob == other_loader.b_ob && attribute == other_loader.attribute;
|
||||
return b_domain == other_loader.b_domain && attribute == other_loader.attribute;
|
||||
}
|
||||
|
||||
BL::Object b_ob;
|
||||
BL::FluidDomainSettings b_domain;
|
||||
BL::Mesh b_mesh;
|
||||
AttributeStandard attribute;
|
||||
};
|
||||
|
||||
|
@@ -924,7 +924,8 @@ class OptiXDevice : public CUDADevice {
|
||||
&rtiles[9].h,
|
||||
&rtiles[9].offset,
|
||||
&rtiles[9].stride,
|
||||
&task.pass_stride};
|
||||
&task.pass_stride,
|
||||
&rtile.sample};
|
||||
launch_filter_kernel(
|
||||
"kernel_cuda_filter_convert_from_rgb", rtiles[9].w, rtiles[9].h, output_args);
|
||||
# endif
|
||||
|
@@ -1903,7 +1903,15 @@ string OpenCLDevice::kernel_build_options(const string *debug_src)
|
||||
int version_major, version_minor;
|
||||
if (OpenCLInfo::get_device_version(cdDevice, &version_major, &version_minor)) {
|
||||
if (version_major >= 2) {
|
||||
build_options += "-cl-std=CL2.0 ";
|
||||
/* This appears to trigger a driver bug in Radeon RX cards, so we
|
||||
* don't use OpenCL 2.0 for those. */
|
||||
string device_name = OpenCLInfo::get_readable_device_name(cdDevice);
|
||||
if (!(string_startswith(device_name, "Radeon RX 4") ||
|
||||
string_startswith(device_name, "Radeon (TM) RX 4") ||
|
||||
string_startswith(device_name, "Radeon RX 5") ||
|
||||
string_startswith(device_name, "Radeon (TM) RX 5"))) {
|
||||
build_options += "-cl-std=CL2.0 ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -300,7 +300,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg,
|
||||
// Is set to zero on miss or if ray is aborted, so can be used as return value
|
||||
uint p5 = max_hits;
|
||||
|
||||
local_isect->num_hits = 0; // Initialize hit count to zero
|
||||
if (local_isect) {
|
||||
local_isect->num_hits = 0; // Initialize hit count to zero
|
||||
}
|
||||
optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0,
|
||||
ray->P,
|
||||
ray->D,
|
||||
@@ -323,7 +325,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg,
|
||||
return p5;
|
||||
# else /* __KERNEL_OPTIX__ */
|
||||
if (!scene_intersect_valid(ray)) {
|
||||
local_isect->num_hits = 0;
|
||||
if (local_isect) {
|
||||
local_isect->num_hits = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -229,8 +229,6 @@ ccl_device_inline int bsdf_sample(KernelGlobals *kg,
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
|
||||
label = bsdf_microfacet_ggx_sample(kg,
|
||||
sc,
|
||||
@@ -281,7 +279,6 @@ ccl_device_inline int bsdf_sample(KernelGlobals *kg,
|
||||
&sd->lcg_state);
|
||||
break;
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
|
||||
label = bsdf_microfacet_beckmann_sample(kg,
|
||||
sc,
|
||||
@@ -298,7 +295,6 @@ ccl_device_inline int bsdf_sample(KernelGlobals *kg,
|
||||
pdf);
|
||||
break;
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
|
||||
label = bsdf_ashikhmin_shirley_sample(sc,
|
||||
sd->Ng,
|
||||
sd->I,
|
||||
@@ -504,8 +500,6 @@ ccl_device_inline
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
|
||||
eval = bsdf_microfacet_ggx_eval_reflect(sc, sd->I, omega_in, pdf);
|
||||
break;
|
||||
@@ -519,12 +513,10 @@ ccl_device_inline
|
||||
sc, sd->I, omega_in, pdf, &sd->lcg_state);
|
||||
break;
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
|
||||
eval = bsdf_microfacet_beckmann_eval_reflect(sc, sd->I, omega_in, pdf);
|
||||
break;
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
|
||||
eval = bsdf_ashikhmin_shirley_eval_reflect(sc, sd->I, omega_in, pdf);
|
||||
break;
|
||||
case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
|
||||
@@ -595,8 +587,6 @@ ccl_device_inline
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
|
||||
eval = bsdf_microfacet_ggx_eval_transmit(sc, sd->I, omega_in, pdf);
|
||||
break;
|
||||
@@ -610,12 +600,10 @@ ccl_device_inline
|
||||
sc, sd->I, omega_in, pdf, &sd->lcg_state);
|
||||
break;
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
|
||||
eval = bsdf_microfacet_beckmann_eval_transmit(sc, sd->I, omega_in, pdf);
|
||||
break;
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
|
||||
eval = bsdf_ashikhmin_shirley_eval_transmit(sc, sd->I, omega_in, pdf);
|
||||
break;
|
||||
case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
|
||||
@@ -679,18 +667,14 @@ ccl_device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness)
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
|
||||
bsdf_microfacet_ggx_blur(sc, roughness);
|
||||
break;
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
|
||||
bsdf_microfacet_beckmann_blur(sc, roughness);
|
||||
break;
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
|
||||
bsdf_ashikhmin_shirley_blur(sc, roughness);
|
||||
break;
|
||||
case CLOSURE_BSDF_HAIR_PRINCIPLED_ID:
|
||||
@@ -719,18 +703,14 @@ ccl_device bool bsdf_merge(ShaderClosure *a, ShaderClosure *b)
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
|
||||
return bsdf_microfacet_merge(a, b);
|
||||
case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
|
||||
return bsdf_ashikhmin_velvet_merge(a, b);
|
||||
|
@@ -32,20 +32,11 @@ Other than that, the implementation directly follows the paper.
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
ccl_device int bsdf_ashikhmin_shirley_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f);
|
||||
bsdf->alpha_y = bsdf->alpha_x;
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID;
|
||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||
}
|
||||
|
||||
ccl_device int bsdf_ashikhmin_shirley_aniso_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f);
|
||||
bsdf->alpha_y = clamp(bsdf->alpha_y, 1e-4f, 1.0f);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID;
|
||||
bsdf->type = CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID;
|
||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||
}
|
||||
|
||||
|
@@ -256,9 +256,7 @@ ccl_device_forceinline float3 reflection_color(const MicrofacetBsdf *bsdf, float
|
||||
{
|
||||
float3 F = make_float3(1.0f, 1.0f, 1.0f);
|
||||
bool use_fresnel = (bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID ||
|
||||
bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID ||
|
||||
bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID);
|
||||
|
||||
bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID);
|
||||
if (use_fresnel) {
|
||||
float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
|
||||
|
||||
@@ -311,19 +309,27 @@ ccl_device int bsdf_microfacet_ggx_setup(MicrofacetBsdf *bsdf)
|
||||
bsdf->extra = NULL;
|
||||
|
||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||
bsdf->alpha_y = bsdf->alpha_x;
|
||||
bsdf->alpha_y = saturate(bsdf->alpha_y);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_ID;
|
||||
|
||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||
}
|
||||
|
||||
/* Required to maintain OSL interface. */
|
||||
ccl_device int bsdf_microfacet_ggx_isotropic_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
bsdf->alpha_y = bsdf->alpha_x;
|
||||
|
||||
return bsdf_microfacet_ggx_setup(bsdf);
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd)
|
||||
{
|
||||
bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
|
||||
|
||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||
bsdf->alpha_y = bsdf->alpha_x;
|
||||
bsdf->alpha_y = saturate(bsdf->alpha_y);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID;
|
||||
|
||||
@@ -361,32 +367,6 @@ ccl_device bool bsdf_microfacet_merge(const ShaderClosure *a, const ShaderClosur
|
||||
(bsdf_a->extra->clearcoat == bsdf_b->extra->clearcoat)));
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_ggx_aniso_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
bsdf->extra = NULL;
|
||||
|
||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||
bsdf->alpha_y = saturate(bsdf->alpha_y);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID;
|
||||
|
||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd)
|
||||
{
|
||||
bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
|
||||
|
||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||
bsdf->alpha_y = saturate(bsdf->alpha_y);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID;
|
||||
|
||||
bsdf_microfacet_fresnel_color(sd, bsdf);
|
||||
|
||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_ggx_refraction_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
bsdf->extra = NULL;
|
||||
@@ -636,8 +616,7 @@ ccl_device int bsdf_microfacet_ggx_sample(KernelGlobals *kg,
|
||||
*eval = make_float3(1e6f, 1e6f, 1e6f);
|
||||
|
||||
bool use_fresnel = (bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID ||
|
||||
bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID ||
|
||||
bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID);
|
||||
bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID);
|
||||
|
||||
/* if fresnel is used, calculate the color with reflection_color(...) */
|
||||
if (use_fresnel) {
|
||||
@@ -811,19 +790,18 @@ ccl_device int bsdf_microfacet_ggx_sample(KernelGlobals *kg,
|
||||
ccl_device int bsdf_microfacet_beckmann_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||
bsdf->alpha_y = bsdf->alpha_x;
|
||||
bsdf->alpha_y = saturate(bsdf->alpha_y);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_BECKMANN_ID;
|
||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_beckmann_aniso_setup(MicrofacetBsdf *bsdf)
|
||||
/* Required to maintain OSL interface. */
|
||||
ccl_device int bsdf_microfacet_beckmann_isotropic_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||
bsdf->alpha_y = saturate(bsdf->alpha_y);
|
||||
bsdf->alpha_y = bsdf->alpha_x;
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID;
|
||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||
return bsdf_microfacet_beckmann_setup(bsdf);
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_beckmann_refraction_setup(MicrofacetBsdf *bsdf)
|
||||
|
@@ -384,32 +384,10 @@ ccl_device int bsdf_microfacet_multi_ggx_common_setup(MicrofacetBsdf *bsdf)
|
||||
return SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSDF_NEEDS_LCG;
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_multi_ggx_aniso_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
if (is_zero(bsdf->T))
|
||||
bsdf->T = make_float3(1.0f, 0.0f, 0.0f);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID;
|
||||
|
||||
return bsdf_microfacet_multi_ggx_common_setup(bsdf);
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_multi_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsdf,
|
||||
const ShaderData *sd)
|
||||
{
|
||||
if (is_zero(bsdf->T))
|
||||
bsdf->T = make_float3(1.0f, 0.0f, 0.0f);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID;
|
||||
|
||||
bsdf_microfacet_fresnel_color(sd, bsdf);
|
||||
|
||||
return bsdf_microfacet_multi_ggx_common_setup(bsdf);
|
||||
}
|
||||
|
||||
ccl_device int bsdf_microfacet_multi_ggx_setup(MicrofacetBsdf *bsdf)
|
||||
{
|
||||
bsdf->alpha_y = bsdf->alpha_x;
|
||||
if (is_zero(bsdf->T))
|
||||
bsdf->T = make_float3(1.0f, 0.0f, 0.0f);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID;
|
||||
|
||||
@@ -418,7 +396,8 @@ ccl_device int bsdf_microfacet_multi_ggx_setup(MicrofacetBsdf *bsdf)
|
||||
|
||||
ccl_device int bsdf_microfacet_multi_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd)
|
||||
{
|
||||
bsdf->alpha_y = bsdf->alpha_x;
|
||||
if (is_zero(bsdf->T))
|
||||
bsdf->T = make_float3(1.0f, 0.0f, 0.0f);
|
||||
|
||||
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID;
|
||||
|
||||
|
@@ -185,19 +185,19 @@ ccl_device bool kernel_do_adaptive_filter_x(KernelGlobals *kg, int y, ccl_global
|
||||
ccl_global float *buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||
kernel_data.film.pass_adaptive_aux_buffer);
|
||||
if (aux->w == 0.0f) {
|
||||
if ((*aux).w == 0.0f) {
|
||||
any = true;
|
||||
if (x > tile->x && !prev) {
|
||||
index = index - 1;
|
||||
buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
||||
aux = (ccl_global float4 *)(buffer + kernel_data.film.pass_adaptive_aux_buffer);
|
||||
aux->w = 0.0f;
|
||||
(*aux).w = 0.0f;
|
||||
}
|
||||
prev = true;
|
||||
}
|
||||
else {
|
||||
if (prev) {
|
||||
aux->w = 0.0f;
|
||||
(*aux).w = 0.0f;
|
||||
}
|
||||
prev = false;
|
||||
}
|
||||
@@ -214,19 +214,19 @@ ccl_device bool kernel_do_adaptive_filter_y(KernelGlobals *kg, int x, ccl_global
|
||||
ccl_global float *buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||
kernel_data.film.pass_adaptive_aux_buffer);
|
||||
if (aux->w == 0.0f) {
|
||||
if ((*aux).w == 0.0f) {
|
||||
any = true;
|
||||
if (y > tile->y && !prev) {
|
||||
index = index - tile->stride;
|
||||
buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
||||
aux = (ccl_global float4 *)(buffer + kernel_data.film.pass_adaptive_aux_buffer);
|
||||
aux->w = 0.0f;
|
||||
(*aux).w = 0.0f;
|
||||
}
|
||||
prev = true;
|
||||
}
|
||||
else {
|
||||
if (prev) {
|
||||
aux->w = 0.0f;
|
||||
(*aux).w = 0.0f;
|
||||
}
|
||||
prev = false;
|
||||
}
|
||||
|
@@ -28,13 +28,13 @@ ccl_device float4 film_get_pass_result(KernelGlobals *kg,
|
||||
int display_pass_components = kernel_data.film.display_pass_components;
|
||||
|
||||
if (display_pass_components == 4) {
|
||||
ccl_global float4 *in = (ccl_global float4 *)(buffer + display_pass_stride +
|
||||
index * kernel_data.film.pass_stride);
|
||||
float4 in = *(ccl_global float4 *)(buffer + display_pass_stride +
|
||||
index * kernel_data.film.pass_stride);
|
||||
float alpha = use_display_sample_scale ?
|
||||
(kernel_data.film.use_display_pass_alpha ? in->w : 1.0f / sample_scale) :
|
||||
(kernel_data.film.use_display_pass_alpha ? in.w : 1.0f / sample_scale) :
|
||||
1.0f;
|
||||
|
||||
pass_result = make_float4(in->x, in->y, in->z, alpha);
|
||||
pass_result = make_float4(in.x, in.y, in.z, alpha);
|
||||
|
||||
int display_divide_pass_stride = kernel_data.film.display_divide_pass_stride;
|
||||
if (display_divide_pass_stride != -1) {
|
||||
|
@@ -662,7 +662,7 @@ ccl_device void kernel_path_trace(
|
||||
if (kernel_data.film.pass_adaptive_aux_buffer) {
|
||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||
kernel_data.film.pass_adaptive_aux_buffer);
|
||||
if (aux->w > 0.0f) {
|
||||
if ((*aux).w > 0.0f) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -526,7 +526,7 @@ ccl_device void kernel_branched_path_trace(
|
||||
if (kernel_data.film.pass_adaptive_aux_buffer) {
|
||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||
kernel_data.film.pass_adaptive_aux_buffer);
|
||||
if (aux->w > 0.0f) {
|
||||
if ((*aux).w > 0.0f) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -99,7 +99,7 @@ ccl_device bool get_next_work(KernelGlobals *kg,
|
||||
ccl_global float *buffer = kernel_split_params.tile.buffer + buffer_offset;
|
||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||
kernel_data.film.pass_adaptive_aux_buffer);
|
||||
if (aux->w == 0.0f) {
|
||||
if ((*aux).w == 0.0f) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -57,9 +57,9 @@ kernel_cuda_filter_convert_to_rgb(float *rgb, float *buf, int sw, int sh, int st
|
||||
if (num_inputs > 0) {
|
||||
float *in = buf + x * pass_stride + (y * stride + pass_offset.x) / sizeof(float);
|
||||
float *out = rgb + (x + y * sw) * 3;
|
||||
out[0] = clamp(in[0], 0.0f, 10000.0f);
|
||||
out[1] = clamp(in[1], 0.0f, 10000.0f);
|
||||
out[2] = clamp(in[2], 0.0f, 10000.0f);
|
||||
out[0] = clamp(in[0] / num_samples, 0.0f, 10000.0f);
|
||||
out[1] = clamp(in[1] / num_samples, 0.0f, 10000.0f);
|
||||
out[2] = clamp(in[2] / num_samples, 0.0f, 10000.0f);
|
||||
}
|
||||
if (num_inputs > 1) {
|
||||
float *in = buf + x * pass_stride + (y * stride + pass_offset.y) / sizeof(float);
|
||||
@@ -80,16 +80,16 @@ kernel_cuda_filter_convert_to_rgb(float *rgb, float *buf, int sw, int sh, int st
|
||||
|
||||
extern "C" __global__ void
|
||||
CUDA_LAUNCH_BOUNDS(CUDA_THREADS_BLOCK_WIDTH, CUDA_KERNEL_MAX_REGISTERS)
|
||||
kernel_cuda_filter_convert_from_rgb(float *rgb, float *buf, int ix, int iy, int iw, int ih, int sx, int sy, int sw, int sh, int offset, int stride, int pass_stride)
|
||||
kernel_cuda_filter_convert_from_rgb(float *rgb, float *buf, int ix, int iy, int iw, int ih, int sx, int sy, int sw, int sh, int offset, int stride, int pass_stride, int num_samples)
|
||||
{
|
||||
int x = blockDim.x*blockIdx.x + threadIdx.x;
|
||||
int y = blockDim.y*blockIdx.y + threadIdx.y;
|
||||
if(x < sw && y < sh) {
|
||||
float *in = rgb + ((ix + x) + (iy + y) * iw) * 3;
|
||||
float *out = buf + (offset + (sx + x) + (sy + y) * stride) * pass_stride;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
out[0] = in[0] * num_samples;
|
||||
out[1] = in[1] * num_samples;
|
||||
out[2] = in[2] * num_samples;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -100,14 +100,14 @@ CLOSURE_FLOAT3_PARAM(DiffuseClosure, params.N),
|
||||
BSDF_CLOSURE_CLASS_END(AshikhminVelvet, ashikhmin_velvet)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(AshikhminShirley,
|
||||
ashikhmin_shirley_aniso,
|
||||
ashikhmin_shirley,
|
||||
MicrofacetBsdf,
|
||||
LABEL_GLOSSY | LABEL_REFLECT)
|
||||
CLOSURE_FLOAT3_PARAM(AshikhminShirleyClosure, params.N),
|
||||
CLOSURE_FLOAT3_PARAM(AshikhminShirleyClosure, params.T),
|
||||
CLOSURE_FLOAT_PARAM(AshikhminShirleyClosure, params.alpha_x),
|
||||
CLOSURE_FLOAT_PARAM(AshikhminShirleyClosure, params.alpha_y),
|
||||
BSDF_CLOSURE_CLASS_END(AshikhminShirley, ashikhmin_shirley_aniso)
|
||||
BSDF_CLOSURE_CLASS_END(AshikhminShirley, ashikhmin_shirley)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(DiffuseToon, diffuse_toon, ToonBsdf, LABEL_DIFFUSE)
|
||||
CLOSURE_FLOAT3_PARAM(DiffuseToonClosure, params.N),
|
||||
@@ -121,42 +121,42 @@ CLOSURE_FLOAT3_PARAM(DiffuseClosure, params.N),
|
||||
CLOSURE_FLOAT_PARAM(GlossyToonClosure, params.smooth),
|
||||
BSDF_CLOSURE_CLASS_END(GlossyToon, glossy_toon)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGXIsotropic,
|
||||
microfacet_ggx_isotropic,
|
||||
MicrofacetBsdf,
|
||||
LABEL_GLOSSY | LABEL_REFLECT)
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetGGXIsotropicClosure, params.N),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetGGXIsotropicClosure, params.alpha_x),
|
||||
BSDF_CLOSURE_CLASS_END(MicrofacetGGXIsotropic, microfacet_ggx_isotropic)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGX,
|
||||
microfacet_ggx,
|
||||
MicrofacetBsdf,
|
||||
LABEL_GLOSSY | LABEL_REFLECT)
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetGGXClosure, params.N),
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetGGXClosure, params.T),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure, params.alpha_x),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure, params.alpha_y),
|
||||
BSDF_CLOSURE_CLASS_END(MicrofacetGGX, microfacet_ggx)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGXAniso,
|
||||
microfacet_ggx_aniso,
|
||||
BSDF_CLOSURE_CLASS_BEGIN(MicrofacetBeckmannIsotropic,
|
||||
microfacet_beckmann_isotropic,
|
||||
MicrofacetBsdf,
|
||||
LABEL_GLOSSY | LABEL_REFLECT)
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetGGXAnisoClosure, params.N),
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetGGXAnisoClosure, params.T),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetGGXAnisoClosure, params.alpha_x),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetGGXAnisoClosure, params.alpha_y),
|
||||
BSDF_CLOSURE_CLASS_END(MicrofacetGGXAniso, microfacet_ggx_aniso)
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannIsotropicClosure, params.N),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetBeckmannIsotropicClosure, params.alpha_x),
|
||||
BSDF_CLOSURE_CLASS_END(MicrofacetBeckmannIsotropic, microfacet_beckmann_isotropic)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(MicrofacetBeckmann,
|
||||
microfacet_beckmann,
|
||||
MicrofacetBsdf,
|
||||
LABEL_GLOSSY | LABEL_REFLECT)
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannClosure, params.N),
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannClosure, params.T),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure, params.alpha_x),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure, params.alpha_y),
|
||||
BSDF_CLOSURE_CLASS_END(MicrofacetBeckmann, microfacet_beckmann)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(MicrofacetBeckmannAniso,
|
||||
microfacet_beckmann_aniso,
|
||||
MicrofacetBsdf,
|
||||
LABEL_GLOSSY | LABEL_REFLECT)
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannAnisoClosure, params.N),
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannAnisoClosure, params.T),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetBeckmannAnisoClosure, params.alpha_x),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetBeckmannAnisoClosure, params.alpha_y),
|
||||
BSDF_CLOSURE_CLASS_END(MicrofacetBeckmannAniso, microfacet_beckmann_aniso)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGXRefraction,
|
||||
microfacet_ggx_refraction,
|
||||
MicrofacetBsdf,
|
||||
@@ -362,13 +362,16 @@ void OSLShader::register_closures(OSLShadingSystem *ss_)
|
||||
id++,
|
||||
closure_bsdf_transparent_params(),
|
||||
closure_bsdf_transparent_prepare);
|
||||
|
||||
register_closure(
|
||||
ss, "microfacet_ggx", id++, bsdf_microfacet_ggx_params(), bsdf_microfacet_ggx_prepare);
|
||||
ss, "microfacet", id++, closure_bsdf_microfacet_params(), closure_bsdf_microfacet_prepare);
|
||||
register_closure(ss,
|
||||
"microfacet_ggx_aniso",
|
||||
"microfacet_ggx",
|
||||
id++,
|
||||
bsdf_microfacet_ggx_aniso_params(),
|
||||
bsdf_microfacet_ggx_aniso_prepare);
|
||||
bsdf_microfacet_ggx_isotropic_params(),
|
||||
bsdf_microfacet_ggx_isotropic_prepare);
|
||||
register_closure(
|
||||
ss, "microfacet_ggx_aniso", id++, bsdf_microfacet_ggx_params(), bsdf_microfacet_ggx_prepare);
|
||||
register_closure(ss,
|
||||
"microfacet_ggx_refraction",
|
||||
id++,
|
||||
@@ -417,13 +420,13 @@ void OSLShader::register_closures(OSLShadingSystem *ss_)
|
||||
register_closure(ss,
|
||||
"microfacet_beckmann",
|
||||
id++,
|
||||
bsdf_microfacet_beckmann_params(),
|
||||
bsdf_microfacet_beckmann_prepare);
|
||||
bsdf_microfacet_beckmann_isotropic_params(),
|
||||
bsdf_microfacet_beckmann_isotropic_prepare);
|
||||
register_closure(ss,
|
||||
"microfacet_beckmann_aniso",
|
||||
id++,
|
||||
bsdf_microfacet_beckmann_aniso_params(),
|
||||
bsdf_microfacet_beckmann_aniso_prepare);
|
||||
bsdf_microfacet_beckmann_params(),
|
||||
bsdf_microfacet_beckmann_prepare);
|
||||
register_closure(ss,
|
||||
"microfacet_beckmann_refraction",
|
||||
id++,
|
||||
@@ -432,8 +435,8 @@ void OSLShader::register_closures(OSLShadingSystem *ss_)
|
||||
register_closure(ss,
|
||||
"ashikhmin_shirley",
|
||||
id++,
|
||||
bsdf_ashikhmin_shirley_aniso_params(),
|
||||
bsdf_ashikhmin_shirley_aniso_prepare);
|
||||
bsdf_ashikhmin_shirley_params(),
|
||||
bsdf_ashikhmin_shirley_prepare);
|
||||
register_closure(
|
||||
ss, "ashikhmin_velvet", id++, bsdf_ashikhmin_velvet_params(), bsdf_ashikhmin_velvet_prepare);
|
||||
register_closure(
|
||||
@@ -508,6 +511,82 @@ bool CBSDFClosure::skip(const ShaderData *sd, int path_flag, int scattering)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Standard Microfacet Closure */
|
||||
|
||||
class MicrofacetClosure : public CBSDFClosure {
|
||||
public:
|
||||
MicrofacetBsdf params;
|
||||
ustring distribution;
|
||||
int refract;
|
||||
|
||||
void setup(ShaderData *sd, int path_flag, float3 weight)
|
||||
{
|
||||
static ustring u_ggx("ggx");
|
||||
static ustring u_default("default");
|
||||
|
||||
const int label = (refract) ? LABEL_TRANSMIT : LABEL_REFLECT;
|
||||
if (skip(sd, path_flag, LABEL_GLOSSY | label)) {
|
||||
return;
|
||||
}
|
||||
|
||||
MicrofacetBsdf *bsdf = (MicrofacetBsdf *)bsdf_alloc_osl(
|
||||
sd, sizeof(MicrofacetBsdf), weight, ¶ms);
|
||||
|
||||
if (!bsdf) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* GGX */
|
||||
if (distribution == u_ggx || distribution == u_default) {
|
||||
if (!refract) {
|
||||
if (params.alpha_x == params.alpha_y) {
|
||||
/* Isotropic */
|
||||
sd->flag |= bsdf_microfacet_ggx_isotropic_setup(bsdf);
|
||||
}
|
||||
else {
|
||||
/* Anisotropic */
|
||||
sd->flag |= bsdf_microfacet_ggx_setup(bsdf);
|
||||
}
|
||||
}
|
||||
else {
|
||||
sd->flag |= bsdf_microfacet_ggx_refraction_setup(bsdf);
|
||||
}
|
||||
}
|
||||
/* Beckmann */
|
||||
else {
|
||||
if (!refract) {
|
||||
if (params.alpha_x == params.alpha_y) {
|
||||
/* Isotropic */
|
||||
sd->flag |= bsdf_microfacet_beckmann_isotropic_setup(bsdf);
|
||||
}
|
||||
else {
|
||||
/* Anisotropic */
|
||||
sd->flag |= bsdf_microfacet_beckmann_setup(bsdf);
|
||||
}
|
||||
}
|
||||
else {
|
||||
sd->flag |= bsdf_microfacet_beckmann_refraction_setup(bsdf);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ClosureParam *closure_bsdf_microfacet_params()
|
||||
{
|
||||
static ClosureParam params[] = {CLOSURE_STRING_PARAM(MicrofacetClosure, distribution),
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetClosure, params.N),
|
||||
CLOSURE_FLOAT3_PARAM(MicrofacetClosure, params.T),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetClosure, params.alpha_x),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetClosure, params.alpha_y),
|
||||
CLOSURE_FLOAT_PARAM(MicrofacetClosure, params.ior),
|
||||
CLOSURE_INT_PARAM(MicrofacetClosure, refract),
|
||||
CLOSURE_STRING_KEYPARAM(MicrofacetClosure, label, "label"),
|
||||
CLOSURE_FINISH_PARAM(MicrofacetClosure)};
|
||||
|
||||
return params;
|
||||
}
|
||||
CCLOSURE_PREPARE(closure_bsdf_microfacet_prepare, MicrofacetClosure)
|
||||
|
||||
/* GGX closures with Fresnel */
|
||||
|
||||
class MicrofacetFresnelClosure : public CBSDFClosure {
|
||||
@@ -582,7 +661,7 @@ class MicrofacetGGXAnisoFresnelClosure : public MicrofacetFresnelClosure {
|
||||
return;
|
||||
}
|
||||
|
||||
sd->flag |= bsdf_microfacet_ggx_aniso_fresnel_setup(bsdf, sd);
|
||||
sd->flag |= bsdf_microfacet_ggx_fresnel_setup(bsdf, sd);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -676,7 +755,7 @@ class MicrofacetMultiGGXAnisoClosure : public MicrofacetMultiClosure {
|
||||
}
|
||||
|
||||
bsdf->ior = 0.0f;
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_aniso_setup(bsdf);
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_setup(bsdf);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -801,7 +880,7 @@ class MicrofacetMultiGGXAnisoFresnelClosure : public MicrofacetMultiFresnelClosu
|
||||
return;
|
||||
}
|
||||
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_aniso_fresnel_setup(bsdf, sd);
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_fresnel_setup(bsdf, sd);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -51,6 +51,7 @@ OSL::ClosureParam *closure_bsdf_transparent_params();
|
||||
OSL::ClosureParam *closure_bssrdf_params();
|
||||
OSL::ClosureParam *closure_absorption_params();
|
||||
OSL::ClosureParam *closure_henyey_greenstein_params();
|
||||
OSL::ClosureParam *closure_bsdf_microfacet_params();
|
||||
OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_params();
|
||||
OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_glass_params();
|
||||
OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_aniso_params();
|
||||
@@ -70,6 +71,7 @@ void closure_bsdf_transparent_prepare(OSL::RendererServices *, int id, void *dat
|
||||
void closure_bssrdf_prepare(OSL::RendererServices *, int id, void *data);
|
||||
void closure_absorption_prepare(OSL::RendererServices *, int id, void *data);
|
||||
void closure_henyey_greenstein_prepare(OSL::RendererServices *, int id, void *data);
|
||||
void closure_bsdf_microfacet_prepare(OSL::RendererServices *, int id, void *data);
|
||||
void closure_bsdf_microfacet_multi_ggx_prepare(OSL::RendererServices *, int id, void *data);
|
||||
void closure_bsdf_microfacet_multi_ggx_glass_prepare(OSL::RendererServices *, int id, void *data);
|
||||
void closure_bsdf_microfacet_multi_ggx_aniso_prepare(OSL::RendererServices *, int id, void *data);
|
||||
|
@@ -320,9 +320,9 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg,
|
||||
/* setup bsdf */
|
||||
if (distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID ||
|
||||
roughness <= 0.075f) /* use single-scatter GGX */
|
||||
sd->flag |= bsdf_microfacet_ggx_aniso_fresnel_setup(bsdf, sd);
|
||||
sd->flag |= bsdf_microfacet_ggx_fresnel_setup(bsdf, sd);
|
||||
else /* use multi-scatter GGX */
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_aniso_fresnel_setup(bsdf, sd);
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_fresnel_setup(bsdf, sd);
|
||||
}
|
||||
}
|
||||
# ifdef __CAUSTICS_TRICKS__
|
||||
@@ -515,12 +515,34 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg,
|
||||
float roughness = sqr(param1);
|
||||
|
||||
bsdf->N = N;
|
||||
bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
|
||||
bsdf->alpha_x = roughness;
|
||||
bsdf->alpha_y = roughness;
|
||||
bsdf->ior = 0.0f;
|
||||
bsdf->extra = NULL;
|
||||
|
||||
if (data_node.y == SVM_STACK_INVALID) {
|
||||
bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
|
||||
bsdf->alpha_x = roughness;
|
||||
bsdf->alpha_y = roughness;
|
||||
}
|
||||
else {
|
||||
bsdf->T = stack_load_float3(stack, data_node.y);
|
||||
|
||||
/* rotate tangent */
|
||||
float rotation = stack_load_float(stack, data_node.z);
|
||||
if (rotation != 0.0f)
|
||||
bsdf->T = rotate_around_axis(bsdf->T, bsdf->N, rotation * M_2PI_F);
|
||||
|
||||
/* compute roughness */
|
||||
float anisotropy = clamp(param2, -0.99f, 0.99f);
|
||||
if (anisotropy < 0.0f) {
|
||||
bsdf->alpha_x = roughness / (1.0f + anisotropy);
|
||||
bsdf->alpha_y = roughness * (1.0f + anisotropy);
|
||||
}
|
||||
else {
|
||||
bsdf->alpha_x = roughness * (1.0f - anisotropy);
|
||||
bsdf->alpha_y = roughness / (1.0f - anisotropy);
|
||||
}
|
||||
}
|
||||
|
||||
/* setup bsdf */
|
||||
if (type == CLOSURE_BSDF_REFLECTION_ID)
|
||||
sd->flag |= bsdf_reflection_setup(bsdf);
|
||||
@@ -529,10 +551,10 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg,
|
||||
else if (type == CLOSURE_BSDF_MICROFACET_GGX_ID)
|
||||
sd->flag |= bsdf_microfacet_ggx_setup(bsdf);
|
||||
else if (type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID) {
|
||||
kernel_assert(stack_valid(data_node.z));
|
||||
kernel_assert(stack_valid(data_node.w));
|
||||
bsdf->extra = (MicrofacetExtra *)closure_alloc_extra(sd, sizeof(MicrofacetExtra));
|
||||
if (bsdf->extra) {
|
||||
bsdf->extra->color = stack_load_float3(stack, data_node.z);
|
||||
bsdf->extra->color = stack_load_float3(stack, data_node.w);
|
||||
bsdf->extra->cspec0 = make_float3(0.0f, 0.0f, 0.0f);
|
||||
bsdf->extra->clearcoat = 0.0f;
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_setup(bsdf);
|
||||
@@ -675,64 +697,6 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg,
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_glass_setup(bsdf);
|
||||
break;
|
||||
}
|
||||
case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
|
||||
case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID:
|
||||
case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID: {
|
||||
#ifdef __CAUSTICS_TRICKS__
|
||||
if (!kernel_data.integrator.caustics_reflective && (path_flag & PATH_RAY_DIFFUSE))
|
||||
break;
|
||||
#endif
|
||||
float3 weight = sd->svm_closure_weight * mix_weight;
|
||||
MicrofacetBsdf *bsdf = (MicrofacetBsdf *)bsdf_alloc(sd, sizeof(MicrofacetBsdf), weight);
|
||||
|
||||
if (bsdf) {
|
||||
bsdf->N = N;
|
||||
bsdf->extra = NULL;
|
||||
bsdf->T = stack_load_float3(stack, data_node.y);
|
||||
|
||||
/* rotate tangent */
|
||||
float rotation = stack_load_float(stack, data_node.z);
|
||||
|
||||
if (rotation != 0.0f)
|
||||
bsdf->T = rotate_around_axis(bsdf->T, bsdf->N, rotation * M_2PI_F);
|
||||
|
||||
/* compute roughness */
|
||||
float roughness = sqr(param1);
|
||||
float anisotropy = clamp(param2, -0.99f, 0.99f);
|
||||
|
||||
if (anisotropy < 0.0f) {
|
||||
bsdf->alpha_x = roughness / (1.0f + anisotropy);
|
||||
bsdf->alpha_y = roughness * (1.0f + anisotropy);
|
||||
}
|
||||
else {
|
||||
bsdf->alpha_x = roughness * (1.0f - anisotropy);
|
||||
bsdf->alpha_y = roughness / (1.0f - anisotropy);
|
||||
}
|
||||
|
||||
bsdf->ior = 0.0f;
|
||||
|
||||
if (type == CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID) {
|
||||
sd->flag |= bsdf_microfacet_beckmann_aniso_setup(bsdf);
|
||||
}
|
||||
else if (type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID) {
|
||||
sd->flag |= bsdf_microfacet_ggx_aniso_setup(bsdf);
|
||||
}
|
||||
else if (type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID) {
|
||||
kernel_assert(stack_valid(data_node.w));
|
||||
bsdf->extra = (MicrofacetExtra *)closure_alloc_extra(sd, sizeof(MicrofacetExtra));
|
||||
if (bsdf->extra) {
|
||||
bsdf->extra->color = stack_load_float3(stack, data_node.w);
|
||||
bsdf->extra->cspec0 = make_float3(0.0f, 0.0f, 0.0f);
|
||||
bsdf->extra->clearcoat = 0.0f;
|
||||
sd->flag |= bsdf_microfacet_multi_ggx_aniso_setup(bsdf);
|
||||
}
|
||||
}
|
||||
else
|
||||
sd->flag |= bsdf_ashikhmin_shirley_aniso_setup(bsdf);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: {
|
||||
float3 weight = sd->svm_closure_weight * mix_weight;
|
||||
VelvetBsdf *bsdf = (VelvetBsdf *)bsdf_alloc(sd, sizeof(VelvetBsdf), weight);
|
||||
|
@@ -539,12 +539,6 @@ typedef enum ClosureType {
|
||||
CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID,
|
||||
CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID,
|
||||
CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID,
|
||||
CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID,
|
||||
CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID,
|
||||
CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID,
|
||||
CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_FRESNEL_ID,
|
||||
CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID,
|
||||
CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID,
|
||||
CLOSURE_BSDF_ASHIKHMIN_VELVET_ID,
|
||||
CLOSURE_BSDF_PHONG_RAMP_ID,
|
||||
CLOSURE_BSDF_GLOSSY_TOON_ID,
|
||||
@@ -605,10 +599,9 @@ typedef enum ClosureType {
|
||||
#define CLOSURE_IS_BSDF_TRANSPARENT(type) (type == CLOSURE_BSDF_TRANSPARENT_ID)
|
||||
#define CLOSURE_IS_BSDF_MULTISCATTER(type) \
|
||||
(type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID || \
|
||||
type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID || \
|
||||
type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID)
|
||||
#define CLOSURE_IS_BSDF_MICROFACET(type) \
|
||||
((type >= CLOSURE_BSDF_MICROFACET_GGX_ID && type <= CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID) || \
|
||||
((type >= CLOSURE_BSDF_MICROFACET_GGX_ID && type <= CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID) || \
|
||||
(type >= CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID && \
|
||||
type <= CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID) || \
|
||||
(type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID))
|
||||
@@ -616,8 +609,7 @@ typedef enum ClosureType {
|
||||
(type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID || \
|
||||
type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID || \
|
||||
type == CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID || \
|
||||
type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID || \
|
||||
type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID)
|
||||
type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID)
|
||||
#define CLOSURE_IS_BSDF_OR_BSSRDF(type) (type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID)
|
||||
#define CLOSURE_IS_BSSRDF(type) \
|
||||
(type >= CLOSURE_BSSRDF_CUBIC_ID && type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID)
|
||||
|
@@ -204,10 +204,6 @@ class ShaderNode : public Node {
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool has_object_dependency()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool has_attribute_dependency()
|
||||
{
|
||||
return false;
|
||||
|
@@ -2166,12 +2166,11 @@ NODE_DEFINE(AnisotropicBsdfNode)
|
||||
SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL);
|
||||
|
||||
static NodeEnum distribution_enum;
|
||||
distribution_enum.insert("beckmann", CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID);
|
||||
distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID);
|
||||
distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID);
|
||||
distribution_enum.insert("ashikhmin_shirley", CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID);
|
||||
SOCKET_ENUM(
|
||||
distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID);
|
||||
distribution_enum.insert("beckmann", CLOSURE_BSDF_MICROFACET_BECKMANN_ID);
|
||||
distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_ID);
|
||||
distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID);
|
||||
distribution_enum.insert("ashikhmin_shirley", CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID);
|
||||
SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_ID);
|
||||
|
||||
SOCKET_IN_VECTOR(tangent, "Tangent", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TANGENT);
|
||||
|
||||
@@ -2186,7 +2185,7 @@ NODE_DEFINE(AnisotropicBsdfNode)
|
||||
|
||||
AnisotropicBsdfNode::AnisotropicBsdfNode() : BsdfNode(node_type)
|
||||
{
|
||||
closure = CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID;
|
||||
closure = CLOSURE_BSDF_MICROFACET_GGX_ID;
|
||||
}
|
||||
|
||||
void AnisotropicBsdfNode::attributes(Shader *shader, AttributeRequestSet *attributes)
|
||||
@@ -2205,7 +2204,7 @@ void AnisotropicBsdfNode::compile(SVMCompiler &compiler)
|
||||
{
|
||||
closure = distribution;
|
||||
|
||||
if (closure == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID)
|
||||
if (closure == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID)
|
||||
BsdfNode::compile(
|
||||
compiler, input("Roughness"), input("Anisotropy"), input("Rotation"), input("Color"));
|
||||
else
|
||||
@@ -2299,7 +2298,7 @@ void GlossyBsdfNode::compile(SVMCompiler &compiler)
|
||||
if (closure == CLOSURE_BSDF_REFLECTION_ID)
|
||||
BsdfNode::compile(compiler, NULL, NULL);
|
||||
else if (closure == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID)
|
||||
BsdfNode::compile(compiler, input("Roughness"), NULL, input("Color"));
|
||||
BsdfNode::compile(compiler, input("Roughness"), NULL, NULL, input("Color"));
|
||||
else
|
||||
BsdfNode::compile(compiler, input("Roughness"), NULL);
|
||||
}
|
||||
|
@@ -359,10 +359,6 @@ class PointDensityTextureNode : public ShaderNode {
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool has_object_dependency()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Parameters. */
|
||||
ustring filename;
|
||||
@@ -896,10 +892,6 @@ class TextureCoordinateNode : public ShaderNode {
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool has_object_dependency()
|
||||
{
|
||||
return use_transform;
|
||||
}
|
||||
|
||||
float3 normal_osl;
|
||||
bool from_dupli;
|
||||
|
@@ -764,10 +764,6 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath)
|
||||
current_shader->has_volume_attribute_dependency = true;
|
||||
}
|
||||
|
||||
if (node->has_object_dependency()) {
|
||||
current_shader->has_object_dependency = true;
|
||||
}
|
||||
|
||||
if (node->has_integrator_dependency()) {
|
||||
current_shader->has_integrator_dependency = true;
|
||||
}
|
||||
@@ -1142,7 +1138,6 @@ void OSLCompiler::compile(OSLGlobals *og, Shader *shader)
|
||||
shader->has_surface_spatial_varying = false;
|
||||
shader->has_volume_spatial_varying = false;
|
||||
shader->has_volume_attribute_dependency = false;
|
||||
shader->has_object_dependency = false;
|
||||
shader->has_integrator_dependency = false;
|
||||
|
||||
/* generate surface shader */
|
||||
|
@@ -206,7 +206,6 @@ Shader::Shader() : Node(node_type)
|
||||
has_surface_spatial_varying = false;
|
||||
has_volume_spatial_varying = false;
|
||||
has_volume_attribute_dependency = false;
|
||||
has_object_dependency = false;
|
||||
has_integrator_dependency = false;
|
||||
has_volume_connected = false;
|
||||
prev_volume_step_rate = 0.0f;
|
||||
@@ -218,7 +217,6 @@ Shader::Shader() : Node(node_type)
|
||||
|
||||
need_update = true;
|
||||
need_update_geometry = true;
|
||||
need_sync_object = false;
|
||||
}
|
||||
|
||||
Shader::~Shader()
|
||||
|
@@ -98,7 +98,6 @@ class Shader : public Node {
|
||||
/* synchronization */
|
||||
bool need_update;
|
||||
bool need_update_geometry;
|
||||
bool need_sync_object;
|
||||
|
||||
/* If the shader has only volume components, the surface is assumed to
|
||||
* be transparent.
|
||||
@@ -121,7 +120,6 @@ class Shader : public Node {
|
||||
bool has_surface_spatial_varying;
|
||||
bool has_volume_spatial_varying;
|
||||
bool has_volume_attribute_dependency;
|
||||
bool has_object_dependency;
|
||||
bool has_integrator_dependency;
|
||||
|
||||
/* displacement */
|
||||
|
@@ -448,10 +448,6 @@ void SVMCompiler::generate_node(ShaderNode *node, ShaderNodeSet &done)
|
||||
current_shader->has_volume_attribute_dependency = true;
|
||||
}
|
||||
|
||||
if (node->has_object_dependency()) {
|
||||
current_shader->has_object_dependency = true;
|
||||
}
|
||||
|
||||
if (node->has_integrator_dependency()) {
|
||||
current_shader->has_integrator_dependency = true;
|
||||
}
|
||||
@@ -863,7 +859,6 @@ void SVMCompiler::compile(Shader *shader, array<int4> &svm_nodes, int index, Sum
|
||||
shader->has_surface_spatial_varying = false;
|
||||
shader->has_volume_spatial_varying = false;
|
||||
shader->has_volume_attribute_dependency = false;
|
||||
shader->has_object_dependency = false;
|
||||
shader->has_integrator_dependency = false;
|
||||
|
||||
/* generate bump shader */
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#define __UTIL_GUARDED_ALLOCATOR_H__
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
|
||||
#ifdef WITH_BLENDER_GUARDEDALLOC
|
||||
|
@@ -411,17 +411,17 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
|
||||
NSTIFFPboardType,
|
||||
nil]];
|
||||
|
||||
if (state != GHOST_kWindowStateFullScreen) {
|
||||
if (is_dialog && parentWindow) {
|
||||
[parentWindow->getCocoaWindow() addChildWindow:m_window ordered:NSWindowAbove];
|
||||
[m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary];
|
||||
}
|
||||
else if (state != GHOST_kWindowStateFullScreen) {
|
||||
[m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
}
|
||||
|
||||
if (state == GHOST_kWindowStateFullScreen)
|
||||
setState(GHOST_kWindowStateFullScreen);
|
||||
|
||||
if (is_dialog && parentWindow) {
|
||||
[parentWindow->getCocoaWindow() addChildWindow:m_window ordered:NSWindowAbove];
|
||||
}
|
||||
|
||||
setNativePixelSize();
|
||||
|
||||
[pool drain];
|
||||
|
@@ -71,6 +71,7 @@ MANTA::MANTA(int *res, FluidModifierData *mmd) : mCurrentID(++solverID)
|
||||
mUsingNoise = (mmd->domain->flags & FLUID_DOMAIN_USE_NOISE) && mUsingSmoke;
|
||||
mUsingFractions = (mmd->domain->flags & FLUID_DOMAIN_USE_FRACTIONS) && mUsingLiquid;
|
||||
mUsingMesh = (mmd->domain->flags & FLUID_DOMAIN_USE_MESH) && mUsingLiquid;
|
||||
mUsingDiffusion = (mmd->domain->flags & FLUID_DOMAIN_USE_DIFFUSION) && mUsingLiquid;
|
||||
mUsingMVel = (mmd->domain->flags & FLUID_DOMAIN_USE_SPEED_VECTORS) && mUsingLiquid;
|
||||
mUsingGuiding = (mmd->domain->flags & FLUID_DOMAIN_USE_GUIDE);
|
||||
mUsingDrops = (mmd->domain->particle_type & FLUID_DOMAIN_PARTICLE_SPRAY) && mUsingLiquid;
|
||||
@@ -219,6 +220,10 @@ MANTA::MANTA(int *res, FluidModifierData *mmd) : mCurrentID(++solverID)
|
||||
initLiquidMesh(mmd);
|
||||
}
|
||||
|
||||
if (mUsingDiffusion) {
|
||||
initCurvature(mmd);
|
||||
}
|
||||
|
||||
if (mUsingGuiding) {
|
||||
mResGuiding = (mmd->domain->guide_parent) ? mmd->domain->guide_res : mmd->domain->res;
|
||||
initGuiding(mmd);
|
||||
@@ -427,6 +432,16 @@ void MANTA::initLiquidMesh(FluidModifierData *mmd)
|
||||
mUsingMesh = true;
|
||||
}
|
||||
|
||||
void MANTA::initCurvature(FluidModifierData *mmd)
|
||||
{
|
||||
std::vector<std::string> pythonCommands;
|
||||
std::string finalString = parseScript(liquid_alloc_curvature, mmd);
|
||||
pythonCommands.push_back(finalString);
|
||||
|
||||
runPythonString(pythonCommands);
|
||||
mUsingDiffusion = true;
|
||||
}
|
||||
|
||||
void MANTA::initObstacle(FluidModifierData *mmd)
|
||||
{
|
||||
if (!mPhiObsIn) {
|
||||
|
@@ -66,6 +66,7 @@ struct MANTA {
|
||||
void initLiquid(FluidModifierData *mmd);
|
||||
void initLiquidMesh(FluidModifierData *mmd);
|
||||
void initObstacle(FluidModifierData *mmd);
|
||||
void initCurvature(FluidModifierData *mmd);
|
||||
void initGuiding(FluidModifierData *mmd);
|
||||
void initFractions(FluidModifierData *mmd);
|
||||
void initInVelocity(FluidModifierData *mmd);
|
||||
@@ -753,6 +754,7 @@ struct MANTA {
|
||||
bool mUsingOutflow;
|
||||
bool mUsingNoise;
|
||||
bool mUsingMesh;
|
||||
bool mUsingDiffusion;
|
||||
bool mUsingMVel;
|
||||
bool mUsingLiquid;
|
||||
bool mUsingSmoke;
|
||||
|
@@ -80,11 +80,11 @@ mantaMsg('Liquid alloc')\n\
|
||||
phiParts_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
||||
phi_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
||||
phiTmp_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
||||
curvature_s$ID$ = s$ID$.create(RealGrid)\n\
|
||||
velOld_s$ID$ = s$ID$.create(MACGrid)\n\
|
||||
velParts_s$ID$ = s$ID$.create(MACGrid)\n\
|
||||
mapWeights_s$ID$ = s$ID$.create(MACGrid)\n\
|
||||
fractions_s$ID$ = None # allocated dynamically\n\
|
||||
curvature_s$ID$ = None\n\
|
||||
\n\
|
||||
pp_s$ID$ = s$ID$.create(BasicParticleSystem)\n\
|
||||
pVel_pp$ID$ = pp_s$ID$.create(PdataVec3)\n\
|
||||
@@ -124,6 +124,11 @@ liquid_mesh_dict_s$ID$ = dict(lMesh=mesh_sm$ID$)\n\
|
||||
if using_speedvectors_s$ID$:\n\
|
||||
liquid_meshvel_dict_s$ID$ = dict(lVelMesh=mVel_mesh$ID$)\n";
|
||||
|
||||
const std::string liquid_alloc_curvature =
|
||||
"\n\
|
||||
mantaMsg('Liquid alloc curvature')\n\
|
||||
curvature_s$ID$ = s$ID$.create(RealGrid)\n";
|
||||
|
||||
const std::string liquid_alloc_particles =
|
||||
"\n\
|
||||
ppSnd_sp$ID$ = sp$ID$.create(BasicParticleSystem)\n\
|
||||
@@ -227,7 +232,7 @@ def liquid_step_$ID$():\n\
|
||||
mantaMsg('Liquid step')\n\
|
||||
\n\
|
||||
mantaMsg('Advecting particles')\n\
|
||||
pp_s$ID$.advectInGrid(flags=flags_s$ID$, vel=vel_s$ID$, integrationMode=IntRK4, deleteInObstacle=deleteInObstacle_s$ID$, stopInObstacle=False)\n\
|
||||
pp_s$ID$.advectInGrid(flags=flags_s$ID$, vel=vel_s$ID$, integrationMode=IntRK4, deleteInObstacle=deleteInObstacle_s$ID$, stopInObstacle=False, skipNew=True)\n\
|
||||
\n\
|
||||
mantaMsg('Pushing particles out of obstacles')\n\
|
||||
pushOutofObs(parts=pp_s$ID$, flags=flags_s$ID$, phiObs=phiObs_s$ID$)\n\
|
||||
@@ -284,12 +289,13 @@ def liquid_step_$ID$():\n\
|
||||
alphaV = viscosity_s$ID$ * s$ID$.timestep * float(res_s$ID$*res_s$ID$)\n\
|
||||
setWallBcs(flags=flags_s$ID$, vel=vel_s$ID$, obvel=None if using_fractions_s$ID$ else obvel_s$ID$, phiObs=phiObs_s$ID$, fractions=fractions_s$ID$)\n\
|
||||
cgSolveDiffusion(flags_s$ID$, vel_s$ID$, alphaV)\n\
|
||||
\n\
|
||||
mantaMsg('Curvature')\n\
|
||||
getLaplacian(laplacian=curvature_s$ID$, grid=phi_s$ID$)\n\
|
||||
curvature_s$ID$.clamp(-1.0, 1.0)\n\
|
||||
\n\
|
||||
setWallBcs(flags=flags_s$ID$, vel=vel_s$ID$, obvel=None if using_fractions_s$ID$ else obvel_s$ID$, phiObs=phiObs_s$ID$, fractions=fractions_s$ID$)\n\
|
||||
\n\
|
||||
mantaMsg('Calculating curvature')\n\
|
||||
getLaplacian(laplacian=curvature_s$ID$, grid=phi_s$ID$)\n\
|
||||
\n\
|
||||
if using_guiding_s$ID$:\n\
|
||||
mantaMsg('Guiding and pressure')\n\
|
||||
PD_fluid_guiding(vel=vel_s$ID$, velT=velT_s$ID$, flags=flags_s$ID$, phi=phi_s$ID$, curv=curvature_s$ID$, surfTens=surfaceTension_s$ID$, fractions=fractions_s$ID$, weight=weightGuide_s$ID$, blurRadius=beta_sg$ID$, pressure=pressure_s$ID$, tau=tau_sg$ID$, sigma=sigma_sg$ID$, theta=theta_sg$ID$, zeroPressureFixing=not doOpen_s$ID$)\n\
|
||||
@@ -343,7 +349,10 @@ def liquid_step_mesh_$ID$():\n\
|
||||
interpolateMACGrid(target=vel_sm$ID$, source=vel_s$ID$)\n\
|
||||
mVel_mesh$ID$.setSource(vel_sm$ID$, isMAC=True)\n\
|
||||
\n\
|
||||
phi_sm$ID$.setBound(0.5,int(((upres_sm$ID$)*2)-2) )\n\
|
||||
# Set 0.5 boundary at walls + account for extra wall thickness in fractions mode + account for grid scaling:\n\
|
||||
# E.g. at upres=1 we expect 1 cell border (or 2 with fractions), at upres=2 we expect 2 cell border (or 4 with fractions), etc.\n\
|
||||
# Use -1 since setBound() starts counting at 0 (and additional -1 for fractions to account for solid/fluid interface cells)\n\
|
||||
phi_sm$ID$.setBound(value=0.5, boundaryWidth=(upres_sm$ID$*2)-2 if using_fractions_s$ID$ else upres_sm$ID$-1)\n\
|
||||
phi_sm$ID$.createMesh(mesh_sm$ID$)\n";
|
||||
|
||||
const std::string liquid_step_particles =
|
||||
|
@@ -105,8 +105,8 @@ if(WITH_OPENSUBDIV)
|
||||
data_to_c_simple(shader/gpu_shader_opensubdiv_geometry.glsl SRC)
|
||||
data_to_c_simple(shader/gpu_shader_opensubdiv_fragment.glsl SRC)
|
||||
|
||||
add_definitions(-DGLEW_STATIC)
|
||||
add_definitions(-DOSD_USES_GLEW)
|
||||
add_definitions(${GL_DEFINITIONS})
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DNOMINMAX)
|
||||
|
Binary file not shown.
Binary file not shown.
Submodule release/datafiles/locale updated: 1d9b8b2ffa...e8bc1883fd
Binary file not shown.
Before Width: | Height: | Size: 731 KiB After Width: | Height: | Size: 1.1 MiB |
@@ -19,10 +19,10 @@
|
||||
/* For constants. */
|
||||
#include "BLI_math_base.h"
|
||||
|
||||
#include "DNA_userdef_types.h"
|
||||
#include "DNA_anim_types.h"
|
||||
#include "DNA_curve_types.h"
|
||||
#include "DNA_space_types.h"
|
||||
#include "DNA_anim_types.h"
|
||||
#include "DNA_userdef_types.h"
|
||||
|
||||
#include "BLI_math_rotation.h"
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#include "BLO_readfile.h" /* own include */
|
||||
|
||||
const UserDef U_default = {
|
||||
.versionfile = BLENDER_VERSION,
|
||||
.subversionfile = BLENDER_SUBVERSION,
|
||||
.versionfile = BLENDER_FILE_VERSION,
|
||||
.subversionfile = BLENDER_FILE_SUBVERSION,
|
||||
.flag = (USER_AUTOSAVE | USER_TOOLTIPS | USER_SAVE_PREVIEWS | USER_RELPATHS |
|
||||
USER_RELEASECONFIRM | USER_SCRIPT_AUTOEXEC_DISABLE | USER_NONEGFRAMES),
|
||||
.dupflag = USER_DUP_MESH | USER_DUP_CURVE | USER_DUP_SURF | USER_DUP_FONT | USER_DUP_MBALL |
|
||||
|
@@ -496,6 +496,9 @@ const bTheme U_theme_default = {
|
||||
.info_property_text = RGBA(0xffffffff),
|
||||
.info_operator = RGBA(0x3ace87ff),
|
||||
.info_operator_text = RGBA(0xffffffff),
|
||||
.info_report_error = RGBA(0x990000ff),
|
||||
.info_report_warning = RGBA(0xb36a00ff),
|
||||
.info_report_info = RGBA(0x1d4383ff),
|
||||
},
|
||||
.space_action = {
|
||||
.back = RGBA(0x42424200),
|
||||
|
@@ -40,6 +40,26 @@
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<releases>
|
||||
<release version="2.83" date="2020-06-03">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>Volume object to import OpenVDB files</li>
|
||||
<li>VR support for scene inspection through OpenXR</li>
|
||||
<li>Cycles adaptive sampling and OptiX viewport denoising</li>
|
||||
<li>Sculpt face sets and cloth brush</li>
|
||||
<li>Video sequencer disk cache</li>
|
||||
</ul>
|
||||
<p>Enhancements:</p>
|
||||
<ul>
|
||||
<li>Grease Pencil closer integration and improved performance</li>
|
||||
<li>Eevee improved render passes, light cache and hair transparency</li>
|
||||
<li>Faster undo system</li>
|
||||
<li>Rewritten multiresolution modifier</li>
|
||||
<li>Improved hair physics collisions</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.82" date="2020-02-13">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
|
@@ -16,4 +16,4 @@ if [ -n "$XDG_RUNTIME_DIR" ]; then
|
||||
fi
|
||||
|
||||
# Run Blender
|
||||
$SNAP/blender
|
||||
$SNAP/blender "$@"
|
||||
|
Submodule release/scripts/addons updated: 47a32a5370...7fd30539c6
@@ -256,15 +256,15 @@ def world_to_camera_view(scene, obj, coord):
|
||||
z = -co_local.z
|
||||
|
||||
camera = obj.data
|
||||
frame = [-v for v in camera.view_frame(scene=scene)[:3]]
|
||||
frame = [v for v in camera.view_frame(scene=scene)[:3]]
|
||||
if camera.type != 'ORTHO':
|
||||
if z == 0.0:
|
||||
return Vector((0.5, 0.5, 0.0))
|
||||
else:
|
||||
frame = [(v / (v.z / z)) for v in frame]
|
||||
frame = [-(v / (v.z / z)) for v in frame]
|
||||
|
||||
min_x, max_x = frame[1].x, frame[2].x
|
||||
min_y, max_y = frame[0].y, frame[1].y
|
||||
min_x, max_x = frame[2].x, frame[1].x
|
||||
min_y, max_y = frame[1].y, frame[0].y
|
||||
|
||||
x = (co_local.x - min_x) / (max_x - min_x)
|
||||
y = (co_local.y - min_y) / (max_y - min_y)
|
||||
|
@@ -84,6 +84,7 @@ url_manual_mapping = (
|
||||
("bpy.types.linestylegeometrymodifier_simplification*", "render/freestyle/parameter_editor/line_style/modifiers/geometry/simplification.html#bpy-types-linestylegeometrymodifier-simplification"),
|
||||
("bpy.types.materialgpencilstyle.use_overlap_strokes*", "grease_pencil/materials/grease_pencil_shader.html#bpy-types-materialgpencilstyle-use-overlap-strokes"),
|
||||
("bpy.types.toolsettings.use_gpencil_weight_data_add*", "grease_pencil/modes/draw/introduction.html#bpy-types-toolsettings-use-gpencil-weight-data-add"),
|
||||
("bpy.types.brush.surface_smooth_shape_preservation*", "sculpt_paint/sculpting/tools/smooth.html#bpy-types-brush-surface-smooth-shape-preservation"),
|
||||
("bpy.types.cyclesrendersettings.camera_cull_margin*", "render/cycles/render_settings/simplify.html#bpy-types-cyclesrendersettings-camera-cull-margin"),
|
||||
("bpy.types.fluiddomainsettings.export_manta_script*", "physics/fluid/type/domain/cache.html#bpy-types-fluiddomainsettings-export-manta-script"),
|
||||
("bpy.types.fluiddomainsettings.fractions_threshold*", "physics/fluid/type/domain/settings.html#bpy-types-fluiddomainsettings-fractions-threshold"),
|
||||
@@ -110,6 +111,7 @@ url_manual_mapping = (
|
||||
("bpy.types.linestylegeometrymodifier_spatialnoise*", "render/freestyle/parameter_editor/line_style/modifiers/geometry/spatial_noise.html#bpy-types-linestylegeometrymodifier-spatialnoise"),
|
||||
("bpy.types.linestylethicknessmodifier_calligraphy*", "render/freestyle/parameter_editor/line_style/modifiers/thickness/calligraphy.html#bpy-types-linestylethicknessmodifier-calligraphy"),
|
||||
("bpy.types.rendersettings_simplify_gpencil_onplay*", "render/cycles/render_settings/simplify.html#bpy-types-rendersettings-simplify-gpencil-onplay"),
|
||||
("bpy.types.spacedopesheeteditor.show_pose_markers*", "animation/markers.html#bpy-types-spacedopesheeteditor-show-pose-markers"),
|
||||
("bpy.types.toolsettings.use_gpencil_draw_additive*", "grease_pencil/modes/draw/introduction.html#bpy-types-toolsettings-use-gpencil-draw-additive"),
|
||||
("bpy.types.toolsettings.use_snap_backface_culling*", "editors/3dview/controls/snapping.html#bpy-types-toolsettings-use-snap-backface-culling"),
|
||||
("bpy.types.toolsettings.use_transform_data_origin*", "scene_layout/object/editing/transform/control/options.html#bpy-types-toolsettings-use-transform-data-origin"),
|
||||
@@ -138,6 +140,7 @@ url_manual_mapping = (
|
||||
("bpy.types.linestylegeometrymodifier_tipremover*", "render/freestyle/parameter_editor/line_style/modifiers/geometry/tip_remover.html#bpy-types-linestylegeometrymodifier-tipremover"),
|
||||
("bpy.types.rendersettings_simplify_gpencil_tint*", "render/cycles/render_settings/simplify.html#bpy-types-rendersettings-simplify-gpencil-tint"),
|
||||
("bpy.types.toolsettings.use_gpencil_draw_onback*", "grease_pencil/modes/draw/introduction.html#bpy-types-toolsettings-use-gpencil-draw-onback"),
|
||||
("bpy.types.brush.surface_smooth_current_vertex*", "sculpt_paint/sculpting/tools/smooth.html#bpy-types-brush-surface-smooth-current-vertex"),
|
||||
("bpy.types.brush.use_multiplane_scrape_dynamic*", "sculpt_paint/sculpting/tools/multiplane_scrape.html#bpy-types-brush-use-multiplane-scrape-dynamic"),
|
||||
("bpy.types.clothsettings.vertex_group_pressure*", "physics/cloth/settings/physical_properties.html#bpy-types-clothsettings-vertex-group-pressure"),
|
||||
("bpy.types.cyclesmaterialsettings.displacement*", "render/cycles/material_settings.html#bpy-types-cyclesmaterialsettings-displacement"),
|
||||
@@ -215,8 +218,8 @@ url_manual_mapping = (
|
||||
("bpy.types.posebone.use_ik_rotation_control*", "animation/armatures/posing/bone_constraints/inverse_kinematics/introduction.html#bpy-types-posebone-use-ik-rotation-control"),
|
||||
("bpy.ops.constraint.disable_keep_transform*", "animation/constraints/interface/common.html#bpy-ops-constraint-disable-keep-transform"),
|
||||
("bpy.ops.object.vertex_group_normalize_all*", "sculpt_paint/weight_paint/editing.html#bpy-ops-object-vertex-group-normalize-all"),
|
||||
("bpy.types.brush.surface_smooth_iterations*", "sculpt_paint/sculpting/tools/smooth.html#bpy-types-brush-surface-smooth-iterations"),
|
||||
("bpy.types.brushgpencilsettings.pen_jitter*", "grease_pencil/modes/draw/tool_settings/brushes/draw_brush.html#bpy-types-brushgpencilsettings-pen-jitter"),
|
||||
("bpy.types.fluiddomainsettings.domain_size*", "physics/fluid/type/domain/liquid/diffusion.html#bpy-types-fluiddomainsettings-domain-size"),
|
||||
("bpy.types.fluiddomainsettings.domain_type*", "physics/fluid/type/domain/settings.html#bpy-types-fluiddomainsettings-domain-type"),
|
||||
("bpy.types.fluiddomainsettings.flame_smoke*", "physics/fluid/type/domain/settings.html#bpy-types-fluiddomainsettings-flame-smoke"),
|
||||
("bpy.types.fluiddomainsettings.fluid_group*", "physics/fluid/type/domain/collections.html#bpy-types-fluiddomainsettings-fluid-group"),
|
||||
@@ -344,6 +347,7 @@ url_manual_mapping = (
|
||||
("bpy.types.compositornodecolorbalance*", "compositing/types/color/color_balance.html#bpy-types-compositornodecolorbalance"),
|
||||
("bpy.types.compositornodekeyingscreen*", "compositing/types/matte/keying_screen.html#bpy-types-compositornodekeyingscreen"),
|
||||
("bpy.types.dynamicpaintcanvassettings*", "physics/dynamic_paint/canvas.html#bpy-types-dynamicpaintcanvassettings"),
|
||||
("bpy.types.fluidflowsettings.use_flow*", "physics/fluid/type/flow.html#bpy-types-fluidflowsettings-use-flow"),
|
||||
("bpy.types.fmodifierfunctiongenerator*", "editors/graph_editor/fcurves/modifiers.html#bpy-types-fmodifierfunctiongenerator"),
|
||||
("bpy.types.gpencillayer.use_solo_mode*", "grease_pencil/properties/layers.html#bpy-types-gpencillayer-use-solo-mode"),
|
||||
("bpy.types.greasepencil.use_multiedit*", "grease_pencil/multiframe.html#bpy-types-greasepencil-use-multiedit"),
|
||||
@@ -376,6 +380,7 @@ url_manual_mapping = (
|
||||
("bpy.types.dynamicpaintbrushsettings*", "physics/dynamic_paint/brush.html#bpy-types-dynamicpaintbrushsettings"),
|
||||
("bpy.types.fluiddomainsettings.alpha*", "physics/fluid/type/domain/settings.html#bpy-types-fluiddomainsettings-alpha"),
|
||||
("bpy.types.fluidflowsettings.density*", "physics/fluid/type/flow.html#bpy-types-fluidflowsettings-density"),
|
||||
("bpy.types.light.use_custom_distance*", "render/eevee/lighting.html#bpy-types-light-use-custom-distance"),
|
||||
("bpy.types.materialgpencilstyle.flip*", "grease_pencil/materials/grease_pencil_shader.html#bpy-types-materialgpencilstyle-flip"),
|
||||
("bpy.types.materialgpencilstyle.mode*", "grease_pencil/materials/grease_pencil_shader.html#bpy-types-materialgpencilstyle-mode"),
|
||||
("bpy.types.object.empty_display_size*", "modeling/empties.html#bpy-types-object-empty-display-size"),
|
||||
@@ -407,6 +412,7 @@ url_manual_mapping = (
|
||||
("bpy.ops.transform.edge_bevelweight*", "modeling/meshes/editing/edge/edge_data.html#bpy-ops-transform-edge-bevelweight"),
|
||||
("bpy.ops.wm.previews_batch_generate*", "files/blend/previews.html#bpy-ops-wm-previews-batch-generate"),
|
||||
("bpy.types.brush.auto_smooth_factor*", "sculpt_paint/sculpting/tool_settings/brush_settings.html#bpy-types-brush-auto-smooth-factor"),
|
||||
("bpy.types.brush.smooth_deform_type*", "sculpt_paint/sculpting/tools/smooth.html#bpy-types-brush-smooth-deform-type"),
|
||||
("bpy.types.brush.use_cursor_overlay*", "sculpt_paint/brush/cursor.html#bpy-types-brush-use-cursor-overlay"),
|
||||
("bpy.types.compositornodebokehimage*", "compositing/types/input/bokeh_image.html#bpy-types-compositornodebokehimage"),
|
||||
("bpy.types.compositornodecolormatte*", "compositing/types/matte/color_key.html#bpy-types-compositornodecolormatte"),
|
||||
@@ -496,6 +502,7 @@ url_manual_mapping = (
|
||||
("bpy.types.brightcontrastmodifier*", "video_editing/sequencer/properties/modifiers.html#bpy-types-brightcontrastmodifier"),
|
||||
("bpy.types.brush.cursor_color_add*", "sculpt_paint/brush/cursor.html#bpy-types-brush-cursor-color-add"),
|
||||
("bpy.types.brush.pose_ik_segments*", "sculpt_paint/sculpting/tools/pose.html#bpy-types-brush-pose-ik-segments"),
|
||||
("bpy.types.brush.pose_origin_type*", "sculpt_paint/sculpting/tools/pose.html#bpy-types-brush-pose-origin-type"),
|
||||
("bpy.types.camerasolverconstraint*", "animation/constraints/motion_tracking/camera_solver.html#bpy-types-camerasolverconstraint"),
|
||||
("bpy.types.clothcollisionsettings*", "physics/cloth/settings/collisions.html#bpy-types-clothcollisionsettings"),
|
||||
("bpy.types.compositornodecurvergb*", "compositing/types/color/rgb_curves.html#bpy-types-compositornodecurvergb"),
|
||||
@@ -570,6 +577,7 @@ url_manual_mapping = (
|
||||
("bpy.types.fluideffectorsettings*", "physics/fluid/type/effector.html#bpy-types-fluideffectorsettings"),
|
||||
("bpy.types.followtrackconstraint*", "animation/constraints/motion_tracking/follow_track.html#bpy-types-followtrackconstraint"),
|
||||
("bpy.types.gpencilsculptsettings*", "grease_pencil/properties/index.html#bpy-types-gpencilsculptsettings"),
|
||||
("bpy.types.light.cutoff_distance*", "render/eevee/lighting.html#bpy-types-light-cutoff-distance"),
|
||||
("bpy.types.lockedtrackconstraint*", "animation/constraints/tracking/locked_track.html#bpy-types-lockedtrackconstraint"),
|
||||
("bpy.types.material.blend_method*", "render/eevee/materials/settings.html#bpy-types-material-blend-method"),
|
||||
("bpy.types.mirrorgpencilmodifier*", "grease_pencil/modifiers/generate/mirror.html#bpy-types-mirrorgpencilmodifier"),
|
||||
@@ -587,6 +595,7 @@ url_manual_mapping = (
|
||||
("bpy.types.shadernodevertexcolor*", "render/shader_nodes/input/vertex_color.html#bpy-types-shadernodevertexcolor"),
|
||||
("bpy.types.smoothgpencilmodifier*", "grease_pencil/modifiers/deform/smooth.html#bpy-types-smoothgpencilmodifier"),
|
||||
("bpy.types.spline.use_endpoint_u*", "modeling/curves/properties/active_spline.html#bpy-types-spline-use-endpoint-u"),
|
||||
("bpy.types.surfacedeformmodifier*", "modeling/modifiers/deform/surface_deform.html#bpy-types-surfacedeformmodifier"),
|
||||
("bpy.types.viewlayer.use_volumes*", "render/layers/layers.html#bpy-types-viewlayer-use-volumes"),
|
||||
("bpy.types.volume.frame_duration*", "modeling/volumes/properties.html#bpy-types-volume-frame-duration"),
|
||||
("bpy.types.volumedisplay.density*", "modeling/volumes/properties.html#bpy-types-volumedisplay-density"),
|
||||
@@ -671,6 +680,7 @@ url_manual_mapping = (
|
||||
("bpy.ops.sequencer.refresh_all*", "video_editing/sequencer/navigating.html#bpy-ops-sequencer-refresh-all"),
|
||||
("bpy.ops.surface.primitive*add*", "modeling/surfaces/primitives.html#bpy-ops-surface-primitive-add"),
|
||||
("bpy.ops.transform.edge_crease*", "modeling/meshes/editing/edge/edge_data.html#bpy-ops-transform-edge-crease"),
|
||||
("bpy.ops.transform.skin_resize*", "modeling/meshes/editing/mesh/transform/skin_resize.html#bpy-ops-transform-skin-resize"),
|
||||
("bpy.ops.uv.seams_from_islands*", "modeling/meshes/uv/unwrapping/seams.html#bpy-ops-uv-seams-from-islands"),
|
||||
("bpy.types.brush.icon_filepath*", "sculpt_paint/brush/brush.html#bpy-types-brush-icon-filepath"),
|
||||
("bpy.types.brush.smooth_stroke*", "grease_pencil/modes/draw/tool_settings/brushes/draw_brush.html#bpy-types-brush-smooth-stroke"),
|
||||
@@ -740,6 +750,7 @@ url_manual_mapping = (
|
||||
("bpy.ops.object.select_linked*", "scene_layout/object/selecting.html#bpy-ops-object-select-linked"),
|
||||
("bpy.ops.object.select_mirror*", "scene_layout/object/selecting.html#bpy-ops-object-select-mirror"),
|
||||
("bpy.ops.object.select_random*", "scene_layout/object/selecting.html#bpy-ops-object-select-random"),
|
||||
("bpy.ops.paint.add_simple_uvs*", "sculpt_paint/texture_paint/tool_settings/texture_slots.html#bpy-ops-paint-add-simple-uvs"),
|
||||
("bpy.ops.scene.view_layer_add*", "render/layers/layers.html#bpy-ops-scene-view-layer-add"),
|
||||
("bpy.ops.sound.bake_animation*", "scene_layout/scene/properties.html#bpy-ops-sound-bake-animation"),
|
||||
("bpy.ops.transform.edge_slide*", "modeling/meshes/editing/edge/edge_slide.html#bpy-ops-transform-edge-slide"),
|
||||
@@ -788,6 +799,7 @@ url_manual_mapping = (
|
||||
("bpy.types.shrinkwrapmodifier*", "modeling/modifiers/deform/shrinkwrap.html#bpy-types-shrinkwrapmodifier"),
|
||||
("bpy.types.splineikconstraint*", "animation/constraints/tracking/spline_ik.html#bpy-types-splineikconstraint"),
|
||||
("bpy.types.texturenodetexture*", "editors/texture_node/types/input/texture.html#bpy-types-texturenodetexture"),
|
||||
("bpy.types.view3dshading.type*", "editors/3dview/display/shading.html#bpy-types-view3dshading-type"),
|
||||
("bpy.types.volume.frame_start*", "modeling/volumes/properties.html#bpy-types-volume-frame-start"),
|
||||
("bpy.types.volume.is_sequence*", "modeling/volumes/properties.html#bpy-types-volume-is-sequence"),
|
||||
("bpy.types.volumerender.space*", "modeling/volumes/properties.html#bpy-types-volumerender-space"),
|
||||
@@ -1053,7 +1065,7 @@ url_manual_mapping = (
|
||||
("bpy.ops.fluid.free_mesh*", "physics/fluid/type/domain/liquid/mesh.html#bpy-ops-fluid-free-mesh"),
|
||||
("bpy.ops.font.select_all*", "modeling/texts/selecting.html#bpy-ops-font-select-all"),
|
||||
("bpy.ops.mesh.customdata*", "modeling/meshes/properties/custom_data.html#bpy-ops-mesh-customdata"),
|
||||
("bpy.ops.mesh.edge_split*", "modeling/meshes/editing/edge/edge_split.html#bpy-ops-mesh-edge-split"),
|
||||
("bpy.ops.mesh.edge_split*", "modeling/meshes/editing/mesh/split.html#bpy-ops-mesh-edge-split"),
|
||||
("bpy.ops.mesh.fill_holes*", "modeling/meshes/editing/mesh/cleanup.html#bpy-ops-mesh-fill-holes"),
|
||||
("bpy.ops.mesh.mark_sharp*", "modeling/meshes/editing/edge/edge_data.html#bpy-ops-mesh-mark-sharp"),
|
||||
("bpy.ops.mesh.symmetrize*", "modeling/meshes/editing/mesh/symmetrize.html#bpy-ops-mesh-symmetrize"),
|
||||
@@ -1262,7 +1274,7 @@ url_manual_mapping = (
|
||||
("bpy.ops.mesh.bevel*", "modeling/meshes/editing/edge/bevel.html#bpy-ops-mesh-bevel"),
|
||||
("bpy.ops.mesh.inset*", "modeling/meshes/editing/face/inset_faces.html#bpy-ops-mesh-inset"),
|
||||
("bpy.ops.mesh.knife*", "modeling/meshes/tools/knife.html#bpy-ops-mesh-knife"),
|
||||
("bpy.ops.mesh.merge*", "modeling/meshes/editing/vertex/merge_vertices.html#bpy-ops-mesh-merge"),
|
||||
("bpy.ops.mesh.merge*", "modeling/meshes/editing/mesh/merge.html#bpy-ops-mesh-merge"),
|
||||
("bpy.ops.mesh.screw*", "modeling/meshes/editing/edge/screw.html#bpy-ops-mesh-screw"),
|
||||
("bpy.ops.mesh.split*", "modeling/meshes/editing/mesh/split.html#bpy-ops-mesh-split"),
|
||||
("bpy.ops.nla.delete*", "editors/nla/editing.html#bpy-ops-nla-delete"),
|
||||
@@ -1311,6 +1323,7 @@ url_manual_mapping = (
|
||||
("bpy.ops.uv.reset*", "modeling/meshes/editing/uv.html#bpy-ops-uv-reset"),
|
||||
("bpy.ops.wm.addon*", "editors/preferences/addons.html#bpy-ops-wm-addon"),
|
||||
("bpy.types.action*", "animation/actions.html#bpy-types-action"),
|
||||
("bpy.types.camera*", "render/cameras.html#bpy-types-camera"),
|
||||
("bpy.types.cycles*", "render/cycles/index.html#bpy-types-cycles"),
|
||||
("bpy.types.driver*", "animation/drivers/index.html#bpy-types-driver"),
|
||||
("bpy.types.fcurve*", "editors/graph_editor/fcurves/index.html#bpy-types-fcurve"),
|
||||
@@ -1348,6 +1361,7 @@ url_manual_mapping = (
|
||||
("bpy.types.space*", "editors/index.html#bpy-types-space"),
|
||||
("bpy.types.theme*", "editors/preferences/themes.html#bpy-types-theme"),
|
||||
("bpy.ops.action*", "animation/actions.html#bpy-ops-action"),
|
||||
("bpy.ops.camera*", "render/cameras.html#bpy-ops-camera"),
|
||||
("bpy.ops.cycles*", "render/cycles/index.html#bpy-ops-cycles"),
|
||||
("bpy.ops.dpaint*", "physics/dynamic_paint/index.html#bpy-ops-dpaint"),
|
||||
("bpy.ops.export*", "files/import_export.html#bpy-ops-export"),
|
||||
|
@@ -1052,6 +1052,9 @@
|
||||
info_property_text="#ffffff"
|
||||
info_operator="#3ace87ff"
|
||||
info_operator_text="#ffffff"
|
||||
info_report_error="#990000"
|
||||
info_report_warning="#b36a00"
|
||||
info_report_info="#6080ff"
|
||||
>
|
||||
<space>
|
||||
<ThemeSpaceGeneric
|
||||
|
@@ -0,0 +1,64 @@
|
||||
# ##### 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.
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# Initialization script for 2D Animation template
|
||||
|
||||
import bpy
|
||||
from bpy.app.handlers import persistent
|
||||
|
||||
|
||||
@persistent
|
||||
def load_handler(dummy):
|
||||
import bpy
|
||||
|
||||
# 2D Animation
|
||||
screen = bpy.data.screens['2D Animation']
|
||||
if screen:
|
||||
for area in screen.areas:
|
||||
# Set Tool settings as default in properties panel.
|
||||
if area.type == 'PROPERTIES':
|
||||
for space in area.spaces:
|
||||
if space.type != 'PROPERTIES':
|
||||
continue
|
||||
space.context = 'TOOL'
|
||||
|
||||
# Open sidebar in Dopesheet.
|
||||
elif area.type == 'DOPESHEET_EDITOR':
|
||||
for space in area.spaces:
|
||||
if space.type != 'DOPESHEET_EDITOR':
|
||||
continue
|
||||
space.show_region_ui = True
|
||||
|
||||
# 2D Full Canvas
|
||||
screen = bpy.data.screens['2D Full Canvas']
|
||||
if screen:
|
||||
for area in screen.areas:
|
||||
if area.type == 'VIEW_3D':
|
||||
for space in area.spaces:
|
||||
if space.type != 'VIEW_3D':
|
||||
continue
|
||||
space.shading.type = 'MATERIAL'
|
||||
space.shading.use_scene_world = True
|
||||
|
||||
|
||||
def register():
|
||||
bpy.app.handlers.load_factory_startup_post.append(load_handler)
|
||||
|
||||
|
||||
def unregister():
|
||||
bpy.app.handlers.load_factory_startup_post.remove(load_handler)
|
@@ -486,7 +486,10 @@ class CLIP_OT_constraint_to_fcurve(Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
# Find start and end frames.
|
||||
if con.object:
|
||||
if con.type == 'CAMERA_SOLVER':
|
||||
# Camera solver constraint is always referring to camera.
|
||||
tracks = clip.tracking.tracks
|
||||
elif con.object:
|
||||
tracking_object = clip.tracking.objects.get(con.object, None)
|
||||
if not tracking_object:
|
||||
self.report({'ERROR'}, "Motion Tracking object not found")
|
||||
|
@@ -1106,8 +1106,8 @@ class WM_OT_doc_view(Operator):
|
||||
|
||||
doc_id: doc_id
|
||||
if bpy.app.version_cycle in {"release", "rc", "beta"}:
|
||||
_prefix = ("https://docs.blender.org/api/%d.%d%s" %
|
||||
(bpy.app.version[0], bpy.app.version[1], bpy.app.version_char))
|
||||
_prefix = ("https://docs.blender.org/api/%d.%d" %
|
||||
(bpy.app.version[0], bpy.app.version[1]))
|
||||
else:
|
||||
_prefix = ("https://docs.blender.org/api/master")
|
||||
|
||||
|
@@ -267,7 +267,7 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
|
||||
if bone:
|
||||
|
||||
col = layout.column()
|
||||
col.prop(bone, "hide", text="Hide")
|
||||
col.prop(bone, "hide", text="Hide", toggle=0)
|
||||
|
||||
|
||||
class BONE_PT_display_custom_shape(BoneButtonsPanel, Panel):
|
||||
|
@@ -1346,7 +1346,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
if md.mode == 'VOXEL':
|
||||
layout.prop(md, "voxel_size")
|
||||
layout.prop(md, "adaptivity")
|
||||
else:
|
||||
else:
|
||||
row.prop(md, "octree_depth")
|
||||
row.prop(md, "scale")
|
||||
|
||||
|
@@ -639,7 +639,7 @@ class GreasePencilMaterialsPanel:
|
||||
if is_view3d and brush is not None:
|
||||
gp_settings = brush.gpencil_settings
|
||||
if gp_settings.use_material_pin is False:
|
||||
if ob.active_material_index >= 0:
|
||||
if len(ob.material_slots) > 0 and ob.active_material_index >= 0:
|
||||
ma = ob.material_slots[ob.active_material_index].material
|
||||
else:
|
||||
ma = gp_settings.material
|
||||
|
@@ -813,7 +813,7 @@ def brush_settings_advanced(layout, context, brush, popover=False):
|
||||
|
||||
# face masks automasking
|
||||
layout.prop(brush, "use_automasking_face_sets")
|
||||
|
||||
|
||||
# boundary edges/face sets automasking
|
||||
layout.prop(brush, "use_automasking_boundary_edges")
|
||||
layout.prop(brush, "use_automasking_boundary_face_sets")
|
||||
|
@@ -237,7 +237,7 @@ class PHYSICS_PT_settings(PhysicButtonsPanel, Panel):
|
||||
col = grid.column()
|
||||
col.prop(flow, "flow_behavior", expand=False)
|
||||
if flow.flow_behavior in {'INFLOW', 'OUTFLOW'}:
|
||||
col.prop(flow, "use_inflow", text="Use Flow")
|
||||
col.prop(flow, "use_inflow")
|
||||
|
||||
col.prop(flow, "subframes", text="Sampling Substeps")
|
||||
|
||||
|
@@ -563,7 +563,6 @@ class RENDER_PT_gpencil(RenderButtonsPanel, Panel):
|
||||
col.prop(props, "antialias_threshold")
|
||||
|
||||
|
||||
|
||||
class RENDER_PT_opengl_sampling(RenderButtonsPanel, Panel):
|
||||
bl_label = "Sampling"
|
||||
COMPAT_ENGINES = {'BLENDER_WORKBENCH'}
|
||||
|
@@ -93,9 +93,6 @@ class IMAGE_MT_view(Menu):
|
||||
layout.separator()
|
||||
|
||||
layout.prop(sima, "use_realtime_update")
|
||||
if show_uvedit:
|
||||
layout.prop(tool_settings, "show_uv_local_view")
|
||||
|
||||
layout.prop(uv, "show_metadata")
|
||||
|
||||
if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'):
|
||||
|
@@ -142,6 +142,7 @@ class TIME_MT_view(Menu):
|
||||
layout.separator()
|
||||
|
||||
layout.prop(scene, "show_keys_from_selected_only")
|
||||
layout.prop(st.dopesheet, "show_only_errors")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
@@ -137,7 +137,6 @@ class _defs_view3d_generic:
|
||||
idname="builtin.measure",
|
||||
label="Measure",
|
||||
description=description,
|
||||
cursor='CROSSHAIR',
|
||||
icon="ops.view3d.ruler",
|
||||
widget="VIEW3D_GGT_ruler",
|
||||
keymap="3D View Tool: Measure",
|
||||
@@ -375,7 +374,6 @@ class _defs_view3d_select:
|
||||
label="Select Lasso",
|
||||
icon="ops.generic.select_lasso",
|
||||
widget=None,
|
||||
cursor='DEFAULT',
|
||||
keymap="3D View Tool: Select Lasso",
|
||||
draw_settings=draw_settings,
|
||||
)
|
||||
@@ -400,7 +398,6 @@ class _defs_view3d_select:
|
||||
label="Select Circle",
|
||||
icon="ops.generic.select_circle",
|
||||
widget=None,
|
||||
cursor='DEFAULT',
|
||||
keymap="3D View Tool: Select Circle",
|
||||
draw_settings=draw_settings,
|
||||
draw_cursor=draw_cursor,
|
||||
|
@@ -316,16 +316,18 @@ class TOPBAR_MT_file_new(Menu):
|
||||
|
||||
template_paths = bpy.utils.app_template_paths()
|
||||
|
||||
# expand template paths
|
||||
app_templates = []
|
||||
# Expand template paths.
|
||||
|
||||
# Use a set to avoid duplicate user/system templates.
|
||||
# This is a corner case, but users managed to do it! T76849.
|
||||
app_templates = set()
|
||||
for path in template_paths:
|
||||
for d in os.listdir(path):
|
||||
if d.startswith(("__", ".")):
|
||||
continue
|
||||
template = os.path.join(path, d)
|
||||
if os.path.isdir(template):
|
||||
# template_paths_expand.append(template)
|
||||
app_templates.append(d)
|
||||
app_templates.add(d)
|
||||
|
||||
return sorted(app_templates)
|
||||
|
||||
|
@@ -1102,7 +1102,7 @@ class PreferenceThemeSpacePanel:
|
||||
PreferenceThemeSpacePanel._theme_generic(layout, data, self.theme_area)
|
||||
|
||||
|
||||
class ThemeGenericClassGenerator():
|
||||
class ThemeGenericClassGenerator:
|
||||
|
||||
@staticmethod
|
||||
def generate_panel_classes_for_wcols():
|
||||
@@ -1455,16 +1455,7 @@ class USERPREF_PT_input_ndof(InputPanel, CenterAlignMixIn, Panel):
|
||||
prefs = context.preferences
|
||||
inputs = prefs.inputs
|
||||
|
||||
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
|
||||
flow.prop(inputs, "ndof_sensitivity", text="Pan Sensitivity")
|
||||
flow.prop(inputs, "ndof_orbit_sensitivity", text="Orbit Sensitivity")
|
||||
flow.prop(inputs, "ndof_deadzone", text="Deadzone")
|
||||
|
||||
layout.separator()
|
||||
|
||||
flow.row().prop(inputs, "ndof_view_navigate_method", expand=True)
|
||||
flow.row().prop(inputs, "ndof_view_rotate_method", expand=True)
|
||||
USERPREF_PT_ndof_settings.draw_settings(layout, inputs)
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
@@ -1598,6 +1589,64 @@ class USERPREF_PT_ndof_settings(Panel):
|
||||
bl_label = "3D Mouse Settings"
|
||||
bl_space_type = 'TOPBAR' # dummy.
|
||||
bl_region_type = 'HEADER'
|
||||
bl_ui_units_x = 10
|
||||
|
||||
@staticmethod
|
||||
def draw_settings(layout, props, show_3dview_settings=True):
|
||||
col = layout.column()
|
||||
col.prop(props, "ndof_sensitivity", text="Pan Sensitivity")
|
||||
col.prop(props, "ndof_orbit_sensitivity")
|
||||
col.prop(props, "ndof_deadzone")
|
||||
|
||||
layout.separator()
|
||||
|
||||
if show_3dview_settings:
|
||||
col = layout.column()
|
||||
col.row().prop(props, "ndof_view_navigate_method", expand=True, text="Navigation")
|
||||
col.row().prop(props, "ndof_view_rotate_method", expand=True, text="Rotation")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
if show_3dview_settings:
|
||||
col.prop(props, "ndof_show_guide")
|
||||
col.prop(props, "ndof_zoom_invert")
|
||||
col.prop(props, "ndof_pan_yz_swap_axis", text="Swap Y and Z Pan Axes")
|
||||
|
||||
layout.separator()
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(text="Invert Axis Pan" if show_3dview_settings else "Invert Pan Axis")
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
for text, attr in (
|
||||
("X", "ndof_panx_invert_axis"),
|
||||
("Y", "ndof_pany_invert_axis"),
|
||||
("Z", "ndof_panz_invert_axis"),
|
||||
):
|
||||
row.prop(props, attr, text=text, toggle=True)
|
||||
|
||||
if show_3dview_settings:
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(text="Invert Axis Orbit")
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
for text, attr in (
|
||||
("X", "ndof_rotx_invert_axis"),
|
||||
("Y", "ndof_roty_invert_axis"),
|
||||
("Z", "ndof_rotz_invert_axis"),
|
||||
):
|
||||
row.prop(props, attr, text=text, toggle=True)
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(props, "ndof_lock_horizon", text="Fly/Walk Lock Horizon")
|
||||
col.prop(props, "ndof_fly_helicopter")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -1607,62 +1656,7 @@ class USERPREF_PT_ndof_settings(Panel):
|
||||
input_prefs = context.preferences.inputs
|
||||
|
||||
is_view3d = context.space_data.type == 'VIEW_3D'
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(input_prefs, "ndof_sensitivity")
|
||||
col.prop(input_prefs, "ndof_orbit_sensitivity")
|
||||
col.prop(input_prefs, "ndof_deadzone")
|
||||
|
||||
if is_view3d:
|
||||
layout.separator()
|
||||
layout.prop(input_prefs, "ndof_show_guide")
|
||||
|
||||
layout.separator()
|
||||
layout.label(text="Orbit Style")
|
||||
layout.row().prop(input_prefs, "ndof_view_navigate_method", text="Navigate")
|
||||
layout.row().prop(input_prefs, "ndof_view_rotate_method", text="Orbit")
|
||||
layout.separator()
|
||||
|
||||
layout.label(text="Orbit Options")
|
||||
split = layout.split(factor=0.6)
|
||||
row = split.row()
|
||||
row.alignment = 'RIGHT'
|
||||
row.label(text="Invert Axis")
|
||||
row = split.row(align=True)
|
||||
for text, attr in (
|
||||
("X", "ndof_rotx_invert_axis"),
|
||||
("Y", "ndof_roty_invert_axis"),
|
||||
("Z", "ndof_rotz_invert_axis"),
|
||||
):
|
||||
row.prop(input_prefs, attr, text=text, toggle=True)
|
||||
|
||||
# view2d use pan/zoom
|
||||
layout.separator()
|
||||
layout.label(text="Pan Options")
|
||||
|
||||
split = layout.split(factor=0.6)
|
||||
row = split.row()
|
||||
row.alignment = 'RIGHT'
|
||||
row.label(text="Invert Axis")
|
||||
row = split.row(align=True)
|
||||
for text, attr in (
|
||||
("X", "ndof_panx_invert_axis"),
|
||||
("Y", "ndof_pany_invert_axis"),
|
||||
("Z", "ndof_panz_invert_axis"),
|
||||
):
|
||||
row.prop(input_prefs, attr, text=text, toggle=True)
|
||||
|
||||
layout.prop(input_prefs, "ndof_pan_yz_swap_axis")
|
||||
|
||||
layout.label(text="Zoom Options")
|
||||
layout.prop(input_prefs, "ndof_zoom_invert")
|
||||
|
||||
if is_view3d:
|
||||
layout.separator()
|
||||
layout.label(text="Fly/Walk Options")
|
||||
layout.prop(input_prefs, "ndof_fly_helicopter")
|
||||
layout.prop(input_prefs, "ndof_lock_horizon")
|
||||
|
||||
self.draw_settings(layout, input_prefs, is_view3d)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Key-Map Editor Panels
|
||||
|
@@ -432,7 +432,7 @@ class _draw_tool_settings_context_mode:
|
||||
|
||||
row.prop(gp_settings, "use_material_pin", text="")
|
||||
|
||||
if brush.gpencil_tool in {'DRAW', 'FILL'} and ma:
|
||||
if brush.gpencil_tool in {'DRAW', 'FILL'}:
|
||||
row.separator(factor=1.0)
|
||||
subrow = row.row(align=True)
|
||||
row.prop_enum(settings, "color_mode", 'MATERIAL', text="", icon='MATERIAL')
|
||||
@@ -3185,7 +3185,6 @@ class VIEW3D_MT_face_sets_init(Menu):
|
||||
op.mode = 'FACE_MAPS'
|
||||
|
||||
|
||||
|
||||
class VIEW3D_MT_particle(Menu):
|
||||
bl_label = "Particle"
|
||||
|
||||
@@ -5282,6 +5281,7 @@ class VIEW3D_MT_sculpt_mask_edit_pie(Menu):
|
||||
op.mode = 'INVERT'
|
||||
op = pie.operator("paint.mask_flood_fill", text='Clear Mask')
|
||||
op.mode = 'VALUE'
|
||||
op.value = 0.0
|
||||
op = pie.operator("sculpt.mask_filter", text='Smooth Mask')
|
||||
op.filter_type = 'SMOOTH'
|
||||
op.auto_iteration_count = True
|
||||
@@ -6768,7 +6768,10 @@ class VIEW3D_PT_overlay_gpencil_options(Panel):
|
||||
|
||||
if context.object.mode in {'PAINT_GPENCIL', 'VERTEX_GPENCIL'}:
|
||||
layout.label(text="Vertex Paint")
|
||||
layout.prop(overlay, "gpencil_vertex_paint_opacity", text="Opacity", slider=True)
|
||||
row = layout.row()
|
||||
shading = VIEW3D_PT_shading.get_shading(context)
|
||||
row.enabled = shading.type not in {'WIREFRAME', 'RENDERED'}
|
||||
row.prop(overlay, "gpencil_vertex_paint_opacity", text="Opacity", slider=True)
|
||||
|
||||
|
||||
class VIEW3D_PT_quad_view(Panel):
|
||||
|
@@ -844,10 +844,6 @@ class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
|
||||
col.prop(sculpt, "use_smooth_shading")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class VIEW3D_PT_sculpt_voxel_remesh(Panel, View3DPaintPanel):
|
||||
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
|
||||
bl_label = "Remesh"
|
||||
@@ -1423,6 +1419,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_select(Panel, View3DPanel, GreasePenci
|
||||
|
||||
class VIEW3D_PT_tools_grease_pencil_brush_settings(Panel, View3DPanel, GreasePencilPaintPanel):
|
||||
bl_label = "Brush Settings"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
# What is the point of brush presets? Seems to serve the exact same purpose as brushes themselves??
|
||||
def draw_header_preset(self, _context):
|
||||
@@ -2105,7 +2102,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel):
|
||||
bl_context = ".greasepencil_paint"
|
||||
bl_label = "Color"
|
||||
bl_category = "Tool"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -2165,7 +2161,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_mix_palette(View3DPanel, Panel):
|
||||
bl_label = "Palette"
|
||||
bl_category = "Tool"
|
||||
bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_mixcolor'
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
@@ -89,7 +89,7 @@ void BKE_armature_bone_hash_free(struct bArmature *arm);
|
||||
|
||||
bool BKE_armature_bone_flag_test_recursive(const struct Bone *bone, int flag);
|
||||
|
||||
void BKE_armature_refresh_layer_used(struct bArmature *arm);
|
||||
void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmature *arm);
|
||||
|
||||
float distfactor_to_bone(
|
||||
const float vec[3], const float b1[3], const float b2[3], float r1, float r2, float rdist);
|
||||
|
@@ -34,12 +34,6 @@ void BKE_blender_free(void);
|
||||
|
||||
void BKE_blender_globals_init(void);
|
||||
void BKE_blender_globals_clear(void);
|
||||
void BKE_blender_version_string(char *version_str,
|
||||
size_t maxncpy,
|
||||
short version,
|
||||
short subversion,
|
||||
bool v_prefix,
|
||||
bool include_subversion);
|
||||
|
||||
void BKE_blender_userdef_data_swap(struct UserDef *userdef_dst, struct UserDef *userdef_src);
|
||||
void BKE_blender_userdef_data_set(struct UserDef *userdef);
|
||||
|
@@ -26,21 +26,25 @@
|
||||
*
|
||||
* \note Use #STRINGIFY() rather than defining with quotes.
|
||||
*/
|
||||
|
||||
/* Blender major and minor version. */
|
||||
#define BLENDER_VERSION 283
|
||||
#define BLENDER_SUBVERSION 16
|
||||
/** Several breakages with 280, e.g. collections vs layers. */
|
||||
#define BLENDER_MINVERSION 280
|
||||
#define BLENDER_MINSUBVERSION 0
|
||||
|
||||
/** Used by packaging tools. */
|
||||
/** Can be left blank, otherwise a,b,c... etc with no quotes. */
|
||||
#define BLENDER_VERSION_CHAR
|
||||
/** alpha/beta/rc/release, docs use this. */
|
||||
/* Blender patch version for bugfix releases. */
|
||||
#define BLENDER_VERSION_PATCH 2
|
||||
/** Blender release cycle stage: alpha/beta/rc/release. */
|
||||
#define BLENDER_VERSION_CYCLE beta
|
||||
/** Optionally set to 1,2,... for example to get alpha1 or rc2. */
|
||||
#define BLENDER_VERSION_CYCLE_NUMBER
|
||||
|
||||
/** Defined in from blender.c */
|
||||
extern char versionstr[];
|
||||
/* Blender file format version. */
|
||||
#define BLENDER_FILE_VERSION BLENDER_VERSION
|
||||
#define BLENDER_FILE_SUBVERSION 19
|
||||
|
||||
/* Minimum Blender version that supports reading file written with the current
|
||||
* version. Older Blender versions will test this and show a warning if the file
|
||||
* was written with too new a version. */
|
||||
#define BLENDER_FILE_MIN_VERSION 280
|
||||
#define BLENDER_FILE_MIN_SUBVERSION 0
|
||||
|
||||
/** User readable version string. */
|
||||
const char *BKE_blender_version_string(void);
|
||||
|
||||
#endif /* __BKE_BLENDER_VERSION_H__ */
|
||||
|
@@ -57,10 +57,18 @@ struct Brush *BKE_brush_copy(struct Main *bmain, const struct Brush *brush);
|
||||
|
||||
void BKE_brush_sculpt_reset(struct Brush *brush);
|
||||
|
||||
void BKE_brush_gpencil_paint_presets(struct Main *bmain, struct ToolSettings *ts);
|
||||
void BKE_brush_gpencil_vertex_presets(struct Main *bmain, struct ToolSettings *ts);
|
||||
void BKE_brush_gpencil_sculpt_presets(struct Main *bmain, struct ToolSettings *ts);
|
||||
void BKE_brush_gpencil_weight_presets(struct Main *bmain, struct ToolSettings *ts);
|
||||
void BKE_brush_gpencil_paint_presets(struct Main *bmain,
|
||||
struct ToolSettings *ts,
|
||||
const bool reset);
|
||||
void BKE_brush_gpencil_vertex_presets(struct Main *bmain,
|
||||
struct ToolSettings *ts,
|
||||
const bool reset);
|
||||
void BKE_brush_gpencil_sculpt_presets(struct Main *bmain,
|
||||
struct ToolSettings *ts,
|
||||
const bool reset);
|
||||
void BKE_brush_gpencil_weight_presets(struct Main *bmain,
|
||||
struct ToolSettings *ts,
|
||||
const bool reset);
|
||||
void BKE_gpencil_brush_preset_set(struct Main *bmain, struct Brush *brush, const short type);
|
||||
|
||||
/* image icon function */
|
||||
|
@@ -259,8 +259,9 @@ void BKE_nurb_handles_calc(struct Nurb *nu);
|
||||
void BKE_nurb_handles_autocalc(struct Nurb *nu, int flag);
|
||||
void BKE_nurb_bezt_handle_test(struct BezTriple *bezt,
|
||||
const eBezTriple_Flag__Alias sel_flag,
|
||||
const bool use_handle);
|
||||
void BKE_nurb_handles_test(struct Nurb *nu, const bool use_handles);
|
||||
const bool use_handle,
|
||||
const bool use_around_local);
|
||||
void BKE_nurb_handles_test(struct Nurb *nu, const bool use_handles, const bool use_around_local);
|
||||
|
||||
/* **** Depsgraph evaluation **** */
|
||||
|
||||
|
@@ -41,6 +41,7 @@ struct Object;
|
||||
struct Scene;
|
||||
struct SpaceImage;
|
||||
struct ToolSettings;
|
||||
struct ViewLayer;
|
||||
struct bDeformGroup;
|
||||
struct bGPDframe;
|
||||
struct bGPDlayer;
|
||||
@@ -253,7 +254,8 @@ typedef void (*gpIterCb)(struct bGPDlayer *layer,
|
||||
struct bGPDstroke *stroke,
|
||||
void *thunk);
|
||||
|
||||
void BKE_gpencil_visible_stroke_iter(struct Object *ob,
|
||||
void BKE_gpencil_visible_stroke_iter(struct ViewLayer *view_layer,
|
||||
struct Object *ob,
|
||||
gpIterCb layer_cb,
|
||||
gpIterCb stroke_cb,
|
||||
void *thunk,
|
||||
|
@@ -30,6 +30,7 @@ extern "C" {
|
||||
|
||||
#include "BLI_compiler_attrs.h"
|
||||
|
||||
struct Depsgraph;
|
||||
struct Light;
|
||||
struct Main;
|
||||
|
||||
@@ -37,6 +38,8 @@ struct Light *BKE_light_add(struct Main *bmain, const char *name) ATTR_WARN_UNUS
|
||||
struct Light *BKE_light_copy(struct Main *bmain, const struct Light *la) ATTR_WARN_UNUSED_RESULT;
|
||||
struct Light *BKE_light_localize(struct Light *la) ATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
void BKE_light_eval(struct Depsgraph *depsgraph, struct Light *la);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -87,7 +87,7 @@ enum {
|
||||
typedef struct Main {
|
||||
struct Main *next, *prev;
|
||||
char name[1024]; /* 1024 = FILE_MAX */
|
||||
short versionfile, subversionfile; /* see BLENDER_VERSION, BLENDER_SUBVERSION */
|
||||
short versionfile, subversionfile; /* see BLENDER_FILE_VERSION, BLENDER_FILE_SUBVERSION */
|
||||
short minversionfile, minsubversionfile;
|
||||
uint64_t build_commit_timestamp; /* commit's timestamp from buildinfo */
|
||||
char build_hash[16]; /* hash from buildinfo */
|
||||
@@ -105,6 +105,12 @@ typedef struct Main {
|
||||
*/
|
||||
char use_memfile_full_barrier;
|
||||
|
||||
/**
|
||||
* When linking, disallow creation of new data-blocks.
|
||||
* Make sure we don't do this by accident, see T76738.
|
||||
*/
|
||||
char is_locked_for_linking;
|
||||
|
||||
BlendThumbnail *blen_thumb;
|
||||
|
||||
struct Library *curlib;
|
||||
|
@@ -308,6 +308,8 @@ void BKE_pbvh_face_sets_set(PBVH *bvh, int *face_sets);
|
||||
|
||||
void BKE_pbvh_face_sets_color_set(PBVH *bvh, int seed, int color_default);
|
||||
|
||||
void BKE_pbvh_respect_hide_set(PBVH *bvh, bool respect_hide);
|
||||
|
||||
/* vertex deformer */
|
||||
float (*BKE_pbvh_vert_coords_alloc(struct PBVH *pbvh))[3];
|
||||
void BKE_pbvh_vert_coords_apply(struct PBVH *pbvh, const float (*vertCos)[3], const int totvert);
|
||||
@@ -333,6 +335,7 @@ typedef struct PBVHVertexIter {
|
||||
int gy;
|
||||
int i;
|
||||
int index;
|
||||
bool respect_hide;
|
||||
|
||||
/* grid */
|
||||
struct CCGKey key;
|
||||
@@ -401,9 +404,15 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, PBVHVertexIter *vi, int mo
|
||||
} \
|
||||
else if (vi.mverts) { \
|
||||
vi.mvert = &vi.mverts[vi.vert_indices[vi.gx]]; \
|
||||
vi.visible = !(vi.mvert->flag & ME_HIDE); \
|
||||
if (mode == PBVH_ITER_UNIQUE && !vi.visible) \
|
||||
continue; \
|
||||
if (vi.respect_hide) { \
|
||||
vi.visible = !(vi.mvert->flag & ME_HIDE); \
|
||||
if (mode == PBVH_ITER_UNIQUE && !vi.visible) { \
|
||||
continue; \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
BLI_assert(vi.visible); \
|
||||
} \
|
||||
vi.co = vi.mvert->co; \
|
||||
vi.no = vi.mvert->no; \
|
||||
vi.index = vi.vert_indices[vi.i]; \
|
||||
|
@@ -66,6 +66,7 @@
|
||||
#include "BKE_scene.h"
|
||||
|
||||
#include "DEG_depsgraph_build.h"
|
||||
#include "DEG_depsgraph_query.h"
|
||||
|
||||
#include "BIK_api.h"
|
||||
|
||||
@@ -480,14 +481,21 @@ static void armature_refresh_layer_used_recursive(bArmature *arm, ListBase *bone
|
||||
}
|
||||
}
|
||||
|
||||
/* Update the layers_used variable after bones are moved between layer
|
||||
* NOTE: Used to be done in drawing code in 2.7, but that won't work with
|
||||
* Copy-on-Write, as drawing uses evaluated copies.
|
||||
*/
|
||||
void BKE_armature_refresh_layer_used(bArmature *arm)
|
||||
void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmature *arm)
|
||||
{
|
||||
if (arm->edbo != NULL) {
|
||||
/* Don't perform this update when the armature is in edit mode. In that case it should be
|
||||
* handled by ED_armature_edit_refresh_layer_used(). */
|
||||
return;
|
||||
}
|
||||
|
||||
arm->layer_used = 0;
|
||||
armature_refresh_layer_used_recursive(arm, &arm->bonebase);
|
||||
|
||||
if (depsgraph == NULL || DEG_is_active(depsgraph)) {
|
||||
bArmature *arm_orig = (bArmature *)DEG_get_original_id(&arm->id);
|
||||
arm_orig->layer_used = arm->layer_used;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finds the best possible extension to the name on a particular axis. (For renaming, check for
|
||||
|
@@ -66,7 +66,7 @@
|
||||
Global G;
|
||||
UserDef U;
|
||||
|
||||
char versionstr[48] = "";
|
||||
static char blender_version_string[48] = "";
|
||||
|
||||
/* ********** free ********** */
|
||||
|
||||
@@ -102,26 +102,43 @@ void BKE_blender_free(void)
|
||||
free_nodesystem();
|
||||
}
|
||||
|
||||
void BKE_blender_version_string(char *version_str,
|
||||
size_t maxncpy,
|
||||
short version,
|
||||
short subversion,
|
||||
bool v_prefix,
|
||||
bool include_subversion)
|
||||
static void blender_version_init(void)
|
||||
{
|
||||
const char *prefix = v_prefix ? "v" : "";
|
||||
|
||||
if (include_subversion && subversion > 0) {
|
||||
BLI_snprintf(
|
||||
version_str, maxncpy, "%s%d.%02d.%d", prefix, version / 100, version % 100, subversion);
|
||||
const char *version_cycle = "";
|
||||
if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "alpha")) {
|
||||
version_cycle = " Alpha";
|
||||
}
|
||||
else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "beta")) {
|
||||
version_cycle = " Beta";
|
||||
}
|
||||
else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "rc")) {
|
||||
version_cycle = " Release Candidate";
|
||||
}
|
||||
else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "release")) {
|
||||
version_cycle = "";
|
||||
}
|
||||
else {
|
||||
BLI_snprintf(version_str, maxncpy, "%s%d.%02d", prefix, version / 100, version % 100);
|
||||
BLI_assert(!"Invalid Blender version cycle");
|
||||
}
|
||||
|
||||
BLI_snprintf(blender_version_string,
|
||||
ARRAY_SIZE(blender_version_string),
|
||||
"%d.%02d.%d%s",
|
||||
BLENDER_VERSION / 100,
|
||||
BLENDER_VERSION % 100,
|
||||
BLENDER_VERSION_PATCH,
|
||||
version_cycle);
|
||||
}
|
||||
|
||||
const char *BKE_blender_version_string(void)
|
||||
{
|
||||
return blender_version_string;
|
||||
}
|
||||
|
||||
void BKE_blender_globals_init(void)
|
||||
{
|
||||
blender_version_init();
|
||||
|
||||
memset(&G, 0, sizeof(Global));
|
||||
|
||||
U.savetime = 1;
|
||||
@@ -130,9 +147,6 @@ void BKE_blender_globals_init(void)
|
||||
|
||||
strcpy(G.ima, "//");
|
||||
|
||||
BKE_blender_version_string(
|
||||
versionstr, sizeof(versionstr), BLENDER_VERSION, BLENDER_SUBVERSION, true, true);
|
||||
|
||||
#ifndef WITH_PYTHON_SECURITY /* default */
|
||||
G.f |= G_FLAG_SCRIPT_AUTOEXEC;
|
||||
#else
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user