Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
15
Question by drhenry · Apr 16, 2010 at 04:17 PM · updatemodelprefabsworkflowexternal-tools

Prefabs Workflow - Changing models in a 3D app after they have been used in a prefab

Hi, I'd like to know what's the right workflow and how to use Prefabs for writing Unity games where its used meshes get updated by modelers (using Maya) while the game is developed in Unity.

I've got the following problem:

  • I build a model in Maya

  • I import the .mb file in Unity

  • I drag it from Project pane into Hierarchy pane

  • Create in the Project pane a Prefab

  • Drag the top level object from Hierarchy pane onto prefab in Project Pane

  • I (or any modeler) change the model in Maya and overwrite the model in the Asset folder

Now in the Project pane are two models: the one I originally imported and the prefab. After updating the model in Maya, the original model in the project pane changes (I can see the changes made to the model in the small preview window), but the prefab doesn't get updated, nor does the object in the Scene View (in the Hierarchy pane respectively).

How can we change geometries already in use by the Unity project afterwards?

Comment
Add comment · Show 1
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 SisterKy · Jul 21, 2011 at 11:13 PM 0
Share

cross reference http://answers.unity3d.com/questions/8838/how-can-i-keep-the-prefab-connection-when-re-expor.html Greetz, $$anonymous$$y.

9 Replies

· Add your reply
  • Sort: 
avatar image
9

Answer by duck · Apr 16, 2010 at 04:49 PM

I have come up against this problem, and I currently work around it (to a certain degree) this way, by adding an extra step:

  • Build Model in 3D app

  • Import the .mb / .max / .fbx file in Unity

  • Create a new empty gameobject in your hierarchy

  • Drag your imported model onto the empty gameobject (so you model is a child of it)

  • Create a new prefab in your project pane

  • Drag the top-level empty gameobject (which has your model as a child) onto the new prefab

Now, I find this method works for mesh changes to the existing objects, but it still doesn't pick up any changes in transforms to the existing objects, or any additional new objects added to the original file.

I know this doesn't seem like much of an improvement; it still requires a manual update if any models were moved or any new models were added. However, because your model is now a child within the prefab, it becomes a lot simpler to delete & re-add your model to the prefab.

Before, if you had made a prefab with your model as the root object (as opposed to an empty GO), you would probably have added components, scripts and adjusted settings, and from that position, it seems that there is no way to update the model without losing all these components and their settings. You simply have to delete and re-make the prefab.

Wheras now, because your model is a child within the prefab, you would add your components and scripts to the empty base GO, and this means you can preserve that whole part of the prefab while just deleting & re-adding the visible model part (you'd do this to an instance in the hierarchy, then choose "apply" to apply your changes to the prefab).

Hope this helps!

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 Molix · Apr 16, 2010 at 05:34 PM 0
Share

This is what we do too, and for the same reasons. You may need to modify some of your scripts if they are expecting certain components to be in the root object. For example, if your scripts do GetComponent for a mesh or animation, you'll need to update those to search child objects too. Typically just do that in Start() and keep a reference to them so the rest of the script can refer to the right one.

avatar image drhenry · Apr 19, 2010 at 07:19 AM 0
Share

So there is no way to update a mesh in the Hierarchy pane, when a modeler changes position, scale etc. in $$anonymous$$aya? And adding submeshes, replacing meshes and making meshes more detailed (triangle count) doesn't work either? What about Color? In all these cases you have to delete the object from Hierarchy pane, reimport it, drag it from Project pane to Hierarchy pane again and add all scripts and components to its child objects (if they can't be moved to the parent node) and modify the scene hierarchy again as it has been before?

avatar image drhenry · Apr 19, 2010 at 02:52 PM 1
Share

Hm, I don't get it. In the Unity Video tutorial No. 5 (see http://unity3d.com/support/documentation/video/5.html) the author applies a rigidbody and a collider to a game object without losing prefab link. That's why thereafter he can make changes to the model in Studio $$anonymous$$ax which are automatically applied to the unity scene on saving. If I try doing the same, Unity asks me if I really want to lose prefab...

avatar image
7

Answer by Brad-Newman · Sep 27, 2010 at 07:28 AM

Dear lord, this workflow is abhorrent.

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
2

Answer by gooncorp · Jun 30, 2012 at 05:26 PM

man do i really have to spend 3 hours doing this everytime my partner gives me an updated model? it takes over 3 hours for me to update the model if he adds for example gloves...

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
1

Answer by Bill 2 · Oct 08, 2010 at 11:01 AM

Here is what we are doing that seems to be working well and allows the 3d model to be updated and have prefabs that use it update as welll.

Import the model make an empty game object, call it "Global" and throw a script called "Global" on it that has something like

var myModel:GameObject;

Then click on Global in the heirarchy and drag the 3d object in the project panel into the myModel var in the inspector.

Then in any script on any prefab you can instantiate the 3d object in the start function

function Start(){ var model=GameObject.Find("Global").GetComponent(Global).myModel; var newModel=Instantiate(model,Vector3.zero,Quaternion.identity); newModel.name="CharacterObject"; newModel.transform.parent=transform; newModel.transform.localPosition=Vector3.zero;

}

Hope that helps

Comment
Add comment · Show 1 · 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 Lenn Dolling · Jul 23, 2011 at 11:12 PM 0
Share

sweet stuff. I love it how the script file actually holds a higher class of functions. $$anonymous$$ooo Booo

avatar image
1

Answer by alxqs · Jun 03, 2013 at 02:13 AM

This is some awful pipeline mess we got here.

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
  • 1
  • 2
  • ›

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Replacing a prefab with a new one to update model changes 1 Answer

Quick way to reproduce fully rigged, animated prefabs with different meshes/Materials? 1 Answer

Using .prefabs externally 1 Answer

Equipping weapons to photon prefabs 1 Answer

Strip model with submeshes to prefabs or not? 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