Skip to content

Commit

Permalink
Merge pull request #17 from neverhood311/bug/allow-relative-paths
Browse files Browse the repository at this point in the history
Allow for relative filepaths
  • Loading branch information
neverhood311 authored Mar 29, 2019
2 parents 82bb824 + 4ccced0 commit 7ada13f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ PayPal: https://www.paypal.me/justinj
- This allows the sequence to be viewed on other computers without installing the addon (in a renderfarm, for example)

### Limitations
- Only absolute filepaths are supported (for now)
- No motion blur
- Only single-object files are supported
- ~~Only absolute filepaths are supported~~
- Fixed in [https://github.com/neverhood311/Stop-motion-OBJ/pull/17](https://github.com/neverhood311/Stop-motion-OBJ/pull/17)
- ~~File numbers must be zero-padded~~
- Sorting file with correct order is added in [this PR](https://github.com/neverhood311/Stop-motion-OBJ/pull/15)
- Files like file1, file2, file3 will be loaded in correct order, and zero-padded filenames still work, too.
- No motion blur
- ~~Doesn't work with physics~~
- (It actually works with rigid body physics. In Rigid Body Collisions set Shape to 'Mesh' and Source to 'Base')
- Only single-object files are supported
- ~~Sequences can't be duplicated (for now)~~
- ~~Sequences can't be duplicated~~
- Sequences can now be duplicated, but they share a material. For a duplicate sequence with a different material, you have to re-import the sequence.

## Installing Stop motion OBJ
Expand Down
7 changes: 4 additions & 3 deletions mesh_sequence_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ def loadSequenceFromFile(self, _obj, _dir, _file):
format = 'ply'
importFunc = bpy.ops.import_mesh.ply
#combine the file directory with the filename and the .obj extension
full_filepath = os.path.join(_dir, _file + '*.' + format)
print(full_filepath)
full_dirpath = bpy.path.abspath(_dir)
full_filepath = os.path.join(full_dirpath, _file + '*.' + format)

numFrames = 0
unsortedFiles = glob.glob(full_filepath)
# Sort the given list in the way that humans expect.
Expand Down Expand Up @@ -488,7 +489,7 @@ def execute(self, context):

num = MSC.loadSequenceFromFile(obj, dirPath, fileName)
if(num == 0):
self.report({'ERROR'}, "Invalid file path. Make sure the Root Folder, File Name, and File Format are correct. Make sure to uncheck 'Relative Path'")
self.report({'ERROR'}, "No matching files found. Make sure the Root Folder, File Name, and File Format are correct.")
return {'CANCELLED'}

return {'FINISHED'}
Expand Down

0 comments on commit 7ada13f

Please sign in to comment.