Leondude1 / blender-smd

Automatically exported from code.google.com/p/blender-smd
0 stars 0 forks source link

SUGGESTION: Use a comment in the VTA file for the name of a shape key #105

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
SUGGESTION:
When importing or exporting Shape Keys from or to a VTA file, use a comment in 
the VTA file for the name of a shape key shown in Blender. The VTA file format 
doesn't have "names" as part of the syntax, but names would be highly useful 
for users like myself. I also develop Crowbar (source engine model decompiler), 
which already includes the kind of VTA comments I am suggesting here.

For example, in the VTA file (data lines removed so only relevant lines shown):
skeleton
  time 0 # basis shape key
  time 1 # innerBrowRaiser
end
vertexanimation
  time 0 # basis shape key
  time 1 # innerBrowRaiser
end

Original issue reported on code.google.com by ZeqMacaw on 6 Nov 2013 at 2:37

GoogleCodeExporter commented 8 years ago
I already add comments exactly like those on export. Parsing them during import 
sounds like a good idea!

Original comment by cont...@steamreview.org on 6 Nov 2013 at 2:43

GoogleCodeExporter commented 8 years ago
OK, cool. I was just about to check the latest version to make sure I wasn't 
suggesting something already there. I guess I was too slow. :P 

Actually, now that I think more about this, I probably got the idea to put in 
those comments via Crowbar based on the SMD Tools exporting them. I just wanted 
to post this idea before I forgot about it again.

Original comment by ZeqMacaw on 6 Nov 2013 at 3:11

GoogleCodeExporter commented 8 years ago
Implemented in r356 / 1.9.2

Original comment by cont...@steamreview.org on 6 Nov 2013 at 7:41

GoogleCodeExporter commented 8 years ago

Original comment by cont...@steamreview.org on 6 Nov 2013 at 7:41

GoogleCodeExporter commented 8 years ago
:)

Original comment by ZeqMacaw on 6 Nov 2013 at 8:05

GoogleCodeExporter commented 8 years ago
I tested this out with what Crowbar produces (like the examples I gave above), 
and it fails to assign names. I looked at the code, and it seems the cause is 
the line.startswith("time") on line 318 of import_smd.py file. Based on 
sourcemdl.exe source code, a smd/vta file can have whitespace before the 
"time", and my many compile runs have shown this is true.

Would you be willing to change the code so it handles the whitespace? I had put 
the whitespace in to make the format easier to read when looked at in a text 
editor, because often when debugging, it has come in handy.

As a test, I removed the whitespace from before the "time" lines in skeleton 
section in a vta file, and the import named the shape keys just fine that way 
(as expected).

Original comment by ZeqMacaw on 6 Nov 2013 at 8:45