Cgettys / X4Converter

MIT License
7 stars 1 forks source link

Blender Addon - Unknow location (importing/exporting) #2

Open OscarOG opened 4 years ago

OscarOG commented 4 years ago

Hi! After importing, the model loads correctly but this message shows in the log:

Traceback (most recent call last): File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\importer.py", line 65, in execute ship_macro=base_path.rsplit('/',1)[1] IndexError: list index out of range

location: unknown location:-1

Exporting is not working for my with this message in log:

Traceback (most recent call last): File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\exporter.py", line 36, in execute self.tweak_and_export_collada(context,base_path) File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\exporter.py", line 51, in tweak_and_export_collada ship_macro=base_path.rsplit('/',1)[1] IndexError: list index out of range

location: unknown location:-1

Cgettys commented 4 years ago

I'll look at it later this week; I'm unfortunately moving at the moment.

Cgettys commented 4 years ago

@OscarOG does this https://github.com/Cgettys/X4Converter/blob/rewrite-xml/X4ConverterBlenderAddonBeta3.zip fix the issue for you? it's a bit ugly but I think it will fix your issue, it's a filepath separator issue (I develop on Linux, which uses "blah/blahblah/whatever", whereas Windows would be "C:\blah\blahblah\whatever")

Cgettys commented 4 years ago

Make that https://github.com/Cgettys/X4Converter/blob/rewrite-xml/X4ConverterBlenderAddon3-1.zip I only fixed it one of the two places the first time

OscarOG commented 4 years ago

Hi @Cgettys ! Thank you for your answer but sorry to tell you that it still doesn't work.

As before, importing model loads the model but now, i noticed that the scale when importing is not optimal for working directly as before, it´s very small.

Exporting still not working, i think same log as before.

Importin log:

Traceback (most recent call last): File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\importer.py", line 62, in execute self.read_animations(base_path) File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\importer.py", line 110, in read_animations subname = anim.attrib["subname"] KeyError: 'subname'

location: unknown location:-1

Exporting log:

Traceback (most recent call last): File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\exporter.py", line 36, in execute self.tweak_and_export_collada(context,base_path) File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\exporter.py", line 52, in tweak_and_export_collada if (base_path.contains('/')): AttributeError: 'str' object has no attribute 'contains'

location: unknown location:-1

As i said, thanks for checking it out.

Cgettys commented 4 years ago

D'oh! wrong set of string functions, I'm rusty on python. This should work for the export issue. https://github.com/Cgettys/X4Converter/blob/rewrite-xml/X4ConverterBlenderAddon3-2.zip The new, different import issue can be fixed by unchecking the experimental animation import; I've adjusted the default to be unchecked in the above version. RE: scaling, I don't know why that would have changed. Did you accidentally adjust the scale factor in the import menu? Lastly, are you in the Egosoft discord? if so, that's a faster place to reach me

OscarOG commented 4 years ago

Ok, now importing seems to works but only without animation as you said. The scale backs to normal when import without animation but when I import with animation it´s when the log is shown and the scale is very small. Are you planning to complete this feature in the near future?, just to know.

Exporting it´s not working yet:

Traceback (most recent call last): File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\exporter.py", line 36, in execute self.tweak_and_export_collada(context,base_path) File "C:\Users\Oscar\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\X4ConverterBlenderAddon\exporter.py", line 58, in tweak_and_export_collada root_part = bpy.data.objects[ship_macro] KeyError: 'bpy_prop_collection[key]: key "suzanne_showcase" not found'

location: unknown location:-1

Cgettys commented 4 years ago

@OscarOG Yes, I intend to complete that feature; I am not sure of the timeline yet, I'm actively working on the core of the converter at the moment.

Could you give me a bit more information (e.g. screenshots, or the blender file itself) on the objects you're trying to export and how you're trying to export them? The basic issue is it thinks the root of your object is suzanne_showcase but it can't find something by that name. I don't have enough information to tell you why that is.

Again, I can help you debug this faster if you find me on the Egosoft discord; I usually hang out in the modding channel.