SE2Dev / io_anim_seanim

SEAnim Plugin for Blender
MIT License
81 stars 30 forks source link

Use forward slash in path #9

Closed xDShot closed 6 years ago

xDShot commented 6 years ago

Otherwise it cannot import or export properly on Unix-like OSes

SE2Dev commented 6 years ago

Merged! I also added a path normalization step as well. Unfortunately, I don't have access to a Unix-like OS at the moment - so I don't have any way to check that the new code still works on Unix-like OSes. Can you please verify that import / export still work correctly, so that I can make a new release commit?

xDShot commented 6 years ago

Tried development branch. Unfortunately, not. For some reasons it drops latest slash before the file itself.

What done:

but it just created 1 frame action with only reference pose

The log from blender: `SMD IMPORTER: now working on c_usa_cia_masonjr_armlaunch_viewhands_LOD0

Imported 1 files in 11.0 seconds ( 0.0001 sec | 0.0001 sec) viewmodel_msmc_reload.seanim Could not open file for reading: /home/xdshot/msmc/bo2/animsviewmodel_msmc_reload.seanim ( 0.0135 sec | 0.0134 sec) Finished! Progress: 100.00%`

The correct path to seanim is /home/xdshot/msmc/bo2/anims/viewmodel_msmc_reload.seanim, note the slash before the file, it's inside anims folder.

SE2Dev commented 6 years ago

Ah yes - I see what's happening here. os.path.normalize() strips the trailing slash, and since I was just doing a simple string append operation, a new slash is never added. I'll switch to os.path.join() and see how that works.

SE2Dev commented 6 years ago

Ok, I modified the directory path logic in 91c1183. Can you confirm that it functions correctly?

xDShot commented 6 years ago

Imported 1 files in 5.1 seconds ( 0.0006 sec | 0.0004 sec) viewmodel_msmc_reload_empty.seanim Could not open file for reading: /home/xdshot/msmc/bo2/anims\viewmodel_msmc_reload_empty.seanim ( 0.0168 sec | 0.0167 sec) Finished! Progress: 100.00%

Backslash returned ¯\_(ツ)_/¯

SE2Dev commented 6 years ago

Ech - I guess os.path.join() is broken... Neat! I suppose I'll try normalizing the path again after joining the parts together. Out of curiosity which OS are you using?

xDShot commented 6 years ago

Linux (Arch Linux x64)

SE2Dev commented 6 years ago

Alright, let's try this again: 246e1d3

xDShot commented 6 years ago

Confirming it working :+1:

SE2Dev commented 6 years ago

Out of curiosity, is there any particular reason you're using the SMD versions of the models over the XMODEL_EXPORTS?

xDShot commented 6 years ago

Dunno ¯\_(ツ)_/¯ Just wanted to import with preferred reliable tools. I'll try xmodel bit later.