I have a machine built in Sketchup that I want to get into Unity. It is made from a bunch of groupings. I can get it into Unity, but I run into the…
Adding a component will lose the prefab parent
message when I add components. If I ignore the message and add the components I can hook everything up to scripts, but when I modify my machine in Sketchup things tend to break on reimport.
Just wondering if there is a way around this issue.
There were a few threads on using Sketchup with Unity a few weeks ago, you might want to do a search of past threads, you might find something that helps.
My experience with Sketchup is pretty limited, I only recently started to experiment with it so I am by no means an expert on the topic. I’ve been exporting from Sketchup to Blender via a .OBJ file and often find a variety of issues with the resulting model: objects are all merged into one, normals are often flipped, etc. etc.
I’ll be interested to hear how those who use it all the time cope with these sorts of problems.
After making changes (and breaking the connection with the prefab), are you going to Game Object > Apply Changes to Prefab? Doing that should help out here so give it a try.
I don’t have too many problems with Sketchup geometry. My problem is a workflow issue when dealing with a multi-object models connected via joints. If I modify my Sketchup asset to have more or less objects ( groups ) then I basically have to do a bunch of tedious renaming inside Unity as the meshes move around between exports.
What I want to know is if…
I am just not understanding how prefabs work at a fundamental level. ( Quite possible. )
If I need to change how I build things in Sketchup. Maybe I should be using components or layers or something else instead of groups? Maybe some special naming?
Unity just does not currently support this type of workflow.
If the answer is 3 then I’ll go ahead and see if I can trick Unity into the workflow I want by creating the components at runtime based on naming convention and/or writing a Sketchup export plugin.
oh man. We both posted at 10:32 and you beat me by a few seconds so I didn’t see your post!
I don’t think the apply prefab works in my situation. In my understanding you use it when you want to push your game object modifications of a prefab instance to its prefab. What I need is the opposite. I need the asset changes to be pushed to the prefab. Is that possible?
If I don’t create a prefab of my asset I am able to see simple asset changes. Say for instance I manipulate a mesh to be a different shape it’ll work fine. However if I add or remove meshes in my asset I usually end up having to do a bunch a renaming in Unity. Maybe Unity supports this and Sketchup is just rearranging things for no reason and confusing the import.
I think I know what the problem is. You can’t actually name the meshes in Sketchup. You can name the groups and components, but the mesh names will always be auto-generated and placed as a child in Unity.
For a simple example you make three boxes in Sketchup. Each one you make into a group and name them BoxA, BoxB, and BoxC. When you get it into Unity you’ll end up with something like…
-BoxA
–Mesh1
-BoxB
–Mesh2
-BoxC
–Mesh3
Now say you add another group to BoxA and and some geometry to it. You might end up with something like…
If unity is relying upon those mesh names to be consistent ( which makes sense ) then that’s going to cause a lot of issues.
I can see two ways to fix the problem.
A Unity import option that has Unity generate “leaf” mesh names based upon its parent grouping name and ignore the actual mesh name. That could look something like this…
So regardless of how Sketchup renumbers the mesh names they’ll be consistent to the group name.
Make my own Sketchup export plugin.
I guess there is also a third option… Maybe Unity is the one that is generating the mesh names during import and not the Sketchup exporter. If that’s the case Unity could name similar to as suggested in option 1 instead of numbering.
Again… Maybe I am missing something with the Unity process. Is anyone else able to make a reasonable Sketchup workflow for multi-part models?
After checking the output from an obj export it looks like the mesh numbering is a Sketchup thing. The Unity import obeys the full naming, but does not put things into nice folders. That might be better anyway as the name will be unique and fully qualified ( Unity name resolution uses only the trailing name correct? ) though lookups will be slower. I’ll still need to ( at least ) remove the mesh number from names, but converting an obj text file is a lot easier than dealing with a FBX. Though making a new export plugin still might be the best plan.
Make sure you are using a sketchup version that is supported.
Using this exporter I haven’t ran into many problems, less then I have when I have to export from sketchup to 3dmax to unity.
Take note you will also need imagemagik to get textures to properly work.