FBX export to Unity with Switch Layers
Posted: Mon Dec 05, 2016 6:05 pm
...(or other visibility toggle function)
Hi All,
I'm fresh to this forum and also not native English speaker, so please bear with me.
I have been trying to have my characters exported as FBX and then import them to Unity. This whole FBX topic has several serious issues both on AS and Unity side, most of which I have successfully tackled. Yay! (btw. I am planning to write a thorough tutorial when I am done, but I have to solve this [hopefully] last issue. I am nearly there guys, and it is gonna be awesome, but I need your help!)
This far I learned:
- FBX is a very limited very format in terms of 2D model creation. There is not at all any support for vector operation e.g. point binding, point translation, etc. Basically you have to consider your vector layers as if they were images. - check
- AS Pro 11.2 is required, mostly due to the importer script to be put into Unity Editor folder - check
- Tick on FBX Preview mode to see what is exactly going to be exported to the FBX - check
- Use flexi binding instead of layer binding - check
- This I learned myself (and asking whether others had this issue as well): if there IS a red dot (e.g. vector layer is optimized for flash export), flexi binding does NOT work, not even inside AS Pro. Had to redo quite many layers of my models because of this. - check
Most of the things work when all the above are being taken into consideration. BUT! I can't have the switch layers tool/effect (whatever) working reliably. As with the case of one of my characters: I am trying to "animate" the mouth movement. Because FBX does not let you translate points, I decided to create the character's mouth positions on different layers and switch them when the character's talking. Inside AS it shows as it was switching (I can see the the different layers appearing/disappearing in the animation inside Anime Studio), but after exporting to FBX, and importing to Unity, nothing happens with the switches. Only the top layer is visible from the switch layers throughout the whole clip. Other part of the same animation clip is playing perfectly.
Is anybody still here? Good, because it gets worse! I have an animated background element in the same game. On this BG element, I am also using switches (among other layer based animations), and there it works!
Main differences between the two models are:
- BG element's layers are imported images (PNGs), while the character's layers are vectors
- BG element does not have bones at all, while the character does
- BG element is a completely new model, while some parts of the character come from a model made with an earlier version of AS Pro (10 maybe)
My findings so far with the switch problem:
- It does not work without bones
- It does not work ticking off Allow nested layer control
- It does not work if enabling animated layer order, and trying to hide/show layers that way instead of using switches
- It does not work either with vector layers, nor imported images
The main reason I am coming here and not to Unity forum is my guess for the root of the problem: for some reason AS Pro does not include (or does not always include) some information about these layers. I found that when successfully exporting and importing an FBX model with switches, the switch layers themselves are being stored in the FBX like this:
- the "switched off" layer is being scaled down to minimal, not visible level (scale: 1-e06)
- the "switched on" layer is being scaled up to the proper value on the same frame
What I found is that when a switch does not work in an FBX model, the file itself does not have the information stored (or it loses the information through the import process?).
I am happy to share my work with any of you who is able and willing to help. I'd really appreciate that.
One last thing: when trying to export an FBX, sometimes my AS simply does not create the file. Maybe there is a compatibility issue? I am using Win 7 x64 on an old-ish Toshiba laptop with AMD mobile GPU.
Many thanks advance!
embraiz
Hi All,
I'm fresh to this forum and also not native English speaker, so please bear with me.
I have been trying to have my characters exported as FBX and then import them to Unity. This whole FBX topic has several serious issues both on AS and Unity side, most of which I have successfully tackled. Yay! (btw. I am planning to write a thorough tutorial when I am done, but I have to solve this [hopefully] last issue. I am nearly there guys, and it is gonna be awesome, but I need your help!)
This far I learned:
- FBX is a very limited very format in terms of 2D model creation. There is not at all any support for vector operation e.g. point binding, point translation, etc. Basically you have to consider your vector layers as if they were images. - check
- AS Pro 11.2 is required, mostly due to the importer script to be put into Unity Editor folder - check
- Tick on FBX Preview mode to see what is exactly going to be exported to the FBX - check
- Use flexi binding instead of layer binding - check
- This I learned myself (and asking whether others had this issue as well): if there IS a red dot (e.g. vector layer is optimized for flash export), flexi binding does NOT work, not even inside AS Pro. Had to redo quite many layers of my models because of this. - check
Most of the things work when all the above are being taken into consideration. BUT! I can't have the switch layers tool/effect (whatever) working reliably. As with the case of one of my characters: I am trying to "animate" the mouth movement. Because FBX does not let you translate points, I decided to create the character's mouth positions on different layers and switch them when the character's talking. Inside AS it shows as it was switching (I can see the the different layers appearing/disappearing in the animation inside Anime Studio), but after exporting to FBX, and importing to Unity, nothing happens with the switches. Only the top layer is visible from the switch layers throughout the whole clip. Other part of the same animation clip is playing perfectly.
Is anybody still here? Good, because it gets worse! I have an animated background element in the same game. On this BG element, I am also using switches (among other layer based animations), and there it works!
Main differences between the two models are:
- BG element's layers are imported images (PNGs), while the character's layers are vectors
- BG element does not have bones at all, while the character does
- BG element is a completely new model, while some parts of the character come from a model made with an earlier version of AS Pro (10 maybe)
My findings so far with the switch problem:
- It does not work without bones
- It does not work ticking off Allow nested layer control
- It does not work if enabling animated layer order, and trying to hide/show layers that way instead of using switches
- It does not work either with vector layers, nor imported images
The main reason I am coming here and not to Unity forum is my guess for the root of the problem: for some reason AS Pro does not include (or does not always include) some information about these layers. I found that when successfully exporting and importing an FBX model with switches, the switch layers themselves are being stored in the FBX like this:
- the "switched off" layer is being scaled down to minimal, not visible level (scale: 1-e06)
- the "switched on" layer is being scaled up to the proper value on the same frame
What I found is that when a switch does not work in an FBX model, the file itself does not have the information stored (or it loses the information through the import process?).
I am happy to share my work with any of you who is able and willing to help. I'd really appreciate that.
One last thing: when trying to export an FBX, sometimes my AS simply does not create the file. Maybe there is a compatibility issue? I am using Win 7 x64 on an old-ish Toshiba laptop with AMD mobile GPU.
Many thanks advance!
embraiz