• 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
0
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
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 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
0

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
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 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 "$$anonymous$$AIN", 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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

245 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 avatar image avatar image

Related Questions

Rigidbody gravity X Generic Mecanim Additive Move-Forward Animation 0 Answers

Can I make animations snap to a frame? 2 Answers

problems importing animations 0 Answers

Animation from 3dsMax to Unity 6 Answers

Importing animated FBX files 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges