Cycles: shuffle addon import statements a bit to try to fix a strange import
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 13 Dec 2012 08:45:55 +0000 (08:45 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 13 Dec 2012 08:45:55 +0000 (08:45 +0000)
error in some builds.

intern/cycles/blender/CMakeLists.txt
intern/cycles/blender/addon/__init__.py
intern/cycles/blender/addon/engine.py
intern/cycles/blender/addon/enums.py [deleted file]
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py

index 292c37d6b6174f180c8c0033a2564163a9b97831..88363758364bf31997c7c1c02de885418679f173 100644 (file)
@@ -38,7 +38,6 @@ set(SRC
 set(ADDON_FILES
        addon/__init__.py
        addon/engine.py 
 set(ADDON_FILES
        addon/__init__.py
        addon/engine.py 
-       addon/enums.py
        addon/osl.py
        addon/presets.py
        addon/properties.py
        addon/osl.py
        addon/presets.py
        addon/properties.py
index 0fad2ac561845bb4455284f63d86eec83ab3853f..6d1b6d4f56efb91c23476f2666098c05127764dc 100644 (file)
@@ -21,7 +21,7 @@
 bl_info = {
     "name": "Cycles Render Engine",
     "author": "",
 bl_info = {
     "name": "Cycles Render Engine",
     "author": "",
-    "blender": (2, 6, 3),
+    "blender": (2, 6, 5),
     "location": "Info header, render engine menu",
     "description": "Cycles Render Engine integration",
     "warning": "",
     "location": "Info header, render engine menu",
     "description": "Cycles Render Engine integration",
     "warning": "",
@@ -31,8 +31,8 @@ bl_info = {
     "category": "Render"}
 
 import bpy
     "category": "Render"}
 
 import bpy
-from . import ui, properties, engine, presets
 
 
+from . import engine
 
 class CyclesRender(bpy.types.RenderEngine):
     bl_idname = 'CYCLES'
 
 class CyclesRender(bpy.types.RenderEngine):
     bl_idname = 'CYCLES'
@@ -84,6 +84,10 @@ class CyclesRender(bpy.types.RenderEngine):
 
 
 def register():
 
 
 def register():
+    from . import ui
+    from . import properties
+    from . import presets
+
     properties.register()
     ui.register()
     presets.register()
     properties.register()
     ui.register()
     presets.register()
@@ -91,6 +95,10 @@ def register():
 
 
 def unregister():
 
 
 def unregister():
+    from . import ui
+    from . import properties
+    from . import presets
+
     ui.unregister()
     properties.unregister()
     presets.unregister()
     ui.unregister()
     properties.unregister()
     presets.unregister()
index ca5cbee9325d0cc16bc5bde167e04a5a5ed579b6..9641128d994a1835cce16b3436ca0737876f83b3 100644 (file)
 
 # <pep8 compliant>
 
 
 # <pep8 compliant>
 
-import bpy
-
-
 def init():
 def init():
+    import bpy
     import _cycles
     import os.path
 
     import _cycles
     import os.path
 
@@ -32,6 +30,7 @@ def init():
 
 
 def create(engine, data, scene, region=0, v3d=0, rv3d=0):
 
 
 def create(engine, data, scene, region=0, v3d=0, rv3d=0):
+    import bpy
     import _cycles
 
     data = data.as_pointer()
     import _cycles
 
     data = data.as_pointer()
diff --git a/intern/cycles/blender/addon/enums.py b/intern/cycles/blender/addon/enums.py
deleted file mode 100644 (file)
index 82b4897..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Copyright 2011, Blender Foundation.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-
-# <pep8 compliant>
-
-from . import engine
-
-devices = (
-    ('CPU', "CPU", "Use CPU for rendering"),
-    ('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"))
-
-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"),
-    )
-
-shading_systems = (
-    ('GPU_COMPATIBLE', "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
-    ('OSL', "Open Shading Language", "Open Shading Language shading system that only runs on the CPU"),
-    )
-
-displacement_methods = (
-    ('BUMP', "Bump", "Bump mapping to simulate the appearance of displacement"),
-    ('TRUE', "True", "Use true displacement only, requires fine subdivision"),
-    ('BOTH', "Both", "Combination of displacement and bump mapping"),
-    )
-
-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"),
-    )
-
-filter_types = (
-    ('BOX', "Box", "Box filter"),
-    ('GAUSSIAN', "Gaussian", "Gaussian filter"),
-    )
-
-aperture_types = (
-    ('RADIUS', "Radius", "Directly change the size of the aperture"),
-    ('FSTOP', "F/stop", "Change the size of the aperture by f/stops"),
-    )
-
-panorama_types = (
-    ('EQUIRECTANGULAR', "Equirectangular", "Render the scene with a spherical camera, also known as Lat Long panorama"),
-    ('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"),
-    ('FISHEYE_EQUISOLID', "Fisheye Equisolid",
-                          "Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
-    )
index 0b8ca6e0fbecff7159479fc973b489ab1f997559..ae4b7e3cc9206f83475e8d968773cb2fe8193187 100644 (file)
@@ -25,10 +25,49 @@ from bpy.props import (BoolProperty,
                        IntProperty,
                        PointerProperty)
 
                        IntProperty,
                        PointerProperty)
 
-import math
-
-from . import enums
-
+# enums
+
+enum_devices = (
+    ('CPU', "CPU", "Use CPU for rendering"),
+    ('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"))
+
+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"),
+    )
+
+enum_shading_systems = (
+    ('GPU_COMPATIBLE', "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
+    ('OSL', "Open Shading Language", "Open Shading Language shading system that only runs on the CPU"),
+    )
+
+enum_displacement_methods = (
+    ('BUMP', "Bump", "Bump mapping to simulate the appearance of displacement"),
+    ('TRUE', "True", "Use true displacement only, requires fine subdivision"),
+    ('BOTH', "Both", "Combination of displacement and bump mapping"),
+    )
+
+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"),
+    )
+
+enum_aperture_types = (
+    ('RADIUS', "Radius", "Directly change the size of the aperture"),
+    ('FSTOP', "F/stop", "Change the size of the aperture by f/stops"),
+    )
+
+enum_panorama_types = (
+    ('EQUIRECTANGULAR', "Equirectangular", "Render the scene with a spherical camera, also known as Lat Long panorama"),
+    ('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"),
+    ('FISHEYE_EQUISOLID', "Fisheye Equisolid",
+                          "Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
+    )
 
 class CyclesRenderSettings(bpy.types.PropertyGroup):
     @classmethod
 
 class CyclesRenderSettings(bpy.types.PropertyGroup):
     @classmethod
@@ -41,19 +80,19 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         cls.device = EnumProperty(
                 name="Device",
                 description="Device to use for rendering",
         cls.device = EnumProperty(
                 name="Device",
                 description="Device to use for rendering",
-                items=enums.devices,
+                items=enum_devices,
                 default='CPU',
                 )
         cls.feature_set = EnumProperty(
                 name="Feature Set",
                 description="Feature set to use for rendering",
                 default='CPU',
                 )
         cls.feature_set = EnumProperty(
                 name="Feature Set",
                 description="Feature set to use for rendering",
-                items=enums.feature_set,
+                items=enum_feature_set,
                 default='SUPPORTED',
                 )
         cls.shading_system = EnumProperty(
                 name="Shading System",
                 description="Shading system to use for rendering",
                 default='SUPPORTED',
                 )
         cls.shading_system = EnumProperty(
                 name="Shading System",
                 description="Shading system to use for rendering",
-                items=enums.shading_systems,
+                items=enum_shading_systems,
                 default='GPU_COMPATIBLE',
                 )
 
                 default='GPU_COMPATIBLE',
                 )
 
@@ -212,7 +251,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         cls.filter_type = EnumProperty(
                 name="Filter Type",
                 description="Pixel filter type",
         cls.filter_type = EnumProperty(
                 name="Filter Type",
                 description="Pixel filter type",
-                items=enums.filter_types,
+                items=enum_filter_types,
                 default='GAUSSIAN',
                 )
         cls.filter_width = FloatProperty(
                 default='GAUSSIAN',
                 )
         cls.filter_width = FloatProperty(
@@ -275,7 +314,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         cls.debug_bvh_type = EnumProperty(
                 name="Viewport BVH Type",
                 description="Choose between faster updates, or faster render",
         cls.debug_bvh_type = EnumProperty(
                 name="Viewport BVH Type",
                 description="Choose between faster updates, or faster render",
-                items=enums.bvh_types,
+                items=enum_bvh_types,
                 default='DYNAMIC_BVH',
                 )
         cls.debug_use_spatial_splits = BoolProperty(
                 default='DYNAMIC_BVH',
                 )
         cls.debug_use_spatial_splits = BoolProperty(
@@ -305,6 +344,8 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
 class CyclesCameraSettings(bpy.types.PropertyGroup):
     @classmethod
     def register(cls):
 class CyclesCameraSettings(bpy.types.PropertyGroup):
     @classmethod
     def register(cls):
+        import math
+
         bpy.types.Camera.cycles = PointerProperty(
                 name="Cycles Camera Settings",
                 description="Cycles camera settings",
         bpy.types.Camera.cycles = PointerProperty(
                 name="Cycles Camera Settings",
                 description="Cycles camera settings",
@@ -314,7 +355,7 @@ class CyclesCameraSettings(bpy.types.PropertyGroup):
         cls.aperture_type = EnumProperty(
                 name="Aperture Type",
                 description="Use F/stop number or aperture radius",
         cls.aperture_type = EnumProperty(
                 name="Aperture Type",
                 description="Use F/stop number or aperture radius",
-                items=enums.aperture_types,
+                items=enum_aperture_types,
                 default='RADIUS',
                 )
         cls.aperture_fstop = FloatProperty(
                 default='RADIUS',
                 )
         cls.aperture_fstop = FloatProperty(
@@ -349,7 +390,7 @@ class CyclesCameraSettings(bpy.types.PropertyGroup):
         cls.panorama_type = EnumProperty(
                 name="Panorama Type",
                 description="Distortion to use for the calculation",
         cls.panorama_type = EnumProperty(
                 name="Panorama Type",
                 description="Distortion to use for the calculation",
-                items=enums.panorama_types,
+                items=enum_panorama_types,
                 default='FISHEYE_EQUISOLID',
                 )
         cls.fisheye_fov = FloatProperty(
                 default='FISHEYE_EQUISOLID',
                 )
         cls.fisheye_fov = FloatProperty(
@@ -518,7 +559,7 @@ class CyclesMeshSettings(bpy.types.PropertyGroup):
         cls.displacement_method = EnumProperty(
                 name="Displacement Method",
                 description="Method to use for the displacement",
         cls.displacement_method = EnumProperty(
                 name="Displacement Method",
                 description="Method to use for the displacement",
-                items=enums.displacement_methods,
+                items=enum_displacement_methods,
                 default='BUMP',
                 )
         cls.use_subdivision = BoolProperty(
                 default='BUMP',
                 )
         cls.use_subdivision = BoolProperty(
index ba931469e8a3842355586946e496382d7e937dad..66f99beeb9731aa64a0499286227491909b60501 100644 (file)
@@ -22,8 +22,6 @@ import bpy
 
 from bpy.types import Panel, Menu
 
 
 from bpy.types import Panel, Menu
 
-from . import enums, engine
-
 
 class CYCLES_MT_integrator_presets(Menu):
     bl_label = "Integrator Presets"
 
 class CYCLES_MT_integrator_presets(Menu):
     bl_label = "Integrator Presets"
@@ -947,6 +945,7 @@ def draw_device(self, context):
     layout = self.layout
 
     if scene.render.engine == 'CYCLES':
     layout = self.layout
 
     if scene.render.engine == 'CYCLES':
+        from . import engine
         cscene = scene.cycles
 
         layout.prop(cscene, "feature_set")
         cscene = scene.cycles
 
         layout.prop(cscene, "feature_set")