I’m using blender to create a scene that I wish to import as an asset into unity.
This is working great. I can do the mods to the models in blender and they instantly update in unity.
The problem is that as soon as I assign a script to an object in the prefab I get the message “This action will loose the prefab connection” so after this point any mods to the model in blender are ignored in the instance in unity.
After reading through the manual and searching the forum I find that I should be able to “Apply changes to prefab” but the option is grayed out.
Is there a way I can assign scrips to the prefab in unity whilst still being able to modify in blender?
You must put a copy of your model at the scene, then create a new prefab from menu, and then drag your model over it. Once you got it you will be able to do whatever you need to the copy of the prefab at the scene and, when it looses conection, you will be able to “aply changes to the prefab”. And any changes made to the blender file will be reflected in the prefab. The matter here is that an imported model is not a prefab, you must build one for it.
I have done everything you say but it still doesn’t seem to work.
I can now apply scrips to the model and Apply changes to prefab, but the prefab doesn’t seem to be linked to the imported model. So the changes in blender are still not seen in the unity prefab.
What have I missed?
What kind of changes are you doing in Blender? Drastically changing the file (adding new objects or deleting existing ones, adding or deleting bones in an armature) can get Unity confused as it will not be able to relate the new model features to the old ones. But in this case you should also see a Unity advice about the problem…
Yeah, I find that changing geometry like adding/removing polys won’t persist through the prefab link. But even if you have to rebuild your prefab, you don’t have to reposition it manually, you can copy/paste it’s position.
Well I have a scene full of moving parts.
And as a test I was applying some scripts in unity, then I found I needed to modify some of the models.
After modification almost everything didn’t update but one item did. I cant really figure out why some do and some don’t. Kinda seems silly to have to go back and redo all the scripting just for a few minor mods to the base models.
Now I’m having a problem that any of the materials painted on to the model in unity are not being displayed correctly…Can anyone lead me in the right direction?
If you change geometry, you must redo the UV mapping for that object as well. Also make sure you have the material indices set properly in Blender, each material index will create a new material slot for the object in Unity, and each will need it’s own texture (or a copy of the main texture).
HTH - post a sample, might help to see what the problem is.
I stumbles upon this page
http://www.unifycommunity.com/wiki/index.php?title=Blender
It seemed to answer most of my questions.
Is the wiki outdated? I noticed under “Animations” it says that Unity can’t import Blender armatures and animations.
But then, below that, it mentions that Blender 2.45 (a freakin’ old version!) “has a working FBX exporter that handles 2 UV channels, and multiple animations.”
And then in “Export” it says that “The latest version of Blender 3D now supports animations and armature export into Unity.” Meaning that we can skip the fbx export after all?
I’m confused.
Yeah, I think it is a little outdated.
The main thing I was after was this
Known Issues
- If you put a model in your game world and then delete/add an object or component it will lose its prefab connection to the 3D file (blender or other) it came from and if that file is reimported with new objects in it it won’t take effect. However edits to verts, uvs and removing objects inside the original objects will be recognized.
- You have to re-add all the colliders to an object imported from Blender
- You should probably bake the scale and rotation in Object Mode before importing into Unity. Select Object>Clear/Apply>Apply Size/Rotation. This “bakes” the transformations into the model.
Currently I am not doing any fbx exporting. I just put the .blend file in the assets folder. It is recognised by unity. I can even click on the asset and it opens up in blender for editing. The changes are reflected straight away in unity as long as you take into account the known limitations listed above.