Exemple #1
0
    def execute(self, context):

        objType, option = self.arg.split('.')

        # cleanup before we start
        bpy.ops.object.select_all(action='DESELECT')

        if objType == 'camera':
            obj = easyAsset.createCamera(option)
        elif objType == 'light':
            obj = easyAsset.createLight(option)
        elif objType == 'fx':
            obj = easyAsset.createFX(option)
        elif objType == 'barrel':
            obj = easyAsset.createBarrel(option)
        elif objType == 'concrete':
            obj = easyAsset.createConcrete(option)
        elif objType == 'wood':
            obj = easyAsset.createWood(option)
        else:
            obj = 'Sorry, not implemented yet.'

        if not obj:
            self.report({'ERROR'}, 'Error Importing this model.')
            return {'CANCELLED'}
        else:
            obj.select = True
            bpy.context.scene.objects.active = obj
            return {'FINISHED'}
	def execute(self, context):
		
		objType, option = self.arg.split('.')

		# cleanup before we start
		bpy.ops.object.select_all(action='DESELECT')

		if objType == 'camera':
			obj = easyAsset.createCamera(option)
		elif objType == 'light':
			obj = easyAsset.createLight(option)
		elif objType == 'fx':
			obj = easyAsset.createFX(option)
		elif objType == 'barrel':
			obj = easyAsset.createBarrel(option)
		elif objType == 'concrete':
			obj = easyAsset.createConcrete(option)
		else:
			obj = 'Sorry, not implemented yet.'

		if not obj:
			self.report({'ERROR'}, 'something went wrong')
			return {'CANCELLED'}
		else:

			obj.select = True
			bpy.context.scene.objects.active = obj

			return {'FINISHED'}
	def execute(self, context):
		objType, option = self.arg.split('.')
		
		# cleanup before we start
		bpy.ops.object.select_all(action='DESELECT')

		if objType == 'camera':
			error = easyAsset.createCamera(option)
		elif objType == 'light':
			error = easyAsset.createLight(option)
		elif objType == 'obj':
			error = easyAsset.createObj(option)
		elif objType == 'post':
			error = easyAsset.createPost(option)
		else:
			error = 'Sorry, not implemented yet.'

		if error:
			self.report({'ERROR'}, error)
			return {'CANCELLED'}
		else:
			return {'FINISHED'}