• 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
4
Question by Moxon · Nov 30, 2010 at 06:44 AM · prefablightmapexport

How can you export a prefab as a package and retain a Lightmap (that was generated by Unity)?

Question: Is it possible to export a prefab as a package that can be imported into another project with the Lightmap information intact?

Details: I'm trying to use a Scene which contains a building model that was Lightmapped using Unity. The geometry was made into a prefab and inside this particular Scene, I can drag the prefab into the Hierarchy and it looks fine.

However, when I create a new scene inside this project -- dragging the same prefab out yields a broken (incorrectly lit) model. The same holds true for exporting a packaged prefab and importing in a new project.

The Lightmapped Scene in Question was setup by someone else who is new to Unity so if it doesn't export/package could that mean it is not setup correctly?

We are using Unity 3.0 - if that is of any relevance.

Thanks in advance for any help/tips/suggestions!

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 Hugh · Mar 18, 2011 at 11:58 AM 0
Share

I am having the same problem too

5 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by CuddleBeaver · Nov 29, 2011 at 02:13 PM

As far as I can see the lightmap is tied to the scene, so if you try to export the prefab package with all its dependencies, the lightmaps will not be included. Here is what you have to do:

When you make a lightmap inside Unity, a new folder is created in the same folder as the scene with the same name, containing all the 'near' and 'far' lightmaps.

1) Create a new scene in the existing or new project

2) Import the package containing your prefab with all its dependencies.

3) Drag the prefab into the Hierarchy

4) Copy the folder with the lightmaps from the original scene to the one you want to work with.

5) Inside Unity choose Window -> Lightmapping -> Maps

6) Set the 'array size' to the number of lightmaps - if you have 10 near and 10 far lightmaps, set the array size to 10 (if in doubt look in the same place in the original scene). This creates two columns: The first contains the 'far' lightmaps and the second the 'near' lightmaps.

7) Drag each lightmap from the folder to correct place in the collumns. Again - look in the original scene if in doubt.

This works for me.

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 _kiu_ · Jul 25, 2012 at 12:10 PM

Same problem here. Please answer. Was trying to move a project from PC to MAC. LIghtmap UV's are messed up now with some models though settings remains unchanged. What can I do?

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 hatto · Feb 06, 2011 at 04:34 AM

I have the same question... can we have an answer please

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
0

Answer by CuddleBeaver · Nov 29, 2011 at 02:02 PM

One more thing. If the lightmapped objects look VERY light, then you have to select each lightmap file, and under Texture Importer -> Texture Type in the Inspector choose 'Lightmap'.

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
0

Answer by mattdonlan1 · Dec 07, 2011 at 09:58 AM

I have been using this method with some success. I always seem to have a few objects where the light map is re-applied, but incorrectly. It looks as if the auto-unwrap is flipping some normals between scenes. Has anyone else encountered something similar? The only fix seems to be re-running the light map in the new scene.

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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Attaching default script to prefab 1 Answer

Problems importing an asset bundle 1 Answer

How to export Prefab to .FBX file on iOS platform at runtime ? 0 Answers

How to save a lightmapped prefab in Project? 0 Answers

External Lightmapping tool doesn't export all selected objects 2 Answers

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