lib/glitch3d/bpy/canvas/dreamatorium.py in glitch3d-0.5.0.0 vs lib/glitch3d/bpy/canvas/dreamatorium.py in glitch3d-0.5.0.1

- old
+ new

@@ -6,11 +6,11 @@ class Dreamatorium(canvas.Canvas): def render(self): props = [] bpy.ops.import_scene.obj(filepath = os.path.join(self.MODELS_FOLDER_PATH + 'lightning.obj'), use_edges=True) logo = bpy.context.selected_objects[0] - logo.location = self.rand_location(self.CANVAS_BOUNDARY) + logo.location = helpers.rand_location(self.CANVAS_BOUNDARY) props.append(logo) bpy.ops.mesh.primitive_grid_add(x_subdivisions=100, y_subdivisions=100, location=(0, 6, 2)) display1 = bpy.context.object display1.name = 'display_1' @@ -40,17 +40,16 @@ bpy.data.groups['lines'].objects.link(new_line) new_line.location.z += i / 3 props.append(new_line) ocean = self.add_ocean(10, 20) - helpers.apply_displacement(ocean, self.HEIGHT_MAP_FOLDER_PATH) for index in range(1, 5): new_object = helpers.spawn_text(self.TEXT_FILE_PATH) bpy.data.groups['texts'].objects.link(new_object) props.append(new_object) - self.assign_material(new_object, helpers.random_material(self.MATERIALS_NAMES)) + helpers.assign_material(new_object, helpers.random_material(self.MATERIALS_NAMES)) text_scale = random.uniform(0.75, 3) new_object.scale = (text_scale, text_scale, text_scale) new_object.location = helpers.rand_location(self.CANVAS_BOUNDARY) props.append(new_object) @@ -61,22 +60,17 @@ bpy.context.scene.frame_set(f) for prop in props: helpers.shuffle(prop, self.CANVAS_BOUNDARY) helpers.assign_material(prop, helpers.random_material(self.MATERIALS_NAMES)) - def add_ocean(self, spatial_size, resolution, depth = 100, scale=(4,4,4), wave_scale = 0.5): bpy.ops.mesh.primitive_cube_add(location=(0, 0, -0.4),radius=1) ocean = bpy.context.object ocean.scale = scale ocean.modifiers.new(name='Ocean', type='OCEAN') ocean.modifiers["Ocean"].spatial_size = spatial_size ocean.modifiers["Ocean"].resolution = resolution ocean.modifiers["Ocean"].wave_scale = wave_scale ocean.modifiers["Ocean"].depth = depth - helpers.assign_material(ocean, helpers.fetch_material("jello")) - shadow = helpers.duplicate_object(ocean) - shadow.location += mathutils.Vector((1,1,-0.4)) - helpers.wireframize(shadow, random.choice(self.COLORS)) - shadow.name = 'shadow' + helpers.wireframize(ocean, random.choice(self.COLORS)) ocean.name = 'ocean' return ocean