diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-02 03:15:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-02 04:59:16 +0300 |
commit | 41d2d6da0c96d351b47acb64d3e0decdba16cb16 (patch) | |
tree | 8f955ed71d907ab9f7ee97627a9a7c91192d139a /intern/cycles/blender | |
parent | bab9de2a52929fe2b45ecddb1eb09da3378e303b (diff) |
Cleanup: pep8 (indentation, spacing, long lines)
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/addon/engine.py | 3 | ||||
-rw-r--r-- | intern/cycles/blender/addon/operators.py | 8 | ||||
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 32 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 45 | ||||
-rw-r--r-- | intern/cycles/blender/addon/version_update.py | 8 |
5 files changed, 55 insertions, 41 deletions
diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index a50b733eda2..54221d3f1e0 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -150,8 +150,7 @@ def create(engine, data, region=None, v3d=None, rv3d=None, preview_osl=False): screen = screen or rv3d.id_data.as_pointer() rv3d = rv3d.as_pointer() - engine.session = _cycles.create( - engine.as_pointer(), prefs, data, screen, region, v3d, rv3d, preview_osl) + engine.session = _cycles.create(engine.as_pointer(), prefs, data, screen, region, v3d, rv3d, preview_osl) def free(engine): diff --git a/intern/cycles/blender/addon/operators.py b/intern/cycles/blender/addon/operators.py index 895e1a83c66..2045f6ab780 100644 --- a/intern/cycles/blender/addon/operators.py +++ b/intern/cycles/blender/addon/operators.py @@ -46,8 +46,8 @@ class CYCLES_OT_use_shading_nodes(Operator): class CYCLES_OT_add_aov(bpy.types.Operator): """Add an AOV pass""" - bl_idname="cycles.add_aov" - bl_label="Add AOV" + bl_idname = "cycles.add_aov" + bl_label = "Add AOV" def execute(self, context): view_layer = context.view_layer @@ -61,8 +61,8 @@ class CYCLES_OT_add_aov(bpy.types.Operator): class CYCLES_OT_remove_aov(bpy.types.Operator): """Remove an AOV pass""" - bl_idname="cycles.remove_aov" - bl_label="Remove AOV" + bl_idname = "cycles.remove_aov" + bl_label = "Remove AOV" def execute(self, context): view_layer = context.view_layer diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 3d4dafb43ad..d29f709263e 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -143,7 +143,7 @@ enum_texture_limit = ( ('8192', "8192", "Limit texture size to 8192 pixels", 7), ) -enum_view3d_shading_render_pass= ( +enum_view3d_shading_render_pass = ( ('', "General", ""), ('COMBINED', "Combined", "Show the Combined Render pass", 1), @@ -417,18 +417,18 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): ) min_light_bounces: IntProperty( - name="Min Light Bounces", - description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, " - "but can also be less efficient for more complex geometry like hair and volumes", - min=0, max=1024, - default=0, + name="Min Light Bounces", + description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, " + "but can also be less efficient for more complex geometry like hair and volumes", + min=0, max=1024, + default=0, ) min_transparent_bounces: IntProperty( - name="Min Transparent Bounces", - description="Minimum number of transparent bounces. Setting this higher reduces noise in the first bounces, " - "but can also be less efficient for more complex geometry like hair and volumes", - min=0, max=1024, - default=0, + name="Min Transparent Bounces", + description="Minimum number of transparent bounces. Setting this higher reduces noise in the first bounces, " + "but can also be less efficient for more complex geometry like hair and volumes", + min=0, max=1024, + default=0, ) caustics_reflective: BoolProperty( @@ -1473,31 +1473,31 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): description="Render cryptomatte object pass, for isolating objects in compositing", default=False, update=update_render_passes, - ) + ) use_pass_crypto_material: BoolProperty( name="Cryptomatte Material", description="Render cryptomatte material pass, for isolating materials in compositing", default=False, update=update_render_passes, - ) + ) use_pass_crypto_asset: BoolProperty( name="Cryptomatte Asset", description="Render cryptomatte asset pass, for isolating groups of objects with the same parent", default=False, update=update_render_passes, - ) + ) pass_crypto_depth: IntProperty( name="Cryptomatte Levels", description="Sets how many unique objects can be distinguished per pixel", default=6, min=2, max=16, step=2, update=update_render_passes, - ) + ) pass_crypto_accurate: BoolProperty( name="Cryptomatte Accurate", description="Generate a more accurate Cryptomatte pass. CPU only, may render slower and use more memory", default=True, update=update_render_passes, - ) + ) aovs: CollectionProperty( type=CyclesAOVPass, diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 11c89a70ad9..72d98e78c4d 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -711,9 +711,9 @@ class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Pa if use_cpu(context): use_embree = _cycles.with_embree if not use_embree: - sub = col.column(align=True) - sub.label(text="Cycles built without Embree support") - sub.label(text="CPU raytracing performance will be poor") + sub = col.column(align=True) + sub.label(text="Cycles built without Embree support") + sub.label(text="CPU raytracing performance will be poor") col.prop(cscene, "debug_use_spatial_splits") sub = col.column() @@ -843,8 +843,6 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, Panel): col.prop(cycles_view_layer, "pass_debug_render_time", text="Render Time") col.prop(cycles_view_layer, "pass_debug_sample_count", text="Sample Count") - - layout.prop(view_layer, "pass_alpha_threshold") @@ -959,7 +957,15 @@ class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, Panel): row = layout.row() col = row.column() - col.template_list("CYCLES_RENDER_UL_aov", "aovs", cycles_view_layer, "aovs", cycles_view_layer, "active_aov", rows=2) + col.template_list( + "CYCLES_RENDER_UL_aov", + "aovs", + cycles_view_layer, + "aovs", + cycles_view_layer, + "active_aov", + rows=2, + ) col = row.column() sub = col.column(align=True) @@ -967,9 +973,9 @@ class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, Panel): sub.operator("cycles.remove_aov", icon='REMOVE', text="") if cycles_view_layer.active_aov < len(cycles_view_layer.aovs): - active_aov = cycles_view_layer.aovs[cycles_view_layer.active_aov] - if active_aov.conflict: - layout.label(text=active_aov.conflict, icon='ERROR') + active_aov = cycles_view_layer.aovs[cycles_view_layer.active_aov] + if active_aov.conflict: + layout.label(text=active_aov.conflict, icon='ERROR') class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel): @@ -1222,7 +1228,7 @@ class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel): def has_geometry_visibility(ob): return ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or - (ob.instance_type == 'COLLECTION' and ob.instance_collection)) + (ob.instance_type == 'COLLECTION' and ob.instance_collection)) class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel): @@ -1232,7 +1238,7 @@ class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): - return CyclesButtonsPanel.poll(context) and (context.object) + return CyclesButtonsPanel.poll(context) and (context.object) def draw(self, context): layout = self.layout @@ -1255,7 +1261,7 @@ class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): - return CyclesButtonsPanel.poll(context) and (context.object) + return CyclesButtonsPanel.poll(context) and (context.object) def draw(self, context): layout = self.layout @@ -1865,6 +1871,7 @@ class CYCLES_RENDER_PT_bake_influence(CyclesButtonsPanel, Panel): bl_context = "render" bl_parent_id = "CYCLES_RENDER_PT_bake" COMPAT_ENGINES = {'CYCLES'} + @classmethod def poll(cls, context): scene = context.scene @@ -2150,8 +2157,10 @@ class CYCLES_VIEW3D_PT_shading_render_pass(Panel): @classmethod def poll(cls, context): - return (context.engine in cls.COMPAT_ENGINES - and context.space_data.shading.type == 'RENDERED') + return ( + context.engine in cls.COMPAT_ENGINES and + context.space_data.shading.type == 'RENDERED' + ) def draw(self, context): shading = context.space_data.shading @@ -2169,8 +2178,10 @@ class CYCLES_VIEW3D_PT_shading_lighting(Panel): @classmethod def poll(cls, context): - return (context.engine in cls.COMPAT_ENGINES - and context.space_data.shading.type == 'RENDERED') + return ( + context.engine in cls.COMPAT_ENGINES and + context.space_data.shading.type == 'RENDERED' + ) def draw(self, context): layout = self.layout @@ -2199,12 +2210,14 @@ class CYCLES_VIEW3D_PT_shading_lighting(Panel): col.prop(shading, "studiolight_intensity") col.prop(shading, "studiolight_background_alpha") + class CYCLES_VIEW3D_PT_simplify_greasepencil(CyclesButtonsPanel, Panel, GreasePencilSimplifyPanel): bl_label = "Grease Pencil" bl_parent_id = "CYCLES_RENDER_PT_simplify" COMPAT_ENGINES = {'CYCLES'} bl_options = {'DEFAULT_CLOSED'} + def draw_device(self, context): scene = context.scene layout = self.layout diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index 49f23f4ba30..f7e3e693858 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -137,9 +137,11 @@ def do_versions(self): # Caustics Reflective/Refractive separation in 272 if version <= (2, 72, 0): cscene = scene.cycles - if (cscene.get("no_caustics", False) and - not cscene.is_property_set("caustics_reflective") and - not cscene.is_property_set("caustics_refractive")): + if ( + cscene.get("no_caustics", False) and + not cscene.is_property_set("caustics_reflective") and + not cscene.is_property_set("caustics_refractive") + ): cscene.caustics_reflective = False cscene.caustics_refractive = False |