MattiasFredriksson / io_anim_c3d

Blender addon for importing .c3d files.
GNU General Public License v2.0
26 stars 5 forks source link

Fails to import c3d files with screen axis parameters #12

Open Peaj opened 3 months ago

Peaj commented 3 months ago

The axis_interpretation function reads the screen axis data from the file using reader.get_screen_axis() which returns axis in string format ('+X', '-Y', etc.) here.

The code afterwards just assumes this data to be numeric vectors instead. Which causes an exception when trying to import files with screen axis parameters.

This could easily be resolved by using a dictionary to retrieve the correct vector like this:

axis_dict = {
            '+X': [1,0,0],
            '-X': [-1,0,0],
            '+Y': [0,1,0],
            '-Y': [0,-1,0],
            '+Z': [0,0,1],
            '-Z': [0,0,-1],
}

I am still unsure if this function works correctly though as I dont know what X_Screen and Y_Screen should actually mean in a 3D context. The code seems to assume that its the forward and up axis. But shouldnt it be the right and up axis instead?

I could not find a proper definition on those parameters, as the c3d specification is sparse on these parameters: https://www.c3d.org/HTML/default.htm?turl=Documents%2Fspecification.htm