Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Help me export unitypackage/prefabs to work inside Maya

Discussion in 'General Discussion' started by FitnessRegiment, Aug 17, 2014.

  1. FitnessRegiment

    FitnessRegiment

    Joined:
    Mar 3, 2014
    Posts:
    20
    I haven't used unity much, I downloaded it on my PC because it has a bunch of unitypackage and prefabs that I want.

    I am not 100% sure how to export these with the textures, UVs etc intact so that I can easily manipulate them in other custom engines and inside Maya.

    Some of the packages are easy and come with .fbx and .psd files, however this one is just a .prefab

    the .UNITYPACKAGE I usually just open inside unity in new scene, right click on asset, show in explorer, and copy all of these into my external hard drive. That should work for these right? They show up as .fbx , .psd etc...

    Is there a custom script that works for exporting assets that are NOT inside the scene? I know 1 custom script but you have to add assets to the scene, and when I am trying to export 500 - 1000 assets it will take hours to go through this.
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    First up, not sure if this is legit as per the EULA and such. For Asset Store stuff I'm fairly sure that you can do what you want with what you buy, but for stuff that comes with Unity itself there might be an expectation that you use it with Unity. But there might not be. Worth checking if that's something you're doing.

    Anyhow, what you're asking doesn't make sense in the general case. Some UnityPackages do indeed contain source model files, such as FBX, OBJ, whatever. But since it's a container format, there's a whole bunch of other arbitrary stuff it could store. Ignoring that it's associated with Unity, what you're asking us is kind of comparable to asking how to import a ZIP file into Maya - the answer depends entirely on what's inside the file, and actually has little to do with the fact that the data is packaged in a ZIP.

    So the answer, as good as it can be, is that if there's something Maya compatible in a package, you get it out by doing exactly what you're doing - using Unity to extract the package, then copying the file that you extracted. If the extracted files aren't in a Maya format you're probably out of luck.

    On the topic of prefabs, they are in fact a Unity specific file format. They don't contain model data, they contain GameObject/Component config data. Sometimes they refer to model data, but with some exceptions (next paragraph) they do not contain it.

    Those exceptions are when someone's written a tool that saves geometry as a part of a scene. There's a few level editor tools that do this, as an example. That's the only way I know of to have a prefab actually contain model data. In that case, the model data is in a tool-specific format, and the only way to get it into Maya is to use that tool to export the data in an appropriate format, assuming it has that functionality.
     
  3. FitnessRegiment

    FitnessRegiment

    Joined:
    Mar 3, 2014
    Posts:
    20
    angrypenguin thank you, these are custom models, not created by the Unity team.

    I thought the same about prefab packages, however I have 100 assets that are all prefabs and they work perfectly, even though I can't find the original objects.

    I have "exported" the other fbx/psds this way:

    1. Open unitypackage
    2. Right click on any asset, show in explorer
    3. Copy all assets I want and drag into my external HDD

    Will these then work in modelling softwares? the PSDs work fine in photoshop. I mean .fbx and .obj should work fine hopefully.
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    Can you give an example of one of these objects? The most likely thing that springs to mind is that they're made up of built-in primitives.

    Like I said, it's just like if you extracted them from a ZIP. In fact, I expect that internally that's almost exactly what's going on - just a compressed archive file with some meta-data.
     
  5. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Collada dae exporter might help you, you can find it in the asset store