Ello, I'm working with FBX files in unity. When I'm working on binary parsing, i come across compressed data. When i try to extract it, Gzip, and zipstream do not work. Zlib works, but does change the size of compressed data. I change the data of the processed file to include the new offset, and the new property list length, but even when i make sure that it works, unity runs into import errors when importing the file with the newly compressed data. If i dont process compressed data, it works fine
#What Compression algorithm does Unity use for FBX Import
1 messages · Page 1 of 1 (latest)
by works, i mean im correctly changing the offset bytes and the property list bytes inplace. Just looking to understand exactly how unity does compression undoing in its importation of models / files
i figured it out that the problem was that i was trying to use default Zlib compression, when i should of used Zlib BestSpeed Compression. It make be that fbx files only compress in best speed, or some byte value dertermines the compression algorithm parsers use.
just was trying to uncompress data to read/ modify it, then write it back to file
at runtime?
when writing back, if you change the zlib compression type, unity seems to not be able to read it, ill come back to this if a fbx file i read turns out to use a different form of compression
no, editor only
okay
but the editor can import fbx files
what is the idea
is this some kind of exotic fbx file?
its a fbx reader for use in rotating underlying model's origin points
well, rotation, changing origin, and scale
you're saying you're trying to fix issues like, the fbx file has the wrong... what exactly?
the wrong origin position?
imported with -90x rotation, 100x scale right now, once i finish that ill find other uses
okay, the import settings has fixes for both of these things, yes?
like built in
did you know that?
it does not, if you fix both of those in the importer, it still defaults to -90x and 100x rotation on all instantiated objects
what version of unity are you using
can you send me an example fbx file
that you are having trouble with
are these just ordinary maya fbx files?
only maya has cm units, but the y points in the correct direction
if x or z are forward is sort of up to you
z is forward in maya
but it doesn't really matter
they are not maya files, they are Blender exports, unity supports maya instantly, not so much blender
okay lemme ask you something
are you the only person on earth exporting fbx from blender?
"no"
no lol
do you want to ask why i am creating this?
if you fixed it in the importer it's fixed.
i mean, i can show screenshots
you might be referencing the wrong thing
just dragged and drop the wrong thing into the "slot" or whatever
think deeply about this.
you are writing a whole thing, with compression and all kinds of shit that doesn't matter, to fix a bug with something you aren't getting with instantiation
in blender, are your things z forward or x forward?
nvm
it's x forward not y forward right?
first: unfixed at all
second: fixed with unity imports
third: fixed with my plugin
the texture is different, because i havent fixed the binary fixer, only have implemented in Ascii rn
i can export them right in blender super easily
okay
well
your models, what are they?
are they actually x forward and they were incorrectly exported -z forward?
i already know how to export in blender right so that the scale and rotation show up as 0 0 0 and 1 1 1 in unity
they were exported with (im assuming) default export settings (the settings you get if you dont change any on blender start
but no matter what i set as my import scale, it affects the import correctly, and it also correctly has 0 0 0 1 1 1
so you are simply dragging and dropping the wrong thing from the assets directory
which is what i suspected
so you can send me an example file
and i will prove it to you
the import scale in the FBX file doesnt seem to matter, its actually "lcl rotation" and "lcl scaling" that affects the imported scale factor
obviously you have to drag and drop in the thing all the way on the left
and none of the stuff inside
if you want this to work
are you trying to help me import stuff back to blender, fix it, then reimport to unity, or drag and drop inside unity to fix it
why don't you send me this uncorrected pipe fbx
and i will show it to you next to a default cube
and it will be clear
in a scene
okay, and the pipe opening should be y up correct?
the larger should be y-up, yes. but without needing to import it back into another program
i think this is a colossal waste of time. the person who exported these just made a very basic mistake that is very easy to fix
in unity
yes, without needing to open blender up
oh that doesnt fix it lol, just adds a root object
the model underneath still has the wrong problems
i want you to think deeply about this
if you are using this to bake a mesh, if you cannot deal with transform hierarchies
you're not going to have a thing
right now you are doing the absolute bonkers thing
of writing an fbx importer
that is a colossal waste of time
i mean, id on't know what your goal is
you know that scene in star wars
where luke asks questions and yoda literally closes his eyes and dies
by fading away
my goal is the ability for wrong fbx imports to be fixed with the click of a button without adding / removing anything from the file
either of these "issues" is extremely quick to fix in blender by just exporting it properly. infact there are scripts out there already to just export it with the correct settings. Its literally 1 button.
to be quite realistic with you here: this entirely is just a waste of time especially if you dont already know how to solve it. very few people research into the level of detail you would need to solve this problem. This isn't even really a unity issue, you're just trying to modify an FBX file through code rather than just export it properly