forked from bartvdbraak/blender
Cleanup: pep8, blank lines
This commit is contained in:
parent
28ebe827e6
commit
bab9de2a52
@ -24,6 +24,7 @@ import re
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def is_tool(name):
|
def is_tool(name):
|
||||||
"""Check whether `name` is on PATH and marked as executable."""
|
"""Check whether `name` is on PATH and marked as executable."""
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ def is_tool(name):
|
|||||||
|
|
||||||
return which(name) is not None
|
return which(name) is not None
|
||||||
|
|
||||||
|
|
||||||
class Builder:
|
class Builder:
|
||||||
def __init__(self, name, branch, codesign):
|
def __init__(self, name, branch, codesign):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
@ -23,6 +23,7 @@ import shutil
|
|||||||
|
|
||||||
import buildbot_utils
|
import buildbot_utils
|
||||||
|
|
||||||
|
|
||||||
def get_cmake_options(builder):
|
def get_cmake_options(builder):
|
||||||
codesign_script = os.path.join(
|
codesign_script = os.path.join(
|
||||||
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
|
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
|
||||||
@ -49,6 +50,7 @@ def get_cmake_options(builder):
|
|||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
||||||
|
|
||||||
def update_git(builder):
|
def update_git(builder):
|
||||||
# Do extra git fetch because not all platform/git/buildbot combinations
|
# Do extra git fetch because not all platform/git/buildbot combinations
|
||||||
# update the origin remote, causing buildinfo to detect local changes.
|
# update the origin remote, causing buildinfo to detect local changes.
|
||||||
@ -58,6 +60,7 @@ def update_git(builder):
|
|||||||
command = ['git', 'fetch', '--all']
|
command = ['git', 'fetch', '--all']
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
buildbot_utils.call(builder.command_prefix + command)
|
||||||
|
|
||||||
|
|
||||||
def clean_directories(builder):
|
def clean_directories(builder):
|
||||||
# Make sure no garbage remained from the previous run
|
# Make sure no garbage remained from the previous run
|
||||||
if os.path.isdir(builder.install_dir):
|
if os.path.isdir(builder.install_dir):
|
||||||
@ -73,6 +76,7 @@ def clean_directories(builder):
|
|||||||
print("Removing {}" . format(buildinfo))
|
print("Removing {}" . format(buildinfo))
|
||||||
os.remove(full_path)
|
os.remove(full_path)
|
||||||
|
|
||||||
|
|
||||||
def cmake_configure(builder):
|
def cmake_configure(builder):
|
||||||
# CMake configuration
|
# CMake configuration
|
||||||
os.chdir(builder.build_dir)
|
os.chdir(builder.build_dir)
|
||||||
@ -87,6 +91,7 @@ def cmake_configure(builder):
|
|||||||
command = ['cmake', builder.blender_dir] + cmake_options
|
command = ['cmake', builder.blender_dir] + cmake_options
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
buildbot_utils.call(builder.command_prefix + command)
|
||||||
|
|
||||||
|
|
||||||
def cmake_build(builder):
|
def cmake_build(builder):
|
||||||
# CMake build
|
# CMake build
|
||||||
os.chdir(builder.build_dir)
|
os.chdir(builder.build_dir)
|
||||||
@ -109,6 +114,7 @@ def cmake_build(builder):
|
|||||||
print("CMake build:")
|
print("CMake build:")
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
buildbot_utils.call(builder.command_prefix + command)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
builder = buildbot_utils.create_builder_from_arguments()
|
builder = buildbot_utils.create_builder_from_arguments()
|
||||||
update_git(builder)
|
update_git(builder)
|
||||||
|
@ -29,6 +29,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import buildbot_utils
|
import buildbot_utils
|
||||||
|
|
||||||
|
|
||||||
def get_package_name(builder, platform=None):
|
def get_package_name(builder, platform=None):
|
||||||
info = buildbot_utils.VersionInfo(builder)
|
info = buildbot_utils.VersionInfo(builder)
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ def get_package_name(builder, platform=None):
|
|||||||
|
|
||||||
return package_name
|
return package_name
|
||||||
|
|
||||||
|
|
||||||
def sign_file_or_directory(path):
|
def sign_file_or_directory(path):
|
||||||
from codesign.simple_code_signer import SimpleCodeSigner
|
from codesign.simple_code_signer import SimpleCodeSigner
|
||||||
code_signer = SimpleCodeSigner()
|
code_signer = SimpleCodeSigner()
|
||||||
@ -64,6 +66,7 @@ def create_buildbot_upload_zip(builder, package_files):
|
|||||||
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
|
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def create_tar_xz(src, dest, package_name):
|
def create_tar_xz(src, dest, package_name):
|
||||||
# One extra to remove leading os.sep when cleaning root for package_root
|
# One extra to remove leading os.sep when cleaning root for package_root
|
||||||
ln = len(src) + 1
|
ln = len(src) + 1
|
||||||
@ -91,6 +94,7 @@ def create_tar_xz(src, dest, package_name):
|
|||||||
package.add(entry[0], entry[1], recursive=False, filter=_fakeroot)
|
package.add(entry[0], entry[1], recursive=False, filter=_fakeroot)
|
||||||
package.close()
|
package.close()
|
||||||
|
|
||||||
|
|
||||||
def cleanup_files(dirpath, extension):
|
def cleanup_files(dirpath, extension):
|
||||||
for f in os.listdir(dirpath):
|
for f in os.listdir(dirpath):
|
||||||
filepath = os.path.join(dirpath, f)
|
filepath = os.path.join(dirpath, f)
|
||||||
|
@ -22,18 +22,21 @@ import buildbot_utils
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def get_ctest_arguments(builder):
|
def get_ctest_arguments(builder):
|
||||||
args = ['--output-on-failure']
|
args = ['--output-on-failure']
|
||||||
if builder.platform == 'win':
|
if builder.platform == 'win':
|
||||||
args += ['-C', 'Release']
|
args += ['-C', 'Release']
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
def test(builder):
|
def test(builder):
|
||||||
os.chdir(builder.build_dir)
|
os.chdir(builder.build_dir)
|
||||||
|
|
||||||
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
|
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
|
||||||
buildbot_utils.call(command)
|
buildbot_utils.call(command)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
builder = buildbot_utils.create_builder_from_arguments()
|
builder = buildbot_utils.create_builder_from_arguments()
|
||||||
test(builder)
|
test(builder)
|
||||||
|
@ -355,6 +355,8 @@ def recursive_arg_sizes(node, ):
|
|||||||
# print("adding", node.spelling)
|
# print("adding", node.spelling)
|
||||||
for c in node.get_children():
|
for c in node.get_children():
|
||||||
recursive_arg_sizes(c)
|
recursive_arg_sizes(c)
|
||||||
|
|
||||||
|
|
||||||
# cache function sizes
|
# cache function sizes
|
||||||
recursive_arg_sizes(tu.cursor)
|
recursive_arg_sizes(tu.cursor)
|
||||||
_defs.update(defs_precalc)
|
_defs.update(defs_precalc)
|
||||||
|
@ -8,6 +8,7 @@ import sys
|
|||||||
|
|
||||||
cmakelists_file = sys.argv[-1]
|
cmakelists_file = sys.argv[-1]
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
options = []
|
options = []
|
||||||
for l in open(cmakelists_file, 'r').readlines():
|
for l in open(cmakelists_file, 'r').readlines():
|
||||||
|
@ -114,5 +114,6 @@ def main():
|
|||||||
import subprocess
|
import subprocess
|
||||||
subprocess.call(cmd)
|
subprocess.call(cmd)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@ -242,5 +242,6 @@ def main():
|
|||||||
for s in build_info():
|
for s in build_info():
|
||||||
print(s)
|
print(s)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@ -12,6 +12,7 @@ from make_utils import call
|
|||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
|
|
||||||
|
|
||||||
def parse_arguments():
|
def parse_arguments():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--ctest-command", default="ctest")
|
parser.add_argument("--ctest-command", default="ctest")
|
||||||
@ -22,6 +23,7 @@ def parse_arguments():
|
|||||||
parser.add_argument("build_directory")
|
parser.add_argument("build_directory")
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
args = parse_arguments()
|
args = parse_arguments()
|
||||||
git_command = args.git_command
|
git_command = args.git_command
|
||||||
svn_command = args.svn_command
|
svn_command = args.svn_command
|
||||||
|
@ -14,12 +14,15 @@ import sys
|
|||||||
import make_utils
|
import make_utils
|
||||||
from make_utils import call, check_output
|
from make_utils import call, check_output
|
||||||
|
|
||||||
|
|
||||||
def print_stage(text):
|
def print_stage(text):
|
||||||
print("")
|
print("")
|
||||||
print(text)
|
print(text)
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
|
|
||||||
|
|
||||||
def parse_arguments():
|
def parse_arguments():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--no-libraries", action="store_true")
|
parser.add_argument("--no-libraries", action="store_true")
|
||||||
@ -31,10 +34,13 @@ def parse_arguments():
|
|||||||
parser.add_argument("--use-centos-libraries", action="store_true")
|
parser.add_argument("--use-centos-libraries", action="store_true")
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def get_blender_git_root():
|
def get_blender_git_root():
|
||||||
return check_output([args.git_command, "rev-parse", "--show-toplevel"])
|
return check_output([args.git_command, "rev-parse", "--show-toplevel"])
|
||||||
|
|
||||||
# Setup for precompiled libraries and tests from svn.
|
# Setup for precompiled libraries and tests from svn.
|
||||||
|
|
||||||
|
|
||||||
def svn_update(args, release_version):
|
def svn_update(args, release_version):
|
||||||
svn_non_interactive = [args.svn_command, '--non-interactive']
|
svn_non_interactive = [args.svn_command, '--non-interactive']
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def call(cmd, exit_on_error=True):
|
def call(cmd, exit_on_error=True):
|
||||||
print(" ".join(cmd))
|
print(" ".join(cmd))
|
||||||
|
|
||||||
@ -19,6 +20,7 @@ def call(cmd, exit_on_error=True):
|
|||||||
sys.exit(retcode)
|
sys.exit(retcode)
|
||||||
return retcode
|
return retcode
|
||||||
|
|
||||||
|
|
||||||
def check_output(cmd, exit_on_error=True):
|
def check_output(cmd, exit_on_error=True):
|
||||||
# Flush to ensure correct order output on Windows.
|
# Flush to ensure correct order output on Windows.
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
@ -35,6 +37,7 @@ def check_output(cmd, exit_on_error=True):
|
|||||||
|
|
||||||
return output.strip()
|
return output.strip()
|
||||||
|
|
||||||
|
|
||||||
def git_branch(git_command):
|
def git_branch(git_command):
|
||||||
# Get current branch name.
|
# Get current branch name.
|
||||||
try:
|
try:
|
||||||
@ -45,6 +48,7 @@ def git_branch(git_command):
|
|||||||
|
|
||||||
return branch.strip().decode('utf8')
|
return branch.strip().decode('utf8')
|
||||||
|
|
||||||
|
|
||||||
def git_tag(git_command):
|
def git_tag(git_command):
|
||||||
# Get current tag name.
|
# Get current tag name.
|
||||||
try:
|
try:
|
||||||
@ -54,6 +58,7 @@ def git_tag(git_command):
|
|||||||
|
|
||||||
return tag.strip().decode('utf8')
|
return tag.strip().decode('utf8')
|
||||||
|
|
||||||
|
|
||||||
def git_branch_release_version(branch, tag):
|
def git_branch_release_version(branch, tag):
|
||||||
release_version = re.search("^blender-v(.*)-release$", branch)
|
release_version = re.search("^blender-v(.*)-release$", branch)
|
||||||
if release_version:
|
if release_version:
|
||||||
@ -64,6 +69,7 @@ def git_branch_release_version(branch, tag):
|
|||||||
release_version = release_version.group(1)
|
release_version = release_version.group(1)
|
||||||
return release_version
|
return release_version
|
||||||
|
|
||||||
|
|
||||||
def svn_libraries_base_url(release_version):
|
def svn_libraries_base_url(release_version):
|
||||||
if release_version:
|
if release_version:
|
||||||
svn_branch = "tags/blender-" + release_version + "-release"
|
svn_branch = "tags/blender-" + release_version + "-release"
|
||||||
@ -71,6 +77,7 @@ def svn_libraries_base_url(release_version):
|
|||||||
svn_branch = "trunk"
|
svn_branch = "trunk"
|
||||||
return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/"
|
return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/"
|
||||||
|
|
||||||
|
|
||||||
def command_missing(command):
|
def command_missing(command):
|
||||||
# Support running with Python 2 for macOS
|
# Support running with Python 2 for macOS
|
||||||
if sys.version_info >= (3, 0):
|
if sys.version_info >= (3, 0):
|
||||||
|
@ -99,6 +99,7 @@ SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
|
|||||||
# See: D6261 for reference.
|
# See: D6261 for reference.
|
||||||
USE_ONLY_BUILTIN_RNA_TYPES = True
|
USE_ONLY_BUILTIN_RNA_TYPES = True
|
||||||
|
|
||||||
|
|
||||||
def handle_args():
|
def handle_args():
|
||||||
'''
|
'''
|
||||||
Parse the args passed to Blender after "--", ignored by Blender
|
Parse the args passed to Blender after "--", ignored by Blender
|
||||||
|
@ -224,6 +224,7 @@ def system_info():
|
|||||||
import _cycles
|
import _cycles
|
||||||
return _cycles.system_info()
|
return _cycles.system_info()
|
||||||
|
|
||||||
|
|
||||||
def list_render_passes(scene, srl):
|
def list_render_passes(scene, srl):
|
||||||
# Builtin Blender passes.
|
# Builtin Blender passes.
|
||||||
yield ("Combined", "RGBA", 'COLOR')
|
yield ("Combined", "RGBA", 'COLOR')
|
||||||
@ -298,6 +299,7 @@ def list_render_passes(scene, srl):
|
|||||||
else:
|
else:
|
||||||
yield (aov.name, "RGBA", 'COLOR')
|
yield (aov.name, "RGBA", 'COLOR')
|
||||||
|
|
||||||
|
|
||||||
def register_passes(engine, scene, view_layer):
|
def register_passes(engine, scene, view_layer):
|
||||||
# Detect duplicate render pass names, first one wins.
|
# Detect duplicate render pass names, first one wins.
|
||||||
listed = set()
|
listed = set()
|
||||||
@ -306,6 +308,7 @@ def register_passes(engine, scene, view_layer):
|
|||||||
engine.register_pass(scene, view_layer, name, len(channelids), channelids, channeltype)
|
engine.register_pass(scene, view_layer, name, len(channelids), channelids, channeltype)
|
||||||
listed.add(name)
|
listed.add(name)
|
||||||
|
|
||||||
|
|
||||||
def detect_conflicting_passes(scene, view_layer):
|
def detect_conflicting_passes(scene, view_layer):
|
||||||
# Detect conflicting render pass names for UI.
|
# Detect conflicting render pass names for UI.
|
||||||
counter = {}
|
counter = {}
|
||||||
|
@ -203,6 +203,7 @@ classes = (
|
|||||||
CYCLES_OT_merge_images
|
CYCLES_OT_merge_images
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
from bpy.utils import register_class
|
from bpy.utils import register_class
|
||||||
for cls in classes:
|
for cls in classes:
|
||||||
|
@ -188,11 +188,13 @@ def enum_openimagedenoise_denoiser(self, context):
|
|||||||
return [('OPENIMAGEDENOISE', "OpenImageDenoise", "Use Intel OpenImageDenoise AI denoiser running on the CPU", 4)]
|
return [('OPENIMAGEDENOISE', "OpenImageDenoise", "Use Intel OpenImageDenoise AI denoiser running on the CPU", 4)]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def enum_optix_denoiser(self, context):
|
def enum_optix_denoiser(self, context):
|
||||||
if not context or bool(context.preferences.addons[__package__].preferences.get_devices_for_type('OPTIX')):
|
if not context or bool(context.preferences.addons[__package__].preferences.get_devices_for_type('OPTIX')):
|
||||||
return [('OPTIX', "OptiX", "Use the OptiX AI denoiser with GPU acceleration, only available on NVIDIA GPUs", 2)]
|
return [('OPTIX', "OptiX", "Use the OptiX AI denoiser with GPU acceleration, only available on NVIDIA GPUs", 2)]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def enum_preview_denoiser(self, context):
|
def enum_preview_denoiser(self, context):
|
||||||
optix_items = enum_optix_denoiser(self, context)
|
optix_items = enum_optix_denoiser(self, context)
|
||||||
oidn_items = enum_openimagedenoise_denoiser(self, context)
|
oidn_items = enum_openimagedenoise_denoiser(self, context)
|
||||||
@ -206,12 +208,14 @@ def enum_preview_denoiser(self, context):
|
|||||||
items += oidn_items
|
items += oidn_items
|
||||||
return items
|
return items
|
||||||
|
|
||||||
|
|
||||||
def enum_denoiser(self, context):
|
def enum_denoiser(self, context):
|
||||||
items = [('NLM', "NLM", "Cycles native non-local means denoiser, running on any compute device", 1)]
|
items = [('NLM', "NLM", "Cycles native non-local means denoiser, running on any compute device", 1)]
|
||||||
items += enum_optix_denoiser(self, context)
|
items += enum_optix_denoiser(self, context)
|
||||||
items += enum_openimagedenoise_denoiser(self, context)
|
items += enum_openimagedenoise_denoiser(self, context)
|
||||||
return items
|
return items
|
||||||
|
|
||||||
|
|
||||||
enum_denoising_input_passes = (
|
enum_denoising_input_passes = (
|
||||||
('RGB', "Color", "Use only color as input", 1),
|
('RGB', "Color", "Use only color as input", 1),
|
||||||
('RGB_ALBEDO', "Color + Albedo", "Use color and albedo data as input", 2),
|
('RGB_ALBEDO', "Color + Albedo", "Use color and albedo data as input", 2),
|
||||||
@ -1325,6 +1329,7 @@ class CyclesAOVPass(bpy.types.PropertyGroup):
|
|||||||
default=""
|
default=""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||||
|
|
||||||
pass_debug_bvh_traversed_nodes: BoolProperty(
|
pass_debug_bvh_traversed_nodes: BoolProperty(
|
||||||
@ -1644,7 +1649,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
col.label(text="OptiX support is experimental", icon='INFO')
|
col.label(text="OptiX support is experimental", icon='INFO')
|
||||||
col.label(text="Not all Cycles features are supported yet", icon='BLANK1')
|
col.label(text="Not all Cycles features are supported yet", icon='BLANK1')
|
||||||
|
|
||||||
|
|
||||||
def draw_impl(self, layout, context):
|
def draw_impl(self, layout, context):
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(self, "compute_device_type", expand=True)
|
row.prop(self, "compute_device_type", expand=True)
|
||||||
|
@ -45,6 +45,7 @@ import bpy
|
|||||||
|
|
||||||
# Generic functions
|
# Generic functions
|
||||||
|
|
||||||
|
|
||||||
def area_tri_signed_2x_v2(v1, v2, v3):
|
def area_tri_signed_2x_v2(v1, v2, v3):
|
||||||
return (v1[0] - v2[0]) * (v2[1] - v3[1]) + (v1[1] - v2[1]) * (v3[0] - v2[0])
|
return (v1[0] - v2[0]) * (v2[1] - v3[1]) + (v1[1] - v2[1]) * (v3[0] - v2[0])
|
||||||
|
|
||||||
|
@ -5,10 +5,12 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def run(cmd):
|
def run(cmd):
|
||||||
print(" ", " ".join(cmd))
|
print(" ", " ".join(cmd))
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
|
|
||||||
|
|
||||||
BASEDIR = os.path.abspath(os.path.dirname(__file__))
|
BASEDIR = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
|
inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
|
||||||
|
@ -88,6 +88,7 @@ class pyChainSilhouetteIterator(ChainingIterator):
|
|||||||
silhouettes, then borders, then suggestive contours, then all other edge
|
silhouettes, then borders, then suggestive contours, then all other edge
|
||||||
types. A ViewEdge is only chained once.
|
types. A ViewEdge is only chained once.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, stayInSelection=True):
|
def __init__(self, stayInSelection=True):
|
||||||
ChainingIterator.__init__(self, stayInSelection, True, None, True)
|
ChainingIterator.__init__(self, stayInSelection, True, None, True)
|
||||||
|
|
||||||
@ -279,6 +280,7 @@ class pySketchyChainingIterator(ChainingIterator):
|
|||||||
ViewEdge several times in order to produce multiple strokes per
|
ViewEdge several times in order to produce multiple strokes per
|
||||||
ViewEdge.
|
ViewEdge.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, nRounds=3, stayInSelection=True):
|
def __init__(self, nRounds=3, stayInSelection=True):
|
||||||
ChainingIterator.__init__(self, stayInSelection, False, None, True)
|
ChainingIterator.__init__(self, stayInSelection, False, None, True)
|
||||||
self._timeStamp = CF.get_time_stamp() + nRounds
|
self._timeStamp = CF.get_time_stamp() + nRounds
|
||||||
@ -396,6 +398,7 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
|
|||||||
:arg length: The maximum length of the occluded part in pixels.
|
:arg length: The maximum length of the occluded part in pixels.
|
||||||
:type length: int
|
:type length: int
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, length):
|
def __init__(self, length):
|
||||||
ChainingIterator.__init__(self, False, True, None, True)
|
ChainingIterator.__init__(self, False, True, None, True)
|
||||||
self._length = float(length)
|
self._length = float(length)
|
||||||
@ -530,6 +533,7 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
|
|||||||
:arg l: Absolute length.
|
:arg l: Absolute length.
|
||||||
:type l: float
|
:type l: float
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, percent, l):
|
def __init__(self, percent, l):
|
||||||
ChainingIterator.__init__(self, False, True, None, True)
|
ChainingIterator.__init__(self, False, True, None, True)
|
||||||
self._length = 0.0
|
self._length = 0.0
|
||||||
|
@ -128,6 +128,7 @@ callbacks_lineset_post = []
|
|||||||
|
|
||||||
class ColorRampModifier(StrokeShader):
|
class ColorRampModifier(StrokeShader):
|
||||||
"""Primitive for the color modifiers."""
|
"""Primitive for the color modifiers."""
|
||||||
|
|
||||||
def __init__(self, blend, influence, ramp):
|
def __init__(self, blend, influence, ramp):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.blend = blend
|
self.blend = blend
|
||||||
@ -144,6 +145,7 @@ class ColorRampModifier(StrokeShader):
|
|||||||
|
|
||||||
class ScalarBlendModifier(StrokeShader):
|
class ScalarBlendModifier(StrokeShader):
|
||||||
"""Primitive for alpha and thickness modifiers."""
|
"""Primitive for alpha and thickness modifiers."""
|
||||||
|
|
||||||
def __init__(self, blend_type, influence):
|
def __init__(self, blend_type, influence):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.blend_type = blend_type
|
self.blend_type = blend_type
|
||||||
@ -304,6 +306,7 @@ class BaseThicknessShader(StrokeShader, ThicknessModifierMixIn):
|
|||||||
|
|
||||||
class ColorAlongStrokeShader(ColorRampModifier):
|
class ColorAlongStrokeShader(ColorRampModifier):
|
||||||
"""Maps a ramp to the color of the stroke, using the curvilinear abscissa (t)."""
|
"""Maps a ramp to the color of the stroke, using the curvilinear abscissa (t)."""
|
||||||
|
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
for svert, t in zip(stroke, iter_t2d_along_stroke(stroke)):
|
for svert, t in zip(stroke, iter_t2d_along_stroke(stroke)):
|
||||||
a = svert.attribute.color
|
a = svert.attribute.color
|
||||||
@ -313,6 +316,7 @@ class ColorAlongStrokeShader(ColorRampModifier):
|
|||||||
|
|
||||||
class AlphaAlongStrokeShader(CurveMappingModifier):
|
class AlphaAlongStrokeShader(CurveMappingModifier):
|
||||||
"""Maps a curve to the alpha/transparency of the stroke, using the curvilinear abscissa (t)."""
|
"""Maps a curve to the alpha/transparency of the stroke, using the curvilinear abscissa (t)."""
|
||||||
|
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
for svert, t in zip(stroke, iter_t2d_along_stroke(stroke)):
|
for svert, t in zip(stroke, iter_t2d_along_stroke(stroke)):
|
||||||
a = svert.attribute.alpha
|
a = svert.attribute.alpha
|
||||||
@ -322,6 +326,7 @@ class AlphaAlongStrokeShader(CurveMappingModifier):
|
|||||||
|
|
||||||
class ThicknessAlongStrokeShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
class ThicknessAlongStrokeShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
||||||
"""Maps a curve to the thickness of the stroke, using the curvilinear abscissa (t)."""
|
"""Maps a curve to the thickness of the stroke, using the curvilinear abscissa (t)."""
|
||||||
|
|
||||||
def __init__(self, thickness_position, thickness_ratio,
|
def __init__(self, thickness_position, thickness_ratio,
|
||||||
blend, influence, mapping, invert, curve, value_min, value_max):
|
blend, influence, mapping, invert, curve, value_min, value_max):
|
||||||
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
||||||
@ -338,6 +343,7 @@ class ThicknessAlongStrokeShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
|||||||
|
|
||||||
class ColorDistanceFromCameraShader(ColorRampModifier):
|
class ColorDistanceFromCameraShader(ColorRampModifier):
|
||||||
"""Picks a color value from a ramp based on the vertex' distance from the camera."""
|
"""Picks a color value from a ramp based on the vertex' distance from the camera."""
|
||||||
|
|
||||||
def __init__(self, blend, influence, ramp, range_min, range_max):
|
def __init__(self, blend, influence, ramp, range_min, range_max):
|
||||||
ColorRampModifier.__init__(self, blend, influence, ramp)
|
ColorRampModifier.__init__(self, blend, influence, ramp)
|
||||||
self.range = BoundedProperty(range_min, range_max)
|
self.range = BoundedProperty(range_min, range_max)
|
||||||
@ -352,6 +358,7 @@ class ColorDistanceFromCameraShader(ColorRampModifier):
|
|||||||
|
|
||||||
class AlphaDistanceFromCameraShader(CurveMappingModifier):
|
class AlphaDistanceFromCameraShader(CurveMappingModifier):
|
||||||
"""Picks an alpha value from a curve based on the vertex' distance from the camera"""
|
"""Picks an alpha value from a curve based on the vertex' distance from the camera"""
|
||||||
|
|
||||||
def __init__(self, blend, influence, mapping, invert, curve, range_min, range_max):
|
def __init__(self, blend, influence, mapping, invert, curve, range_min, range_max):
|
||||||
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
||||||
self.range = BoundedProperty(range_min, range_max)
|
self.range = BoundedProperty(range_min, range_max)
|
||||||
@ -366,6 +373,7 @@ class AlphaDistanceFromCameraShader(CurveMappingModifier):
|
|||||||
|
|
||||||
class ThicknessDistanceFromCameraShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
class ThicknessDistanceFromCameraShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
||||||
"""Picks a thickness value from a curve based on the vertex' distance from the camera."""
|
"""Picks a thickness value from a curve based on the vertex' distance from the camera."""
|
||||||
|
|
||||||
def __init__(self, thickness_position, thickness_ratio,
|
def __init__(self, thickness_position, thickness_ratio,
|
||||||
blend, influence, mapping, invert, curve, range_min, range_max, value_min, value_max):
|
blend, influence, mapping, invert, curve, range_min, range_max, value_min, value_max):
|
||||||
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
||||||
@ -383,6 +391,7 @@ class ThicknessDistanceFromCameraShader(ThicknessBlenderMixIn, CurveMappingModif
|
|||||||
|
|
||||||
class ColorDistanceFromObjectShader(ColorRampModifier):
|
class ColorDistanceFromObjectShader(ColorRampModifier):
|
||||||
"""Picks a color value from a ramp based on the vertex' distance from a given object."""
|
"""Picks a color value from a ramp based on the vertex' distance from a given object."""
|
||||||
|
|
||||||
def __init__(self, blend, influence, ramp, target, range_min, range_max):
|
def __init__(self, blend, influence, ramp, target, range_min, range_max):
|
||||||
ColorRampModifier.__init__(self, blend, influence, ramp)
|
ColorRampModifier.__init__(self, blend, influence, ramp)
|
||||||
if target is None:
|
if target is None:
|
||||||
@ -403,6 +412,7 @@ class ColorDistanceFromObjectShader(ColorRampModifier):
|
|||||||
|
|
||||||
class AlphaDistanceFromObjectShader(CurveMappingModifier):
|
class AlphaDistanceFromObjectShader(CurveMappingModifier):
|
||||||
"""Picks an alpha value from a curve based on the vertex' distance from a given object."""
|
"""Picks an alpha value from a curve based on the vertex' distance from a given object."""
|
||||||
|
|
||||||
def __init__(self, blend, influence, mapping, invert, curve, target, range_min, range_max):
|
def __init__(self, blend, influence, mapping, invert, curve, target, range_min, range_max):
|
||||||
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
||||||
if target is None:
|
if target is None:
|
||||||
@ -423,6 +433,7 @@ class AlphaDistanceFromObjectShader(CurveMappingModifier):
|
|||||||
|
|
||||||
class ThicknessDistanceFromObjectShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
class ThicknessDistanceFromObjectShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
||||||
"""Picks a thickness value from a curve based on the vertex' distance from a given object."""
|
"""Picks a thickness value from a curve based on the vertex' distance from a given object."""
|
||||||
|
|
||||||
def __init__(self, thickness_position, thickness_ratio,
|
def __init__(self, thickness_position, thickness_ratio,
|
||||||
blend, influence, mapping, invert, curve, target, range_min, range_max, value_min, value_max):
|
blend, influence, mapping, invert, curve, target, range_min, range_max, value_min, value_max):
|
||||||
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
||||||
@ -446,6 +457,7 @@ class ThicknessDistanceFromObjectShader(ThicknessBlenderMixIn, CurveMappingModif
|
|||||||
# Material modifiers
|
# Material modifiers
|
||||||
class ColorMaterialShader(ColorRampModifier):
|
class ColorMaterialShader(ColorRampModifier):
|
||||||
"""Assigns a color to the vertices based on their underlying material."""
|
"""Assigns a color to the vertices based on their underlying material."""
|
||||||
|
|
||||||
def __init__(self, blend, influence, ramp, material_attribute, use_ramp):
|
def __init__(self, blend, influence, ramp, material_attribute, use_ramp):
|
||||||
ColorRampModifier.__init__(self, blend, influence, ramp)
|
ColorRampModifier.__init__(self, blend, influence, ramp)
|
||||||
self.attribute = material_attribute
|
self.attribute = material_attribute
|
||||||
@ -474,6 +486,7 @@ class ColorMaterialShader(ColorRampModifier):
|
|||||||
|
|
||||||
class AlphaMaterialShader(CurveMappingModifier):
|
class AlphaMaterialShader(CurveMappingModifier):
|
||||||
"""Assigns an alpha value to the vertices based on their underlying material."""
|
"""Assigns an alpha value to the vertices based on their underlying material."""
|
||||||
|
|
||||||
def __init__(self, blend, influence, mapping, invert, curve, material_attribute):
|
def __init__(self, blend, influence, mapping, invert, curve, material_attribute):
|
||||||
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
||||||
self.attribute = material_attribute
|
self.attribute = material_attribute
|
||||||
@ -488,6 +501,7 @@ class AlphaMaterialShader(CurveMappingModifier):
|
|||||||
|
|
||||||
class ThicknessMaterialShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
class ThicknessMaterialShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
||||||
"""Assigns a thickness value to the vertices based on their underlying material."""
|
"""Assigns a thickness value to the vertices based on their underlying material."""
|
||||||
|
|
||||||
def __init__(self, thickness_position, thickness_ratio,
|
def __init__(self, thickness_position, thickness_ratio,
|
||||||
blend, influence, mapping, invert, curve, material_attribute, value_min, value_max):
|
blend, influence, mapping, invert, curve, material_attribute, value_min, value_max):
|
||||||
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
||||||
@ -506,6 +520,7 @@ class ThicknessMaterialShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
|||||||
|
|
||||||
class CalligraphicThicknessShader(ThicknessBlenderMixIn, ScalarBlendModifier):
|
class CalligraphicThicknessShader(ThicknessBlenderMixIn, ScalarBlendModifier):
|
||||||
"""Thickness modifier for achieving a calligraphy-like effect."""
|
"""Thickness modifier for achieving a calligraphy-like effect."""
|
||||||
|
|
||||||
def __init__(self, thickness_position, thickness_ratio,
|
def __init__(self, thickness_position, thickness_ratio,
|
||||||
blend_type, influence, orientation, thickness_min, thickness_max):
|
blend_type, influence, orientation, thickness_min, thickness_max):
|
||||||
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
||||||
@ -531,6 +546,7 @@ class CalligraphicThicknessShader(ThicknessBlenderMixIn, ScalarBlendModifier):
|
|||||||
|
|
||||||
class TangentColorShader(ColorRampModifier):
|
class TangentColorShader(ColorRampModifier):
|
||||||
"""Color based on the direction of the stroke"""
|
"""Color based on the direction of the stroke"""
|
||||||
|
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
it = Interface0DIterator(stroke)
|
it = Interface0DIterator(stroke)
|
||||||
for svert in it:
|
for svert in it:
|
||||||
@ -542,6 +558,7 @@ class TangentColorShader(ColorRampModifier):
|
|||||||
|
|
||||||
class TangentAlphaShader(CurveMappingModifier):
|
class TangentAlphaShader(CurveMappingModifier):
|
||||||
"""Alpha transparency based on the direction of the stroke"""
|
"""Alpha transparency based on the direction of the stroke"""
|
||||||
|
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
it = Interface0DIterator(stroke)
|
it = Interface0DIterator(stroke)
|
||||||
for svert in it:
|
for svert in it:
|
||||||
@ -553,6 +570,7 @@ class TangentAlphaShader(CurveMappingModifier):
|
|||||||
|
|
||||||
class TangentThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
class TangentThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
||||||
"""Thickness based on the direction of the stroke"""
|
"""Thickness based on the direction of the stroke"""
|
||||||
|
|
||||||
def __init__(self, thickness_position, thickness_ratio, blend, influence, mapping, invert, curve,
|
def __init__(self, thickness_position, thickness_ratio, blend, influence, mapping, invert, curve,
|
||||||
thickness_min, thickness_max):
|
thickness_min, thickness_max):
|
||||||
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
||||||
@ -571,6 +589,7 @@ class TangentThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
|||||||
|
|
||||||
class NoiseShader:
|
class NoiseShader:
|
||||||
"""Base class for noise shaders"""
|
"""Base class for noise shaders"""
|
||||||
|
|
||||||
def __init__(self, amplitude, period, seed=512):
|
def __init__(self, amplitude, period, seed=512):
|
||||||
self.amplitude = amplitude
|
self.amplitude = amplitude
|
||||||
self.scale = 1 / period / seed
|
self.scale = 1 / period / seed
|
||||||
@ -605,6 +624,7 @@ class ThicknessNoiseShader(ThicknessBlenderMixIn, ScalarBlendModifier, NoiseShad
|
|||||||
|
|
||||||
class ColorNoiseShader(ColorRampModifier, NoiseShader):
|
class ColorNoiseShader(ColorRampModifier, NoiseShader):
|
||||||
"""Color based on pseudo-noise"""
|
"""Color based on pseudo-noise"""
|
||||||
|
|
||||||
def __init__(self, blend, influence, ramp, amplitude, period, seed=512):
|
def __init__(self, blend, influence, ramp, amplitude, period, seed=512):
|
||||||
ColorRampModifier.__init__(self, blend, influence, ramp)
|
ColorRampModifier.__init__(self, blend, influence, ramp)
|
||||||
NoiseShader.__init__(self, amplitude, period, seed)
|
NoiseShader.__init__(self, amplitude, period, seed)
|
||||||
@ -617,6 +637,7 @@ class ColorNoiseShader(ColorRampModifier, NoiseShader):
|
|||||||
|
|
||||||
class AlphaNoiseShader(CurveMappingModifier, NoiseShader):
|
class AlphaNoiseShader(CurveMappingModifier, NoiseShader):
|
||||||
"""Alpha transparency on based pseudo-noise"""
|
"""Alpha transparency on based pseudo-noise"""
|
||||||
|
|
||||||
def __init__(self, blend, influence, mapping, invert, curve, amplitude, period, seed=512):
|
def __init__(self, blend, influence, mapping, invert, curve, amplitude, period, seed=512):
|
||||||
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
||||||
NoiseShader.__init__(self, amplitude, period, seed)
|
NoiseShader.__init__(self, amplitude, period, seed)
|
||||||
@ -641,6 +662,7 @@ def crease_angle(svert):
|
|||||||
|
|
||||||
class CreaseAngleColorShader(ColorRampModifier):
|
class CreaseAngleColorShader(ColorRampModifier):
|
||||||
"""Color based on the crease angle between two adjacent faces on the underlying geometry"""
|
"""Color based on the crease angle between two adjacent faces on the underlying geometry"""
|
||||||
|
|
||||||
def __init__(self, blend, influence, ramp, angle_min, angle_max):
|
def __init__(self, blend, influence, ramp, angle_min, angle_max):
|
||||||
ColorRampModifier.__init__(self, blend, influence, ramp)
|
ColorRampModifier.__init__(self, blend, influence, ramp)
|
||||||
# angles are (already) in radians
|
# angles are (already) in radians
|
||||||
@ -657,6 +679,7 @@ class CreaseAngleColorShader(ColorRampModifier):
|
|||||||
|
|
||||||
class CreaseAngleAlphaShader(CurveMappingModifier):
|
class CreaseAngleAlphaShader(CurveMappingModifier):
|
||||||
"""Alpha transparency based on the crease angle between two adjacent faces on the underlying geometry"""
|
"""Alpha transparency based on the crease angle between two adjacent faces on the underlying geometry"""
|
||||||
|
|
||||||
def __init__(self, blend, influence, mapping, invert, curve, angle_min, angle_max):
|
def __init__(self, blend, influence, mapping, invert, curve, angle_min, angle_max):
|
||||||
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
||||||
# angles are (already) in radians
|
# angles are (already) in radians
|
||||||
@ -673,6 +696,7 @@ class CreaseAngleAlphaShader(CurveMappingModifier):
|
|||||||
|
|
||||||
class CreaseAngleThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
class CreaseAngleThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
||||||
"""Thickness based on the crease angle between two adjacent faces on the underlying geometry"""
|
"""Thickness based on the crease angle between two adjacent faces on the underlying geometry"""
|
||||||
|
|
||||||
def __init__(self, thickness_position, thickness_ratio, blend, influence, mapping, invert, curve,
|
def __init__(self, thickness_position, thickness_ratio, blend, influence, mapping, invert, curve,
|
||||||
angle_min, angle_max, thickness_min, thickness_max):
|
angle_min, angle_max, thickness_min, thickness_max):
|
||||||
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
||||||
@ -709,6 +733,7 @@ def normalized_absolute_curvature(svert, bounded_curvature):
|
|||||||
|
|
||||||
class Curvature3DColorShader(ColorRampModifier):
|
class Curvature3DColorShader(ColorRampModifier):
|
||||||
"""Color based on the 3D curvature of the underlying geometry"""
|
"""Color based on the 3D curvature of the underlying geometry"""
|
||||||
|
|
||||||
def __init__(self, blend, influence, ramp, curvature_min, curvature_max):
|
def __init__(self, blend, influence, ramp, curvature_min, curvature_max):
|
||||||
ColorRampModifier.__init__(self, blend, influence, ramp)
|
ColorRampModifier.__init__(self, blend, influence, ramp)
|
||||||
self.curvature = BoundedProperty(curvature_min, curvature_max)
|
self.curvature = BoundedProperty(curvature_min, curvature_max)
|
||||||
@ -723,6 +748,7 @@ class Curvature3DColorShader(ColorRampModifier):
|
|||||||
|
|
||||||
class Curvature3DAlphaShader(CurveMappingModifier):
|
class Curvature3DAlphaShader(CurveMappingModifier):
|
||||||
"""Alpha based on the 3D curvature of the underlying geometry"""
|
"""Alpha based on the 3D curvature of the underlying geometry"""
|
||||||
|
|
||||||
def __init__(self, blend, influence, mapping, invert, curve, curvature_min, curvature_max):
|
def __init__(self, blend, influence, mapping, invert, curve, curvature_min, curvature_max):
|
||||||
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
|
||||||
self.curvature = BoundedProperty(curvature_min, curvature_max)
|
self.curvature = BoundedProperty(curvature_min, curvature_max)
|
||||||
@ -737,6 +763,7 @@ class Curvature3DAlphaShader(CurveMappingModifier):
|
|||||||
|
|
||||||
class Curvature3DThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
class Curvature3DThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
||||||
"""Alpha based on the 3D curvature of the underlying geometry"""
|
"""Alpha based on the 3D curvature of the underlying geometry"""
|
||||||
|
|
||||||
def __init__(self, thickness_position, thickness_ratio, blend, influence, mapping, invert, curve,
|
def __init__(self, thickness_position, thickness_ratio, blend, influence, mapping, invert, curve,
|
||||||
curvature_min, curvature_max, thickness_min, thickness_max):
|
curvature_min, curvature_max, thickness_min, thickness_max):
|
||||||
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
|
||||||
@ -744,7 +771,6 @@ class Curvature3DThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
|||||||
self.curvature = BoundedProperty(curvature_min, curvature_max)
|
self.curvature = BoundedProperty(curvature_min, curvature_max)
|
||||||
self.thickness = BoundedProperty(thickness_min, thickness_max)
|
self.thickness = BoundedProperty(thickness_min, thickness_max)
|
||||||
|
|
||||||
|
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
for svert in stroke:
|
for svert in stroke:
|
||||||
t = normalized_absolute_curvature(svert, self.curvature)
|
t = normalized_absolute_curvature(svert, self.curvature)
|
||||||
@ -756,6 +782,7 @@ class Curvature3DThicknessShader(ThicknessBlenderMixIn, CurveMappingModifier):
|
|||||||
|
|
||||||
class SimplificationShader(StrokeShader):
|
class SimplificationShader(StrokeShader):
|
||||||
"""Simplifies a stroke by merging points together"""
|
"""Simplifies a stroke by merging points together"""
|
||||||
|
|
||||||
def __init__(self, tolerance):
|
def __init__(self, tolerance):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.tolerance = tolerance
|
self.tolerance = tolerance
|
||||||
@ -774,6 +801,7 @@ class SimplificationShader(StrokeShader):
|
|||||||
|
|
||||||
class SinusDisplacementShader(StrokeShader):
|
class SinusDisplacementShader(StrokeShader):
|
||||||
"""Displaces the stroke in a sine wave-like shape."""
|
"""Displaces the stroke in a sine wave-like shape."""
|
||||||
|
|
||||||
def __init__(self, wavelength, amplitude, phase):
|
def __init__(self, wavelength, amplitude, phase):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.wavelength = wavelength
|
self.wavelength = wavelength
|
||||||
@ -797,6 +825,7 @@ class PerlinNoise1DShader(StrokeShader):
|
|||||||
that lines with the same length and sampling interval will be
|
that lines with the same length and sampling interval will be
|
||||||
identically distorded.
|
identically distorded.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, freq=10, amp=10, oct=4, angle=radians(45), seed=-1):
|
def __init__(self, freq=10, amp=10, oct=4, angle=radians(45), seed=-1):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.noise = Noise(seed)
|
self.noise = Noise(seed)
|
||||||
@ -821,6 +850,7 @@ class PerlinNoise2DShader(StrokeShader):
|
|||||||
More information on the noise shaders can be found at:
|
More information on the noise shaders can be found at:
|
||||||
freestyleintegration.wordpress.com/2011/09/25/development-updates-on-september-25/
|
freestyleintegration.wordpress.com/2011/09/25/development-updates-on-september-25/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, freq=10, amp=10, oct=4, angle=radians(45), seed=-1):
|
def __init__(self, freq=10, amp=10, oct=4, angle=radians(45), seed=-1):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.noise = Noise(seed)
|
self.noise = Noise(seed)
|
||||||
@ -839,6 +869,7 @@ class PerlinNoise2DShader(StrokeShader):
|
|||||||
|
|
||||||
class Offset2DShader(StrokeShader):
|
class Offset2DShader(StrokeShader):
|
||||||
"""Offsets the stroke by a given amount."""
|
"""Offsets the stroke by a given amount."""
|
||||||
|
|
||||||
def __init__(self, start, end, x, y):
|
def __init__(self, start, end, x, y):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.start = start
|
self.start = start
|
||||||
@ -856,6 +887,7 @@ class Offset2DShader(StrokeShader):
|
|||||||
|
|
||||||
class Transform2DShader(StrokeShader):
|
class Transform2DShader(StrokeShader):
|
||||||
"""Transforms the stroke (scale, rotation, location) around a given pivot point """
|
"""Transforms the stroke (scale, rotation, location) around a given pivot point """
|
||||||
|
|
||||||
def __init__(self, pivot, scale_x, scale_y, angle, pivot_u, pivot_x, pivot_y):
|
def __init__(self, pivot, scale_x, scale_y, angle, pivot_u, pivot_x, pivot_y):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.pivot = pivot
|
self.pivot = pivot
|
||||||
@ -1168,6 +1200,7 @@ class Seed:
|
|||||||
return self.t
|
return self.t
|
||||||
return seed
|
return seed
|
||||||
|
|
||||||
|
|
||||||
_seed = Seed()
|
_seed = Seed()
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ __all__ = (
|
|||||||
"generate",
|
"generate",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def generate(context, space_type, use_fallback_keys=True, use_reset=True):
|
def generate(context, space_type, use_fallback_keys=True, use_reset=True):
|
||||||
"""
|
"""
|
||||||
Keymap for popup toolbar, currently generated each time.
|
Keymap for popup toolbar, currently generated each time.
|
||||||
@ -110,7 +111,6 @@ def generate(context, space_type, use_fallback_keys=True, use_reset=True):
|
|||||||
del keymap_src
|
del keymap_src
|
||||||
del items_all_id
|
del items_all_id
|
||||||
|
|
||||||
|
|
||||||
kmi_unique_args = set()
|
kmi_unique_args = set()
|
||||||
|
|
||||||
def kmi_unique_or_pass(kmi_args):
|
def kmi_unique_or_pass(kmi_args):
|
||||||
@ -118,7 +118,6 @@ def generate(context, space_type, use_fallback_keys=True, use_reset=True):
|
|||||||
kmi_unique_args.add(dict_as_tuple(kmi_args))
|
kmi_unique_args.add(dict_as_tuple(kmi_args))
|
||||||
return kmi_unique_len != len(kmi_unique_args)
|
return kmi_unique_len != len(kmi_unique_args)
|
||||||
|
|
||||||
|
|
||||||
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
||||||
|
|
||||||
if use_hack_properties:
|
if use_hack_properties:
|
||||||
@ -405,7 +404,6 @@ def generate(context, space_type, use_fallback_keys=True, use_reset=True):
|
|||||||
kmi.properties.name = item.idname
|
kmi.properties.name = item.idname
|
||||||
kmi_unique_args.add(kmi_tuple)
|
kmi_unique_args.add(kmi_tuple)
|
||||||
|
|
||||||
|
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# End Keymap Generation
|
# End Keymap Generation
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ __all__ = (
|
|||||||
"generate",
|
"generate",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _km_expand_from_toolsystem(space_type, context_mode):
|
def _km_expand_from_toolsystem(space_type, context_mode):
|
||||||
def _fn():
|
def _fn():
|
||||||
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
||||||
|
@ -847,7 +847,6 @@ def register_tool(tool_cls, *, after=None, separator=False, group=False):
|
|||||||
# Create a new group
|
# Create a new group
|
||||||
tool_converted = (tool_converted,)
|
tool_converted = (tool_converted,)
|
||||||
|
|
||||||
|
|
||||||
tool_def_insert = (
|
tool_def_insert = (
|
||||||
(None, tool_converted) if separator else
|
(None, tool_converted) if separator else
|
||||||
(tool_converted,)
|
(tool_converted,)
|
||||||
|
@ -51,6 +51,7 @@ def addon_keymap_register(keymap_data):
|
|||||||
kmap = kconf.keymaps.new(km_name, **km_args)
|
kmap = kconf.keymaps.new(km_name, **km_args)
|
||||||
keymap_init_from_data(kmap, km_content["items"], is_modal=km_modal)
|
keymap_init_from_data(kmap, km_content["items"], is_modal=km_modal)
|
||||||
|
|
||||||
|
|
||||||
def addon_keymap_unregister(keymap_data):
|
def addon_keymap_unregister(keymap_data):
|
||||||
"""
|
"""
|
||||||
Unregister a set of keymaps for addons.
|
Unregister a set of keymaps for addons.
|
||||||
|
@ -36,12 +36,15 @@ def _set_check(func):
|
|||||||
return func(self, *args, **kwargs)
|
return func(self, *args, **kwargs)
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
def rgb_to_rgba(rgb):
|
def rgb_to_rgba(rgb):
|
||||||
return list(rgb) + [1.0]
|
return list(rgb) + [1.0]
|
||||||
|
|
||||||
|
|
||||||
def rgba_to_rgb(rgba):
|
def rgba_to_rgb(rgba):
|
||||||
return Color((rgba[0], rgba[1], rgba[2]))
|
return Color((rgba[0], rgba[1], rgba[2]))
|
||||||
|
|
||||||
|
|
||||||
# All clamping value shall follow Blender's defined min/max (check relevant node definition .c file).
|
# All clamping value shall follow Blender's defined min/max (check relevant node definition .c file).
|
||||||
def values_clamp(val, minv, maxv):
|
def values_clamp(val, minv, maxv):
|
||||||
if hasattr(val, "__iter__"):
|
if hasattr(val, "__iter__"):
|
||||||
@ -110,7 +113,6 @@ class ShaderWrapper():
|
|||||||
self._textures = {}
|
self._textures = {}
|
||||||
self._grid_locations = set()
|
self._grid_locations = set()
|
||||||
|
|
||||||
|
|
||||||
def use_nodes_get(self):
|
def use_nodes_get(self):
|
||||||
return self.material.use_nodes
|
return self.material.use_nodes
|
||||||
|
|
||||||
@ -121,7 +123,6 @@ class ShaderWrapper():
|
|||||||
|
|
||||||
use_nodes = property(use_nodes_get, use_nodes_set)
|
use_nodes = property(use_nodes_get, use_nodes_set)
|
||||||
|
|
||||||
|
|
||||||
def node_texcoords_get(self):
|
def node_texcoords_get(self):
|
||||||
if not self.use_nodes:
|
if not self.use_nodes:
|
||||||
return None
|
return None
|
||||||
@ -173,7 +174,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
def __init__(self, material, is_readonly=True, use_nodes=True):
|
def __init__(self, material, is_readonly=True, use_nodes=True):
|
||||||
super(PrincipledBSDFWrapper, self).__init__(material, is_readonly, use_nodes)
|
super(PrincipledBSDFWrapper, self).__init__(material, is_readonly, use_nodes)
|
||||||
|
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
super(PrincipledBSDFWrapper, self).update()
|
super(PrincipledBSDFWrapper, self).update()
|
||||||
|
|
||||||
@ -234,7 +234,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
# Tex Coords, lazy initialization...
|
# Tex Coords, lazy initialization...
|
||||||
self._node_texcoords = ...
|
self._node_texcoords = ...
|
||||||
|
|
||||||
|
|
||||||
def node_normalmap_get(self):
|
def node_normalmap_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
return None
|
return None
|
||||||
@ -263,7 +262,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
node_normalmap = property(node_normalmap_get)
|
node_normalmap = property(node_normalmap_get)
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Base Color.
|
# Base Color.
|
||||||
|
|
||||||
@ -282,7 +280,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
base_color = property(base_color_get, base_color_set)
|
base_color = property(base_color_get, base_color_set)
|
||||||
|
|
||||||
|
|
||||||
def base_color_texture_get(self):
|
def base_color_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
return None
|
return None
|
||||||
@ -294,7 +291,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
base_color_texture = property(base_color_texture_get)
|
base_color_texture = property(base_color_texture_get)
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Specular.
|
# Specular.
|
||||||
|
|
||||||
@ -312,7 +308,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
specular = property(specular_get, specular_set)
|
specular = property(specular_get, specular_set)
|
||||||
|
|
||||||
|
|
||||||
def specular_tint_get(self):
|
def specular_tint_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
return 0.0
|
return 0.0
|
||||||
@ -326,7 +321,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
specular_tint = property(specular_tint_get, specular_tint_set)
|
specular_tint = property(specular_tint_get, specular_tint_set)
|
||||||
|
|
||||||
|
|
||||||
# Will only be used as gray-scale one...
|
# Will only be used as gray-scale one...
|
||||||
def specular_texture_get(self):
|
def specular_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
@ -341,7 +335,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
specular_texture = property(specular_texture_get)
|
specular_texture = property(specular_texture_get)
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Roughness (also sort of inverse of specular hardness...).
|
# Roughness (also sort of inverse of specular hardness...).
|
||||||
|
|
||||||
@ -359,7 +352,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
roughness = property(roughness_get, roughness_set)
|
roughness = property(roughness_get, roughness_set)
|
||||||
|
|
||||||
|
|
||||||
# Will only be used as gray-scale one...
|
# Will only be used as gray-scale one...
|
||||||
def roughness_texture_get(self):
|
def roughness_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
@ -373,7 +365,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
roughness_texture = property(roughness_texture_get)
|
roughness_texture = property(roughness_texture_get)
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Metallic (a.k.a reflection, mirror).
|
# Metallic (a.k.a reflection, mirror).
|
||||||
|
|
||||||
@ -391,7 +382,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
metallic = property(metallic_get, metallic_set)
|
metallic = property(metallic_get, metallic_set)
|
||||||
|
|
||||||
|
|
||||||
# Will only be used as gray-scale one...
|
# Will only be used as gray-scale one...
|
||||||
def metallic_texture_get(self):
|
def metallic_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
@ -405,7 +395,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
metallic_texture = property(metallic_texture_get)
|
metallic_texture = property(metallic_texture_get)
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Transparency settings.
|
# Transparency settings.
|
||||||
|
|
||||||
@ -422,7 +411,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
ior = property(ior_get, ior_set)
|
ior = property(ior_get, ior_set)
|
||||||
|
|
||||||
|
|
||||||
# Will only be used as gray-scale one...
|
# Will only be used as gray-scale one...
|
||||||
def ior_texture_get(self):
|
def ior_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
@ -436,7 +424,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
ior_texture = property(ior_texture_get)
|
ior_texture = property(ior_texture_get)
|
||||||
|
|
||||||
|
|
||||||
def transmission_get(self):
|
def transmission_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
return 0.0
|
return 0.0
|
||||||
@ -450,7 +437,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
transmission = property(transmission_get, transmission_set)
|
transmission = property(transmission_get, transmission_set)
|
||||||
|
|
||||||
|
|
||||||
# Will only be used as gray-scale one...
|
# Will only be used as gray-scale one...
|
||||||
def transmission_texture_get(self):
|
def transmission_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
@ -464,7 +450,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
transmission_texture = property(transmission_texture_get)
|
transmission_texture = property(transmission_texture_get)
|
||||||
|
|
||||||
|
|
||||||
def alpha_get(self):
|
def alpha_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
return 1.0
|
return 1.0
|
||||||
@ -478,7 +463,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
alpha = property(alpha_get, alpha_set)
|
alpha = property(alpha_get, alpha_set)
|
||||||
|
|
||||||
|
|
||||||
# Will only be used as gray-scale one...
|
# Will only be used as gray-scale one...
|
||||||
def alpha_texture_get(self):
|
def alpha_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
@ -493,7 +477,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
alpha_texture = property(alpha_texture_get)
|
alpha_texture = property(alpha_texture_get)
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Emission color.
|
# Emission color.
|
||||||
|
|
||||||
@ -511,7 +494,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
emission_color = property(emission_color_get, emission_color_set)
|
emission_color = property(emission_color_get, emission_color_set)
|
||||||
|
|
||||||
|
|
||||||
def emission_color_texture_get(self):
|
def emission_color_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
return None
|
return None
|
||||||
@ -536,7 +518,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
emission_strength = property(emission_strength_get, emission_strength_set)
|
emission_strength = property(emission_strength_get, emission_strength_set)
|
||||||
|
|
||||||
|
|
||||||
def emission_strength_texture_get(self):
|
def emission_strength_texture_get(self):
|
||||||
if not self.use_nodes or self.node_principled_bsdf is None:
|
if not self.use_nodes or self.node_principled_bsdf is None:
|
||||||
return None
|
return None
|
||||||
@ -565,7 +546,6 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
normalmap_strength = property(normalmap_strength_get, normalmap_strength_set)
|
normalmap_strength = property(normalmap_strength_get, normalmap_strength_set)
|
||||||
|
|
||||||
|
|
||||||
def normalmap_texture_get(self):
|
def normalmap_texture_get(self):
|
||||||
if not self.use_nodes or self.node_normalmap is None:
|
if not self.use_nodes or self.node_normalmap is None:
|
||||||
return None
|
return None
|
||||||
@ -578,6 +558,7 @@ class PrincipledBSDFWrapper(ShaderWrapper):
|
|||||||
|
|
||||||
normalmap_texture = property(normalmap_texture_get)
|
normalmap_texture = property(normalmap_texture_get)
|
||||||
|
|
||||||
|
|
||||||
class ShaderImageTextureWrapper():
|
class ShaderImageTextureWrapper():
|
||||||
"""
|
"""
|
||||||
Generic 'image texture'-like wrapper, handling image node, some mapping (texture coordinates transformations),
|
Generic 'image texture'-like wrapper, handling image node, some mapping (texture coordinates transformations),
|
||||||
@ -642,7 +623,6 @@ class ShaderImageTextureWrapper():
|
|||||||
if from_node.bl_idname == 'ShaderNodeMapping':
|
if from_node.bl_idname == 'ShaderNodeMapping':
|
||||||
self._node_mapping = from_node
|
self._node_mapping = from_node
|
||||||
|
|
||||||
|
|
||||||
def copy_from(self, tex):
|
def copy_from(self, tex):
|
||||||
# Avoid generating any node in source texture.
|
# Avoid generating any node in source texture.
|
||||||
is_readonly_back = tex.is_readonly
|
is_readonly_back = tex.is_readonly
|
||||||
@ -656,7 +636,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
tex.is_readonly = is_readonly_back
|
tex.is_readonly = is_readonly_back
|
||||||
|
|
||||||
|
|
||||||
def copy_mapping_from(self, tex):
|
def copy_mapping_from(self, tex):
|
||||||
# Avoid generating any node in source texture.
|
# Avoid generating any node in source texture.
|
||||||
is_readonly_back = tex.is_readonly
|
is_readonly_back = tex.is_readonly
|
||||||
@ -685,7 +664,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
tex.is_readonly = is_readonly_back
|
tex.is_readonly = is_readonly_back
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Image.
|
# Image.
|
||||||
|
|
||||||
@ -712,7 +690,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
node_image = property(node_image_get)
|
node_image = property(node_image_get)
|
||||||
|
|
||||||
|
|
||||||
def image_get(self):
|
def image_get(self):
|
||||||
return self.node_image.image if self.node_image is not None else None
|
return self.node_image.image if self.node_image is not None else None
|
||||||
|
|
||||||
@ -730,7 +707,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
image = property(image_get, image_set)
|
image = property(image_get, image_set)
|
||||||
|
|
||||||
|
|
||||||
def projection_get(self):
|
def projection_get(self):
|
||||||
return self.node_image.projection if self.node_image is not None else 'FLAT'
|
return self.node_image.projection if self.node_image is not None else 'FLAT'
|
||||||
|
|
||||||
@ -740,7 +716,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
projection = property(projection_get, projection_set)
|
projection = property(projection_get, projection_set)
|
||||||
|
|
||||||
|
|
||||||
def texcoords_get(self):
|
def texcoords_get(self):
|
||||||
if self.node_image is not None:
|
if self.node_image is not None:
|
||||||
socket = (self.node_mapping if self.has_mapping_node() else self.node_image).inputs["Vector"]
|
socket = (self.node_mapping if self.has_mapping_node() else self.node_image).inputs["Vector"]
|
||||||
@ -762,7 +737,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
texcoords = property(texcoords_get, texcoords_set)
|
texcoords = property(texcoords_get, texcoords_set)
|
||||||
|
|
||||||
|
|
||||||
def extension_get(self):
|
def extension_get(self):
|
||||||
return self.node_image.extension if self.node_image is not None else 'REPEAT'
|
return self.node_image.extension if self.node_image is not None else 'REPEAT'
|
||||||
|
|
||||||
@ -772,7 +746,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
extension = property(extension_get, extension_set)
|
extension = property(extension_get, extension_set)
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Mapping.
|
# Mapping.
|
||||||
|
|
||||||
@ -813,7 +786,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
node_mapping = property(node_mapping_get)
|
node_mapping = property(node_mapping_get)
|
||||||
|
|
||||||
|
|
||||||
def translation_get(self):
|
def translation_get(self):
|
||||||
if self.node_mapping is None:
|
if self.node_mapping is None:
|
||||||
return Vector((0.0, 0.0, 0.0))
|
return Vector((0.0, 0.0, 0.0))
|
||||||
@ -825,7 +797,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
translation = property(translation_get, translation_set)
|
translation = property(translation_get, translation_set)
|
||||||
|
|
||||||
|
|
||||||
def rotation_get(self):
|
def rotation_get(self):
|
||||||
if self.node_mapping is None:
|
if self.node_mapping is None:
|
||||||
return Vector((0.0, 0.0, 0.0))
|
return Vector((0.0, 0.0, 0.0))
|
||||||
@ -837,7 +808,6 @@ class ShaderImageTextureWrapper():
|
|||||||
|
|
||||||
rotation = property(rotation_get, rotation_set)
|
rotation = property(rotation_get, rotation_set)
|
||||||
|
|
||||||
|
|
||||||
def scale_get(self):
|
def scale_get(self):
|
||||||
if self.node_mapping is None:
|
if self.node_mapping is None:
|
||||||
return Vector((1.0, 1.0, 1.0))
|
return Vector((1.0, 1.0, 1.0))
|
||||||
|
@ -27,6 +27,7 @@ StructMetaPropGroup = bpy_types.bpy_struct_meta_idprop
|
|||||||
|
|
||||||
# Note that methods extended in C are defined in: 'bpy_rna_types_capi.c'
|
# Note that methods extended in C are defined in: 'bpy_rna_types_capi.c'
|
||||||
|
|
||||||
|
|
||||||
class Context(StructRNA):
|
class Context(StructRNA):
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ from bpy.props import (
|
|||||||
DIRNAME, FILENAME = os.path.split(__file__)
|
DIRNAME, FILENAME = os.path.split(__file__)
|
||||||
IDNAME = os.path.splitext(FILENAME)[0]
|
IDNAME = os.path.splitext(FILENAME)[0]
|
||||||
|
|
||||||
|
|
||||||
def update_fn(_self, _context):
|
def update_fn(_self, _context):
|
||||||
load()
|
load()
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ class Prefs(bpy.types.KeyConfigPreferences):
|
|||||||
|
|
||||||
blender_default = bpy.utils.execfile(os.path.join(DIRNAME, "keymap_data", "blender_default.py"))
|
blender_default = bpy.utils.execfile(os.path.join(DIRNAME, "keymap_data", "blender_default.py"))
|
||||||
|
|
||||||
|
|
||||||
def load():
|
def load():
|
||||||
from sys import platform
|
from sys import platform
|
||||||
from bpy import context
|
from bpy import context
|
||||||
@ -68,7 +70,6 @@ def load():
|
|||||||
from bl_keymap_utils.platform_helpers import keyconfig_data_oskey_from_ctrl_for_macos
|
from bl_keymap_utils.platform_helpers import keyconfig_data_oskey_from_ctrl_for_macos
|
||||||
keyconfig_data = keyconfig_data_oskey_from_ctrl_for_macos(keyconfig_data)
|
keyconfig_data = keyconfig_data_oskey_from_ctrl_for_macos(keyconfig_data)
|
||||||
|
|
||||||
|
|
||||||
keyconfig_init_from_data(kc, keyconfig_data)
|
keyconfig_init_from_data(kc, keyconfig_data)
|
||||||
|
|
||||||
|
|
||||||
|
@ -6388,6 +6388,7 @@ def km_3d_view_tool_sculpt_lasso_trim(params):
|
|||||||
]},
|
]},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def km_3d_view_tool_sculpt_line_mask(params):
|
def km_3d_view_tool_sculpt_line_mask(params):
|
||||||
return (
|
return (
|
||||||
"3D View Tool: Sculpt, Line Mask",
|
"3D View Tool: Sculpt, Line Mask",
|
||||||
@ -6400,6 +6401,7 @@ def km_3d_view_tool_sculpt_line_mask(params):
|
|||||||
]},
|
]},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def km_3d_view_tool_sculpt_line_project(params):
|
def km_3d_view_tool_sculpt_line_project(params):
|
||||||
return (
|
return (
|
||||||
"3D View Tool: Sculpt, Line Project",
|
"3D View Tool: Sculpt, Line Project",
|
||||||
@ -6410,6 +6412,7 @@ def km_3d_view_tool_sculpt_line_project(params):
|
|||||||
]},
|
]},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def km_3d_view_tool_sculpt_mesh_filter(params):
|
def km_3d_view_tool_sculpt_mesh_filter(params):
|
||||||
return (
|
return (
|
||||||
"3D View Tool: Sculpt, Mesh Filter",
|
"3D View Tool: Sculpt, Mesh Filter",
|
||||||
|
@ -63,6 +63,7 @@ def load_handler(dummy):
|
|||||||
gpd = ob.data
|
gpd = ob.data
|
||||||
gpd.onion_keyframe_type = 'ALL'
|
gpd.onion_keyframe_type = 'ALL'
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
bpy.app.handlers.load_factory_startup_post.append(load_handler)
|
bpy.app.handlers.load_factory_startup_post.append(load_handler)
|
||||||
|
|
||||||
|
@ -208,7 +208,6 @@ class SelectHierarchy(Operator):
|
|||||||
select_new.sort(key=lambda obj_iter: obj_iter.name)
|
select_new.sort(key=lambda obj_iter: obj_iter.name)
|
||||||
act_new = select_new[0]
|
act_new = select_new[0]
|
||||||
|
|
||||||
|
|
||||||
# don't edit any object settings above this
|
# don't edit any object settings above this
|
||||||
if select_new:
|
if select_new:
|
||||||
if not self.extend:
|
if not self.extend:
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
|
||||||
class NewSimulation(bpy.types.Operator):
|
class NewSimulation(bpy.types.Operator):
|
||||||
"""Create a new simulation data block and edit it in the opened simulation editor"""
|
"""Create a new simulation data block and edit it in the opened simulation editor"""
|
||||||
|
|
||||||
@ -34,6 +35,7 @@ class NewSimulation(bpy.types.Operator):
|
|||||||
context.space_data.simulation = simulation
|
context.space_data.simulation = simulation
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
NewSimulation,
|
NewSimulation,
|
||||||
)
|
)
|
||||||
|
@ -49,6 +49,7 @@ def module_filesystem_remove(path_base, module_name):
|
|||||||
else:
|
else:
|
||||||
os.remove(f_full)
|
os.remove(f_full)
|
||||||
|
|
||||||
|
|
||||||
# This duplicates shutil.copytree from Python 3.8, with the new dirs_exist_ok
|
# This duplicates shutil.copytree from Python 3.8, with the new dirs_exist_ok
|
||||||
# argument that we need. Once we upgrade to 3.8 we can remove this.
|
# argument that we need. Once we upgrade to 3.8 we can remove this.
|
||||||
def _preferences_copytree(entries, src, dst):
|
def _preferences_copytree(entries, src, dst):
|
||||||
@ -85,11 +86,13 @@ def _preferences_copytree(entries, src, dst):
|
|||||||
raise Error(errors)
|
raise Error(errors)
|
||||||
return dst
|
return dst
|
||||||
|
|
||||||
|
|
||||||
def preferences_copytree(src, dst):
|
def preferences_copytree(src, dst):
|
||||||
import os
|
import os
|
||||||
with os.scandir(src) as entries:
|
with os.scandir(src) as entries:
|
||||||
return _preferences_copytree(entries=entries, src=src, dst=dst)
|
return _preferences_copytree(entries=entries, src=src, dst=dst)
|
||||||
|
|
||||||
|
|
||||||
class PREFERENCES_OT_keyconfig_activate(Operator):
|
class PREFERENCES_OT_keyconfig_activate(Operator):
|
||||||
bl_idname = "preferences.keyconfig_activate"
|
bl_idname = "preferences.keyconfig_activate"
|
||||||
bl_label = "Activate Keyconfig"
|
bl_label = "Activate Keyconfig"
|
||||||
|
@ -1381,7 +1381,6 @@ class WM_OT_properties_edit(Operator):
|
|||||||
is_overridable = item.is_property_overridable_library('["%s"]' % self.property)
|
is_overridable = item.is_property_overridable_library('["%s"]' % self.property)
|
||||||
self.is_overridable_library = bool(is_overridable)
|
self.is_overridable_library = bool(is_overridable)
|
||||||
|
|
||||||
|
|
||||||
# default default value
|
# default default value
|
||||||
prop_type, is_array = rna_idprop_value_item_type(self.get_value_eval())
|
prop_type, is_array = rna_idprop_value_item_type(self.get_value_eval())
|
||||||
if prop_type in {int, float}:
|
if prop_type in {int, float}:
|
||||||
|
@ -374,7 +374,6 @@ class ConstraintButtonsPanel(Panel):
|
|||||||
subsub.prop(con, "max_z", text="")
|
subsub.prop(con, "max_z", text="")
|
||||||
row.prop_decorator(con, "max_z")
|
row.prop_decorator(con, "max_z")
|
||||||
|
|
||||||
|
|
||||||
layout.prop(con, "use_transform_limit")
|
layout.prop(con, "use_transform_limit")
|
||||||
layout.prop(con, "owner_space")
|
layout.prop(con, "owner_space")
|
||||||
|
|
||||||
@ -752,7 +751,6 @@ class ConstraintButtonsPanel(Panel):
|
|||||||
row.active = not con.use_3d_position
|
row.active = not con.use_3d_position
|
||||||
row.prop(con, "use_undistorted_position")
|
row.prop(con, "use_undistorted_position")
|
||||||
|
|
||||||
|
|
||||||
if not con.use_active_clip:
|
if not con.use_active_clip:
|
||||||
layout.prop(con, "clip")
|
layout.prop(con, "clip")
|
||||||
|
|
||||||
@ -1152,6 +1150,7 @@ class BONE_PT_bChildOfConstraint(BoneConstraintPanel, ConstraintButtonsPanel):
|
|||||||
|
|
||||||
# Track To Constraint
|
# Track To Constraint
|
||||||
|
|
||||||
|
|
||||||
class OBJECT_PT_bTrackToConstraint(ObjectConstraintPanel, ConstraintButtonsPanel):
|
class OBJECT_PT_bTrackToConstraint(ObjectConstraintPanel, ConstraintButtonsPanel):
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.draw_trackto(context)
|
self.draw_trackto(context)
|
||||||
@ -1163,6 +1162,7 @@ class BONE_PT_bTrackToConstraint(BoneConstraintPanel, ConstraintButtonsPanel):
|
|||||||
|
|
||||||
# Follow Path Constraint
|
# Follow Path Constraint
|
||||||
|
|
||||||
|
|
||||||
class OBJECT_PT_bFollowPathConstraint(ObjectConstraintPanel, ConstraintButtonsPanel):
|
class OBJECT_PT_bFollowPathConstraint(ObjectConstraintPanel, ConstraintButtonsPanel):
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.draw_follow_path(context)
|
self.draw_follow_path(context)
|
||||||
@ -1530,12 +1530,12 @@ class OBJECT_PT_bPythonConstraint(ObjectConstraintPanel, ConstraintButtonsPanel)
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.draw_python_constraint(context)
|
self.draw_python_constraint(context)
|
||||||
|
|
||||||
|
|
||||||
class BONE_PT_bPythonConstraint(BoneConstraintPanel, ConstraintButtonsPanel):
|
class BONE_PT_bPythonConstraint(BoneConstraintPanel, ConstraintButtonsPanel):
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.draw_python_constraint(context)
|
self.draw_python_constraint(context)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Armature Constraint
|
# Armature Constraint
|
||||||
|
|
||||||
class OBJECT_PT_bArmatureConstraint(ObjectConstraintPanel, ConstraintButtonsPanel):
|
class OBJECT_PT_bArmatureConstraint(ObjectConstraintPanel, ConstraintButtonsPanel):
|
||||||
@ -1576,7 +1576,6 @@ class BONE_PT_bKinematicConstraint(BoneConstraintPanel, ConstraintButtonsPanel):
|
|||||||
self.draw_kinematic(context)
|
self.draw_kinematic(context)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
# Object Panels
|
# Object Panels
|
||||||
OBJECT_PT_constraints,
|
OBJECT_PT_constraints,
|
||||||
|
@ -395,6 +395,7 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
|||||||
sub.prop(cam, "passepartout_alpha", text="")
|
sub.prop(cam, "passepartout_alpha", text="")
|
||||||
row.prop_decorator(cam, "passepartout_alpha")
|
row.prop_decorator(cam, "passepartout_alpha")
|
||||||
|
|
||||||
|
|
||||||
class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel):
|
class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel):
|
||||||
bl_label = "Composition Guides"
|
bl_label = "Composition Guides"
|
||||||
bl_parent_id = "DATA_PT_camera_display"
|
bl_parent_id = "DATA_PT_camera_display"
|
||||||
|
@ -1120,6 +1120,7 @@ def brush_basic_texpaint_settings(layout, context, brush, *, compact=False):
|
|||||||
header=True
|
header=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props):
|
def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props):
|
||||||
tool_settings = context.scene.tool_settings
|
tool_settings = context.scene.tool_settings
|
||||||
settings = tool_settings.gpencil_paint
|
settings = tool_settings.gpencil_paint
|
||||||
@ -1168,6 +1169,7 @@ def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props)
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(props, "subdivision")
|
row.prop(props, "subdivision")
|
||||||
|
|
||||||
|
|
||||||
def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False):
|
def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False):
|
||||||
tool_settings = context.tool_settings
|
tool_settings = context.tool_settings
|
||||||
settings = tool_settings.gpencil_paint
|
settings = tool_settings.gpencil_paint
|
||||||
|
@ -618,7 +618,6 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
|
|||||||
layout.prop(part, "use_rotations", text="")
|
layout.prop(part, "use_rotations", text="")
|
||||||
layout.enabled = particle_panel_enabled(context, psys)
|
layout.enabled = particle_panel_enabled(context, psys)
|
||||||
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
|
@ -363,6 +363,7 @@ def basic_force_field_falloff_ui(self, field):
|
|||||||
sub.prop(field, "distance_max", text="")
|
sub.prop(field, "distance_max", text="")
|
||||||
row.prop_decorator(field, "distance_max")
|
row.prop_decorator(field, "distance_max")
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
PHYSICS_PT_add,
|
PHYSICS_PT_add,
|
||||||
)
|
)
|
||||||
|
@ -1397,6 +1397,7 @@ class PHYSICS_PT_viewport_display_debug(PhysicButtonsPanel, Panel):
|
|||||||
col.prop(domain, "vector_field")
|
col.prop(domain, "vector_field")
|
||||||
col.prop(domain, "vector_scale")
|
col.prop(domain, "vector_scale")
|
||||||
|
|
||||||
|
|
||||||
class PHYSICS_PT_viewport_display_advanced(PhysicButtonsPanel, Panel):
|
class PHYSICS_PT_viewport_display_advanced(PhysicButtonsPanel, Panel):
|
||||||
bl_label = "Advanced"
|
bl_label = "Advanced"
|
||||||
bl_parent_id = 'PHYSICS_PT_viewport_display'
|
bl_parent_id = 'PHYSICS_PT_viewport_display'
|
||||||
@ -1428,6 +1429,7 @@ class PHYSICS_PT_viewport_display_advanced(PhysicButtonsPanel, Panel):
|
|||||||
else:
|
else:
|
||||||
note.label(icon='INFO', text="Range highlighting for flags is not available!")
|
note.label(icon='INFO', text="Range highlighting for flags is not available!")
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
FLUID_PT_presets,
|
FLUID_PT_presets,
|
||||||
PHYSICS_PT_fluid,
|
PHYSICS_PT_fluid,
|
||||||
|
@ -134,6 +134,7 @@ class VIEWLAYER_PT_eevee_layer_passes_effects(ViewLayerButtonsPanel, Panel):
|
|||||||
col.prop(view_layer_eevee, "use_pass_bloom", text="Bloom")
|
col.prop(view_layer_eevee, "use_pass_bloom", text="Bloom")
|
||||||
col.active = scene_eevee.use_bloom
|
col.active = scene_eevee.use_bloom
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
VIEWLAYER_PT_layer,
|
VIEWLAYER_PT_layer,
|
||||||
VIEWLAYER_PT_eevee_layer_passes,
|
VIEWLAYER_PT_eevee_layer_passes,
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
from bpy.types import Header, Panel, Menu, UIList
|
from bpy.types import Header, Panel, Menu, UIList
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FILEBROWSER_HT_header(Header):
|
class FILEBROWSER_HT_header(Header):
|
||||||
bl_space_type = 'FILE_BROWSER'
|
bl_space_type = 'FILE_BROWSER'
|
||||||
|
|
||||||
|
@ -1288,7 +1288,6 @@ class _defs_sculpt:
|
|||||||
draw_settings=draw_settings,
|
draw_settings=draw_settings,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def face_set_lasso():
|
def face_set_lasso():
|
||||||
def draw_settings(_context, layout, tool):
|
def draw_settings(_context, layout, tool):
|
||||||
|
@ -1019,6 +1019,7 @@ class USERPREF_PT_theme_bone_color_sets(ThemePanel, CenterAlignMixIn, Panel):
|
|||||||
flow.prop(ui, "active")
|
flow.prop(ui, "active")
|
||||||
flow.prop(ui, "show_colored_constraints")
|
flow.prop(ui, "show_colored_constraints")
|
||||||
|
|
||||||
|
|
||||||
class USERPREF_PT_theme_collection_colors(ThemePanel, CenterAlignMixIn, Panel):
|
class USERPREF_PT_theme_collection_colors(ThemePanel, CenterAlignMixIn, Panel):
|
||||||
bl_label = "Collection Colors"
|
bl_label = "Collection Colors"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
@ -1671,6 +1672,7 @@ class USERPREF_PT_ndof_settings(Panel):
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Key-Map Editor Panels
|
# Key-Map Editor Panels
|
||||||
|
|
||||||
|
|
||||||
class KeymapPanel:
|
class KeymapPanel:
|
||||||
bl_space_type = 'PREFERENCES'
|
bl_space_type = 'PREFERENCES'
|
||||||
bl_region_type = 'WINDOW'
|
bl_region_type = 'WINDOW'
|
||||||
@ -2157,6 +2159,7 @@ class ExperimentalPanel:
|
|||||||
col = split.split()
|
col = split.split()
|
||||||
col.operator("wm.url_open", text=task, icon='URL').url = self.url_prefix + task
|
col.operator("wm.url_open", text=task, icon='URL').url = self.url_prefix + task
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Example panel, leave it here so we always have a template to follow even
|
# Example panel, leave it here so we always have a template to follow even
|
||||||
# after the features are gone from the experimental panel.
|
# after the features are gone from the experimental panel.
|
||||||
|
@ -3066,13 +3066,13 @@ class VIEW3D_MT_mask(Menu):
|
|||||||
|
|
||||||
props = layout.operator("sculpt.dirty_mask", text='Dirty Mask')
|
props = layout.operator("sculpt.dirty_mask", text='Dirty Mask')
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_MT_face_sets(Menu):
|
class VIEW3D_MT_face_sets(Menu):
|
||||||
bl_label = "Face Sets"
|
bl_label = "Face Sets"
|
||||||
|
|
||||||
def draw(self, _context):
|
def draw(self, _context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
|
|
||||||
op = layout.operator("sculpt.face_sets_create", text='Face Set From Masked')
|
op = layout.operator("sculpt.face_sets_create", text='Face Set From Masked')
|
||||||
op.mode = 'MASKED'
|
op.mode = 'MASKED'
|
||||||
|
|
||||||
@ -3248,6 +3248,7 @@ class VIEW3D_MT_particle_context_menu(Menu):
|
|||||||
|
|
||||||
layout.operator("particle.select_linked", text="Select Linked")
|
layout.operator("particle.select_linked", text="Select Linked")
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_MT_particle_showhide(ShowHideMenu, Menu):
|
class VIEW3D_MT_particle_showhide(ShowHideMenu, Menu):
|
||||||
_operator_name = "particle"
|
_operator_name = "particle"
|
||||||
|
|
||||||
@ -5283,6 +5284,7 @@ class VIEW3D_MT_sculpt_mask_edit_pie(Menu):
|
|||||||
op.filter_type = 'CONTRAST_DECREASE'
|
op.filter_type = 'CONTRAST_DECREASE'
|
||||||
op.auto_iteration_count = False
|
op.auto_iteration_count = False
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu):
|
class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu):
|
||||||
|
|
||||||
bl_label = "Face Sets Edit"
|
bl_label = "Face Sets Edit"
|
||||||
@ -5303,6 +5305,7 @@ class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu):
|
|||||||
op = pie.operator("sculpt.face_set_change_visibility", text='Show All')
|
op = pie.operator("sculpt.face_set_change_visibility", text='Show All')
|
||||||
op.mode = 'SHOW_ALL'
|
op.mode = 'SHOW_ALL'
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_MT_wpaint_vgroup_lock_pie(Menu):
|
class VIEW3D_MT_wpaint_vgroup_lock_pie(Menu):
|
||||||
bl_label = "Vertex Group Locks"
|
bl_label = "Vertex Group Locks"
|
||||||
|
|
||||||
|
@ -397,7 +397,6 @@ class VIEW3D_PT_tools_brush_settings_advanced(Panel, View3DPaintBrushPanel):
|
|||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
bl_ui_units_x = 14
|
bl_ui_units_x = 14
|
||||||
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
@ -825,7 +824,6 @@ class VIEW3D_PT_sculpt_voxel_remesh(Panel, View3DPaintPanel):
|
|||||||
if context.preferences.experimental.use_sculpt_vertex_colors:
|
if context.preferences.experimental.use_sculpt_vertex_colors:
|
||||||
col.prop(mesh, "use_remesh_preserve_vertex_colors", text="Vertex Colors")
|
col.prop(mesh, "use_remesh_preserve_vertex_colors", text="Vertex Colors")
|
||||||
|
|
||||||
|
|
||||||
layout.operator("object.voxel_remesh", text="Remesh")
|
layout.operator("object.voxel_remesh", text="Remesh")
|
||||||
|
|
||||||
|
|
||||||
@ -966,7 +964,6 @@ class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
|
|||||||
row.prop(context.object.data, 'use_mirror_vertex_group_x')
|
row.prop(context.object.data, 'use_mirror_vertex_group_x')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_PT_tools_weightpaint_symmetry_for_topbar(Panel):
|
class VIEW3D_PT_tools_weightpaint_symmetry_for_topbar(Panel):
|
||||||
bl_space_type = 'TOPBAR'
|
bl_space_type = 'TOPBAR'
|
||||||
bl_region_type = 'HEADER'
|
bl_region_type = 'HEADER'
|
||||||
@ -1237,7 +1234,7 @@ class VIEW3D_PT_tools_particlemode_options(View3DPanel, Panel):
|
|||||||
col.active = pe.is_editable
|
col.active = pe.is_editable
|
||||||
col.prop(ob.data, "use_mirror_x")
|
col.prop(ob.data, "use_mirror_x")
|
||||||
if pe.tool == 'ADD':
|
if pe.tool == 'ADD':
|
||||||
col.prop(ob.data, "use_mirror_topology")
|
col.prop(ob.data, "use_mirror_topology")
|
||||||
col.separator()
|
col.separator()
|
||||||
col.prop(pe, "use_preserve_length", text="Preserve Strand Lengths")
|
col.prop(pe, "use_preserve_length", text="Preserve Strand Lengths")
|
||||||
col.prop(pe, "use_preserve_root", text="Preserve Root Positions")
|
col.prop(pe, "use_preserve_root", text="Preserve Root Positions")
|
||||||
|
@ -475,12 +475,14 @@ texture_node_categories = [
|
|||||||
]),
|
]),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def not_implemented_node(idname):
|
def not_implemented_node(idname):
|
||||||
NodeType = getattr(bpy.types, idname)
|
NodeType = getattr(bpy.types, idname)
|
||||||
name = NodeType.bl_rna.name
|
name = NodeType.bl_rna.name
|
||||||
label = "%s (mockup)" % name
|
label = "%s (mockup)" % name
|
||||||
return NodeItem(idname, label=label)
|
return NodeItem(idname, label=label)
|
||||||
|
|
||||||
|
|
||||||
simulation_node_categories = [
|
simulation_node_categories = [
|
||||||
# Simulation Nodes
|
# Simulation Nodes
|
||||||
SimulationNodeCategory("SIM_OUTPUT", "Output", items=[
|
SimulationNodeCategory("SIM_OUTPUT", "Output", items=[
|
||||||
|
@ -33,6 +33,7 @@ def execute_command(cmd : list, name : str, errcode : int):
|
|||||||
if cmd_process.stderr: print(cmd_process.stderr)
|
if cmd_process.stderr: print(cmd_process.stderr)
|
||||||
exit(errcode)
|
exit(errcode)
|
||||||
|
|
||||||
|
|
||||||
LTSORNOT = ""
|
LTSORNOT = ""
|
||||||
PACKAGETYPE = ""
|
PACKAGETYPE = ""
|
||||||
if args.lts:
|
if args.lts:
|
||||||
@ -115,7 +116,6 @@ with zipfile.ZipFile(local_blender_zip, "r") as blender_zip:
|
|||||||
print("... extraction complete.")
|
print("... extraction complete.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print(f"Creating MSIX package using command: {' '.join(msix_command)}")
|
print(f"Creating MSIX package using command: {' '.join(msix_command)}")
|
||||||
|
|
||||||
# Remove MSIX file if it already exists. Otherwise the MakeAppX tool
|
# Remove MSIX file if it already exists. Otherwise the MakeAppX tool
|
||||||
|
@ -28,6 +28,7 @@ import unittest
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
|
||||||
class FCurveEvaluationTest(unittest.TestCase):
|
class FCurveEvaluationTest(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
@ -44,7 +44,6 @@ class TestBlendFileSaveLoadBasic(TestHelper):
|
|||||||
assert(orig_data == read_data)
|
assert(orig_data == read_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TESTS = (
|
TESTS = (
|
||||||
TestBlendFileSaveLoadBasic,
|
TestBlendFileSaveLoadBasic,
|
||||||
)
|
)
|
||||||
|
@ -42,7 +42,6 @@ class TestBlendLibLinkSaveLoadBasic(TestHelper):
|
|||||||
assert(orig_data == read_data)
|
assert(orig_data == read_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TESTS = (
|
TESTS = (
|
||||||
TestBlendLibLinkSaveLoadBasic,
|
TestBlendLibLinkSaveLoadBasic,
|
||||||
)
|
)
|
||||||
|
@ -43,6 +43,7 @@ def get_arguments(filepath, output_filepath):
|
|||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
def create_argparse():
|
def create_argparse():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-blender", nargs="+")
|
parser.add_argument("-blender", nargs="+")
|
||||||
|
@ -8,6 +8,7 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import glob
|
|||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
|
|
||||||
def _write_html(output_dir):
|
def _write_html(output_dir):
|
||||||
combined_reports = ""
|
combined_reports = ""
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ class PhysicsSpec:
|
|||||||
return "Physics Modifier: " + self.modifier_name + " of type " + self.modifier_type + \
|
return "Physics Modifier: " + self.modifier_name + " of type " + self.modifier_type + \
|
||||||
" with parameters: " + str(self.modifier_parameters) + " with frame end: " + str(self.frame_end)
|
" with parameters: " + str(self.modifier_parameters) + " with frame end: " + str(self.frame_end)
|
||||||
|
|
||||||
|
|
||||||
class OperatorSpec:
|
class OperatorSpec:
|
||||||
"""
|
"""
|
||||||
Holds one operator and its parameters.
|
Holds one operator and its parameters.
|
||||||
@ -281,7 +282,6 @@ class MeshTest:
|
|||||||
print("Created modifier '{}' of type '{}'.".
|
print("Created modifier '{}' of type '{}'.".
|
||||||
format(physics_spec.modifier_name, physics_spec.modifier_type))
|
format(physics_spec.modifier_name, physics_spec.modifier_type))
|
||||||
|
|
||||||
|
|
||||||
for param_name in physics_spec.modifier_parameters:
|
for param_name in physics_spec.modifier_parameters:
|
||||||
try:
|
try:
|
||||||
setattr(physics_setting, param_name, physics_spec.modifier_parameters[param_name])
|
setattr(physics_setting, param_name, physics_spec.modifier_parameters[param_name])
|
||||||
|
@ -34,6 +34,7 @@ BLACKLIST = (
|
|||||||
# 'file_to_blacklist.blend',
|
# 'file_to_blacklist.blend',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def print_message(message, type=None, status=''):
|
def print_message(message, type=None, status=''):
|
||||||
if type == 'SUCCESS':
|
if type == 'SUCCESS':
|
||||||
print(COLORS.GREEN, end="")
|
print(COLORS.GREEN, end="")
|
||||||
|
Loading…
Reference in New Issue
Block a user