Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by TimYanalunas · Nov 18, 2010 at 01:44 AM · animationprefabprefabsfbxversion-control

Updating a prefab fbx or animation while using version-control is broken

Our project is being developed by a small team, so we are using version control software (Perforce) with Unity Pro. We have set up our file versioning to behave as suggested by this page:

http://unity3d.com/support/documentation/Manual/ExternalVersionControlSystemSupport.html

Most of our game objects are instances of prefabs. When one of our artists updates an FBX or an animation file, updates the prefab, then checks in the changes, those changes cannot be seen by anyone else.

In the case of an updated FBX, the new version of the model simply is not seen in the prefab. The old version of the model is still visible. The user must manually re-apply the FBX to the prefab, and then the new model shows up. (However, the preview window still shows the old version of the model)

In the case of an updated animation, the prefab often says "Missing Animation Clip" in the Animation section. The user must manually browse for the animation to re-associate it with the prefab.

I discovered one bit of information about the missing animation problem. I opened one of the problematic prefab files in a text editor and saw some references to locally cached animations: "library/metadata/3b/3b9331fc2712fb04a96b1dff65d4a798...assets/soldier@die.fbx". We're not even doing version control of the "library/metadata" folder, so it seems questionable that the prefab is directly referencing this data.

At any rate, the prefabs seemingly work fine for the artist that is modifying the model or animation. There is only a problem when someone else tries to see the changes. While it is POSSIBLE to fix this locally on each user's machine for each piece of artwork every time a revision is made, it certainly is not a desirable workflow.

Has anyone figured out any way to reliably use prefabs in conjunction with version control software? I have seen a few posts about this, but the answers are generally work-arounds that involve re-exporting art locally or re-creating prefabs every time the art is updated. Are prefabs just not designed to ever be modified?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Ben 14 · May 02, 2011 at 06:06 PM

As far as I can tell, this is not related to using version control. We've always witnessed strange behaviour when updating FBX assets that are instantiated inside prefabs. I guess that what Paulus Liekis says in a comment to the other answer is probably correct, meaning that changes to an FBX inside a prefab may be correctly replicated as long as the update only changes the vertice/faces/materialIdxs of the mesh, but not if it is the bones or subobjects (adding/removing animations, I'm not certain of also). This is linked to the fact that Unity does not handle nested prefabs I guess - which is a pity really.

Anyway, what we do is maintain a clear separation on the fbx within the prefabs - they are never the parent of anything, nor referenced explicitely in the scripts in their parent (references are usually rebuilt at runtime through a GetComponentInChildren), so that when an FBX is updated, we may erase its instance(s) in the prefab(s) and recreate it. For our most recurrent cases we store the prefab next to the fbx with the same name, so that it's easy to parse all fbxs, get the prefabs that uses them, and apply that destroy/recreate/apply automatically through an import script. This is done only once after the fbx reimport - preferably by the artist who modified the fbx - and once committed to perforce everybody get the correct version.

Admittedly, that's far from ideal, but we manage to live with it with a 15+ team.

Hope this helps,
Ben

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Paulius-Liekis · Nov 18, 2010 at 08:27 AM

Do you have .meta files enabled (i.e. "external source control" in editor settings)? - IIRC, when having .meta files enabled you shouldn't have to care what's happening in library folder. Are you sure your prefab connections are not broken?

I used Perforce with Unity and I can't remember having problems like this.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TimYanalunas · Nov 18, 2010 at 05:01 PM 0
Share

I do have External Version Control Support enabled.

avatar image Velketor · Mar 16, 2011 at 06:19 PM 0
Share

I've had the same problem. Animations will update but not geometry changes (to .fbx files)

avatar image Paulius-Liekis · May 02, 2011 at 02:18 PM 0
Share

As far as I know it should work. The only thing that doesn't work is if you add more nodes to your fbx - they won't be added to the prefab, but animations and meshes should be updated. If it doesn't, then please raise a bug and attach $$anonymous$$i project (with initial model) and a file with which model should be overridden.

avatar image
0

Answer by Davo 1 · Dec 12, 2011 at 02:43 PM

Man, I put my vote in for this to be the #1 fix I would like to see to Unity! Allow artists to update models and have prefabs pick up the changes.

I got kicked hard with this issue- after building a really fun game over the course of a few weeks with temporary graphics, time came to update to real art and boom! Models dissapearing, turning to vertex pizza, and pain, pain, pain. Since I built everything in prefabs, It now looks like I have to manually go through and recreate absolutely everything. Yay.

I am worried about commiting all that time unless the workaround is solid...

So I create a null parent and put all my scripts in that, then at START() instantiate the model which I link in. I suppose I could put in a temporary mesh in the heirarchy that I delete on START so I can see where the model is being placed in the editor, right? Then on start, hunt down the bones I need to attach weapons, colliders and particles to by name?

Does anyone have an example chunk of prewritten java for this?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by sreedhar3d · Mar 20, 2015 at 05:54 AM

This is not a Unity issue,

The first Fbx when you export that should be clean (Optimized and delete BindPose in Maya)

and next time you need to use the same maya file and update any model change do the same (Optimized and delete BindPose in Maya). Then your prefab works fine.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

how to fix this dont play animation and prefabs?,how to fix this 0 Answers

Exporting animations from fbx files....or something like that 2 Answers

A Prefab with animation.Play doesnt work 0 Answers

Multiple FBX Animations 1 Answer

Create a Prefab from imported Assets automatically 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges