Search Unity

Prefab Evolution Plugin(nested prefabs)

Discussion in 'Works In Progress' started by PrefabEvolution, Mar 27, 2014.

  1. ParkyRander

    ParkyRander

    Joined:
    Jun 1, 2014
    Posts:
    7
    I only recently upgraded to the latest version of PE and started hitting issues I hadn't had before, namely every time I saved a scene PE would go through its prefab dependency checks and then Unity would do a re-import on small assets which would take ages. As you can imagine that was painful, but I'm already too dependant on the plugin to strip it away.

    Anyway cut a long story short, and for anyone else out there with the same issue, looks like the bug was down to line 27 in PEPrefabScriptExt.cs

    Code (CSharp):
    1. if (_this.transform == _this.transform.root && _this.PrefabGUID != AssetDatabase.GetAssetPath(_this.gameObject))
    2. {
    3.     _this.Prefab = _this.gameObject;
    4.     _this.BuildLinks();
    5. }
    As you can see there's a check checking a GUID against an asset path, so there never going to be equal which causes the BuildLinks operation to fire, which in turn marks assets as dirty.

    My fix, not saying its the best, but:
    Code (CSharp):
    1. if (_this.transform == _this.transform.root && AssetDatabase.GUIDToAssetPath(_this.PrefabGUID) != AssetDatabase.GetAssetPath(_this.gameObject))
    2. {
    3.     _this.Prefab = _this.gameObject;
    4.     _this.BuildLinks();
    5. }
    6.  
    Convert the PrefabGUID to an asset path also.

    This has saved me load of grief.
    BTW, I recommend the other fixes pointed out earlier in this thread with regards to checking if userData has actually changed before setting it back on the importer, and also the string length issue, though don't just get rid of the -1, that will only solve the issue for certain line endings, better off using a string split or something instead.
     
    Shadeless likes this.
  2. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    @ParkyRander
    Hey thanks for this fix it really does make sense!

    And based on what you mentioned I decided to make a debug project and test stuff out in the getMetaUserData function and I came up with another fix.

    The function is on line 186 in PECache.cs and here's my modified version.

    Code (CSharp):
    1. static string getMetaUserData(string meta)
    2. {
    3.     var prefix = "  userData:";
    4.     var indexOfUserData = meta.LastIndexOf(prefix);
    5.     var indexOfEOL = meta.IndexOf("\n", indexOfUserData);
    6.  
    7.     // original lines
    8.     //if (indexOfEOL == -1)
    9.     //    indexOfEOL = meta.Length - 1;
    10.  
    11.     indexOfEOL = (indexOfEOL == -1) ? meta.Length : indexOfEOL - 1;   // new line
    12.  
    13.     var start = indexOfUserData + prefix.Length;
    14.  
    15.     //var length = indexOfEOL - 1 - start;  // original line
    16.  
    17.     var length = indexOfEOL - start;    // new line
    18.  
    19.     //return meta.Substring(start, length).Trim();   // original line
    20.  
    21.     return meta.Substring(start, length).Replace("\r", "").Trim();  // new line
    22. }
    23.  
    So this will evaluate correctly if the userData is on the last line and there's no "\n". While testing, if indexOfEOL was meta.Length - 1 it skipped the last character because Substring is inclusive of the start index.

    If the userData is not on the last line I returned the original indexOfEOL - 1 because that's the correct thing to do. The fix by netics increased the line length by 1 by removing the -1, but it was only to fix the case where the userData was on the last line and needlessly increased the length otherwise.

    Also I replace "\r" if there is any and if not, it doesn't matter. In my testing it seemed like string.Trim() removed it, or it wasn't considered in the equality test (==). But it might make a difference on other OS?

    I hope this helps.

    Cheers
     
    Last edited: Jul 29, 2016
    novaVision and ParkyRander like this.
  3. jocyf

    jocyf

    Joined:
    Jan 30, 2007
    Posts:
    252
    I've been reading the last posts about this asset (witch I own and use in my project) and it's amazing what users (customers) are doing to fix the known bugs. Thanks you all.

    The "elephant in the room' question is where the author is and when is going to submit a new version fixing/improbing his great, great asset (it's a pity to see the users doing the creator's job).
     
  4. BIMG

    BIMG

    Joined:
    Oct 1, 2014
    Posts:
    8
    Yes,
    thanks to users support.

    One star for author in AssetStore from me.
     
  5. neirogames

    neirogames

    Joined:
    Oct 10, 2014
    Posts:
    4
    Давно приобрел PrefabEvolution.

    Если создать два префаба 1 и 2, вложить 1 в 2, далее нажать apply на 2,
    то иконка префаб 1 окрасится в желтый цвет. После этого, если изменить префаб 2 нажать у него кнопку Apply, то дугие экземпляры в сцене префаба 2 не меняются. Также если нажать у префаба 2 кнопки
    Revert и Apply, то тоже ничего не меняется.

    Ранее удобно было редактировать дочерний вложенный префаб и нажимать Apply, чтобы трансформация
    применилась ко всем экземплярам.

    В чем может быть дело?

    Unity 5.3 и 5.4.0f3
     
  6. neirogames

    neirogames

    Joined:
    Oct 10, 2014
    Posts:
    4
    Потестировал еще, к дополнению к вышеприведенному, выявил, что кнопки Apply и Revert в Инспекторе и в окне Иерархии работают по разному. Приходится много сделать ненормальных действий,чтобы приблизить функционал, который был до поломки данного плагина.
    Используемая версия плагина PrefabEvolution 1.3.9.6
     
  7. jocyf

    jocyf

    Joined:
    Jan 30, 2007
    Posts:
    252
    The asset seems to be still alive. The author has published a new version (v1.3.9.7, 8 Aug).
    I hope it will continue doing so. It would be great if he starts being more active in this threath too, aswering our questions (or commenting our seggestions at least).
    This asset is covering one of the major Unity lacks. Nested prefabs if a must in any game engine (I can't believe this feature hasn't been fullfilled by Unity yet).
     
    Last edited: Aug 9, 2016
    Tinjaw likes this.
  8. boolean01

    boolean01

    Joined:
    Nov 16, 2013
    Posts:
    68
    Since the author doesn't seem to be posting in this thread, I updated to the new version to check what the changes are.

    The only change in the latest version is that the fix from netics was pasted in. This fix mostly works, but as I and some others found it seems to work sometimes and fail others. ParkyRander and Shadeless noticed this was because of line endings with /n and /r.

    So if you update to the latest version, you'll still need to paste in the fix from Shadeless.
     
  9. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    107
    Hi im interested in Prefab Evolution, but i have a question, i use a very good asset called QHierarchy, will this come into conflict with Prefab Evolution?
     
  10. BAIZOR

    BAIZOR

    Joined:
    Jul 4, 2013
    Posts:
    73
    Last edited: Nov 30, 2016
  11. Deleted User

    Deleted User

    Guest

    After removing Prefab Evolution I got ghost objects. He gave me a script to remove them all but not working properly. Still getting ghost objects from this asset. Wouldn't buy it until it's fixed.
     
  12. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    192
    Здравствуй. У меня возник вопрос по ассету PrefabEvolution.

    У нас есть тачки со сложной иерархией, с кучей скриптов, партиклями,
    кучей связей между частями и нам надо кое-что поменять в модели,
    например переименовать какую-то часть wheels0 в wheels1. Я
    переименовал, экспортирую модель в fbx формате как обычно. Далее
    происходит следующее. префаб машины внезапно теряет колёса, круто блин
    и все ручками надо назначать. Так вот может ли твой ассет
    PrefabEvolution решить эту проблему и как им пользоваться чтобы обойти
    эту проблему? PS. можно в скайпе созвониться? У нас довольно сложный
    проект и помощь хотяб советами нам не помешает, спасибо. мой скайп.
    boychaos8th.
    https://vk.com/gunsandwheels
     
  13. neirogames

    neirogames

    Joined:
    Oct 10, 2014
    Posts:
    4
    Здравствуйте,

    Был куплен ваш плагин для проекта, долгое время проект разрабатывался, но в один момент, большинство префабов окрасилось в красный цвет и стали “ошибочными”. Также, даже в новом почти пустом проекте, функционал обновления вложенного не работает. Проблемы, я описал еще пару месяцев назад постами выше.

    Я купил плагин, в результате в основном проекте все связи “побились” и в новых проектах плагин не работает корректно.

    В силу этого, я прошу вас вернуть плагин в работоспособное состояние, предварительно указав здесь примерные сроки, в противном случае, я обращусь в Asset Store, для возврата моих денежных средств, более того вероятно, это будет групповое письмо. На данный момент, сломанный плагин не может продаваться в Asset Store, хотя он до сих пор находится в магазине.

    “Давно приобрел PrefabEvolution.

    Если создать два префаба 1 и 2, вложить 1 в 2, далее нажать apply на 2,
    то иконка префаб 1 окрасится в желтый цвет. После этого, если изменить префаб 2 нажать у него кнопку Apply, то дугие экземпляры в сцене префаба 2 не меняются. Также если нажать у префаба 2 кнопки
    Revert и Apply, то тоже ничего не меняется.

    Ранее удобно было редактировать дочерний вложенный префаб и нажимать Apply, чтобы трансформация
    применилась ко всем экземплярам.

    В чем может быть дело?

    Unity 5.3 и 5.4.0f3”

    ******

    “Потестировал еще, к дополнению к вышеприведенному, выявил, что кнопки Apply и Revert в Инспекторе и в окне Иерархии работают по разному. Приходится много сделать ненормальных действий,чтобы приблизить функционал, который был до поломки данного плагина.”


    Используемая версия плагина PrefabEvolution 1.3.9.7
    Unity 5.4.0f3, 5.3 и ближайшие версии ниже.
     
    Last edited: Jan 21, 2017
  14. BAIZOR

    BAIZOR

    Joined:
    Jul 4, 2013
    Posts:
    73
    Да, плагин не работает. И автор не отвечает на наши вопросы и жалобы.
    Но то что ты нашел, рашается банальным нажатием Apply через кнопку Menu (под кнопкной Apply)

    Но без этого там полно других проблем :(
     
    Last edited: Jan 22, 2017
  15. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    210
    Excellent, we got a patch today!
     
  16. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    50
    Hi! When I save a scene unity starts checking prefab dependencies and my game crashes. Can anybody help me? This is the error that appears in the console:

    NullReferenceException: Object reference not set to an instance of an object
    PrefabEvolution.PEUtils+<GetNestedInstances>c__Iterator4.MoveNext () (at Assets/PrefabEvolution/Sources/Editor/PEUtils.cs:128)
    System.Collections.Generic.List`1[PrefabEvolution.PEPrefabScript].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
    System.Collections.Generic.List`1[PrefabEvolution.PEPrefabScript]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
    System.Linq.Enumerable.ToArray[PEPrefabScript] (IEnumerable`1 source)
    PrefabEvolution.PECache.CheckPrefab (System.String guid, UnityEngine.GameObject prefab) (at Assets/PrefabEvolution/Sources/Editor/PECache.cs:156)
    PrefabEvolution.PECache.CheckPrefab (System.String[] paths) (at Assets/PrefabEvolution/Sources/Editor/PECache.cs:60)
    PrefabEvolution.PECache.CheckAllAssets () (at Assets/PrefabEvolution/Sources/Editor/PECache.cs:111)
    PrefabEvolution.PECache.get_Item (System.String guid) (at Assets/PrefabEvolution/Sources/Editor/PECache.cs:130)
    PrefabEvolution.PECache.Add (System.String prefabGuid, System.String guid) (at Assets/PrefabEvolution/Sources/Editor/PECache.cs:241)
    PrefabEvolution.PECache.CheckPrefab (System.String guid, UnityEngine.GameObject prefab) (at Assets/PrefabEvolution/Sources/Editor/PECache.cs:167)
    PrefabEvolution.PECache.CheckPrefab (System.String[] paths) (at Assets/PrefabEvolution/Sources/Editor/PECache.cs:60)
    PrefabEvolution.PECache+PrefabAssetModificationProcessor.OnWillSaveAssets (System.String[] paths) (at Assets/PrefabEvolution/Sources/Editor/PECache.cs:262)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.AssetModificationProcessorInternal.OnWillSaveAssets (System.String[] assets, System.String[]& assetsThatShouldBeSaved, System.String[]& assetsThatShouldBeReverted, Int32 explicitlySaveScene) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssetModificationProcessor.cs:149)
     
  17. PsyDev

    PsyDev

    Joined:
    Sep 30, 2015
    Posts:
    31
    Hi, I'm getting a compiler warning. It's been in the last few releases. I'm on Version: 1.3.9.8 (Jan 27, 2017). Any plans on fixing it any time soon? I keep my build compiler-warning free.

    Assets/PrefabEvolution/Sources/Editor/PropertyExposure/PEPropertyHelper.cs(318,76): warning CS0618: `UnityEditor.EditorGUIUtility.native' is obsolete: `This field is no longer used by any builtin controls. If passing this field to GetControlID, explicitly use the FocusType enum instead.'
     
  18. Cryptite42

    Cryptite42

    Joined:
    Dec 7, 2016
    Posts:
    1
    Was experiencing a crash myself with the very latest Unity version 5.2.2p4 with the January (latest) build of PE.

    Any time we'd make a new Prefab, we'd effectively get a full crash and it's caused by the following code in CheckPrefab in PECache.cs:
    Code (CSharp):
    1. #if UNITY_5
    2.                 EditorUtility.UnloadUnusedAssetsImmediate();
    3. #else
    4.                 EditorUtility.UnloadUnusedAssets();
    5. #endif
    Given we're on Unity 5 here, specifically comment out
    Code (CSharp):
    1. EditorUtility.UnloadUnusedAssetsImmediate();
    and that should fix it.

    I'm unsure as yet of the ramifications of this. Considering it's Editor-Only, it may not be hugely problematic.
     
    Last edited: Mar 24, 2017
  19. vincentgravitas

    vincentgravitas

    Joined:
    Jan 25, 2015
    Posts:
    5
    Don't buy PE until the author responds to this thread. Development status is currently unknown.
     
  20. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    312
    Yeah.. unfortunately I just wasted the time in a result. My project become too complex and I found that Editor performance was dropped a bit. Had to remove PE completely. But the idea is great. I am dreaming about nested prefabs...finally.
     
  21. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi guys. Sorry for that things that happen around here. Last year was very hard for me, and i just doesn't have enough time to work on this project. But now i feel that i can solve all problems with this plugin. So if some one have any problems, bug, feature request, or just want to talk with me about any thing, can write a letter to prefabevolution@gmail.com, or create an issue on GitHub.
     
    Mazak likes this.
  22. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    107
    Great to hear! if you update it i will buy it :D
     
  23. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    210
    Welcome back
     
  24. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi. Today recent version of Prefab Evolution plugin is sent to Asset Store review.
    In this version i have fix one huge prefomance issue. So now prefab apply operation is x5 faster than before.

    Also prefabs dependency check now bit faster.

    Also introduced new feature, now you can expose prefab properties to GameObject inspector. Just right click on property and click "Expose Property". So now you don't need to dig deep inside prefab hierarchy to find your favorite property.
     
  25. jay-jin

    jay-jin

    Joined:
    Jun 22, 2014
    Posts:
    12
    :)Good to know!
     
  26. jice_nolaroads

    jice_nolaroads

    Joined:
    Oct 2, 2016
    Posts:
    21
    hello.
    is there anyway to modify and apply a sub-prefab (yellow cube) without instantiating it separately (green cube) to apply on this prefab and not in parent prefab ?

    if yes, could you explain me how ?
    if not, this could be a feature in a next release please ?
    plugin is good, but lacking of this feature is really a hassle.
     
  27. jice_nolaroads

    jice_nolaroads

    Joined:
    Oct 2, 2016
    Posts:
    21
    i have some of errors of theses types with PE and Unity 2017.1p4
    and some other errors (7), with other prefabs GUID and parent's prefab path.
    and due to that it's not building on UCB
    i checked and prefab with theses GUID exists ...

    what can i do ?

    EDIT:
    finally, it seem the build fails (on UCB) is not due to that, and also i have no more theses errors. but i don't really know why ...
    i let the subject open if any details can emerge.
     
    Last edited: Aug 27, 2017
  28. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Hi. Yes feature now is under construction, so we hope we canrelese it soon.
     
    jay-jin likes this.
  29. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    This kinde of errors are said that some prefabs, that referenced by nested prefab instances, are missing. That means that you probably remove some prefabs assets from your project.
     
  30. jice_nolaroads

    jice_nolaroads

    Joined:
    Oct 2, 2016
    Posts:
    21
    thanks, this feature can be a great improvement.
     
  31. jeremytm

    jeremytm

    Joined:
    Jun 6, 2016
    Posts:
    29
    Hi prefab evolution team, I've got a small bug for ya:


    If you create things in a certain order, and then make the parent a prefab, applying a change to a child item (a button in this case) will break display of the modal background. It looks like it's been thrown into World Space and then back into a canvas.

    The only way to fix is to invert the rect transform (i.e. pull the top right corner of the rect transform down passed the bottom left).

    This happens fairly frequently when using PrefabEvolution with UI (which, btw, it makes so much better when dealing with a UI heavy game).

    The warning provided by Unity is:
     
    Last edited: Oct 18, 2017
  32. jeremytm

    jeremytm

    Joined:
    Jun 6, 2016
    Posts:
    29
    Is this project still being maintained?
     
  33. jeremytm

    jeremytm

    Joined:
    Jun 6, 2016
    Posts:
    29
    This asset has been abandoned. We have tried to get in touch with the developers via this forum thread, and via email. We've given them plenty of time to respond but it's been radio silence for months. Do not buy this product. Instead you should look at the "Nested Prefabs" asset by Visual Design Cafe. I have been emailing with them and they have confirmed they are adding a full-fledged prefab parent/child feature around Jan/Feb 2018.
     
    sonnyb likes this.
  34. dozhwal

    dozhwal

    Joined:
    Aug 21, 2014
    Posts:
    56
    it's a shame, this asset i just tried seems promising :/
     
  35. Joviex

    Joviex

    Joined:
    Jan 23, 2011
    Posts:
    41
    Well, they are also adding nested prefabs to Unity. It was hint on the last Aras blog with the "prefab" inside the "nest".

    https://aras-p.info/blog/

     
    Last edited: Feb 21, 2018
  36. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    210
    upload_2018-2-21_19-23-14.png
     
    sonnyb likes this.
  37. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    How do you uninstall prefab evolution properly? If I just delete the asset, it leaves missing script components all over the places!
     
  38. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    210
    it is a huge pain in the butt..

    I suggest...
    1. Add this script to your Assets/Editor folder: FindMissingSCripts.cs
    2. Run the script ensure you dont have any missing scripts to begin with.
    3. Make a backup
    4. Remove prefab evolution
    5. Run FindMissingSCripts.cs
    6. Clean it up

    Good Luck and Good hunting

    Yes, you can try to open all your scenes... @#$@#$
     

    Attached Files:

unityunity