Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Nested Prefabs: Fully integrated, Completely automatic

Discussion in 'Assets and Asset Store' started by Visual-Design-Cafe, Mar 6, 2017.

  1. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    You can right-click on a property override to remove it.
    And yes, you can override materials. But you can only override the reference to the material and not the properties of a material. This is because the material is a separate asset and it is not part of any prefab. If you want to override properties of a material then you'll have to create a new material, change the properties in the new material, and then override the reference so that it points to this new material.
     
  2. NobleRobot

    NobleRobot

    Joined:
    Jan 14, 2016
    Posts:
    56
    Hi! I'm having some trouble with this asset. Of course, it's a marvel that it works as well as it does, but I find it incredibly finicky and nerve-wracking to correctly use the "Prefab Overrides" component, and often find it doing unexpected things that end up ruining my entire project, requiring me to revert to a previous git commit in order to "try again," and again, and again, to configure something correctly.

    Here's my use-case:

    I have a series of "block" prefabs which are each a small section of a game level, like a single challenge or puzzle area, which my level designers are creating independently by copying a "block template" prefab.

    The "block template" prefab holds a copy of nearly all of the other prefabs in the game, such as "platform" "door" "lift" "art tile", etc. The reason I need to build it this way is because you can't add the "Prefab Overrides" script to a prefab unless it's *already* nested inside another prefab, and each of our prefabs has a lot of variables that need to be configured, so adding the "prefab override" script to each new object one-by-one would take, like, hundreds of years :p. My level designers, when they want to add a new "platform" or "door," duplicate one that already exists in their "block" or copy it from the "block template" prefab, so that the "prefab override" script is also copied over.

    Then, when building out entire levels, we stitch the "blocks" together. Keeping them as prefabs allows to to edit them later, rearrange them between levels, etc.

    I still think this is the best way to do this, given the limitations of what this asset is allowed to do in Unity, but occasionally the linkage will fail, and when a designer applies changes to their "block" prefab strange things will happen, like some but not all of the nested prefabs will randomly just lose their Prefab Overrides component. Of course, sometimes *all* of the nested prefabs will lose the component, too. Or, some (but not all) of the overridden properties will populate to all the prefabs in the project, even when the Prefab Overrides component on the offending nested prefab hasn't disappeared.

    I don't mind dealing with some quirky workflows that are introduced by this asset, and I trust my team to handle a little extra cognitive overhead, because it's still way better than not having it, but I feel like I'm going insane because I don't understand what's happening when it goes wrong. It feels somewhere in-between "buggy" and "user error," and I can't quite figure out which is more likely at any given time.

    I'm probably not describing my situation well-enough to properly troubleshoot, but there are two feature requests which I think would help me out here:

    First, the ability to *copy and paste* Prefab Overrides values from one (of the same) nested prefab to another would be very useful. Now you may be saying, "wait, you can totally do that already." Yes, but it's actually worse than useless because the pasted component still references and controls the GameObject that you copied it from, making it horribly misleading when pasted onto another object (particularly because names/properties are often identical). As far as I know, there is no way to give the same overrides to another object without adding a new empty instance of the Prefabs Override component and manually re-adding the same overrides to that object, or copy/pasting the entire GameObject. Even "paste component values" doesn't work because it also pastes the link to the original GameObject.

    Second, and most helpfully, would be the ability to add a Prefab Overrides component (or similar) to a prefab in the project rather than requiring the prefab to be in a scene and/or already nested in another prefab. Yes, I know this would make it less convenient to uninstall the asset if you need to, but it would solve literally all of my problems and make my project (and others) much less fragile and prone to disaster and user error when using this asset. Is there another reason that this is not possible? Surely the component could simply be set up to have no effect when a prefab isn't nested, no?

    From a technical perspective, I don't have any complaints. This asset seems to be pretty fast and generally useable, and the extra time it takes to apply changes feels perfectly reasonable. I'd like to think that my problems can be completely solved with a little extra UX love, rather than a lot of under-the-hood changes, but I'd like to know if I'm wrong about that, or if there's something I'm missing about how it already works that can alleviate my frustrations.
     
  3. gyorc

    gyorc

    Joined:
    Jan 26, 2018
    Posts:
    1
    Hi, I'm having trouble with VisualDesignCafe.Editor.dll when I try to build from Unity (2017.3.1f1)
    I get the following error:

    Code (CSharp):
    1. ArgumentException: The Assembly UnityEditor is referenced by VisualDesignCafe.Editor ('Assets/Plugins/Visual Design Cafe/Assemblies/VisualDesignCafe.Editor.dll'). But the dll is not allowed to be included or could not be found.
    2. UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
    3. UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:162)
    4. UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:196)
    5. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    I've tried reading through this thread, I've attempted to look for Read-Only files but I'm still unable to build.
    Has anyone else experienced this or are there any thoughts on what could be causing this?
    Thanks in advance.
     
  4. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    There is a file called VisualDesignCafe.Editor.Analytics that was included with the update. What is this for?
     
  5. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    This is most likely caused by a wrong setting in the import settings of the DLL, which can happen if the meta file got deleted. Please select the 'VisualDesignCafe.Editor.dll' plugin in your project and check in the Inspector to make sure that it is only active in the 'editor' and not on any other platforms.
     
  6. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    It is used for automatic bug reporting (if enabled in the settings). It has been included since the first release of Nested Prefabs, but the plugin files have been separated in the latest releases to allow for easier updating on our side.
     
  7. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for using Nested Prefabs and I am glad to hear that you like (most features of) it!

    I am not sure if I understand your use-case completely but it seems that creating a variation for each prefab in the block, instead of having a block template, might fix the issues. You can create a new empty gameobject as a parent so that it is nested and then you can add prefab overrides. Please take a look at the documentation page for more information: https://support.visualdesigncafe.com/hc/en-us/articles/360002412013-Create-Variations
    (We are moving to a new documentation page, in case it doesn't load property please refer to the old one: https://www.visualdesigncafe.com/nestedprefabs/documentation/creating-variations/)

    One of the reasons that the prefab overrides get deleted might be because they are either referring to the wrong objects or attached to a non-nested prefab. Each object has a unique ID inside the prefab, which is referenced by the prefab overrides. And when copying these values between prefabs it can end up with the wrong reference and they will be removed automatically. Duplicating nested prefabs within the hierarchy should work fine. But then moving that duplicated prefab outside of the hierarchy, for example, can cause issues.

    The main reason for this behavior is that your second suggestion, to add prefab overrides to a (root) prefab in the project, does not work with Unity. A prefab override modifies the value of its target property. And when applying the prefab, Unity will automatically save this modified value to the original prefab. Therefore, adding a prefab override to a root prefab has the exact same effect as directly modifying the original property. Nested Prefabs can only change these property values for nested prefabs because they are applied and updated through the plugin and not through Unity. (hopefully, this explanation makes sense). Due to this limitation, the plugin will automatically remove any prefab overrides attached to a root prefab to prevent issues, which probably results in the issues you are seeing where prefab overrides are removed.

    I'll see if there is anything I can do to make copying of prefab overrides easier. But we are quite limited by Unity here as to what is possible.

    As mentioned above, creating prefab variations will most likely solve this issue for you. Because that way you can preconfigure the prefab variation with the correct prefab overrides. However, please let me know if I misunderstood your workflow and this does not work for you.
     
  8. WallaceT_MFM

    WallaceT_MFM

    Joined:
    Sep 25, 2017
    Posts:
    394
    Hi there!
    I'm trying to use Nested Prefabs for levels in my game, so I have a hierarchy like this:
    Code (CSharp):
    1. -Level 5 Prefab
    2. --Player Prefab
    3. ---Normal Nested Stuff Prefab
    4.  
    5. -Level 6 Prefab
    6. --Player Prefab
    7. ---Normal Nested Stuff Prefab
    8. ---Extra Level 6 Only Nested Prefab
    However, with this sort of setup, I can't apply the changes to the "Level 6 Prefab" without applying the "Extra Level 6 Only Nested Prefab" to the "Player" prefab for all the levels, which isn't what I want.
    I looked at using the Prefab Override component, but I couldn't find a way to tell nested prefabs that the extra nested part shouldn't be applied to the Player prefab, only to the Level prefab.
    The workaround I'm using is to just break the prefab connection to the Player for this level, but this seems like a bad idea in the long term, in case the Player prefab is updated later. Making two different versions of the Player prefab also seems like it wouldn't be a good idea, since I'd need to maintain them both.
    So my question is, is there a way to tell Nested prefabs about my use case and not apply the extra prefab to the Player prefab?
    [EDIT] To be clear, when I say "I can't apply the changes", I mean that the Apply Prefab option isn't available to click on, only the Apply Prefab and Children, or the Apply All options.
     
    Last edited: Apr 16, 2018
  9. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    @Visual-Design-Cafe should i put whole folder in gitignore or there is some folder i should not as you save prefabs info there? please advise
     
  10. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I looked into it for you and it should be possible to apply changes to the "Level 6 Prefab". However, in this case, it is not possible to use the Apply Prefab button for "Player Prefab" because Unity will automatically add any children to the prefab that are not in the prefab yet. Unity will see the "Extra Level 6 Only Nested Prefab" as a child that has not been applied yet. This is standard Unity behaviour for prefabs and unfortunately I can't change it (it would require changes to the Unity source code). Therefore the Apply Prefab button and Apply Prefab and Children button will show a warning that it is required to Apply All changes to the entire hierarchy.

    I am currently working on adding support for overriding entire prefabs, objects, or components. But at the moment this is not yet possible. If possible, I recommend moving the extra prefab up in the hierarchy so that it is directly under "Level 6 Prefab" instead of "Player Prefab" (though I understand that this might not be possible).
     
  11. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Which folder do you want to add to gitignore? You do not have to put any additional folders in gitignore for Nested Prefabs. All nested prefab data is saved inside the prefab assets themselves, so the default setup for Unity + Git should work just fine.
     
  12. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    i actual put all the plugins root folders in gitignore.
    like yours is like this
    Assets/Plugins/Visual Design Cafe/
     
  13. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Unfortunately, that will break the project for other users. Please make sure that all the plugin files for Nested Prefabs are included. Otherwise, Nested Prefabs won't be able to load the nested prefab data.
     
    jGate99 likes this.
  14. weber-jaroslaw-dmm

    weber-jaroslaw-dmm

    Joined:
    Mar 30, 2017
    Posts:
    14
    The asset is great overall, but needs some polishing (especially performance). Sometimes it takes over 30 seconds to save deeply nested prefab.

    Also, changing something which is frequently (for example, one type of button) is creating changes to almost every prefab and it is difficult to synchronize work when working in a team. it would be great to have nested parts be able to be "disattached" from other prefabs so i dont need to worry about git conflicts.

    Current workaround would be commiting only the nested prefabs and reverting other prefabs before modyfing them (this way, no conflicts in git, but lot of "changes" in the git workspace is not pleasant to work with).

    I am using this for big project but didnt have problems with any data corruptions yet. Seems solid.
     
  15. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    I'm starting a new project and I already have a lot of error messages like this one :

    "Failed to change parent. Parent does not exist.
    UnityEngine.Debug:LogError(Object)
    VisualDesignCafe.Editor.Prefabs.Comparing.PropertyModifier:ModifyParent(SerializedProperty, SerializedProperty, PropertyInfo) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs.Comparing/modifiers/PropertyModifier.cs:133)
    VisualDesignCafe.Editor.Prefabs.Comparing.PropertyModifier:ModifyProperty(SerializedProperty, SerializedProperty, SerializedObject, SerializedObject, PropertyInfo, Boolean) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs.Comparing/modifiers/PropertyModifier.cs:70)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier:ApplyModifiedProperty(Modification, Boolean) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs.Comparing/modifiers/PrefabModifier.cs:180)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier:ApplyModification(Modification, Boolean, Prefab) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs.Comparing/modifiers/PrefabModifier.cs:79)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier:ApplyModifications(ModificationList, Boolean) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs.Comparing/modifiers/PrefabModifier.cs:40)
    VisualDesignCafe.Editor.Prefabs.ReloadOperation:ModifyPrefab(ModificationList, Boolean) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/operations/ReloadOperation.cs:196)
    VisualDesignCafe.Editor.Prefabs.ReloadOperation:Do() (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/operations/ReloadOperation.cs:180)
    VisualDesignCafe.Editor.Prefabs.ApplyOperation:Do() (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/operations/ApplyOperation.cs:119)
    VisualDesignCafe.Editor.Prefabs.NestedPrefabUtility:ApplyChanges(Prefab[], Boolean) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/utilities/NestedPrefabUtility.cs:670)
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:ApplyPendingChanges() (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/postprocessors/NestedPrefabsPostprocessor.cs:390)
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:EditorUpdate() (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/postprocessors/NestedPrefabsPostprocessor.cs:335)
    VisualDesignCafe.Editor.PostprocessorEventDispatcher:OnEditorUpdate() (at D:/Compiler/Source/Assemblies Source/Editor/VisualDesignCafe.Editor/classes/PostprocessorEventDispatcher.cs:109)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()"

    Any idea why ?

    Thanks
     
  16. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    It can happen for a couple of reasons. Usually, this happens if one of the internal ID's is incorrect. If the nested prefab has different ID's than the original prefab then the plugin can't find the correct objects. In most cases it can be fixed by applying changes using the Apply button in the Inspector or Apply All from the context menu. Nested Prefabs should automatically fix any incorrect ID's when the prefab is saved.
     
  17. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    This issue happens often even when using "Apply All".
    How and why IDs can become incorrect ? I don't understand why this issue happen, it should not. I'm not making "weird" prefab manipulation.

    Is NP compatible with Bitbucket and multiple people working on the same project ?

    Thanks
     
  18. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    It generally shouldn't, it can happen with merge conflicts in Bitbucket, but it is very rare. At the moment there are no known ways to reproduce the issue of getting incorrect ID's so I am afraid I don't have an immediate solution for you. If you have any way to reproduce this issue then please let me know and I should be able to fix it.

    And yes, Nested Prefabs is compatible with Bitbucket/multiple users. Though, please note that all root prefabs contain a copy of each nested prefab so you can have more changed files than expected.
     
  19. TomaszKozera

    TomaszKozera

    Joined:
    Oct 18, 2017
    Posts:
    14
    We're experiencing an issue where the following error pops up randomly after changing scripts, opening project or finishing a project build:
    Code (CSharp):
    1. Assertion failed: Assertion failed on expression: 'modifications.empty()'
    2. UnityEditor.PrefabUtility:InstantiatePrefab(Object)
    3. VisualDesignCafe.Editor.Prefabs.PrefabOperation:InstantiateAsset(GameObject) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/operations/PrefabOperation.cs:180)
    4. VisualDesignCafe.Editor.Prefabs.PrefabOperation:GetInstanceForAsset(GameObject, Boolean) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/operations/PrefabOperation.cs:95)
    5. VisualDesignCafe.Editor.Prefabs.ReloadAssetOperation:Do() (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/operations/ReloadAssetOperation.cs:104)
    6. VisualDesignCafe.Editor.Prefabs.NestedPrefabUtility:ReloadInstancesForAsset(GameObject, PrefabDatabase, Boolean) (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/utilities/NestedPrefabUtility.cs:683)
    7. VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:ApplyPendingChanges() (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/postprocessors/NestedPrefabsPostprocessor.cs:401)
    8. VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:EditorUpdate() (at D:/Compiler/Source/Open Source/Editor/VisualDesignCafe.Editor.Prefabs/postprocessors/NestedPrefabsPostprocessor.cs:335)
    9. VisualDesignCafe.Editor.PostprocessorEventDispatcher:OnEditorUpdate() (at D:/Compiler/Source/Assemblies Source/Editor/VisualDesignCafe.Editor/classes/PostprocessorEventDispatcher.cs:109)
    10. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    Do you know what might be causing this and what implications it might have for us down the road?
     
  20. Zhnigo

    Zhnigo

    Joined:
    Jan 19, 2016
    Posts:
    2
    Hello!
    My team was using a different prefab nesting plugin (prefab evolution), but ultimately it was decided that it was unusable for our project, as every time people switched between git branches or pulled changes to nested prefabs made by others, something invariably broke and nested connections were getting lost left and right. We're currently looking for an alternative prefab nesting plugin. This one seems to have the best reviews, so I wanted to ask those who had the experience, does it behave in a stable way when extensively using git and hopping between branches? Thanks in advance!
     
  21. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    115
    We moved from Prefab Evolution to Nested Prefabs for the same reasons and the experience is much better. We are small team though, so I can't tell you how this would work for larger team but I'm quite happy with the move. The properties overriding is a bit complex but we can live with it. Definitely the best solution available at the moment.
     
  22. SmartMediaNL

    SmartMediaNL

    Joined:
    Sep 29, 2016
    Posts:
    77
  23. Imillionaire

    Imillionaire

    Joined:
    Dec 14, 2012
    Posts:
    60
    can i import nested prefabs from another project? I have 1 unity project that only has all of my environmental assets most of which are modular pieces and combined to make modular buildings/interiors/exteriors using nested prefabs. can i that pack this project up into a unitpackage and then import into my main game project, unpack it (this project also has nested prefabs) and will it retain the nested prefabs so that everything is preserved?
     
  24. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    This error is an internal Unity error that appears when a prefab contains a component with a missing script. You can fix it by removing all components with a missing script from your prefab. Since it can be quite hard to find all of them I have created a script to automatically clean your project, you can find it in the following article: https://support.visualdesigncafe.co...60314-There-are-missing-scripts-in-my-project
     
    TomaszKozera likes this.
  25. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Yes, that should work just fine.
     
  26. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thanks for linking this! The core of Nested Prefabs already uses a custom format to serialize all data but we might be able to use this to improve the prefab overrides. Right now those are a bit limited on the serialization, which is why you can't override entire arrays, components, or objects at the moment. I'll look into this to see if it can be used :)
     
  27. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Hi, I got a few questions:

    1. Now that unity is implementing nested prefabs themselves, will this asset be continued?

    2. If so, what advantages will it have over the integrated solution?

    3. Any news on being able to add objects/prefabs to as content as override alone, while also being able to set their "insert index"?

    4. That description might be a bit hard to follow so here is:
      An earlier post in this thread
      and
      A better description here (same or similar(?) problem with Unitys solution)

    5. Will there be a converter to convert the nested prefabs from this asset to the unity format?
     
  28. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    To answer all your questions at once:
    I will continue to provide support and bug fixes. However, I do not expect to develop any large new features. Unity's nested prefabs has roughly the same features (and some more) so I expect this asset to become obsolete for newer Unity versions, as Unity's nested prefabs is built-in and more performant. Therefore, I am working on a converter script to convert your nested prefabs to Unity's nested prefabs. The current plan is to support this asset up to Unity 2018.2 and provide a converter script for 2018.3 and above.

    Regarding overriding objects: I have made multiple prototypes for this feature, however, I have not been able to develop a stable feature and do not expect it to be added due to the limitations of the current implementation of nested prefabs.
     
    Meceka and tapawafo like this.
  29. TomaszKozera

    TomaszKozera

    Joined:
    Oct 18, 2017
    Posts:
    14
    How can I override the width property of RectTransform? It doesn't show up on the overrides list and is also not found when searching.
     
  30. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Since the built-in Nested prefab system is announced, we were reluctant to produce new nested prefabs with this asset, worrying about converting to unity built in system after it's released. (that would be very complicated to do manually)

    I am relieved to hear that you are going to work on a converter. I am posting this because with your commitment we are going to keep producing more nested prefabs in our project. And I believe 99% of asset users would need that converter after 2018.3 is released.

    In case you realize that you might not be able to work on the converter, or it would have major limitations, please share it as early as possible.

    Thanks
     
  31. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    The width of the RectTransform is serialized by Unity as the 'Size Delta' property. You can override the 'x' value of the 'Size Delta' property to override the width.
     
  32. sketchygio

    sketchygio

    Joined:
    Nov 6, 2014
    Posts:
    31
    Hey I just wanted to say thanks again for making this addon. It's really helped me get a headstart on my project when Unity never had the functionality I needed, and it's been so intuitive and helpful.

    Now that Unity seems to be adding its own version of nested prefabs, and although your plugin has been invaluable to me, I might try migrating to the new system. While I haven't gotten a chance to mess around in the beta just yet, I was wondering if you had tried it out and found any significant differences or flaws with the new workflow. And if it is outright similar, I wanted to know if you had any suggestions for migrating existing nested prefabs from the addon to default Unity nested prefab system.
     
  33. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you, I am glad to hear that Nested Prefabs helps your workflow!

    The new system in Unity has a different workflow but technically has almost the same features/functionality (and a few more). At the moment I am working on a conversion script to automatically convert your project to Unity's nested prefabs. It is going a bit slowly since there is almost no documentation available on the new prefab system, but I am fairly confident that I will be able to make the plugin fully compatible with Unity's new system.

    At the moment I do not recommend trying out the new preview build along with our Nested Prefabs plugin (unless you make a backup first), in its current state it is not compatible at all and will corrupt all prefabs in your project.
     
    Meceka, sketchygio and Brogan89 like this.
  34. sketchygio

    sketchygio

    Joined:
    Nov 6, 2014
    Posts:
    31
    Thanks, I'm glad to hear that and appreciate your continued support of your addon. You're the best!
     
    Visual-Design-Cafe likes this.
  35. Zarif73

    Zarif73

    Joined:
    Aug 30, 2012
    Posts:
    6
    Hello ,
    May be this question already asked here , but can you explain to me your license policy.
    Lets say , we have couple of tech artists and developers .
    One of tech artists will create all nested prefabs.So we should buy only one license for him?
    but what about rest of artists and developers that will create builds? can they use those nested prefabs and create builds?

    Thank you,
     
  36. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for your interest in Nested Prefabs.
    Everyone who actively works on the project in Unity should purchase a license. This includes developers and artists who do not directly modify the prefabs themselves but still work with them in Unity.
    Those who do not actively work in Unity do not need to purchase a license. For example, an artist who creates models in external software and then opens the project in Unity to import those models, without doing further work with those models in Unity (besides setting import settings and similar tasks).
     
  37. LouisHong

    LouisHong

    Joined:
    Nov 11, 2014
    Posts:
    69
  38. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    We are currently working on support for 2018.3. Since Unity released nested prefabs we are working on making our nested prefabs compatible and convertible to Unity's nested prefabs. The compatible version is about 95% finished and we will release a preview build soon that is compatible with the beta. We recommend not to use the 2018.3 beta with our nested prefabs until then.
     
  39. LouisHong

    LouisHong

    Joined:
    Nov 11, 2014
    Posts:
    69
    I wonder what your opinion on Unity's Nested Prefab is. Since it's the same workflow.
     
  40. helloworldgames

    helloworldgames

    Joined:
    Mar 16, 2017
    Posts:
    60
    please provide the update/fix as soon as possible.
    thanks

     
  41. witcher112x

    witcher112x

    Joined:
    Jul 14, 2017
    Posts:
    3
  42. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    It is almost finished. It is already possible to convert all nested prefabs and nested models. We just have a few last issues and tweaks left, as well as improving the workflow a bit. At the moment we are still on schedule on having it available as a preview build by the end of the week (Sunday that is, not Friday).
     
  43. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Unity's nested prefabs are technically very good. The performance is great and it supports all the features you would need. The workflow takes a bit of time to get used to though, as some of the flexibility of editing prefabs in the hierarchy is gone. I personally find the visual feedback to be quite minimal as well. There is no way to see which objects, components, or properties are overridden unless you open the prefab for editing. But overall it is a great step forward for Unity and it is a very solid nested prefab system to work with.
     
  44. witcher112x

    witcher112x

    Joined:
    Jul 14, 2017
    Posts:
    3
    Thank you!

    I'm looking forward for it.
     
  45. helloworldgames

    helloworldgames

    Joined:
    Mar 16, 2017
    Posts:
    60
    Hi there, How do we access the preview build?
    will we get notification as update?
    Thanks
     
  46. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    The project converter feature will be available as part of the next official release, so you can download it through the built-in updater or through the Asset Store (You should get a notification automatically). The converter will automatically detect if the used Unity version supports nested prefabs and ask if you want to convert the project. Besides that, you can also access the converter through a "beta" option in the menu.
    nested_prefabs_beta_feature.jpg

    Unfortunately, the release of the converter is slightly delayed due to a bug in Unity's beta version. The converter is working fine, but Unity automatically resets the transforms of all prefab instances in the scene when the prefab asset is replaced... :( We should be able to find a workaround pretty quickly though. So hopefully, we can publish the new build today.
    I'll post an update on the workaround for that bug and the release schedule here in a few hours

    Edit
    Luckily, the beta came with some new API calls that did work properly. So the bugs have been fixed :)
     
    Last edited: Sep 24, 2018
  47. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    A conversion script for Unity 2018.3 beta has been published as a preview feature in the latest 1.4.0 release. It can be accessed through the menu 'Assets/Nested Prefabs/Beta/Convert To Unity Nested Prefabs'. The script will convert your entire project to Unity's nested prefabs and then uninstall our Nested Prefabs plugin. Note that the feature is still in beta. The converter has been tested on all regular prefab setups but there might still be some issues in more complex projects. Make sure to create a backup of your project before running the script.
    At the moment the new build is only available through the built-in updater and not yet in the Asset Store. Please go to Window/Visual Design Cafe/Nested Prefabs/Check for Updates' to get the latest build.
     
  48. NobleRobot

    NobleRobot

    Joined:
    Jan 14, 2016
    Posts:
    56
    I need some help.

    I updated to the latest version of this asset, and immediately my project began experiencing a very bizarre set of errors. I am seeing one of my own warning messages appear in the Console, except the script it's part of is not in the scene. The error doesn't highlight which GameObject it comes from, because again, it's not in the scene. The object and script does exist as a child prefab in a few of my nested prefabs, which is why (other than the timing of the error) I suspect that Nested Prefabs is to blame.

    Sure enough, when I go to the part of the script where this warning comes from, I can add any code and it will run in *every single one of my scenes* (this particular code block runs in the editor, too!). I am able, for example, to clone the phantom object into any scene in my project by placing "GameObject.Instaniate(gameObject)" in that same block of code. The "orginal" GameObject remains nowhere to be found. I have run scripts trying to discover "hidden" objects (a not uncommon Unity issue, is seems), but to no avail. This code executes even in scenes where no instance of that object ever existed.

    The only reason I even caught it is because I had placed a Debug warning in that part of my code. Who knows what other phantom objects are being created/executed...

    I understand that Nested Prefabs uses some kind of cache to store information about child prefabs and other values. Is there some way I can clear or rebuild it? I don't want to uninstall the asset unless I have to. What exactly happens if I uninstall and reinstall it?

    Of course, it's possible that this error has nothing to do with Nested Prefabs, but I have no other suspects. Has anyone seen anything like this before?
     
  49. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    There are two possible causes for this that I can think of:
    - When a prefab is modified or applied, the asset will be loaded by Nested Prefabs to check the modifications that were made. When the asset is loaded, Unity will automatically start any scripts on the prefab that run in the editor. This is normal behaviour for Unity and you can check for it in your script so it doesn't run on assets (using EditorUtility.IsPersistent). The same happens when you select the prefab in the project window so that it shows in the Inspector.
    - If a modification to a nested prefab was found then Nested Prefabs will briefly instantiate the original prefab asset so that the modifications to the nested prefab can be applied to the original prefab asset. Once the modifications have been made to the instance of the original asset, it will be saved to the prefab asset, and the instance will be deleted. This is most likely what is causing the warning to show and why you are not able to find the GameObject that logged the error. When the temporary instance of the asset is instantiated your scripts will activate, and then the instance will be deleted immediately so you won't be able to find it.

    There is no difference in this behaviour between the latest version and any of the previous versions of Nested Prefabs, so it is most likely not caused specifically by the latest update (unless you upgraded from a very old version).

    If this keeps happening every time you save a scene then please double check that your custom scripts are not marking the prefab as modified. This is one of the most common causes of unwanted saves and performance issues. If the script sets any of the values in a prefab, even if that value didn't change, then Unity will mark the prefab as modified and it will keep constantly saving it, triggering a modification check for Nested Prefabs.
     
  50. NobleRobot

    NobleRobot

    Joined:
    Jan 14, 2016
    Posts:
    56
    Thanks for the tips. I'll check into them. As I said, this would happen in scenes where the original object has never appeared, but since Prefabs are project-wide and Nested Prefabs works silently in the background, this might go some way toward an explanation.

    Ultimately, though, what I did was place more debug statements in my executing code in order to determine the parent/grandparent GameObject of the object that was causing the problem. Turns out, it was a Prefab object (that contained Nested Prefabs including this one) that I hadn't used in any scene in months, but still existed in the Assets panel. When I deleted the Prefab from the project (thankfully I didn't need it any longer), the problem went away immediately, but it may also have eliminated my only reliable diagnostic method. The "offending" prefabs still exists as both a regular Prefab and a Nested Prefab without complaint elsewhere in the project.

    This is why I was asking about "refreshing" things, because it seemed (and evidentially was) a corrupted reference of some kind, but obviously I don't really know how it does its magic.

    I'll keep my eyes out for any future problems, with your comments to guide me, as I'm not 100% confidant that I've gotten to the bottom of it.