• 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
Question by DonCIV · Sep 21, 2018 at 05:22 PM · animationimportfbxnaming

Importing an FBX with multiple meshes with the same name?

Hi everyone,

I am importing an FBX file hardware.fbx which contains 15 screws and 30 nails.

I have several other FBX files where my screws and nails are in different positions. Some examples of these are hardware@alphaConfiguration.fbx, hardware@betaConfiguration.fbx, and hardware@charlieConfiguration.fbx.

I have put the content of hardware.fbx in the scene as a gameObject called hardware. Occasionally I tell the hardware gameObject to go to an animation state of one of those configuration fbx's clip.

I notice that all of the screws and nails in my FBX are not simply named "screw" or "nail" anymore, but rather "Screw 01", "Screw 02", "Nail 01", "Nail 02", etc. This does not cause a problem yet.

However, my UI displays the model number of the screw when I have the screw selected and the model number of the nail when I have the nail selected. It does this by passing the names of my hardware gameObject and its children to a database, which fetches the appropriate information for "nail" or "screw".

This is broken. I cannot have "Screw 01" or "Screw 02" in my scene because they do not have an associated database entry. I'll have to rename every screw in my scene back to "screw" and every nail back to "nail" manually. But will this break my animation system?

  • The obvious and easy solution would be to just tell Unity to not rename meshes on import. Unity should not be appending anything to "nail" or "screw". There are multiples of them, and they are supposed to have the same name.

  • The second solution would be to manually (or via script) rename objects in the scene back to "nail" or "screw", but I do not know if this will break my animation system.

  • The third solution would be to change my database query to ignore appended auto-increment text, but I don't know how to do that without risking occasionally ripping the number off the end of something that was genuinely meant to have a number.

Comment

People who like this

0 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 DonCIV · Oct 29, 2018 at 03:08 PM 0
Share

I'm still having no luck with this. I can't find any documentation about disabling append/increment for imported models.

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by hectorux · Oct 29, 2018 at 04:00 PM

Instead of passing an array of characters, you could just check the first char:

string name=XXXX;

char check= name[0];

Comment

People who like this

0 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 DonCIV · Oct 29, 2018 at 06:45 PM 0
Share

The system is fairly complex, so I would need to be sure that I get a unique string that handles all cases. If multiple objects start with "MAIN", for instance, that would no longer be unique. If names of objects are short (such as "HEX"), I could run the risk of having things which are not unique appearing unique within the first 4 characters as a result of an appended number, space, or punctuation.

This is the most practical/feasible solution I've seen though.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

243 People are following this question.

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

Related Questions

Manually Animating Bones then blending with existing animations or saving importing as fbx 3 Answers

Motionbuilder->Fbx->Unity. Loads up fine, but animation won't run 0 Answers

Unity reading animations incorrect when constraints used 0 Answers

Model Animation Corruption in FPS Assets? 1 Answer

Importing from lightwave with bone animation 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