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

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
    Unfortunately, it has not been added yet. Due to a lot of requests to release the source code we have pushed some features to the next version and first released the source code as version 1.3.0. Though, we have prepared the backend to support this feature more easily. It will be rolled out in one of the 1.3.x updates.
     
  2. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    I'm still experiencing new issues and I'm starting to be a bit tired about that. I'm expecting the plugin to work seamlessly but it's not really the case. In fact I'm spending a lot of time trying to understand what's is going on and how to fix that. I don't want to be mean but I'm really relying on NP on my project so I need it to works as expected.

    So what's happening now ? I'm working with MasterAudio plugin, not sure if it's related but it could be. I'm creating an object which is an instance of Master Audio "Dynamic Sound Group Creator" Prefab. Then I'm adding (drag & drop) audio source on the newly created object in order to dynamically create "Dynamic Sound Group" which mean create child GameObject with a specific script. This newly created child object will have a child object too. I repeat the operation so I have a hierarchy like this:

    -Parent
    -- Child1
    ---- Grand Child 1
    -- Child 2
    ---- Grand Child 2

    I then put the "parent" game object in my project view in order to make it a prefab and then automatically all "grand child" game objects are removed. I made some other tests after that, I can't remember exactly what and the order. But I do have error messages in the console :

    [EDIT] I repeat the same operation and after dropping the Parent GameObject into the project view it seems that all Child and Grand Child are "treated" as "nested prefabs". Not sure why because they are not. I may confuse all the steps but in all cases the behaviour is not the expected one.

    Thanks

    "SerializedObject target has been destroyed.
    System.Reflection.MethodBase:Invoke(Object, Object[])
    VisualDesignCafe.Editor.Prefabs.SerializedObjectExtensions:UpdateIfRequired(SerializedObject)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier:ApplyModifiedProperty(Modification, Boolean)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier:ApplyModification(Modification, Boolean, Prefab)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier:ApplyModifications(ModificationList, Boolean)
    VisualDesignCafe.Editor.Prefabs.ReloadOperation:ModifyPrefab(ModificationList, Boolean)
    VisualDesignCafe.Editor.Prefabs.ReloadOperation:Do()
    VisualDesignCafe.Editor.Prefabs.ApplyOperation:Do()
    VisualDesignCafe.Editor.Prefabs.NestedPrefabUtility:ApplyChanges(Prefab[], Boolean)
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:ApplyPendingChanges()
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:EditorUpdate()
    VisualDesignCafe.Editor.PostprocessorEventDispatcher:OnEditorUpdate() (at D:/Compiler/Source/Assemblies Source/Editor/VisualDesignCafe.Editor/classes/PostprocessorEventDispatcher.cs:109)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()"

    "ArgumentNullException: Argument cannot be null.
    Parameter name: GameObject
    VisualDesignCafe.Editor.Prefabs.PrefabHierarchyUtility.GetPrefab (UnityEngine.GameObject gameObject)
    VisualDesignCafe.Editor.Prefabs.Comparing.PropertyModifier.ModifyProperty (UnityEditor.SerializedProperty source, UnityEditor.SerializedProperty destination, UnityEditor.SerializedObject destinationObject, UnityEditor.SerializedObject sourceObject, VisualDesignCafe.Editor.Prefabs.Comparing.PropertyInfo info, Boolean keepPrefabOverride)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier.ApplyModifiedProperty (VisualDesignCafe.Editor.Prefabs.Comparing.Modification modification, Boolean keepPrefabOverride)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier.ApplyModification (VisualDesignCafe.Editor.Prefabs.Comparing.Modification modification, Boolean keepPrefabOverride, VisualDesignCafe.Editor.Prefabs.Prefab target)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier.ApplyModifications (VisualDesignCafe.Editor.Prefabs.Comparing.ModificationList modifications, Boolean keepPrefabOverride)
    VisualDesignCafe.Editor.Prefabs.ReloadOperation.ModifyPrefab (VisualDesignCafe.Editor.Prefabs.Comparing.ModificationList modifications, Boolean revertLocalChanges)
    VisualDesignCafe.Editor.Prefabs.ReloadOperation.Do ()
    VisualDesignCafe.Editor.Prefabs.ApplyOperation.Do ()
    VisualDesignCafe.Editor.Prefabs.NestedPrefabUtility.ApplyChanges (VisualDesignCafe.Editor.Prefabs.Prefab[] prefabs, Boolean includeNestedChildren)
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor.ApplyPendingChanges ()
    UnityEngine.Debug:LogException(Exception)
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:ApplyPendingChanges()
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:EditorUpdate()
    VisualDesignCafe.Editor.PostprocessorEventDispatcher:OnEditorUpdate() (at D:/Compiler/Source/Assemblies Source/Editor/VisualDesignCafe.Editor/classes/PostprocessorEventDispatcher.cs:109)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()"

    "Nested Prefabs: Unhandled exception (details below). Please report this as a bug to the developer (support@visualdesigncafe.com) if this exception keeps appearing.
    Bug report:
    {
    Message: "ArgumentNullException: Argument cannot be null.
    Parameter name: GameObject"
    Version: "1.3.1.51"
    Unity Version: "2017.3.0f3 (a9f86dcd79df)"
    StackTrace: [
    VisualDesignCafe.Editor.Prefabs.PrefabHierarchyUtility.GetPrefab (UnityEngine.GameObject gameObject)
    VisualDesignCafe.Editor.Prefabs.Comparing.PropertyModifier.ModifyProperty (UnityEditor.SerializedProperty source, UnityEditor.SerializedProperty destination, UnityEditor.SerializedObject destinationObject, UnityEditor.SerializedObject sourceObject, VisualDesignCafe.Editor.Prefabs.Comparing.PropertyInfo info, Boolean keepPrefabOverride)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier.ApplyModifiedProperty (VisualDesignCafe.Editor.Prefabs.Comparing.Modification modification, Boolean keepPrefabOverride)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier.ApplyModification (VisualDesignCafe.Editor.Prefabs.Comparing.Modification modification, Boolean keepPrefabOverride, VisualDesignCafe.Editor.Prefabs.Prefab target)
    VisualDesignCafe.Editor.Prefabs.Comparing.PrefabModifier.ApplyModifications (VisualDesignCafe.Editor.Prefabs.Comparing.ModificationList modifications, Boolean keepPrefabOverride)
    VisualDesignCafe.Editor.Prefabs.ReloadOperation.ModifyPrefab (VisualDesignCafe.Editor.Prefabs.Comparing.ModificationList modifications, Boolean revertLocalChanges)
    VisualDesignCafe.Editor.Prefabs.ReloadOperation.Do ()
    VisualDesignCafe.Editor.Prefabs.ApplyOperation.Do ()
    VisualDesignCafe.Editor.Prefabs.NestedPrefabUtility.ApplyChanges (VisualDesignCafe.Editor.Prefabs.Prefab[] prefabs, Boolean includeNestedChildren)
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor.ApplyPendingChanges ()
    UnityEngine.Debug:LogException(Exception)
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:ApplyPendingChanges()
    VisualDesignCafe.Editor.Prefabs.NestedPrefabsPostprocessor:EditorUpdate()
    VisualDesignCafe.Editor.PostprocessorEventDispatcher:OnEditorUpdate() (at D:/Compiler/Source/Assemblies Source/Editor/VisualDesignCafe.Editor/classes/PostprocessorEventDispatcher.cs:109)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    ]
    }

    UnityEngine.Debug:LogError(Object)
    VisualDesignCafe.NestedPrefabs.NestedPrefabsAnalytics:LogExceptions() (at D:/Compiler/Source/Closed Source/Editor/VisualDesignCafe.NestedPrefabs/NestedPrefabsAnalytics.cs:470)
    VisualDesignCafe.NestedPrefabs.NestedPrefabsAnalytics:OnEditorUpdate() (at D:/Compiler/Source/Closed Source/Editor/VisualDesignCafe.NestedPrefabs/NestedPrefabsAnalytics.cs:448)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()"
     
    Last edited: Feb 14, 2018
  3. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    I made some screenshots that show a weird behaviours in 3 steps:

    This is a prefab
    Screen Shot 2018-02-14 at 11.59.38.png

    Then I add new game object inside
    Screen Shot 2018-02-14 at 12.00.08.png

    Then I applied the modifications and you can see that nested prefabs are created and the content of TIMER has been changed
    Screen Shot 2018-02-14 at 12.00.22.png
     
  4. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    My apologies for this strange behavior. I looked into it but I can't seem to reproduce the issue so far. In the steps shown in the screenshots, is the 'Playback_04_Metronome' prefab a new prefab dragged in from the project view? Or is it a duplicate of a different prefab in any way? Based on the screenshots it looks like the Playback_04_Metronome prefab and TIMER prefabs point to the same asset. Can you try to left click on the prefab icons once? It will ping the asset it is linked to, that way you can check that it is linked to the correct asset. In this case the child of 'Playback_04_Metronome' is also a 'Playback_04_Metronome' which might not be correct. Are these the exact same prefabs? Or are they different prefabs with the same name?

    Also, since it is not the default hierarchy view, what do the grey prefab icons represent here? Do they indicate objects, prefabs, or something else?

    If it is possible, can you share the project with me? Then I'll look through it to find out why Nested Prefabs is causing such strange issues. It will definitely help to fix all issues, though I understand if it is not possible to share the project.
     
  5. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    The hierarchy view is QHierachy.

    The 'Playback_04_Metronome' prefab does not exist, I mean, it was automatically created by NP after "hitting apply" in the Nested Prefab dropdown menu. Same way the content of the "TIMER" game object has been changed at the same time.

    As you expected 'Playback_04_Metronome' prefabs point to the same prefab which is a default Master Audio prefab for this kind of game object. Same way "TIMER" and "PLAYBACK" (all G of the same hierarchy levels" point to another Master Audio default prefab. It's like NP detect that those GameObject have been instantiated from "prefabs" and then treat them as "nested prefabs". Does that make sense ?

    [EDIT] So if I understand correctly NP may have no "way" to make the difference between "drag & drop" a prefab inside a prefab and "instantiate" a prefab in a prefab. That would explain why nested prefabs are created. But not why the content of one GO (TIMER) has been modified.
     
    Last edited: Feb 14, 2018
  6. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Yes, there is no difference between "drag & drop" and "Instantiate". They both have the exact same effect. So if you instantiate a prefab and then apply the parent, the instantiated prefab will be nested.

    So in this case, if the same thing happened with the TIMER and PLAYBACK prefabs and they point to the same asset, then that is the reason that TIMER was modified.
     
  7. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Ok, so it means that NP is not "compatible" with MasterAudio plugin or any assets that instantiate prefabs. Good to know, painfull but good to know.
     
  8. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I don't use MasterAudio myself, so I am not exactly sure how it instantiates prefabs and if it can be made compatible. Can you let me know what MasterAudio does exactly? Does it instantiate prefabs in the editor based on your settings?
     
  9. corsarus

    corsarus

    Joined:
    Feb 10, 2017
    Posts:
    1
    Hello.

    I'm using Nested Prefabs 1.3.1 in Unity 2017.3.0f3 and the prefab overrides don't seem to work.

    I was been able to reproduce the issue by creating two simple prefabs, UI Panel and UI Button.
    I then added an Panel instance to the Hierarchy and inserted a Button instance as child of the Panel. I clicked Apply on the Panel instance to create the Button nested prefab, then I added the Prefab Overrides component to the Button and selected the Image / Color property to be overriden.

    When I clicked Apply on the Button instance (the "Apply Prefab" option in the Hierarchy contextual is disabled), the Prefab Overrides component was saved in the UI Button prefab and applied across all instances.

    Could you please tell me if I'm doing something wrong or if there is a known issue with the plugin?

    If I can assist you in investigating the problem, please ask me.

    [Edit]: Sorry, I didn't fully understand how prefab overrides work. If I duplicate the root prefab instance in the Hierarchy and change the overriden property on the duplicate, it also applies to the original prefab. So, instead of duplicating the root prefab, I created a new one and added the Button prefab as a child, and I was able to override the same property with different values, one for each root prefab.
     
    Last edited: Feb 21, 2018
  10. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    That sounds correct indeed. If you override a property in the nested Button then that property will be saved in the Panel prefab (in this case). So all instances of the Panel prefab will have the same overrides and values. If you create different Panel prefabs with the same Button as nested prefab then you can set different overrides for the nested Button.

    Please feel free to contact me if anything else is unclear or if you have any further questions and I'll gladly help you out.
     
  11. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,076
    Hi,

    I used Nested Prefabs in my Project but realized that I actually do not need it (because I have a system where I can compose UIs with code consisting of several Prefabs).
    So, I removed it from my project a while ago.

    Now I realized that when I instantiate one of the prefabs, I get a lot of warnings because of MonoBehaviours which couldn't be found. When I click on the instantiated object, I can see that there is one or more Components attached to the object (and sub-objects) which cannot be loaded with the title "Nothing Selected".
    The strange thing is, that these components appear out of nowhere. I have never defined them and they are also not visible when I view the prefab with the inspector.
    Also reimporting all assets did not help.

    I checked the prefab files with a text editor and there I can see that the count of MonoBehaviours is equal to the count of the actual attached MonoBehaviours plus the "Nothing Selected" Behaviours. So the "phantom components" are really stored but I cannot delete them from the prefabs with the inspector (cause they do not appear there).

    I believe these behaviours where created somehow by Nested Prefabs. Prefabs which I created after removing Nested Prefabs do not have these "Phantom Components".

    Is there a way to get rid of the "phantom components"? Or can I somehow identify them with a text editor?
     
    Hazkin likes this.
  12. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    Do you have any news regarding this issue ? I'm unable to to create proper UI because of this. Thanks.
     
  13. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    My apologies for these problems. You can use the script in this post to remove all the missing scripts from your project automatically:
    https://forum.unity.com/threads/nes...mpletely-automatic.459495/page-5#post-3258696

    Can you let me know which version of Unity you are using? We have received some more reports with this issue but we can't seem to reproduce it here.
     
  14. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Unfortunately not, they responded back that they were unable to reproduce the issue. I have given them even more details now and asked them to try again, so I hope they will be able to reproduce the issue this time...
     
  15. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,076
    Thanks for the code.
    Just a note on that: I tried it while having a scene open with a prefab inside. Unity crashed.
    After creating a new scene and tried it with that scene open it worked (however: I got two assertion fails in my logs... but they don't seem to caused any problem).

    I am using Unity 2017.1.1f1
     
    Visual-Design-Cafe likes this.
  16. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    902
    Getting this in Unity 5.6.4:

    Code (CSharp):
    1. GetFullUnityVersion can only be called from the main thread.
    2. Constructors and field initializers will be executed from the loading thread when loading a scene.
    3. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
    4. UnityEditorInternal.InternalEditorUtility:GetFullUnityVersion()
    5. VisualDesignCafe.NestedPrefabs.NestedPrefabsAnalytics:CreateAndSendBugReport(String, String, Boolean)
    6. VisualDesignCafe.NestedPrefabs.NestedPrefabsAnalytics:CreateAndSendBugReport(Exception, Boolean)
    7. VisualDesignCafe.NestedPrefabs.<>c__DisplayClass36_0:<CheckNewVersion>b__0()
    8. VisualDesignCafe.Editor.EditorWebRequest:OnDownloadCompleted(Object, DownloadDataCompletedEventArgs, Action)
    9. VisualDesignCafe.Editor.<>c__DisplayClass30_0:<Send>b__0(Object, DownloadDataCompletedEventArgs)
    10. System.Net.WebClient:<DownloadDataAsync>m__D(Object)
     
  17. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    This is caused by an issue with our servers when checking for updates at startup. It started happening suddenly a while ago without any changes on our side, so we have no idea what is causing it unfortunately. The latest version of Nested Prefabs should have a fix for this. Please download the latest verison from the Asset Store and give it a try. You can also safely ignore this error if you want to keep using the current version, it does not cause any issues.

    If you will update to the latest version then please make sure to make a backup of your current project. The latest version uses a new serialization system for Prefab Overrides and you can't go back after installing.
     
  18. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    191
    Hey @Visual-Design-Cafe

    Looking into getting your asset, just wondering if its compatible with PS4 (or if there is any reason it wouldn't work)? Just don't want to make 100's of prefabs only to have to remake them when we launch on PS4.

    Cheers,
    Colton
     
  19. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Hi Colton,

    Yes, Nested Prefabs should be fully compatible with PS4.
    We have not specifically tested the plugin with PS4, however, when building your project all nested prefab data is removed and only regular Unity prefabs are exported. So there should be no reason at all why it wouldn't work.
     
  20. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    191
    Thats what I figured, Thanks, will be buying later today!
     
    Visual-Design-Cafe likes this.
  21. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    I'm trying to update to 1.3.2 but during the downloading operation it makes Unity crashes everytime.
     
  22. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for letting me know. There have never been any issues with the downloader so I am not sure why it would crash all of a sudden (nothing changed). I'll send you a download link by PM so you can install the latest version.
     
  23. Fatswallow

    Fatswallow

    Joined:
    Dec 4, 2015
    Posts:
    5
    After recent update, we're having problem on builds.
    Every time I build I got lot of exceptions when I call VisualDesignCafe.Editor.Prefabs.Building.BuildUtility:preprocessBuild(). here is error message :
    Code (CSharp):
    1. UnauthorizedAccessException: Access to the path "[PREFAB FILEPATH].prefab" or "Library/PrefabDatabase/58762ebfb99924a4d801154e0fb3a487" is denied.
    2.  
    3.  
    4.   at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) [0x001bd] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:124
    5.  
    6.  
    7.   at VisualDesignCafe.Editor.Prefabs.Building.AssetBackup.Export (System.String path, System.Action`3 progressCallback) [0x0009d] in D:\Compiler\Source\Open Source\Editor\VisualDesignCafe.Editor.Prefabs.Building\classes\AssetBackup.cs:64
    8.  
    9.  
    10. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    11.  
    12.  
    13. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    14.  
    15.  
    16. UnityEngine.Logger:LogException(Exception, Object)
    17.  
    18.  
    19. UnityEngine.Debug:LogException(Exception, Object)
    20.  
    21.  
    22. VisualDesignCafe.Console:LogException(Exception, Object) (at D:\Compiler\Source\Open Source\Editor Mono\VisualDesignCafe.Editor.Prefabs\Console.cs:125)
    23.  
    24.  
    25. VisualDesignCafe.Editor.Prefabs.Building.AssetBackup:Export(String, Action`3) (at D:\Compiler\Source\Open Source\Editor\VisualDesignCafe.Editor.Prefabs.Building\classes\AssetBackup.cs:68)
    26.  
    27.  
    28. VisualDesignCafe.Editor.Prefabs.Building.BuildPreprocessor:PreprocessBuildFull(String) (at D:\Compiler\Source\Open Source\Editor\VisualDesignCafe.Editor.Prefabs.Building\postprocessors\BuildPreprocessor.cs:178)
    29.  
    30.  
    31. VisualDesignCafe.Editor.Prefabs.Building.BuildPreprocessor:PreprocessBuild(String) (at D:\Compiler\Source\Open Source\Editor\VisualDesignCafe.Editor.Prefabs.Building\postprocessors\BuildPreprocessor.cs:126)
    32.  
    33.  
    34. VisualDesignCafe.Editor.Prefabs.Building.BuildPreprocessor:OnPreprocessBuild() (at D:\Compiler\Source\Open Source\Editor\VisualDesignCafe.Editor.Prefabs.Building\postprocessors\BuildPreprocessor.cs:23)
    35.  
    36.  
    37. VisualDesignCafe.Editor.Prefabs.Building.BuildUtility:PreprocessBuild() (at D:\Compiler\Source\Open Source\Editor\VisualDesignCafe.Editor.Prefabs.Building\utilities\BuildUtility.cs:37)
    38.  
    39.  
    40. NKE.BuildScript:BuildApp(BuildTarget, BuildTargetGroup, String) (at Assets\ASSET_STATIC\AS_SCRIPT\NKC\Editor\BuildScript.cs:62)
    41.  
    42.  
    43. NKE.BuildScript:BuildAndroidApp() (at Assets\ASSET_STATIC\AS_SCRIPT\NKC\Editor\BuildScript.cs:48)

    This causes prefab info not backed up, thus prefab not reverted properly.


    I found workaround by deleting /Library/PrefabDatabase before every build.

    this behaivor does not happens when I delete
    /Library/PrefabDatabase, so maybe just read-only access problem I think.
     
  24. nataku000

    nataku000

    Joined:
    Mar 30, 2017
    Posts:
    4
    I uninstall Nested Prefabs in my project but it not clean !
    If there are more than 11 prefab in my project, it seems that Nested Prefabs component will remain
    How i can clean it ?
     
  25. dputros

    dputros

    Joined:
    Jul 31, 2015
    Posts:
    1
    If i purchase Nested Prefab, will others on my team who are on my collab have to purchase this as well for unity to run for them? Or will they be ok as long as they don't try to use Nested Prefab features?
     
  26. nataku000

    nataku000

    Joined:
    Mar 30, 2017
    Posts:
    4
  27. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
  28. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
  29. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for your interest in Nested Prefabs. As long as the other users are not using any of Nested Prefab's features then it will be ok. If they are planning to use Nested Prefabs then they will need a license as well. They will be able to properly load all prefabs without any license.
     
  30. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for reporting this issue. I am currently looking into it and it might be caused by a file that is marked as read-only. Also, it can happen if you don't have administrator permissions. Can you double check that you have administrator permissions when building the project? I'll send you a custom build as well with a fix for read-only files as soon as possible.
     
  31. MomijiStudios

    MomijiStudios

    Joined:
    Dec 9, 2013
    Posts:
    3
    Hi, this tool is exactly what I needed for my project and it's really well done. Thank you!

    But it seems that if I apply Scale values to a nested prefab's original, it does not apply to instances of that nested prefab. I tested it by adding components to the original; that does stick to the instances. Is there a way to make Scale also stick to the instances?

    Edit: Hmm, I'm now having severe issues that are rendering Unity absolutely unusable. I can't seem to edit any Transform values for anything. I can't rename objects. I can't unload a scene. I basically can't really do *anything* that is necessary to make a game. Is there a reason or solution to this? Otherwise I'll just have to get a refund.
     
    Last edited: Mar 16, 2018
  32. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    The transform values for the root of a (nested) prefab are ignored so that multiple instances of the same nested prefab can all have a different position, rotation, and scale. The same goes for the name of the nested prefab. All transform values and names of any children in a nested prefab will be applied as expected. If you absolutely need a nested prefab to have its scale updated then I recommend to add an additional empty game object as the root of the nested prefab.

    If you have any other problems then can you please share a screenshot of the issue? Then I should be able to explain exactly what is happening with the prefabs in the screenshot.
     
  33. nataku000

    nataku000

    Joined:
    Mar 30, 2017
    Posts:
    4
    When a certain character fbx itself was placed in the scene, a build error occurred. Not all fbx gets an error. The error message is below.
     

    Attached Files:

  34. MomijiStudios

    MomijiStudios

    Joined:
    Dec 9, 2013
    Posts:
    3
    Okay, the Transform thing totally makes sense. I could easily just make a script to handle that if it's necessary.

    I went to my backup and deleted the project with NP in it, so I can't really show you screenshots. I could maybe try to reproduce it. But honestly screenshots wouldn't really help. It's just that the hierarchy became completely broken to the point where I couldn't rename any objects or delete them. I also couldn't click in the Transform fields in the Inspector and change the values. Basically it became unusable.
     
  35. nataku000

    nataku000

    Joined:
    Mar 30, 2017
    Posts:
    4
    "Component could not be loaded when loading game object. Cleaning up!" ,
    This error message seems to be just the number of FBX hierarchies.
    If you manually change the FBX Import Setting and then apply it, this error will not occur.
    However, when restarting Unity Editor it will start again
     
  36. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    This sounds like an issue with Unity itself, or maybe an incompatibility with another extension. Nested Prefabs does not influence the UI in the inspector so it is unlikely to cause this (unless the issue happened when applying the changes). When renaming or deleting objects, did you have issues before or after applying the changes, and did you make this changes to a root prefab or a nested prefab?
     
  37. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    There might be a missing script on one of the models, or one of your scripts has an error. (This can happen if the name of a MonoBehavior class does not match the name of the file). Also, do you still have Nested Prefabs installed in your project? In your previous post you mentioned that you uninstalled Nested Prefab.
     
  38. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    I was wondering if it could be possible to "exclude" some prefabs from NP "management" ? I'm using MasterAudio which is completely based on prefab instance creations. When modifying those prefabs configurations, for example audio clips locations, number of Sound Group Variation etc. etc. etc. I have a lot of troubles and properties are not correctly applied, some times values are mixed or child game-objects are duplicated etc. I can't really explain why but it seems that Master Audio and NP do not work really well together. So if it could be possible to "tell" NP to not manage some prefabs it could solve my issue.

    Thanks
     
  39. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Master Audio does indeed have some compatibility issues with Nested Prefabs. It seems that the way they instantiate and modify prefabs doesn't work nicely together. You can compile a custom version of the plugin to easily ignore certain folders, there is already an example array present in the source (line 12 of this file): https://bitbucket.org/VisualDesignC...sor.cs?at=master&fileviewer=file-view-default
    Adding a folder to that array will completely ignore it from any modifications done by Nested Prefabs.

    Alternatively, you should be able to remove all modifications to Master Audio prefabs through a postprocessor, that way you don't have to compile a custom version of the plugin. I'll have to double check it to make sure though. After running some tests I will get back to you on this :)

    Edit
    With the following code you can ignore all changes to prefabs in the "Assets/Master Audio Folder/" (or any other folder you add to the array). You won't have to compile a custom version of the plugin when using this code. It should work with the latest version from the Asset Store.
    Code (csharp):
    1.  
    2. using VisualDesignCafe.Editor.Prefabs;
    3. using VisualDesignCafe.Editor.Prefabs.Comparing;
    4. using UnityEditor;
    5.  
    6. [CustomProcessor( typeof( Prefab ) )]
    7. public class ExcludedFolders
    8. {
    9.     private static string[] _excludedFolders = new string[]
    10.     {
    11.         "Assets/Master Audio Folder/",
    12.     };
    13.  
    14.     [InitializeOnLoadMethod]
    15.     public static void Initialize()
    16.     {
    17.         typeof( NestedPrefabsPostprocessor )
    18.             .GetField( "IGNORED_FOLDERS" )
    19.             .SetValue( null, _excludedFolders );
    20.     }
    21.  
    22.     public static Modification[] PostprocessModifications( Prefab prefab, Modification[] modifications, Prefab source )
    23.     {
    24.         string prefabPath = AssetDatabase.GUIDToAssetPath( prefab.AssetGuid );
    25.  
    26.         if( !string.IsNullOrEmpty( prefabPath ) )
    27.             foreach( string folder in _excludedFolders )
    28.                 if( prefabPath.StartsWith( folder ) )
    29.                     return new Modification[ 0 ];
    30.  
    31.         return modifications;
    32.     }
    33. }
    34.  
     
    Last edited: Mar 21, 2018
    tosiabunio likes this.
  40. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    I never had to compile a Unity plugin. How do I do that ?

    Thanks

    ps: I hope you can find another solution rather than compile the plugin. Maybe a NP editable parameter ?
     
  41. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    I have updated the post above with an example script. It should work fine without having to compile a custom version of the plugin!
     
  42. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Thanks ! I will test that right now !
     
  43. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    What behaviour should I expect after creating this script ? Do I have to execute manually this script ? Because right now the issue is still here.

    Maybe a dum question : should I add Master Audio folder or/and all folder that contains "copy" (instance) of Master Audio prefab references ?
     
  44. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    I'm not sure what's is happening. When I create an Master Audio prefab instance in my scene using Master Audio windows everything seems to work as expected. The instance created seems to not be considered as a prefabs by Unity or Nested Prefab. But as soon as I drag & drop the instance in my project view in order to create a prefab then the Nested Prefab icon appears which and the Nested Prefab contextual menu is available. That makes me think that Nested Prefab still "manage" Master Audio prefabs or at least prefabs that are created based on Master Audio prefabs.

    Does that make sense ?

    EDIT : ok, my bad. When creating a prefab by grag & drop, the prefab should be located in an excluded folder. So I guess everything works as expected. I'm going to delete and re-create all existing prefabs based on Master Audio prefabs and check that is ok.

    Thanks
     
  45. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Yes indeed, when you create a prefab you should put it in an excluded folder. That way the prefab won't get processed and Master Audio should work correctly. Any prefabs created that way should not get a prefab icon.
     
  46. Dizy

    Dizy

    Joined:
    Aug 22, 2015
    Posts:
    13
    HI ! For now i'm really satisfied by this asset but i wonder if something is currently possible.

    Let me explain :

    Is it possible to apply a prefab instance changes without including the nested prefab ?

    For example :
    - I have a Root Prefab PanelA, a content like a scrollrect or a buttonpanel
    - And i have some buttons prefab



    I want to apply prefab changes to the PanelA instance without adding the dynamic content to the root prefab.

    This could be a good feature if you want a general behavior for Panel A but can use it with different content.

    Maybe a component like the "Prefab Override" but excluding child prefabs from the root prefab when clicking on "Apply"?
     

    Attached Files:

  47. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Unfortunately, there is no way of doing this right now because Unity will automatically include the children in the prefab when you click Apply. And we can't change internal Unity behavior. We are working on adding support for overriding entire objects, which should work for this situation. However, it is still a work in progress and we do not have an exact estimate on when this feature will be available.
     
  48. cparki3

    cparki3

    Joined:
    Jan 13, 2014
    Posts:
    41
    Hi there, I am using this asset and I love it so far. I'm wondering if it is possible to set an override on a List in a script. The list will change and I see where I can override individual List items but I really just need the entire List regardless of length to be unique.
     
  49. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    Thank you for using Nested Prefabs :) Unfortunately, with the current version, it is not possible to override an entire list. Only individual elements are supported. I am working on adding support for overriding entire lists but there is no specific timeline for this feature yet.
     
  50. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,844
    @Visual-Design-Cafe

    How can i remove an override property when i have overridden 10+ properties of a single component.
    Right now only way is to remove whole override component, add those properties u need back and this seems like a huge waste of time.

    Secondly cant we override materials? like textmesh pro's