Changeset View
Changeset View
Standalone View
Standalone View
light_field_tools/light_field_tools.py
| Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | def createCameraMultiple(self): | ||||
| cam.location = vert[0] | cam.location = vert[0] | ||||
| # rotation | # rotation | ||||
| cam.rotation_euler = self.baseObject.rotation_euler | cam.rotation_euler = self.baseObject.rotation_euler | ||||
| # set camera props | # set camera props | ||||
| cam.data.angle = scene.lightfield.angle | cam.data.angle = scene.lightfield.angle | ||||
| # display options of the camera | # display options of the camera | ||||
| cam.data.draw_size = 0.15 | cam.data.display_size = 0.15 | ||||
| cam.data.lens_unit = 'FOV' | cam.data.lens_unit = 'FOV' | ||||
| # handler parent | # handler parent | ||||
| if scene.lightfield.create_handler: | if scene.lightfield.create_handler: | ||||
| cam.parent = self.handler | cam.parent = self.handler | ||||
| def createCamera(self): | def createCamera(self): | ||||
| if bpy.context.scene.lightfield.animate_camera: | if bpy.context.scene.lightfield.animate_camera: | ||||
| Show All 22 Lines | def createTexture(self, index): | ||||
| img.filepath = self.imagePaths[index] | img.filepath = self.imagePaths[index] | ||||
| img.source = 'FILE' | img.source = 'FILE' | ||||
| tex.image = img | tex.image = img | ||||
| return tex | return tex | ||||
| def createSpot(self, index, textured=False): | def createSpot(self, index, textured=False): | ||||
| scene = bpy.context.scene | scene = bpy.context.scene | ||||
| bpy.ops.object.lamp_add( | bpy.ops.object.light_add( | ||||
| type='SPOT') | type='SPOT') | ||||
| spot = bpy.context.active_object | spot = bpy.context.active_object | ||||
| # set object props | # set object props | ||||
| spot.name = "light_field_spot_" + str(index) | spot.name = "light_field_spot_" + str(index) | ||||
| # set constants | # set constants | ||||
| spot.data.use_square = True | spot.data.use_square = True | ||||
| ▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines | |||||