minor cycles edits

- use sets rather then tuples
- use relative imports
This commit is contained in:
Campbell Barton 2011-11-27 03:49:09 +00:00
parent 8423b1b33a
commit 42d50c75fa
5 changed files with 14 additions and 17 deletions

@ -33,12 +33,7 @@ bl_info = {
"category": "Render"}
import bpy
from cycles import ui
from cycles import properties
from cycles import xml
from cycles import engine
from cycles import presets
from . import ui, properties, xml, engine, presets
class CyclesRender(bpy.types.RenderEngine):

@ -56,7 +56,7 @@ def free(engine):
def render(engine):
import bcycles
if "session" in dir(engine):
if hasattr(engine, "session"):
bcycles.render(engine.session)

@ -18,7 +18,7 @@
# <pep8 compliant>
from cycles import engine
from . import engine
def get_gpu_device():

@ -27,7 +27,7 @@ from bpy.props import (BoolProperty,
import math
from cycles import enums
from . import enums
class CyclesRenderSettings(bpy.types.PropertyGroup):

@ -22,8 +22,7 @@ import bpy
from bpy.types import Panel, Menu
from cycles import enums
from cycles import engine
from . import enums, engine
class CYCLES_MT_integrator_presets(Menu):
@ -324,7 +323,7 @@ class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
ob = context.object
return CyclesButtonsPanel.poll(context) and ob and ob.type in ('MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META') # todo: 'LAMP'
return CyclesButtonsPanel.poll(context) and ob and ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META'} # todo: 'LAMP'
def draw(self, context):
layout = self.layout
@ -399,7 +398,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
split = layout.split()
col = split.column(align=True)
if lamp.type in ('POINT', 'SUN', 'SPOT'):
if lamp.type in {'POINT', 'SUN', 'SPOT'}:
col.prop(lamp, "shadow_soft_size", text="Size")
elif lamp.type == 'AREA':
col.prop(lamp, "shape", text="")
@ -460,7 +459,8 @@ class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
# world = context.world
return False # world and world.node_tree and CyclesButtonsPanel.poll(context)
# world and world.node_tree and CyclesButtonsPanel.poll(context)
return False
def draw(self, context):
layout = self.layout
@ -494,7 +494,8 @@ class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
# mat = context.material
return False # mat and mat.node_tree and CyclesButtonsPanel.poll(context)
# mat and mat.node_tree and CyclesButtonsPanel.poll(context)
return False
def draw(self, context):
layout = self.layout
@ -730,7 +731,7 @@ def draw_pause(self, context):
def get_panels():
return [
return (
bpy.types.RENDER_PT_render,
bpy.types.RENDER_PT_output,
bpy.types.RENDER_PT_encoding,
@ -782,7 +783,8 @@ def get_panels():
bpy.types.PARTICLE_PT_field_weights,
bpy.types.PARTICLE_PT_force_fields,
bpy.types.PARTICLE_PT_vertexgroups,
bpy.types.PARTICLE_PT_custom_props]
bpy.types.PARTICLE_PT_custom_props,
)
def register():