Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-12 12:03:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-12 12:03:13 +0300
commit0108ce1fe5b9b4f24b5bdce4924e9b058d0edfa3 (patch)
treea97403186f2eb74ca775fb70c30a4ce806dc2707
parentb328a59373a231f749bd0d17fb3bc385002a5946 (diff)
Cleanup: pep8, cycles
-rw-r--r--intern/cycles/blender/addon/__init__.py6
-rw-r--r--intern/cycles/blender/addon/engine.py15
-rw-r--r--intern/cycles/blender/addon/properties.py1644
-rw-r--r--intern/cycles/blender/addon/ui.py20
-rw-r--r--intern/cycles/blender/addon/version_update.py64
5 files changed, 883 insertions, 866 deletions
diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py
index a2d6262fb20..038126278aa 100644
--- a/intern/cycles/blender/addon/__init__.py
+++ b/intern/cycles/blender/addon/__init__.py
@@ -45,9 +45,9 @@ if "bpy" in locals():
import bpy
from . import (
- engine,
- version_update,
- )
+ engine,
+ version_update,
+)
class CyclesRender(bpy.types.RenderEngine):
diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py
index 1f97eff9bd0..08c6a65e5ad 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -82,15 +82,17 @@ def _parse_command_line():
if args.cycles_resumable_current_chunk is not None:
import _cycles
_cycles.set_resumable_chunk(
- int(args.cycles_resumable_num_chunks),
- int(args.cycles_resumable_current_chunk))
+ int(args.cycles_resumable_num_chunks),
+ int(args.cycles_resumable_current_chunk),
+ )
elif args.cycles_resumable_start_chunk is not None and \
- args.cycles_resumable_end_chunk:
+ args.cycles_resumable_end_chunk:
import _cycles
_cycles.set_resumable_chunk_range(
- int(args.cycles_resumable_num_chunks),
- int(args.cycles_resumable_start_chunk),
- int(args.cycles_resumable_end_chunk))
+ int(args.cycles_resumable_num_chunks),
+ int(args.cycles_resumable_start_chunk),
+ int(args.cycles_resumable_end_chunk),
+ )
def init():
@@ -206,6 +208,7 @@ def system_info():
import _cycles
return _cycles.system_info()
+
def register_passes(engine, scene, srl):
engine.register_pass(scene, srl, "Combined", 4, "RGBA", 'COLOR')
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 4484dcfbfd7..c97d942af9d 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -31,7 +31,7 @@ import _cycles
enum_devices = (
('CPU', "CPU", "Use CPU for rendering"),
('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in the system tab in the user preferences"),
- )
+)
if _cycles.with_network:
enum_devices += (('NETWORK', "Networked Device", "Use networked device for rendering"),)
@@ -39,34 +39,34 @@ if _cycles.with_network:
enum_feature_set = (
('SUPPORTED', "Supported", "Only use finished and supported features"),
('EXPERIMENTAL', "Experimental", "Use experimental and incomplete features that might be broken or change in the future", 'ERROR', 1),
- )
+)
enum_displacement_methods = (
('BUMP', "Bump Only", "Bump mapping to simulate the appearance of displacement"),
('DISPLACEMENT', "Displacement Only", "Use true displacement of surface only, requires fine subdivision"),
('BOTH', "Displacement and Bump", "Combination of true displacement and bump mapping for finer detail"),
- )
+)
enum_bvh_layouts = (
('BVH2', "BVH2", "", 1),
('BVH4', "BVH4", "", 2),
- )
+)
enum_bvh_types = (
('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
- )
+)
enum_filter_types = (
('BOX', "Box", "Box filter"),
('GAUSSIAN', "Gaussian", "Gaussian filter"),
('BLACKMAN_HARRIS', "Blackman-Harris", "Blackman-Harris filter"),
- )
+)
enum_aperture_types = (
('RADIUS', "Radius", "Directly change the size of the aperture"),
('FSTOP', "F-stop", "Change the size of the aperture by f-stop"),
- )
+)
enum_panorama_types = (
('EQUIRECTANGULAR', "Equirectangular", "Render the scene with a spherical camera, also known as Lat Long panorama"),
@@ -74,23 +74,23 @@ enum_panorama_types = (
('FISHEYE_EQUISOLID', "Fisheye Equisolid",
"Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
('MIRRORBALL', "Mirror Ball", "Uses the mirror ball mapping"),
- )
+)
enum_curve_primitives = (
('TRIANGLES', "Triangles", "Create triangle geometry around strands"),
('LINE_SEGMENTS', "Line Segments", "Use line segment primitives"),
('CURVE_SEGMENTS', "Curve Segments", "Use segmented cardinal curve primitives"),
- )
+)
enum_triangle_curves = (
('CAMERA_TRIANGLES', "Planes", "Create individual triangles forming planes that face camera"),
('TESSELLATED_TRIANGLES', "Tessellated", "Create mesh surrounding each strand"),
- )
+)
enum_curve_shape = (
('RIBBONS', "Ribbons", "Ignore thickness of each strand"),
('THICK', "Thick", "Use thickness of strand when rendering"),
- )
+)
enum_tile_order = (
('CENTER', "Center", "Render from center to the edges"),
@@ -99,46 +99,46 @@ enum_tile_order = (
('TOP_TO_BOTTOM', "Top to Bottom", "Render from top to bottom"),
('BOTTOM_TO_TOP', "Bottom to Top", "Render from bottom to top"),
('HILBERT_SPIRAL', "Hilbert Spiral", "Render in a Hilbert Spiral"),
- )
+)
enum_use_layer_samples = (
('USE', "Use", "Per render layer number of samples override scene samples"),
('BOUNDED', "Bounded", "Bound per render layer number of samples by global samples"),
('IGNORE', "Ignore", "Ignore per render layer number of samples"),
- )
+)
enum_sampling_pattern = (
('SOBOL', "Sobol", "Use Sobol random sampling pattern"),
('CORRELATED_MUTI_JITTER', "Correlated Multi-Jitter", "Use Correlated Multi-Jitter random sampling pattern"),
- )
+)
enum_integrator = (
('BRANCHED_PATH', "Branched Path Tracing", "Path tracing integrator that branches on the first bounce, giving more control over the number of light and material samples"),
('PATH', "Path Tracing", "Pure path tracing integrator"),
- )
+)
enum_volume_sampling = (
('DISTANCE', "Distance", "Use distance sampling, best for dense volumes with lights far away"),
('EQUIANGULAR', "Equiangular", "Use equiangular sampling, best for volumes with low density with light inside or near the volume"),
('MULTIPLE_IMPORTANCE', "Multiple Importance", "Combine distance and equi-angular sampling for volumes where neither method is ideal"),
- )
+)
enum_volume_interpolation = (
('LINEAR', "Linear", "Good smoothness and speed"),
('CUBIC', "Cubic", "Smoothed high quality interpolation, but slower")
- )
+)
enum_world_mis = (
('NONE', "None", "Don't sample the background, faster but might cause noise for non-solid backgrounds"),
('AUTOMATIC', "Auto", "Automatically try to determine the best setting"),
('MANUAL', "Manual", "Manually set the resolution of the sampling map, higher values are slower and require more memory but reduce noise")
- )
+)
enum_device_type = (
('CPU', "CPU", "CPU", 0),
('CUDA', "CUDA", "CUDA", 1),
('OPENCL', "OpenCL", "OpenCL", 2)
- )
+)
enum_texture_limit = (
('OFF', "No Limit", "No texture size limit", 0),
@@ -149,423 +149,424 @@ enum_texture_limit = (
('2048', "2048", "Limit texture size to 2048 pixels", 5),
('4096', "4096", "Limit texture size to 4096 pixels", 6),
('8192', "8192", "Limit texture size to 8192 pixels", 7),
- )
+)
+
class CyclesRenderSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Scene.cycles = PointerProperty(
- name="Cycles Render Settings",
- description="Cycles render settings",
- type=cls,
- )
+ name="Cycles Render Settings",
+ description="Cycles render settings",
+ type=cls,
+ )
cls.device = EnumProperty(
- name="Device",
- description="Device to use for rendering",
- items=enum_devices,
- default='CPU',
- )
+ name="Device",
+ description="Device to use for rendering",
+ items=enum_devices,
+ default='CPU',
+ )
cls.feature_set = EnumProperty(
- name="Feature Set",
- description="Feature set to use for rendering",
- items=enum_feature_set,
- default='SUPPORTED',
- )
+ name="Feature Set",
+ description="Feature set to use for rendering",
+ items=enum_feature_set,
+ default='SUPPORTED',
+ )
cls.shading_system = BoolProperty(
- name="Open Shading Language",
- description="Use Open Shading Language (CPU rendering only)",
- )
+ name="Open Shading Language",
+ description="Use Open Shading Language (CPU rendering only)",
+ )
cls.progressive = EnumProperty(
- name="Integrator",
- description="Method to sample lights and materials",
- items=enum_integrator,
- default='PATH',
- )
+ name="Integrator",
+ description="Method to sample lights and materials",
+ items=enum_integrator,
+ default='PATH',
+ )
cls.use_square_samples = BoolProperty(
- name="Square Samples",
- description="Square sampling values for easier artist control",
- default=False,
- )
+ name="Square Samples",
+ description="Square sampling values for easier artist control",
+ default=False,
+ )
cls.samples = IntProperty(
- name="Samples",
- description="Number of samples to render for each pixel",
- min=1, max=2147483647,
- default=128,
- )
+ name="Samples",
+ description="Number of samples to render for each pixel",
+ min=1, max=2147483647,
+ default=128,
+ )
cls.preview_samples = IntProperty(
- name="Preview Samples",
- description="Number of samples to render in the viewport, unlimited if 0",
- min=0, max=2147483647,
- default=32,
- )
+ name="Preview Samples",
+ description="Number of samples to render in the viewport, unlimited if 0",
+ min=0, max=2147483647,
+ default=32,
+ )
cls.preview_pause = BoolProperty(
- name="Pause Preview",
- description="Pause all viewport preview renders",
- default=False,
- )
+ name="Pause Preview",
+ description="Pause all viewport preview renders",
+ default=False,
+ )
cls.preview_active_layer = BoolProperty(
- name="Preview Active Layer",
- description="Preview active render layer in viewport",
- default=False,
- )
+ name="Preview Active Layer",
+ description="Preview active render layer in viewport",
+ default=False,
+ )
cls.aa_samples = IntProperty(
- name="AA Samples",
- description="Number of antialiasing samples to render for each pixel",
- min=1, max=2097151,
- default=128,
- )
+ name="AA Samples",
+ description="Number of antialiasing samples to render for each pixel",
+ min=1, max=2097151,
+ default=128,
+ )
cls.preview_aa_samples = IntProperty(
- name="AA Samples",
- description="Number of antialiasing samples to render in the viewport, unlimited if 0",
- min=0, max=2097151,
- default=32,
- )
+ name="AA Samples",
+ description="Number of antialiasing samples to render in the viewport, unlimited if 0",
+ min=0, max=2097151,
+ default=32,
+ )
cls.diffuse_samples = IntProperty(
- name="Diffuse Samples",
- description="Number of diffuse bounce samples to render for each AA sample",
- min=1, max=1024,
- default=1,
- )
+ name="Diffuse Samples",
+ description="Number of diffuse bounce samples to render for each AA sample",
+ min=1, max=1024,
+ default=1,
+ )
cls.glossy_samples = IntProperty(
- name="Glossy Samples",
- description="Number of glossy bounce samples to render for each AA sample",
- min=1, max=1024,
- default=1,
- )
+ name="Glossy Samples",
+ description="Number of glossy bounce samples to render for each AA sample",
+ min=1, max=1024,
+ default=1,
+ )
cls.transmission_samples = IntProperty(
- name="Transmission Samples",
- description="Number of transmission bounce samples to render for each AA sample",
- min=1, max=1024,
- default=1,
- )
+ name="Transmission Samples",
+ description="Number of transmission bounce samples to render for each AA sample",
+ min=1, max=1024,
+ default=1,
+ )
cls.ao_samples = IntProperty(
- name="Ambient Occlusion Samples",
- description="Number of ambient occlusion samples to render for each AA sample",
- min=1, max=1024,
- default=1,
- )
+ name="Ambient Occlusion Samples",
+ description="Number of ambient occlusion samples to render for each AA sample",
+ min=1, max=1024,
+ default=1,
+ )
cls.mesh_light_samples = IntProperty(
- name="Mesh Light Samples",
- description="Number of mesh emission light samples to render for each AA sample",
- min=1, max=1024,
- default=1,
- )
+ name="Mesh Light Samples",
+ description="Number of mesh emission light samples to render for each AA sample",
+ min=1, max=1024,
+ default=1,
+ )
cls.subsurface_samples = IntProperty(
- name="Subsurface Samples",
- description="Number of subsurface scattering samples to render for each AA sample",
- min=1, max=1024,
- default=1,
- )
+ name="Subsurface Samples",
+ description="Number of subsurface scattering samples to render for each AA sample",
+ min=1, max=1024,
+ default=1,
+ )
cls.volume_samples = IntProperty(
- name="Volume Samples",
- description="Number of volume scattering samples to render for each AA sample",
- min=1, max=1024,
- default=1,
- )
+ name="Volume Samples",
+ description="Number of volume scattering samples to render for each AA sample",
+ min=1, max=1024,
+ default=1,
+ )
cls.sampling_pattern = EnumProperty(
- name="Sampling Pattern",
- description="Random sampling pattern used by the integrator",
- items=enum_sampling_pattern,
- default='SOBOL',
- )
+ name="Sampling Pattern",
+ description="Random sampling pattern used by the integrator",
+ items=enum_sampling_pattern,
+ default='SOBOL',
+ )
cls.use_layer_samples = EnumProperty(
- name="Layer Samples",
- description="How to use per render layer sample settings",
- items=enum_use_layer_samples,
- default='USE',
- )
+ name="Layer Samples",
+ description="How to use per render layer sample settings",
+ items=enum_use_layer_samples,
+ default='USE',
+ )
cls.sample_all_lights_direct = BoolProperty(
- name="Sample All Direct Lights",
- description="Sample all lights (for direct samples), rather than randomly picking one",
- default=True,
- )
+ name="Sample All Direct Lights",
+ description="Sample all lights (for direct samples), rather than randomly picking one",
+ default=True,
+ )
cls.sample_all_lights_indirect = BoolProperty(
- name="Sample All Indirect Lights",
- description="Sample all lights (for indirect samples), rather than randomly picking one",
- default=True,
- )
+ name="Sample All Indirect Lights",
+ description="Sample all lights (for indirect samples), rather than randomly picking one",
+ default=True,
+ )
cls.light_sampling_threshold = FloatProperty(
- name="Light Sampling Threshold",
- description="Probabilistically terminate light samples when the light contribution is below this threshold (more noise but faster rendering). "
- "Zero disables the test and never ignores lights",
- min=0.0, max=1.0,
- default=0.01,
- )
+ name="Light Sampling Threshold",
+ description="Probabilistically terminate light samples when the light contribution is below this threshold (more noise but faster rendering). "
+ "Zero disables the test and never ignores lights",
+ min=0.0, max=1.0,
+ default=0.01,
+ )
cls.caustics_reflective = BoolProperty(
- name="Reflective Caustics",
- description="Use reflective caustics, resulting in a brighter image (more noise but added realism)",
- default=True,
- )
+ name="Reflective Caustics",
+ description="Use reflective caustics, resulting in a brighter image (more noise but added realism)",
+ default=True,
+ )
cls.caustics_refractive = BoolProperty(
- name="Refractive Caustics",
- description="Use refractive caustics, resulting in a brighter image (more noise but added realism)",
- default=True,
- )
+ name="Refractive Caustics",
+ description="Use refractive caustics, resulting in a brighter image (more noise but added realism)",
+ default=True,
+ )
cls.blur_glossy = FloatProperty(
- name="Filter Glossy",
- description="Adaptively blur glossy shaders after blurry bounces, "
- "to reduce noise at the cost of accuracy",
- min=0.0, max=10.0,
- default=1.0,
- )
+ name="Filter Glossy",
+ description="Adaptively blur glossy shaders after blurry bounces, "
+ "to reduce noise at the cost of accuracy",
+ min=0.0, max=10.0,
+ default=1.0,
+ )
cls.max_bounces = IntProperty(
- name="Max Bounces",
- description="Total maximum number of bounces",
- min=0, max=1024,
- default=12,
- )
+ name="Max Bounces",
+ description="Total maximum number of bounces",
+ min=0, max=1024,
+ default=12,
+ )
cls.diffuse_bounces = IntProperty(
- name="Diffuse Bounces",
- description="Maximum number of diffuse reflection bounces, bounded by total maximum",
- min=0, max=1024,
- default=4,
- )
+ name="Diffuse Bounces",
+ description="Maximum number of diffuse reflection bounces, bounded by total maximum",
+ min=0, max=1024,
+ default=4,
+ )
cls.glossy_bounces = IntProperty(
- name="Glossy Bounces",
- description="Maximum number of glossy reflection bounces, bounded by total maximum",
- min=0, max=1024,
- default=4,
- )
+ name="Glossy Bounces",
+ description="Maximum number of glossy reflection bounces, bounded by total maximum",
+ min=0, max=1024,
+ default=4,
+ )
cls.transmission_bounces = IntProperty(
- name="Transmission Bounces",
- description="Maximum number of transmission bounces, bounded by total maximum",
- min=0, max=1024,
- default=12,
- )
+ name="Transmission Bounces",
+ description="Maximum number of transmission bounces, bounded by total maximum",
+ min=0, max=1024,
+ default=12,
+ )
cls.volume_bounces = IntProperty(
- name="Volume Bounces",
- description="Maximum number of volumetric scattering events",
- min=0, max=1024,
- default=0,
- )
+ name="Volume Bounces",
+ description="Maximum number of volumetric scattering events",
+ min=0, max=1024,
+ default=0,
+ )
cls.transparent_max_bounces = IntProperty(
- name="Transparent Max Bounces",
- description="Maximum number of transparent bounces",
- min=0, max=1024,
- default=8,
- )
+ name="Transparent Max Bounces",
+ description="Maximum number of transparent bounces",
+ min=0, max=1024,
+ default=8,
+ )
cls.volume_step_size = FloatProperty(
- name="Step Size",
- description="Distance between volume shader samples when rendering the volume "
- "(lower values give more accurate and detailed results, but also increased render time)",
- default=0.1,
- min=0.0000001, max=100000.0, soft_min=0.01, soft_max=1.0, precision=4
- )
+ name="Step Size",
+ description="Distance between volume shader samples when rendering the volume "
+ "(lower values give more accurate and detailed results, but also increased render time)",
+ default=0.1,
+ min=0.0000001, max=100000.0, soft_min=0.01, soft_max=1.0, precision=4
+ )
cls.volume_max_steps = IntProperty(
- name="Max Steps",
- description="Maximum number of steps through the volume before giving up, "
- "to avoid extremely long render times with big objects or small step sizes",
- default=1024,
- min=2, max=65536
- )
+ name="Max Steps",
+ description="Maximum number of steps through the volume before giving up, "
+ "to avoid extremely long render times with big objects or small step sizes",
+ default=1024,
+ min=2, max=65536
+ )
cls.dicing_rate = FloatProperty(
- name="Dicing Rate",
- description="Size of a micropolygon in pixels",
- min=0.1, max=1000.0, soft_min=0.5,
- default=1.0,
- subtype="PIXEL"
- )
+ name="Dicing Rate",
+ description="Size of a micropolygon in pixels",
+ min=0.1, max=1000.0, soft_min=0.5,
+ default=1.0,
+ subtype="PIXEL"
+ )
cls.preview_dicing_rate = FloatProperty(
- name="Preview Dicing Rate",
- description="Size of a micropolygon in pixels during preview render",
- min=0.1, max=1000.0, soft_min=0.5,
- default=8.0,
- subtype="PIXEL"
- )
+ name="Preview Dicing Rate",
+ description="Size of a micropolygon in pixels during preview render",
+ min=0.1, max=1000.0, soft_min=0.5,
+ default=8.0,
+ subtype="PIXEL"
+ )
cls.max_subdivisions = IntProperty(
- name="Max Subdivisions",
- description="Stop subdividing when this level is reached even if the dice rate would produce finer tessellation",
- min=0, max=16,
- default=12,
- )
+ name="Max Subdivisions",
+ description="Stop subdividing when this level is reached even if the dice rate would produce finer tessellation",
+ min=0, max=16,
+ default=12,
+ )
cls.dicing_camera = PointerProperty(
- name="Dicing Camera",
- description="Camera to use as reference point when subdividing geometry, useful to avoid crawling "
- "artifacts in animations when the scene camera is moving",
- type=bpy.types.Object,
- poll=lambda self, obj: obj.type == 'CAMERA',
- )
+ name="Dicing Camera",
+ description="Camera to use as reference point when subdividing geometry, useful to avoid crawling "
+ "artifacts in animations when the scene camera is moving",
+ type=bpy.types.Object,
+ poll=lambda self, obj: obj.type == 'CAMERA',
+ )
cls.offscreen_dicing_scale = FloatProperty(
- name="Offscreen Dicing Scale",
- description="Multiplier for dicing rate of geometry outside of the camera view. The dicing rate "
- "of objects is gradually increased the further they are outside the camera view. "
- "Lower values provide higher quality reflections and shadows for off screen objects, "
- "while higher values use less memory",
- min=1.0, soft_max=25.0,
- default=4.0,
- )
+ name="Offscreen Dicing Scale",
+ description="Multiplier for dicing rate of geometry outside of the camera view. The dicing rate "
+ "of objects is gradually increased the further they are outside the camera view. "
+ "Lower values provide higher quality reflections and shadows for off screen objects, "
+ "while higher values use less memory",
+ min=1.0, soft_max=25.0,
+ default=4.0,
+ )
cls.film_exposure = FloatProperty(
- name="Exposure",
- description="Image brightness scale",
- min=0.0, max=10.0,
- default=1.0,
- )
+ name="Exposure",
+ description="Image brightness scale",
+ min=0.0, max=10.0,
+ default=1.0,
+ )
cls.film_transparent = BoolProperty(
- name="Transparent",
- description="World background is transparent, for compositing the render over another background",
- default=False,
- )
+ name="Transparent",
+ description="World background is transparent, for compositing the render over another background",
+ default=False,
+ )
cls.film_transparent_glass = BoolProperty(
- name="Transparent Glass",
- description="Render transmissive surfaces as transparent, for compositing glass over another background",
- default=False,
- )
+ name="Transparent Glass",
+ description="Render transmissive surfaces as transparent, for compositing glass over another background",
+ default=False,
+ )
cls.film_transparent_roughness = FloatProperty(
- name="Transparent Roughness Threshold",
- description="For transparent transmission, keep surfaces with roughness above the threshold opaque",
- min=0.0, max=1.0,
- default=0.1,
- )
+ name="Transparent Roughness Threshold",
+ description="For transparent transmission, keep surfaces with roughness above the threshold opaque",
+ min=0.0, max=1.0,
+ default=0.1,
+ )
# Really annoyingly, we have to keep it around for a few releases,
# otherwise forward compatibility breaks in really bad manner: CRASH!
#
# TODO(sergey): Remove this during 2.8x series of Blender.
cls.filter_type = EnumProperty(
- name="Filter Type",
- description="Pixel filter type",
- items=enum_filter_types,
- default='BLACKMAN_HARRIS',
- )
+ name="Filter Type",
+ description="Pixel filter type",
+ items=enum_filter_types,
+ default='BLACKMAN_HARRIS',
+ )
cls.pixel_filter_type = EnumProperty(
- name="Filter Type",
- description="Pixel filter type",
- items=enum_filter_types,
- default='BLACKMAN_HARRIS',
- )
+ name="Filter Type",
+ description="Pixel filter type",
+ items=enum_filter_types,
+ default='BLACKMAN_HARRIS',
+ )
cls.filter_width = FloatProperty(
- name="Filter Width",
- description="Pixel filter width",
- min=0.01, max=10.0,
- default=1.5,
- )
+ name="Filter Width",
+ description="Pixel filter width",
+ min=0.01, max=10.0,
+ default=1.5,
+ )
cls.seed = IntProperty(
- name="Seed",
- description="Seed value for integrator to get different noise patterns",
- min=0, max=2147483647,
- default=0,
- )
+ name="Seed",
+ description="Seed value for integrator to get different noise patterns",
+ min=0, max=2147483647,
+ default=0,
+ )
cls.use_animated_seed = BoolProperty(
- name="Use Animated Seed",
- description="Use different seed values (and hence noise patterns) at different frames",
- default=False,
- )
+ name="Use Animated Seed",
+ description="Use different seed values (and hence noise patterns) at different frames",
+ default=False,
+ )
cls.sample_clamp_direct = FloatProperty(
- name="Clamp Direct",
- description="If non-zero, the maximum value for a direct sample, "
- "higher values will be scaled down to avoid too "
- "much noise and slow convergence at the cost of accuracy",
- min=0.0, max=1e8,
- default=0.0,
- )
+ name="Clamp Direct",
+ description="If non-zero, the maximum value for a direct sample, "
+ "higher values will be scaled down to avoid too "
+ "much noise and slow convergence at the cost of accuracy",
+ min=0.0, max=1e8,
+ default=0.0,
+ )
cls.sample_clamp_indirect = FloatProperty(
- name="Clamp Indirect",
- description="If non-zero, the maximum value for an indirect sample, "
- "higher values will be scaled down to avoid too "
- "much noise and slow convergence at the cost of accuracy",
- min=0.0, max=1e8,
- default=10.0,
- )
+ name="Clamp Indirect",
+ description="If non-zero, the maximum value for an indirect sample, "
+ "higher values will be scaled down to avoid too "
+ "much noise and slow convergence at the cost of accuracy",
+ min=0.0, max=1e8,
+ default=10.0,
+ )
cls.debug_tile_size = IntProperty(
- name="Tile Size",
- description="",
- min=1, max=4096,
- default=1024,
- )
+ name="Tile Size",
+ description="",
+ min=1, max=4096,
+ default=1024,
+ )
cls.preview_start_resolution = IntProperty(
- name="Start Resolution",
- description="Resolution to start rendering preview at, "
- "progressively increasing it to the full viewport size",
- min=8, max=16384,
- default=64,
- )
+ name="Start Resolution",
+ description="Resolution to start rendering preview at, "
+ "progressively increasing it to the full viewport size",
+ min=8, max=16384,
+ default=64,
+ )
cls.debug_reset_timeout = FloatProperty(
- name="Reset timeout",
- description="",
- min=0.01, max=10.0,
- default=0.1,
- )
+ name="Reset timeout",
+ description="",
+ min=0.01, max=10.0,
+ default=0.1,
+ )
cls.debug_cancel_timeout = FloatProperty(
- name="Cancel timeout",
- description="",
- min=0.01, max=10.0,
- default=0.1,
- )
+ name="Cancel timeout",
+ description="",
+ min=0.01, max=10.0,
+ default=0.1,
+ )
cls.debug_text_timeout = FloatProperty(
- name="Text timeout",
- description="",
- min=0.01, max=10.0,
- default=1.0,
- )
+ name="Text timeout",
+ description="",
+ min=0.01, max=10.0,
+ default=1.0,
+ )
cls.debug_bvh_type = EnumProperty(
- name="Viewport BVH Type",
- description="Choose between faster updates, or faster render",
- items=enum_bvh_types,
- default='DYNAMIC_BVH',
- )
+ name="Viewport BVH Type",
+ description="Choose between faster updates, or faster render",
+ items=enum_bvh_types,
+ default='DYNAMIC_BVH',
+ )
cls.debug_use_spatial_splits = BoolProperty(
- name="Use Spatial Splits",
- description="Use BVH spatial splits: longer builder time, faster render",
- default=False,
- )
+ name="Use Spatial Splits",
+ description="Use BVH spatial splits: longer builder time, faster render",
+ default=False,
+ )
cls.debug_use_hair_bvh = BoolProperty(
- name="Use Hair BVH",
- description="Use special type BVH optimized for hair (uses more ram but renders faster)",
- default=True,
- )
+ name="Use Hair BVH",
+ description="Use special type BVH optimized for hair (uses more ram but renders faster)",
+ default=True,
+ )
cls.debug_bvh_time_steps = IntProperty(
- name="BVH Time Steps",
- description="Split BVH primitives by this number of time steps to speed up render time in cost of memory",
- default=0,
- min=0, max=16,
- )
+ name="BVH Time Steps",
+ description="Split BVH primitives by this number of time steps to speed up render time in cost of memory",
+ default=0,
+ min=0, max=16,
+ )
cls.tile_order = EnumProperty(
- name="Tile Order",
- description="Tile order for rendering",
- items=enum_tile_order,
- default='HILBERT_SPIRAL',
- options=set(), # Not animatable!
- )
+ name="Tile Order",
+ description="Tile order for rendering",
+ items=enum_tile_order,
+ default='HILBERT_SPIRAL',
+ options=set(), # Not animatable!
+ )
cls.use_progressive_refine = BoolProperty(
- name="Progressive Refine",
- description="Instead of rendering each tile until it is finished, "
- "refine the whole image progressively "
- "(this renders somewhat slower, "
- "but time can be saved by manually stopping the render when the noise is low enough)",
- default=False,
- )
+ name="Progressive Refine",
+ description="Instead of rendering each tile until it is finished, "
+ "refine the whole image progressively "
+ "(this renders somewhat slower, "
+ "but time can be saved by manually stopping the render when the noise is low enough)",
+ default=False,
+ )
cls.bake_type = EnumProperty(
name="Bake Type",
@@ -584,34 +585,34 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
('GLOSSY', "Glossy", ""),
('TRANSMISSION', "Transmission", ""),
('SUBSURFACE', "Subsurface", ""),
- ),
- )
+ ),
+ )
cls.use_camera_cull = BoolProperty(
- name="Use Camera Cull",
- description="Allow objects to be culled based on the camera frustum",
- default=False,
- )
+ name="Use Camera Cull",
+ description="Allow objects to be culled based on the camera frustum",
+ default=False,
+ )
cls.camera_cull_margin = FloatProperty(
- name="Camera Cull Margin",
- description="Margin for the camera space culling",
- default=0.1,
- min=0.0, max=5.0
- )
+ name="Camera Cull Margin",
+ description="Margin for the camera space culling",
+ default=0.1,
+ min=0.0, max=5.0
+ )
cls.use_distance_cull = BoolProperty(
- name="Use Distance Cull",
- description="Allow objects to be culled based on the distance from camera",
- default=False,
- )
+ name="Use Distance Cull",
+ description="Allow objects to be culled based on the distance from camera",
+ default=False,
+ )
cls.distance_cull_margin = FloatProperty(
- name="Cull Distance",
- description="Cull objects which are further away from camera than this distance",
- default=50,
- min=0.0
- )
+ name="Cull Distance",
+ description="Cull objects which are further away from camera than this distance",
+ default=50,
+ min=0.0
+ )
cls.motion_blur_position = EnumProperty(
name="Motion Blur Position",
@@ -621,8 +622,8 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
('START', "Start on Frame", "The shutter opens at the current frame"),
('CENTER', "Center on Frame", "The shutter is open during the current frame"),
('END', "End on Frame", "The shutter closes at the current frame"),
- ),
- )
+ ),
+ )
cls.rolling_shutter_type = EnumProperty(
name="Shutter Type",
@@ -632,43 +633,43 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
('NONE', "None", "No rolling shutter effect used"),
('TOP', "Top-Bottom", "Sensor is being scanned from top to bottom")
# TODO(seergey): Are there real cameras with different scanning direction?
- ),
- )
+ ),
+ )
cls.rolling_shutter_duration = FloatProperty(
name="Rolling Shutter Duration",
description="Scanline \"exposure\" time for the rolling shutter effect",
default=0.1,
min=0.0, max=1.0,
- )
+ )
cls.texture_limit = EnumProperty(
name="Viewport Texture Limit",
default='OFF',
description="Limit texture size used by viewport rendering",
items=enum_texture_limit
- )
+ )
cls.texture_limit_render = EnumProperty(
name="Render Texture Limit",
default='OFF',
description="Limit texture size used by final rendering",
items=enum_texture_limit
- )
+ )
cls.ao_bounces = IntProperty(
name="AO Bounces",
default=0,
description="Approximate indirect light with background tinted ambient occlusion at the specified bounce, 0 disables this feature",
min=0, max=1024,
- )
+ )
cls.ao_bounces_render = IntProperty(
name="AO Bounces Render",
default=0,
description="Approximate indirect light with background tinted ambient occlusion at the specified bounce, 0 disables this feature",
min=0, max=1024,
- )
+ )
# Various fine-tuning debug flags
@@ -683,10 +684,10 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
cls.debug_use_cpu_sse3 = BoolProperty(name="SSE3", default=True)
cls.debug_use_cpu_sse2 = BoolProperty(name="SSE2", default=True)
cls.debug_bvh_layout = EnumProperty(
- name="BVH Layout",
- items=enum_bvh_layouts,
- default='BVH4',
- )
+ name="BVH Layout",
+ items=enum_bvh_layouts,
+ default='BVH4',
+ )
cls.debug_use_cpu_split_kernel = BoolProperty(name="Split Kernel", default=False)
cls.debug_use_cuda_adaptive_compile = BoolProperty(name="Adaptive Compile", default=False)
@@ -699,9 +700,9 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
('DEFAULT', "Default", ""),
('MEGA', "Mega", ""),
('SPLIT', "Split", ""),
- ),
+ ),
update=devices_update_callback
- )
+ )
cls.debug_opencl_device_type = EnumProperty(
name="OpenCL Device Type",
@@ -713,20 +714,20 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
('CPU', "CPU", ""),
('GPU', "GPU", ""),
('ACCELERATOR', "Accelerator", ""),
- ),
+ ),
update=devices_update_callback
- )
+ )
cls.debug_opencl_kernel_single_program = BoolProperty(
name="Single Program",
default=True,
update=devices_update_callback,
- )
+ )
cls.debug_use_opencl_debug = BoolProperty(name="Debug OpenCL", default=False)
cls.debug_opencl_mem_limit = IntProperty(name="Memory limit", default=0,
- description="Artificial limit on OpenCL memory usage in MB (0 to disable limit)")
+ description="Artificial limit on OpenCL memory usage in MB (0 to disable limit)")
@classmethod
def unregister(cls):
@@ -739,101 +740,101 @@ class CyclesCameraSettings(bpy.types.PropertyGroup):
import math
bpy.types.Camera.cycles = PointerProperty(
- name="Cycles Camera Settings",
- description="Cycles camera settings",
- type=cls,
- )
+ name="Cycles Camera Settings",
+ description="Cycles camera settings",
+ type=cls,
+ )
cls.aperture_type = EnumProperty(
- name="Aperture Type",
- description="Use f-stop number or aperture radius",
- items=enum_aperture_types,
- default='RADIUS',
- )
+ name="Aperture Type",
+ description="Use f-stop number or aperture radius",
+ items=enum_aperture_types,
+ default='RADIUS',
+ )
cls.aperture_fstop = FloatProperty(
- name="Aperture f-stop",
- description="F-stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
- min=0.0, soft_min=0.1, soft_max=64.0,
- default=5.6,
- step=10,
- precision=1,
- )
+ name="Aperture f-stop",
+ description="F-stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
+ min=0.0, soft_min=0.1, soft_max=64.0,
+ default=5.6,
+ step=10,
+ precision=1,
+ )
cls.aperture_size = FloatProperty(
- name="Aperture Size",
- description="Radius of the aperture for depth of field (higher values give more defocus)",
- min=0.0, soft_max=10.0,
- default=0.0,
- step=1,
- precision=4,
- subtype='DISTANCE',
- )
+ name="Aperture Size",
+ description="Radius of the aperture for depth of field (higher values give more defocus)",
+ min=0.0, soft_max=10.0,
+ default=0.0,
+ step=1,
+ precision=4,
+ subtype='DISTANCE',
+ )
cls.aperture_blades = IntProperty(
- name="Aperture Blades",
- description="Number of blades in aperture for polygonal bokeh (at least 3)",
- min=0, max=100,
- default=0,
- )
+ name="Aperture Blades",
+ description="Number of blades in aperture for polygonal bokeh (at least 3)",
+ min=0, max=100,
+ default=0,
+ )
cls.aperture_rotation = FloatProperty(
- name="Aperture Rotation",
- description="Rotation of blades in aperture",
- soft_min=-math.pi, soft_max=math.pi,
- subtype='ANGLE',
- default=0,
- )
+ name="Aperture Rotation",
+ description="Rotation of blades in aperture",
+ soft_min=-math.pi, soft_max=math.pi,
+ subtype='ANGLE',
+ default=0,
+ )
cls.aperture_ratio = FloatProperty(
- name="Aperture Ratio",
- description="Distortion to simulate anamorphic lens bokeh",
- min=0.01, soft_min=1.0, soft_max=2.0,
- default=1.0,
- precision=4,
- )
+ name="Aperture Ratio",
+ description="Distortion to simulate anamorphic lens bokeh",
+ min=0.01, soft_min=1.0, soft_max=2.0,
+ default=1.0,
+ precision=4,
+ )
cls.panorama_type = EnumProperty(
- name="Panorama Type",
- description="Distortion to use for the calculation",
- items=enum_panorama_types,
- default='FISHEYE_EQUISOLID',
- )
+ name="Panorama Type",
+ description="Distortion to use for the calculation",
+ items=enum_panorama_types,
+ default='FISHEYE_EQUISOLID',
+ )
cls.fisheye_fov = FloatProperty(
- name="Field of View",
- description="Field of view for the fisheye lens",
- min=0.1745, soft_max=2.0 * math.pi, max=10.0 * math.pi,
- subtype='ANGLE',
- default=math.pi,
- )
+ name="Field of View",
+ description="Field of view for the fisheye lens",
+ min=0.1745, soft_max=2.0 * math.pi, max=10.0 * math.pi,
+ subtype='ANGLE',
+ default=math.pi,
+ )
cls.fisheye_lens = FloatProperty(
- name="Fisheye Lens",
- description="Lens focal length (mm)",
- min=0.01, soft_max=15.0, max=100.0,
- default=10.5,
- )
+ name="Fisheye Lens",
+ description="Lens focal length (mm)",
+ min=0.01, soft_max=15.0, max=100.0,
+ default=10.5,
+ )
cls.latitude_min = FloatProperty(
- name="Min Latitude",
- description="Minimum latitude (vertical angle) for the equirectangular lens",
- min=-0.5 * math.pi, max=0.5 * math.pi,
- subtype='ANGLE',
- default=-0.5 * math.pi,
- )
+ name="Min Latitude",
+ description="Minimum latitude (vertical angle) for the equirectangular lens",
+ min=-0.5 * math.pi, max=0.5 * math.pi,
+ subtype='ANGLE',
+ default=-0.5 * math.pi,
+ )
cls.latitude_max = FloatProperty(
- name="Max Latitude",
- description="Maximum latitude (vertical angle) for the equirectangular lens",
- min=-0.5 * math.pi, max=0.5 * math.pi,
- subtype='ANGLE',
- default=0.5 * math.pi,
- )
+ name="Max Latitude",
+ description="Maximum latitude (vertical angle) for the equirectangular lens",
+ min=-0.5 * math.pi, max=0.5 * math.pi,
+ subtype='ANGLE',
+ default=0.5 * math.pi,
+ )
cls.longitude_min = FloatProperty(
- name="Min Longitude",
- description="Minimum longitude (horizontal angle) for the equirectangular lens",
- min=-math.pi, max=math.pi,
- subtype='ANGLE',
- default=-math.pi,
- )
+ name="Min Longitude",
+ description="Minimum longitude (horizontal angle) for the equirectangular lens",
+ min=-math.pi, max=math.pi,
+ subtype='ANGLE',
+ default=-math.pi,
+ )
cls.longitude_max = FloatProperty(
- name="Max Longitude",
- description="Maximum longitude (horizontal angle) for the equirectangular lens",
- min=-math.pi, max=math.pi,
- subtype='ANGLE',
- default=math.pi,
- )
+ name="Max Longitude",
+ description="Maximum longitude (horizontal angle) for the equirectangular lens",
+ min=-math.pi, max=math.pi,
+ subtype='ANGLE',
+ default=math.pi,
+ )
@classmethod
def unregister(cls):
@@ -844,49 +845,49 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Material.cycles = PointerProperty(
- name="Cycles Material Settings",
- description="Cycles material settings",
- type=cls,
- )
+ name="Cycles Material Settings",
+ description="Cycles material settings",
+ type=cls,
+ )
cls.sample_as_light = BoolProperty(
- name="Multiple Importance Sample",
- description="Use multiple importance sampling for this material, "
- "disabling may reduce overall noise for large "
- "objects that emit little light compared to other light sources",
- default=True,
- )
+ name="Multiple Importance Sample",
+ description="Use multiple importance sampling for this material, "
+ "disabling may reduce overall noise for large "
+ "objects that emit little light compared to other light sources",
+ default=True,
+ )
cls.use_transparent_shadow = BoolProperty(
- name="Transparent Shadows",
- description="Use transparent shadows for this material if it contains a Transparent BSDF, "
- "disabling will render faster but not give accurate shadows",
- default=True,
- )
+ name="Transparent Shadows",
+ description="Use transparent shadows for this material if it contains a Transparent BSDF, "
+ "disabling will render faster but not give accurate shadows",
+ default=True,
+ )
cls.homogeneous_volume = BoolProperty(
- name="Homogeneous Volume",
- description="When using volume rendering, assume volume has the same density everywhere "
- "(not using any textures), for faster rendering",
- default=False,
- )
+ name="Homogeneous Volume",
+ description="When using volume rendering, assume volume has the same density everywhere "
+ "(not using any textures), for faster rendering",
+ default=False,
+ )
cls.volume_sampling = EnumProperty(
- name="Volume Sampling",
- description="Sampling method to use for volumes",
- items=enum_volume_sampling,
- default='MULTIPLE_IMPORTANCE',
- )
+ name="Volume Sampling",
+ description="Sampling method to use for volumes",
+ items=enum_volume_sampling,
+ default='MULTIPLE_IMPORTANCE',
+ )
cls.volume_interpolation = EnumProperty(
- name="Volume Interpolation",
- description="Interpolation method to use for smoke/fire volumes",
- items=enum_volume_interpolation,
- default='LINEAR',
- )
+ name="Volume Interpolation",
+ description="Interpolation method to use for smoke/fire volumes",
+ items=enum_volume_interpolation,
+ default='LINEAR',
+ )
cls.displacement_method = EnumProperty(
- name="Displacement Method",
- description="Method to use for the displacement",
- items=enum_displacement_methods,
- default='DISPLACEMENT',
- )
+ name="Displacement Method",
+ description="Method to use for the displacement",
+ items=enum_displacement_methods,
+ default='DISPLACEMENT',
+ )
@classmethod
def unregister(cls):
@@ -897,39 +898,39 @@ class CyclesLampSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Lamp.cycles = PointerProperty(
- name="Cycles Lamp Settings",
- description="Cycles lamp settings",
- type=cls,
- )
+ name="Cycles Lamp Settings",
+ description="Cycles lamp settings",
+ type=cls,
+ )
cls.cast_shadow = BoolProperty(
- name="Cast Shadow",
- description="Lamp casts shadows",
- default=True,
- )
+ name="Cast Shadow",
+ description="Lamp casts shadows",
+ default=True,
+ )
cls.samples = IntProperty(
- name="Samples",
- description="Number of light samples to render for each AA sample",
- min=1, max=10000,
- default=1,
- )
+ name="Samples",
+ description="Number of light samples to render for each AA sample",
+ min=1, max=10000,
+ default=1,
+ )
cls.max_bounces = IntProperty(
- name="Max Bounces",
- description="Maximum number of bounces the light will contribute to the render",
- min=0, max=1024,
- default=1024,
- )
+ name="Max Bounces",
+ description="Maximum number of bounces the light will contribute to the render",
+ min=0, max=1024,
+ default=1024,
+ )
cls.use_multiple_importance_sampling = BoolProperty(
- name="Multiple Importance Sample",
- description="Use multiple importance sampling for the lamp, "
- "reduces noise for area lamps and sharp glossy materials",
- default=True,
- )
+ name="Multiple Importance Sample",
+ description="Use multiple importance sampling for the lamp, "
+ "reduces noise for area lamps and sharp glossy materials",
+ default=True,
+ )
cls.is_portal = BoolProperty(
- name="Is Portal",
- description="Use this area lamp to guide sampling of the background, "
- "note that this will make the lamp invisible",
- default=False,
- )
+ name="Is Portal",
+ description="Use this area lamp to guide sampling of the background, "
+ "note that this will make the lamp invisible",
+ default=False,
+ )
@classmethod
def unregister(cls):
@@ -940,54 +941,54 @@ class CyclesWorldSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.World.cycles = PointerProperty(
- name="Cycles World Settings",
- description="Cycles world settings",
- type=cls,
- )
+ name="Cycles World Settings",
+ description="Cycles world settings",
+ type=cls,
+ )
cls.sampling_method = EnumProperty(
- name="Sampling method",
- description="How to sample the background light",
- items=enum_world_mis,
- default='AUTOMATIC',
- )
+ name="Sampling method",
+ description="How to sample the background light",
+ items=enum_world_mis,
+ default='AUTOMATIC',
+ )
cls.sample_map_resolution = IntProperty(
- name="Map Resolution",
- description="Importance map size is resolution x resolution/2; "
- "higher values potentially produce less noise, at the cost of memory and speed",
- min=4, max=8192,
- default=1024,
- )
+ name="Map Resolution",
+ description="Importance map size is resolution x resolution/2; "
+ "higher values potentially produce less noise, at the cost of memory and speed",
+ min=4, max=8192,
+ default=1024,
+ )
cls.samples = IntProperty(
- name="Samples",
- description="Number of light samples to render for each AA sample",
- min=1, max=10000,
- default=1,
- )
+ name="Samples",
+ description="Number of light samples to render for each AA sample",
+ min=1, max=10000,
+ default=1,
+ )
cls.max_bounces = IntProperty(
- name="Max Bounces",
- description="Maximum number of bounces the background light will contribute to the render",
- min=0, max=1024,
- default=1024,
- )
+ name="Max Bounces",
+ description="Maximum number of bounces the background light will contribute to the render",
+ min=0, max=1024,
+ default=1024,
+ )
cls.homogeneous_volume = BoolProperty(
- name="Homogeneous Volume",
- description="When using volume rendering, assume volume has the same density everywhere"
- "(not using any textures), for faster rendering",
- default=False,
- )
+ name="Homogeneous Volume",
+ description="When using volume rendering, assume volume has the same density everywhere"
+ "(not using any textures), for faster rendering",
+ default=False,
+ )
cls.volume_sampling = EnumProperty(
- name="Volume Sampling",
- description="Sampling method to use for volumes",
- items=enum_volume_sampling,
- default='EQUIANGULAR',
- )
+ name="Volume Sampling",
+ description="Sampling method to use for volumes",
+ items=enum_volume_sampling,
+ default='EQUIANGULAR',
+ )
cls.volume_interpolation = EnumProperty(
- name="Volume Interpolation",
- description="Interpolation method to use for volumes",
- items=enum_volume_interpolation,
- default='LINEAR',
- )
+ name="Volume Interpolation",
+ description="Interpolation method to use for volumes",
+ items=enum_volume_interpolation,
+ default='LINEAR',
+ )
@classmethod
def unregister(cls):
@@ -998,47 +999,47 @@ class CyclesVisibilitySettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Object.cycles_visibility = PointerProperty(
- name="Cycles Visibility Settings",
- description="Cycles visibility settings",
- type=cls,
- )
+ name="Cycles Visibility Settings",
+ description="Cycles visibility settings",
+ type=cls,
+ )
bpy.types.World.cycles_visibility = PointerProperty(
- name="Cycles Visibility Settings",
- description="Cycles visibility settings",
- type=cls,
- )
+ name="Cycles Visibility Settings",
+ description="Cycles visibility settings",
+ type=cls,
+ )
cls.camera = BoolProperty(
- name="Camera",
- description="Object visibility for camera rays",
- default=True,
- )
+ name="Camera",
+ description="Object visibility for camera rays",
+ default=True,
+ )
cls.diffuse = BoolProperty(
- name="Diffuse",
- description="Object visibility for diffuse reflection rays",
- default=True,
- )
+ name="Diffuse",
+ description="Object visibility for diffuse reflection rays",
+ default=True,
+ )
cls.glossy = BoolProperty(
- name="Glossy",
- description="Object visibility for glossy reflection rays",
- default=True,
- )
+ name="Glossy",
+ description="Object visibility for glossy reflection rays",
+ default=True,
+ )
cls.transmission = BoolProperty(
- name="Transmission",
- description="Object visibility for transmission rays",
- default=True,
- )
+ name="Transmission",
+ description="Object visibility for transmission rays",
+ default=True,
+ )
cls.shadow = BoolProperty(
- name="Shadow",
- description="Object visibility for shadow rays",
- default=True,
- )
+ name="Shadow",
+ description="Object visibility for shadow rays",
+ default=True,
+ )
cls.scatter = BoolProperty(
- name="Volume Scatter",
- description="Object visibility for volume scatter rays",
- default=True,
- )
+ name="Volume Scatter",
+ description="Object visibility for volume scatter rays",
+ default=True,
+ )
@classmethod
def unregister(cls):
@@ -1050,20 +1051,20 @@ class CyclesMeshSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Mesh.cycles = PointerProperty(
- name="Cycles Mesh Settings",
- description="Cycles mesh settings",
- type=cls,
- )
+ name="Cycles Mesh Settings",
+ description="Cycles mesh settings",
+ type=cls,
+ )
bpy.types.Curve.cycles = PointerProperty(
- name="Cycles Mesh Settings",
- description="Cycles mesh settings",
- type=cls,
- )
+ name="Cycles Mesh Settings",
+ description="Cycles mesh settings",
+ type=cls,
+ )
bpy.types.MetaBall.cycles = PointerProperty(
- name="Cycles Mesh Settings",
- description="Cycles mesh settings",
- type=cls,
- )
+ name="Cycles Mesh Settings",
+ description="Cycles mesh settings",
+ type=cls,
+ )
@classmethod
def unregister(cls):
@@ -1076,69 +1077,68 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Object.cycles = PointerProperty(
- name="Cycles Object Settings",
- description="Cycles object settings",
- type=cls,
- )
+ name="Cycles Object Settings",
+ description="Cycles object settings",
+ type=cls,
+ )
cls.use_motion_blur = BoolProperty(
- name="Use Motion Blur",
- description="Use motion blur for this object",
- default=True,
- )
+ name="Use Motion Blur",
+ description="Use motion blur for this object",
+ default=True,
+ )
cls.use_deform_motion = BoolProperty(
- name="Use Deformation Motion",
- description="Use deformation motion blur for this object",
- default=True,
- )
+ name="Use Deformation Motion",
+ description="Use deformation motion blur for this object",
+ default=True,
+ )
cls.motion_steps = IntProperty(
- name="Motion Steps",
- description="Control accuracy of motion blur, more steps gives more memory usage (actual number of steps is 2^(steps - 1))",
- min=1, soft_max=8,
- default=1,
- )
+ name="Motion Steps",
+ description="Control accuracy of motion blur, more steps gives more memory usage (actual number of steps is 2^(steps - 1))",
+ min=1, soft_max=8,
+ default=1,
+ )
cls.use_camera_cull = BoolProperty(
- name="Use Camera Cull",
- description="Allow this object and its duplicators to be culled by camera space culling",
- default=False,
- )
+ name="Use Camera Cull",
+ description="Allow this object and its duplicators to be culled by camera space culling",
+ default=False,
+ )
cls.use_distance_cull = BoolProperty(
- name="Use Distance Cull",
- description="Allow this object and its duplicators to be culled by distance from camera",
- default=False,
- )
+ name="Use Distance Cull",
+ description="Allow this object and its duplicators to be culled by distance from camera",
+ default=False,
+ )
cls.use_adaptive_subdivision = BoolProperty(
- name="Use Adaptive Subdivision",
- description="Use adaptive render time subdivision",
- default=False,
- )
+ name="Use Adaptive Subdivision",
+ description="Use adaptive render time subdivision",
+ default=False,
+ )
cls.dicing_rate = FloatProperty(
- name="Dicing Scale",
- description="Multiplier for scene dicing rate (located in the Geometry Panel)",
- min=0.1, max=1000.0, soft_min=0.5,
- default=1.0,
- )
+ name="Dicing Scale",
+ description="Multiplier for scene dicing rate (located in the Geometry Panel)",
+ min=0.1, max=1000.0, soft_min=0.5,
+ default=1.0,
+ )
cls.is_shadow_catcher = BoolProperty(
- name="Shadow Catcher",
- description="Only render shadows on this object, for compositing renders into real footage",
- default=False,
- )
+ name="Shadow Catcher",
+ description="Only render shadows on this object, for compositing renders into real footage",
+ default=False,
+ )
cls.is_holdout = BoolProperty(
- name="Holdout",
- description="Render objects as a holdout or matte, creating a "
- "hole in the image with zero alpha, to fill out in "
- "compositing with real footange or another render",
- default=False,
- )
-
+ name="Holdout",
+ description="Render objects as a holdout or matte, creating a "
+ "hole in the image with zero alpha, to fill out in "
+ "compositing with real footange or another render",
+ default=False,
+ )
@classmethod
def unregister(cls):
@@ -1149,192 +1149,194 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Scene.cycles_curves = PointerProperty(
- name="Cycles Hair Rendering Settings",
- description="Cycles hair rendering settings",
- type=cls,
- )
+ name="Cycles Hair Rendering Settings",
+ description="Cycles hair rendering settings",
+ type=cls,
+ )
cls.primitive = EnumProperty(
- name="Primitive",
- description="Type of primitive used for hair rendering",
- items=enum_curve_primitives,
- default='LINE_SEGMENTS',
- )
+ name="Primitive",
+ description="Type of primitive used for hair rendering",
+ items=enum_curve_primitives,
+ default='LINE_SEGMENTS',
+ )
cls.shape = EnumProperty(
- name="Shape",
- description="Form of hair",
- items=enum_curve_shape,
- default='THICK',
- )
+ name="Shape",
+ description="Form of hair",
+ items=enum_curve_shape,
+ default='THICK',
+ )
cls.cull_backfacing = BoolProperty(
- name="Cull back-faces",
- description="Do not test the back-face of each strand",
- default=True,
- )
+ name="Cull back-faces",
+ description="Do not test the back-face of each strand",
+ default=True,
+ )
cls.use_curves = BoolProperty(
- name="Use Cycles Hair Rendering",
- description="Activate Cycles hair rendering for particle system",
- default=True,
- )
+ name="Use Cycles Hair Rendering",
+ description="Activate Cycles hair rendering for particle system",
+ default=True,
+ )
cls.resolution = IntProperty(
- name="Resolution",
- description="Resolution of generated mesh",
- min=3, max=64,
- default=3,
- )
+ name="Resolution",
+ description="Resolution of generated mesh",
+ min=3, max=64,
+ default=3,
+ )
cls.minimum_width = FloatProperty(
- name="Minimal width",
- description="Minimal pixel width for strands (0 - deactivated)",
- min=0.0, max=100.0,
- default=0.0,
- )
+ name="Minimal width",
+ description="Minimal pixel width for strands (0 - deactivated)",
+ min=0.0, max=100.0,
+ default=0.0,
+ )
cls.maximum_width = FloatProperty(
- name="Maximal width",
- description="Maximum extension that strand radius can be increased by",
- min=0.0, max=100.0,
- default=0.1,
- )
+ name="Maximal width",
+ description="Maximum extension that strand radius can be increased by",
+ min=0.0, max=100.0,
+ default=0.1,
+ )
cls.subdivisions = IntProperty(
- name="Subdivisions",
- description="Number of subdivisions used in Cardinal curve intersection (power of 2)",
- min=0, max=24,
- default=4,
- )
+ name="Subdivisions",
+ description="Number of subdivisions used in Cardinal curve intersection (power of 2)",
+ min=0, max=24,
+ default=4,
+ )
@classmethod
def unregister(cls):
del bpy.types.Scene.cycles_curves
+
def update_render_passes(self, context):
scene = context.scene
rd = scene.render
rl = rd.layers.active
rl.update_render_passes()
+
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.SceneRenderLayer.cycles = PointerProperty(
- name="Cycles SceneRenderLayer Settings",
- description="Cycles SceneRenderLayer Settings",
- type=cls,
- )
+ name="Cycles SceneRenderLayer Settings",
+ description="Cycles SceneRenderLayer Settings",
+ type=cls,
+ )
cls.pass_debug_bvh_traversed_nodes = BoolProperty(
- name="Debug BVH Traversed Nodes",
- description="Store Debug BVH Traversed Nodes pass",
- default=False,
- update=update_render_passes,
- )
+ name="Debug BVH Traversed Nodes",
+ description="Store Debug BVH Traversed Nodes pass",
+ default=False,
+ update=update_render_passes,
+ )
cls.pass_debug_bvh_traversed_instances = BoolProperty(
- name="Debug BVH Traversed Instances",
- description="Store Debug BVH Traversed Instances pass",
- default=False,
- update=update_render_passes,
- )
+ name="Debug BVH Traversed Instances",
+ description="Store Debug BVH Traversed Instances pass",
+ default=False,
+ update=update_render_passes,
+ )
cls.pass_debug_bvh_intersections = BoolProperty(
- name="Debug BVH Intersections",
- description="Store Debug BVH Intersections",
- default=False,
- update=update_render_passes,
- )
+ name="Debug BVH Intersections",
+ description="Store Debug BVH Intersections",
+ default=False,
+ update=update_render_passes,
+ )
cls.pass_debug_ray_bounces = BoolProperty(
- name="Debug Ray Bounces",
- description="Store Debug Ray Bounces pass",
- default=False,
- update=update_render_passes,
- )
+ name="Debug Ray Bounces",
+ description="Store Debug Ray Bounces pass",
+ default=False,
+ update=update_render_passes,
+ )
cls.pass_debug_render_time = BoolProperty(
- name="Debug Render Time",
- description="Render time in milliseconds per sample and pixel",
- default=False,
- update=update_render_passes,
- )
+ name="Debug Render Time",
+ description="Render time in milliseconds per sample and pixel",
+ default=False,
+ update=update_render_passes,
+ )
cls.use_pass_volume_direct = BoolProperty(
- name="Volume Direct",
- description="Deliver direct volumetric scattering pass",
- default=False,
- update=update_render_passes,
- )
+ name="Volume Direct",
+ description="Deliver direct volumetric scattering pass",
+ default=False,
+ update=update_render_passes,
+ )
cls.use_pass_volume_indirect = BoolProperty(
- name="Volume Indirect",
- description="Deliver indirect volumetric scattering pass",
- default=False,
- update=update_render_passes,
- )
+ name="Volume Indirect",
+ description="Deliver indirect volumetric scattering pass",
+ default=False,
+ update=update_render_passes,
+ )
cls.use_denoising = BoolProperty(
- name="Use Denoising",
- description="Denoise the rendered image",
- default=False,
- update=update_render_passes,
- )
+ name="Use Denoising",
+ description="Denoise the rendered image",
+ default=False,
+ update=update_render_passes,
+ )
cls.denoising_diffuse_direct = BoolProperty(
- name="Diffuse Direct",
- description="Denoise the direct diffuse lighting",
- default=True,
- )
+ name="Diffuse Direct",
+ description="Denoise the direct diffuse lighting",
+ default=True,
+ )
cls.denoising_diffuse_indirect = BoolProperty(
- name="Diffuse Indirect",
- description="Denoise the indirect diffuse lighting",
- default=True,
- )
+ name="Diffuse Indirect",
+ description="Denoise the indirect diffuse lighting",
+ default=True,
+ )
cls.denoising_glossy_direct = BoolProperty(
- name="Glossy Direct",
- description="Denoise the direct glossy lighting",
- default=True,
- )
+ name="Glossy Direct",
+ description="Denoise the direct glossy lighting",
+ default=True,
+ )
cls.denoising_glossy_indirect = BoolProperty(
- name="Glossy Indirect",
- description="Denoise the indirect glossy lighting",
- default=True,
- )
+ name="Glossy Indirect",
+ description="Denoise the indirect glossy lighting",
+ default=True,
+ )
cls.denoising_transmission_direct = BoolProperty(
- name="Transmission Direct",
- description="Denoise the direct transmission lighting",
- default=True,
- )
+ name="Transmission Direct",
+ description="Denoise the direct transmission lighting",
+ default=True,
+ )
cls.denoising_transmission_indirect = BoolProperty(
- name="Transmission Indirect",
- description="Denoise the indirect transmission lighting",
- default=True,
- )
+ name="Transmission Indirect",
+ description="Denoise the indirect transmission lighting",
+ default=True,
+ )
cls.denoising_subsurface_direct = BoolProperty(
- name="Subsurface Direct",
- description="Denoise the direct subsurface lighting",
- default=True,
- )
+ name="Subsurface Direct",
+ description="Denoise the direct subsurface lighting",
+ default=True,
+ )
cls.denoising_subsurface_indirect = BoolProperty(
- name="Subsurface Indirect",
- description="Denoise the indirect subsurface lighting",
- default=True,
- )
+ name="Subsurface Indirect",
+ description="Denoise the indirect subsurface lighting",
+ default=True,
+ )
cls.denoising_strength = FloatProperty(
- name="Denoising Strength",
- description="Controls neighbor pixel weighting for the denoising filter (lower values preserve more detail, but aren't as smooth)",
- min=0.0, max=1.0,
- default=0.5,
- )
+ name="Denoising Strength",
+ description="Controls neighbor pixel weighting for the denoising filter (lower values preserve more detail, but aren't as smooth)",
+ min=0.0, max=1.0,
+ default=0.5,
+ )
cls.denoising_feature_strength = FloatProperty(
- name="Denoising Feature Strength",
- description="Controls removal of noisy image feature passes (lower values preserve more detail, but aren't as smooth)",
- min=0.0, max=1.0,
- default=0.5,
- )
+ name="Denoising Feature Strength",
+ description="Controls removal of noisy image feature passes (lower values preserve more detail, but aren't as smooth)",
+ min=0.0, max=1.0,
+ default=0.5,
+ )
cls.denoising_radius = IntProperty(
- name="Denoising Radius",
- description="Size of the image area that's used to denoise a pixel (higher values are smoother, but might lose detail and are slower)",
- min=1, max=25,
- default=8,
+ name="Denoising Radius",
+ description="Size of the image area that's used to denoise a pixel (higher values are smoother, but might lose detail and are slower)",
+ min=1, max=25,
+ default=8,
)
cls.denoising_relative_pca = BoolProperty(
- name="Relative filter",
- description="When removing pixels that don't carry information, use a relative threshold instead of an absolute one (can help to reduce artifacts, but might cause detail loss around edges)",
- default=False,
+ name="Relative filter",
+ description="When removing pixels that don't carry information, use a relative threshold instead of an absolute one (can help to reduce artifacts, but might cause detail loss around edges)",
+ default=False,
)
cls.denoising_store_passes = BoolProperty(
- name="Store denoising passes",
- description="Store the denoising feature passes and the noisy image",
- default=False,
- update=update_render_passes,
+ name="Store denoising passes",
+ description="Store the denoising feature passes and the noisy image",
+ default=False,
+ update=update_render_passes,
)
@classmethod
@@ -1346,39 +1348,39 @@ class CyclesCurveSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.ParticleSettings.cycles = PointerProperty(
- name="Cycles Hair Settings",
- description="Cycles hair settings",
- type=cls,
- )
+ name="Cycles Hair Settings",
+ description="Cycles hair settings",
+ type=cls,
+ )
cls.radius_scale = FloatProperty(
- name="Radius Scaling",
- description="Multiplier of width properties",
- min=0.0, max=1000.0,
- default=0.01,
- )
+ name="Radius Scaling",
+ description="Multiplier of width properties",
+ min=0.0, max=1000.0,
+ default=0.01,
+ )
cls.root_width = FloatProperty(
- name="Root Size",
- description="Strand's width at root",
- min=0.0, max=1000.0,
- default=1.0,
- )
+ name="Root Size",
+ description="Strand's width at root",
+ min=0.0, max=1000.0,
+ default=1.0,
+ )
cls.tip_width = FloatProperty(
- name="Tip Multiplier",
- description="Strand's width at tip",
- min=0.0, max=1000.0,
- default=0.0,
- )
+ name="Tip Multiplier",
+ description="Strand's width at tip",
+ min=0.0, max=1000.0,
+ default=0.0,
+ )
cls.shape = FloatProperty(
- name="Strand Shape",
- description="Strand shape parameter",
- min=-1.0, max=1.0,
- default=0.0,
- )
+ name="Strand Shape",
+ description="Strand shape parameter",
+ min=-1.0, max=1.0,
+ default=0.0,
+ )
cls.use_closetip = BoolProperty(
- name="Close tip",
- description="Set tip radius to zero",
- default=True,
- )
+ name="Close tip",
+ description="Set tip radius to zero",
+ default=True,
+ )
@classmethod
def unregister(cls):
@@ -1408,10 +1410,10 @@ class CyclesPreferences(bpy.types.AddonPreferences):
return list
compute_device_type = EnumProperty(
- name="Compute Device Type",
- description="Device to use for computation (rendering with Cycles)",
- items=get_device_types,
- )
+ name="Compute Device Type",
+ description="Device to use for computation (rendering with Cycles)",
+ items=get_device_types,
+ )
devices = bpy.props.CollectionProperty(type=CyclesDeviceSettings)
@@ -1421,7 +1423,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
return device_entry
return None
-
def update_device_entries(self, device_list):
for device in device_list:
if not device[1] in {'CUDA', 'OPENCL', 'CPU'}:
@@ -1431,15 +1432,14 @@ class CyclesPreferences(bpy.types.AddonPreferences):
if not entry:
# Create new entry if no existing one was found
entry = self.devices.add()
- entry.id = device[2]
+ entry.id = device[2]
entry.name = device[0]
entry.type = device[1]
- entry.use = entry.type != 'CPU'
+ entry.use = entry.type != 'CPU'
elif entry.name != device[0]:
# Update name in case it changed
entry.name = device[0]
-
def get_devices(self):
import _cycles
# Layout of the device tuples: (Name, Type, Persistent ID)
@@ -1465,7 +1465,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
opencl_devices.extend(cpu_devices)
return cuda_devices, opencl_devices
-
def get_num_gpu_devices(self):
import _cycles
device_list = _cycles.available_devices()
@@ -1478,11 +1477,9 @@ class CyclesPreferences(bpy.types.AddonPreferences):
num += 1
return num
-
def has_active_device(self):
return self.get_num_gpu_devices() > 0
-
def draw_impl(self, layout, context):
layout.label(text="Cycles Compute Device:")
layout.row().prop(self, "compute_device_type", expand=True)
@@ -1500,7 +1497,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
for device in opencl_devices:
box.prop(device, "use", text=device.name)
-
def draw(self, context):
self.draw_impl(self.layout, context)
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 2b11a2eefb0..5edbcb19672 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -19,10 +19,10 @@
import bpy
from bpy.types import (
- Panel,
- Menu,
- Operator,
- )
+ Panel,
+ Menu,
+ Operator,
+)
class CYCLES_MT_sampling_presets(Menu):
@@ -86,6 +86,7 @@ def use_sample_all_lights(context):
return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
+
def show_device_active(context):
cscene = context.scene.cycles
if cscene.device != 'GPU':
@@ -965,9 +966,9 @@ class CYCLES_LAMP_PT_preview(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
return context.lamp and \
- not (context.lamp.type == 'AREA' and
- context.lamp.cycles.is_portal) \
- and CyclesButtonsPanel.poll(context)
+ not (context.lamp.type == 'AREA' and
+ context.lamp.cycles.is_portal) \
+ and CyclesButtonsPanel.poll(context)
def draw(self, context):
self.layout.template_preview(context.lamp)
@@ -1035,7 +1036,7 @@ class CYCLES_LAMP_PT_nodes(CyclesButtonsPanel, Panel):
def poll(cls, context):
return context.lamp and not (context.lamp.type == 'AREA' and
context.lamp.cycles.is_portal) and \
- CyclesButtonsPanel.poll(context)
+ CyclesButtonsPanel.poll(context)
def draw(self, context):
layout = self.layout
@@ -1741,6 +1742,7 @@ class CYCLES_SCENE_PT_simplify(CyclesButtonsPanel, Panel):
col = split.column()
col.prop(cscene, "ao_bounces_render")
+
def draw_device(self, context):
scene = context.scene
layout = self.layout
@@ -1823,7 +1825,7 @@ def get_panels():
'WORLD_PT_mist',
'WORLD_PT_preview',
'WORLD_PT_world'
- }
+ }
panels = []
for panel in bpy.types.Panel.__subclasses__():
diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py
index f9f0b5fb59d..f14fe9abc3d 100644
--- a/intern/cycles/blender/addon/version_update.py
+++ b/intern/cycles/blender/addon/version_update.py
@@ -75,19 +75,25 @@ def foreach_cycles_node(callback):
traversed = set()
for material in bpy.data.materials:
if check_is_new_shading_material(material):
- foreach_notree_node(material.node_tree,
- callback,
- traversed)
+ foreach_notree_node(
+ material.node_tree,
+ callback,
+ traversed,
+ )
for world in bpy.data.worlds:
if check_is_new_shading_world(world):
- foreach_notree_node(world.node_tree,
- callback,
- traversed)
+ foreach_notree_node(
+ world.node_tree,
+ callback,
+ traversed,
+ )
for lamp in bpy.data.lamps:
if check_is_new_shading_world(lamp):
- foreach_notree_node(lamp.node_tree,
- callback,
- traversed)
+ foreach_notree_node(
+ lamp.node_tree,
+ callback,
+ traversed,
+ )
def displacement_node_insert(material, nodetree, traversed):
@@ -102,10 +108,12 @@ def displacement_node_insert(material, nodetree, traversed):
# Gather links to replace
displacement_links = []
for link in nodetree.links:
- if link.to_node.bl_idname == 'ShaderNodeOutputMaterial' and \
- link.from_node.bl_idname != 'ShaderNodeDisplacement' and \
- link.to_socket.identifier == 'Displacement':
- displacement_links.append(link)
+ if (
+ link.to_node.bl_idname == 'ShaderNodeOutputMaterial' and
+ link.from_node.bl_idname != 'ShaderNodeDisplacement' and
+ link.to_socket.identifier == 'Displacement'
+ ):
+ displacement_links.append(link)
# Replace links with displacement node
for link in displacement_links:
@@ -117,20 +125,22 @@ def displacement_node_insert(material, nodetree, traversed):
nodetree.links.remove(link)
node = nodetree.nodes.new(type='ShaderNodeDisplacement')
- node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0]);
- node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1]);
+ node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0])
+ node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1])
node.inputs['Scale'].default_value = 0.1
node.inputs['Midlevel'].default_value = 0.0
nodetree.links.new(from_socket, node.inputs['Height'])
nodetree.links.new(node.outputs['Displacement'], to_socket)
+
def displacement_nodes_insert():
traversed = set()
for material in bpy.data.materials:
if check_is_new_shading_material(material):
displacement_node_insert(material, material.node_tree, traversed)
+
def displacement_principled_nodes(node):
if node.bl_idname == 'ShaderNodeDisplacement':
if node.space != 'WORLD':
@@ -139,6 +149,7 @@ def displacement_principled_nodes(node):
if node.subsurface_method != 'RANDOM_WALK':
node.subsurface_method = 'BURLEY'
+
def square_roughness_node_insert(material, nodetree, traversed):
if nodetree in traversed:
return
@@ -163,7 +174,7 @@ def square_roughness_node_insert(material, nodetree, traversed):
for link in nodetree.links:
if link.to_node.bl_idname in roughness_node_types and \
link.to_socket.identifier == 'Roughness':
- roughness_links.append(link)
+ roughness_links.append(link)
# Replace links with sqrt node
for link in roughness_links:
@@ -176,13 +187,14 @@ def square_roughness_node_insert(material, nodetree, traversed):
node = nodetree.nodes.new(type='ShaderNodeMath')
node.operation = 'POWER'
- node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0]);
- node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1]);
+ node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0])
+ node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1])
nodetree.links.new(from_socket, node.inputs[0])
node.inputs[1].default_value = 0.5
nodetree.links.new(node.outputs['Value'], to_socket)
+
def square_roughness_nodes_insert():
traversed = set()
for material in bpy.data.materials:
@@ -288,7 +300,7 @@ def ambient_occlusion_node_relink(material, nodetree, traversed):
ao_links = []
for link in nodetree.links:
if link.from_node.bl_idname == 'ShaderNodeAmbientOcclusion':
- ao_links.append(link)
+ ao_links.append(link)
# Replace links
for link in ao_links:
@@ -298,6 +310,7 @@ def ambient_occlusion_node_relink(material, nodetree, traversed):
nodetree.links.remove(link)
nodetree.links.new(from_node.outputs['Color'], to_socket)
+
def ambient_occlusion_nodes_relink():
traversed = set()
for material in bpy.data.materials:
@@ -335,9 +348,11 @@ def do_versions(self):
for scene in bpy.data.scenes:
cscene = scene.cycles
sample_clamp = cscene.get("sample_clamp", False)
- if (sample_clamp and
+ if (
+ sample_clamp and
not cscene.is_property_set("sample_clamp_direct") and
- not cscene.is_property_set("sample_clamp_indirect")):
+ not cscene.is_property_set("sample_clamp_indirect")
+ ):
cscene.sample_clamp_direct = sample_clamp
cscene.sample_clamp_indirect = sample_clamp
@@ -353,10 +368,11 @@ def do_versions(self):
if bpy.data.version <= (2, 72, 0):
for scene in bpy.data.scenes:
cscene = scene.cycles
- if (cscene.get("no_caustics", False) and
+ if (
+ cscene.get("no_caustics", False) and
not cscene.is_property_set("caustics_reflective") and
- not cscene.is_property_set("caustics_refractive")):
-
+ not cscene.is_property_set("caustics_refractive")
+ ):
cscene.caustics_reflective = False
cscene.caustics_refractive = False