x


Updating assets changes .meta files and breaks dependencies.

**[UPDATE] I experimented and found out that the problem was caused by the .meta files changing what ID number it assigns to the root node. I'm guessing that means that this problem only applies to people using external version control? We'll be changing to the Unity Asset Server soon, and can try testing to see if this is still a problem.**

We noticed a problem where when we updated an asset by reexporting the FBX from Max, that all the links to that object were broken. Is there a way around this?

I'm not sure if this is related or not, but we had to change the material generation method to be "per material" in order for the materials to update properly.

Here's a more detailed explanation of how the asset is linked. I have an Asset A, which is just sitting in some asset folder. I then create a Prefab P. I attach a script component S to P where S has a public GameObject member called AssetTemplate. I then go and link the asset A to AssetTemplate under the prefab and everything works fine. However once I make a change to Asset A, all of a sudden AssetTemplate under the prefab is now pointing to "Missing".

more ▼

asked Jul 01, 2011 at 10:23 PM

sharat gravatar image

sharat
136 19 17 17

To clarify, I'm referring to the dependencies in prefabs that are linked to the asset.

Jul 06, 2011 at 02:20 PM sharat

by "broken", do you mean meshes that previously referred to the imported model become "Missing" in the inspector? That should only happen if the model mesh names change.

Jul 06, 2011 at 10:50 PM Waz

I have a script in a prefab that attaches a GameObject(as specified in a link) to the object. That link was set to the the asset. When the asset got updated, the GameObject link was changed to "Missing".

Jul 08, 2011 at 05:06 PM sharat

@sharat, the way those Q&A sites work is you edit questions or answers only to add relevant information to the question or to the answer, and not to add an actual answer inside the question, if you know what I mean. Your edit should've been an answer. And it's ok - even encouraged - to answer your own questions. ;-)

May 17, 2012 at 02:54 PM Cawas
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

When you attach a script to the object, this object lost its link to the prefab (you can apply the altered settings to prefab) and lost its link with FBX "Tree".

So, when you make any change to model, in your 3D application, and Unity reimport this model, it will apply the mesh modifications, but if you add or delete any mesh in the FBX it will not apply this change to your object, because he lost its link.

There's no way to prevent this, what I do is to add the scripts By scripts while testing, and lastly attach the scripts directly to the object when finish.

Sorry for my bad gramar. Hope can help you. Borgo

more ▼

answered Jul 08, 2011 at 05:21 PM

Borgo gravatar image

Borgo
1.1k 22 22 37

The thing is that all of this is done within prefabs. The prefab itself is instantiated at runtime where it looks up the asset I specified and adds it to the scene with it.

Here's the scenario. I have an Asset A, which is just sitting in some asset folder. I then create a Prefab P. I attach a script component S to P where S has a public GameObject member called AssetTemplate. I then go and link the asset A to AssetTemplate under the prefab and everything works fine. However once I make a change to Asset A, all of a sudden AssetTemplate under the prefab is now pointing to "Missing".

All of this is done outside of a scene, this is just changing the prefab relations.

Jul 08, 2011 at 06:11 PM sharat
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1423
x788
x669
x95

asked: Jul 01, 2011 at 10:23 PM

Seen: 2864 times

Last Updated: May 17, 2012 at 02:54 PM