Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
Removed some code that was commented-out
Updated the Blender version to 2.78
Updated the copyright to '2016-2017'
  • Loading branch information
neverhood311 committed Mar 15, 2017
1 parent 38a66f6 commit 7101c56
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions mesh_sequence_controller.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# Stop motion OBJ: A Mesh sequence importer for Blender
# Copyright (C) 2016 Justin Jensen
# Copyright (C) 2016-2017 Justin Jensen
#
# 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
Expand All @@ -24,7 +24,7 @@
"description": "Import a sequence of OBJ (or STL or PLY) files and display them each as a single frame of animation. This add-on also supports the .STL and .PLY file formats.",
"author": "Justin Jensen",
"version": (0, 1),
"blender": (2, 77, 0),
"blender": (2, 78, 0),
"location": "View 3D > Add > Mesh > Mesh Sequence",
"warning": "",
"category": "Add Mesh",
Expand Down Expand Up @@ -63,9 +63,6 @@ class MeshSequenceSettings(bpy.types.PropertyGroup):
description="Only .OBJ files will be listed",
subtype="DIR_PATH")
fileName = bpy.props.StringProperty(name='File Name')
#firstNum = bpy.props.IntProperty()
#lastNum = bpy.props.IntProperty()
#numFrames = bpy.props.IntProperty()
startFrame = bpy.props.IntProperty(
name='Start Frame',
update=updateStartFrame,
Expand Down Expand Up @@ -111,11 +108,8 @@ def __init__(self):
#for obj in bpy.context.scene.objects:
#if it's a sequence object (we'll have to figure out how to indicate this, probably with a T/F custom property)
if(obj.mesh_sequence_settings.initialized == True):
#print("I am: " + obj.name)
#call sequence.loadSequenceFromData() on it
self.loadSequenceFromData(obj)
#else:
#print("I'm NOT: " + obj.name)
self.freeUnusedMeshes()

def newMeshSequence(self):
Expand Down Expand Up @@ -169,7 +163,6 @@ def loadSequenceFromFile(self, _obj, _dir, _file):
#for each file that matches the glob query:
for file in sortedFiles:
#import the mesh file
#bpy.ops.import_scene.obj(filepath = file)
importFunc(filepath = file)
#get a reference to it
tmpObject = bpy.context.selected_objects[0]
Expand Down Expand Up @@ -436,7 +429,6 @@ def freeUnusedMeshes(self):
#COMMENT THIS persistent OUT WHEN RUNNING FROM THE TEXT EDITOR
@persistent
def initSequenceController(dummy): #apparently we need a dummy variable?
#print("initSequenceController was just called")
global MSC
#create a new MeshSequenceController object
MSC = MeshSequenceController()
Expand Down Expand Up @@ -480,10 +472,6 @@ def execute(self, context):
self.report({'ERROR'}, "Invalid file path. Make sure the Root Folder, File Name, and File Format are correct. Make sure to uncheck 'Relative Path'")
return {'CANCELLED'}

#print("We've loaded the OBJ sequence!")
#print("Dirpath: " + dirPath)
#print("filename: " + fileName)
#print("MSO object name: " + MSO.seqObject.name)
return {'FINISHED'}

class BatchShadeSmooth(bpy.types.Operator):
Expand Down Expand Up @@ -531,7 +519,6 @@ class MeshSequencePanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = 'object'
#bl_options = {'DEFAULT_CLOSED'}

def draw(self, context):
layout = self.layout
Expand Down Expand Up @@ -585,7 +572,6 @@ def draw(self, context):
box.operator("ms.bake_sequence")

def register():
#print("Registered the OBJ Sequence addon")
#give bpy.types.Mesh a new property that says whether it's part of a mesh sequence
bpy.types.Mesh.inMeshSequence = bpy.props.BoolProperty() #defaults to False
#register this settings class
Expand All @@ -606,7 +592,6 @@ def register():
#initSequenceController(0)

def unregister():
#print("Unregistered the OBJ Sequence addon")
bpy.app.handlers.load_post.remove(initSequenceController)
bpy.app.handlers.frame_change_pre.remove(updateFrame)
bpy.utils.unregister_class(AddMeshSequence)
Expand Down

0 comments on commit 7101c56

Please sign in to comment.