Search Unity

SmartCopier - quickly copy components and properties

Discussion in 'Assets and Asset Store' started by Kwinten, Jun 1, 2018.

  1. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Logo big.png

    If you find yourself regularly needing to copy Components from one GameObject to another (or even multiple), you have probably realized by now that this workflow quickly becomes very tedious. SmartCopier is a tiny utility that improves this, and provides a smooth and easy user experience.

    [Get SmartCopier in the Asset Store]


    Features

    ✔ Copy any number of Components instantly
    ✔ Select which properties of each Component you wish to copy
    ✔ Paste the Components to all selected GameObjects
    ✔ Specify custom types and attributes for Components or properties to ignore by default
    ✔ Full source provided, features fully accessible through code-first API

    How to use

    SmartCopier requires no setup and is immediately available for any GameObject in your project. You can watch the video for a quick intro or read the instructions below.


    1. Right-click any GameObject or component in the inspector.
    2. Click "Smart Copy Components" at the bottom of the context menu.
    3. This will open the SmartCopier window where all of the GameObject's Components will be displayed.
    4. Toggle any Component and their respective properties you wish to copy.
    5. Select any amount of GameObjects you wish to copy the Components to and click "Paste And Replace" or "Paste As New"
    What's new
    SmartCopier v2.0 is out now! This version includes:
    • A complete rewrite of the code
    • A new developer-centric API that is easy to extend
    • Prettier user interface
    Requirements
    Supports Unity 5.0 and above. Requires no additional setup. SmartCopier will work as soon as you import the package!

    Roadmap
    Some features that will be implemented in the future:
    • Save property selection for each Component type to a preset
    • Add default ignored Components or properties through GUI (currently only accessible through code)
    • Dedicated settings panel to access certain features that are only available through code right now
    Support
    Feel free to ask me here if you need any support. I'd also love to be notified if you find any problems or bugs, or come up with ideas for improvement.
     
    Last edited: Jun 17, 2019
  2. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    79
    Hi,

    I just purchased the SmartCopier on the Asset Store.

    This tool is looking amazing!

    There are fields in the Rigidbody component that SmartCopier seems to ignore.

    It's missing the "Constraints" fields from the Rigidbody.

    Can you confirm if this is happening?

    Thank you!
     
  3. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    79
    Here are some screenshots from my previous post.

    upload_2019-4-26_4-21-48.png

    upload_2019-4-26_4-22-43.png
     
  4. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi there,

    I see that the asset hasn't been updated for a while, yet support is still very active.

    Should I assume there was no good reason to push an update and that it still works perfectly in Unity 2019.1.0f2 even when entering/exiting prefab/subscene mode?

    I'm of course interested in purchasing :)
     
  5. endae

    endae

    Joined:
    Mar 3, 2019
    Posts:
    2
    Hi,

    The tool is not working 100% as expected (Win10/Unity 2019.1.0f2), it duplicates components during paste action, see video below

    The template character has a component, RPG character controller, with some dependencies
    • When I copy it and paste it without using Smartcopier, the paste will take the dependencies in account
    • When I use Smartcopier to select n components, the paste is messy
    There is not duplicated items if I uncheck the dependencies from the Smartcopier window, I "just" have to think twice before clicking on Paste button

     
  6. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Hi everyone, thanks for your interest in SmartCopier.

    Apologies for my lack of replies here - email notifications seem not be working as expected. I will look into all reported issues and report back to you as soon as I have an update. You can expect this to be rather soon!

    Cheers
     
    NeatWolf likes this.
  7. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Update: @endae's issue where required components would sometimes be duplicated when being copied to a new object has been resolved in version 2.1 of SmartCopier. You can download the update from the Asset Store!

    To answer @NeatWolf's question:
    Yes! This should work straight out of the box. If you experience any problems you can write me on this forum, send me an email, or request a refund of course if the issue not resolved in time.
     
    NeatWolf likes this.
  8. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    79
    I posted about the missing of the "Constraints" fields from the Rigidbody many weeks ago. Does the new version 2.1 fix that issue? Or, can you confirm if that issue does exist?
     
  9. endae

    endae

    Joined:
    Mar 3, 2019
    Posts:
    2
    I confirm the problem I've reported has been fixed.
    Thanks Kwinten
     
  10. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Hi there. Sorry for overlooking your question.

    I can confirm this particular issue still exists in version 2.1. I can explain why: SmartCopier technically doesn't copy over ALL serializable properties of an object. This is to avoid copying over unwanted properties such as its id, the reference to the GameObject it is on, etc. Instead, SmartCopier copies all "visible" serializable properties - the ones you see in the inspector. However, Unity implements custom inspectors for all of its "native" components. As a result, the "Constraints" property, which is serializable but normally "hidden", becomes visible. Because SmartCopier has no way of knowing it is a "visible" property, it is not copied.

    There's no straightforward solution that I could find. But I will look into implementing a custom fix for this particular component (Rigidbody). I'll keep you up to date.
     
    tachyon-particle likes this.
  11. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Just a quick update:

    I've created a small intro video on how to use SmartCopier and attached it to this thread and to the Asset Store page.

    This tool is still in active development and will see some cool new features soon! Stay tuned.
     
  12. mobdoggo

    mobdoggo

    Joined:
    Oct 22, 2018
    Posts:
    16
    Hello !
    I bought Smartcopier today.
    It is copying only Components , Not values :(



    How to fix it? I am not a coder. I make games with playMaker !
     
  13. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Hi there,

    Sorry to hear that it isn't working as expected for you. Can you try the following things for me:
    1. Completely delete the "SmartCopier" folder from your Assets folder.
    2. Re-import SmartCopier from the Asset Store, making sure that you get the latest version.
    3. See if everything works as expected now - try copying Components again.
    If the issue persists, it would help me to know the following information from you:
    • Your version of Unity.
    • The version of SmartCopier you are / were using.
    • Which Component types are causing issues (all Components or specific ones?).
    If I can identify the bug, I will try to provide a fixed version as early as possible. You can also PM or email me (email address if found here) me if you want to request a refund.
     
    mobdoggo likes this.
  14. mobdoggo

    mobdoggo

    Joined:
    Oct 22, 2018
    Posts:
    16
    Hi ! I tried re-installing. Same issue.

    My Unity Version is Unity 2018.4.0f1 (64-bit)
    Smartcopier : I don't know. I just re-imported from Asset store after deleting

    Ya ! All components are making troubles. Not copying values.
    Btw, Unable to click this Screenshot_8.png
     
  15. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Thanks for reporting back! I will try to reproduce your issue in the specified Unity version and report back to you later today.
     
    mobdoggo likes this.
  16. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Hi @mobdoggo,

    Thank you again for reporting the issue. Thanks to your description I was able to find the bug and fix it. I have submitted a fixed version of SmartCopier to the Asset Store. Note that this can take a few days to be approved by Unity.

    If you want, I can also send you a fixed version immediately (privately).
     
  17. mobdoggo

    mobdoggo

    Joined:
    Oct 22, 2018
    Posts:
    16
    Thanks ! I just PMed my email.
     
  18. mobdoggo

    mobdoggo

    Joined:
    Oct 22, 2018
    Posts:
    16
    Thank you !
    I got fixed version and it's doing it's job.
    Thank you.
     
    Kwinten likes this.
  19. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Version 2.1.3 of SmartCopier is now available for everyone on the Asset Store. It includes the latest bugfix!

    Cheers
     
  20. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    209
    Hello, can this tool copy multiple components in childs based on the names of the gameobjects with couple of clicks?

    For example:
    I got 2 armatures exported from blender. The first armature was modified in unity and has components added to the bones for procedural animations.
    The second armature has has a changed rig, a different hierachy but the bone names are all still the same name. There are however some bones that might be deleted.

    This is how an example Hierachy could look like:

    Armature 1(Source)
    Code (CSharp):
    1. Root
    2. Hip
    3. Back
    4. LegL(comp1,comp2,comp3)
    5. LegR(comp1,comp2,comp3)
    Armature 2 (Target with changed Hierachy)
    Code (CSharp):
    1. Root
    2. Hip
    3. LegL <- Components should be automatically copied here by comparing the names and ignoring the hierachy
    4. LegR <- Components should be automatically copied here by comparing the names and ignoring the hierachy
    5. Back
    What I am looking for is finding a tool, that compares both armatures and copies the components in editor to the new armature by comparing ALL BONES and ignoring bones or objects that doe not exist.
     
    Last edited: Aug 9, 2019
  21. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Hi there!

    Unfortunately, this is not something SmartCopier can do at the moment, as it is not really the intended use case.

    However, it can copy multiple components (and properties) from one source GameObject to multiple target GameObjects with a single click. That might help you a little bit already. However, there's no "many to many" copying from and to GameObjects implemented.
     
  22. MikeChr

    MikeChr

    Joined:
    Feb 2, 2018
    Posts:
    43
    Its a small thing, but the help text on the two bottom buttons on the SmartCopier inspector are reversed.
     
  23. kkl888

    kkl888

    Joined:
    Dec 6, 2014
    Posts:
    55
    Does it work if I copy and paste GameObject with children object?
     
  24. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Just bought this excited to give it a go. I have a similar question can it copy children objects to the other other objects? Example: I have an AI ive made, inside them they have their own eyes object, and inside their hands they have weapons objects.. i want to copy all the scripts from the parent object *and* these children objects into a new gameobject.. and ideally have them at the same positions and of course in the same hierarchy layout (im assuming compatible skeletons) is that possible ?

    edit: regardless if it can or not I know this tool will space me so much time, thanks !
     
    Last edited: Dec 30, 2019
  25. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Looks like this might be exactly what I need, depending if ...

    When you copy a component from a child gameobject, that references the parent gameobject, will the copy reference the new parent or the original parent? I need it to reference the new (please).
     
  26. pradf4i

    pradf4i

    Joined:
    Nov 7, 2017
    Posts:
    39
    upload_2020-9-11_10-40-52.png

    The plugin is disabled. Tried deleting and adding it back but no luck - Using Unity 2019.4 and latest version of Smart component. Can you please help?
     

    Attached Files:

    JohnWong360 likes this.
  27. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    same as @pradf4i :
    Smart copy component is now greyed out. Console shows this

    Please select a valid GameObject to copy components.
    UnityEngine.Debug:LogWarning(Object)
    SmartCopier.SmartCopier:CanCopy(MenuCommand) (at Assets/smartcopier/Editor/SmartCopier.cs:33)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

    Tried deleting plugin, reinstalling the newest version. Unity 2020.1.

    @Kwinten any thoughts?
     
  28. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    @Autarkis @pradf4i

    Hi!

    Apologies for the late reply. Unfortunately I can't check this forum thread every day so I'll usually respond much more quickly over email (can be found on my developer profile on the asset store).

    I'll try to put out a fix ASAP (within the next few days). Note that for Unity to accept and publish this fix it can easily take another week. So in the meantime, if you want a refund or if you want me to send over the patch so you can get back to using the tool, please let me know.

    Also please note that as a small workaround, you can still right-click on a GameObject's components to open the SmartCopier window. Only right-clicking on the GameObject itself is currently broken.
     
    Last edited: Sep 23, 2020
  29. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    @Autarkis @pradf4i

    Hi again,

    I've already submitted a new version of SmartCopier and it has been accepted to the Asset Store already! You can download version 2.1.4 which should fix your issues. Thanks for reporting the problems! Note that this version will work for Unity 207.4.10f1 and later.

    Do let me know if you experience any further issues.

    Cheers
     
  30. pradf4i

    pradf4i

    Joined:
    Nov 7, 2017
    Posts:
    39
    Thanks @Kwinten. Can confirm! It works now on 2019.4.
     
    Kwinten likes this.
  31. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    Kwinten likes this.
  32. chaosmonger

    chaosmonger

    Joined:
    Jan 23, 2019
    Posts:
    71
    Purchased long ago, not working with Unity 2020.1.15f1
    Same issue as above (it's grayed out on the hierarchy, but works on the inspector).
    I'm running 2.1.4. A fix would be appreciated.
     
  33. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Hi,

    I'm working on a fix at this very moment.
    Will update you once it has been deployed.
     
    NeatWolf likes this.
  34. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Almost the same, but I stumbled on the asset right on yesterday, and +1 on supporting Unity 2020.1.x if possible, it's sitting in the cart ;)

    I can't believe I missed this asset, looks uber-useful!
     
  35. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Hi @chaosmonger and @NeatWolf,

    The issue has been resolved and the package has been submitted to Unity. Note that it might still take a few days before the update will be available from the Asset Store.
    It turns out that the fix I created last time was not properly published to the Asset Store (the package management process for publishers is very outdated and cumbersome, sorry for that). But everything should work as expected when the update has gone through. When you update via the Asset Store, please verify that version number 2.1.5 is now also written in the README file.

    In the meantime, if you want to use SmartCopier uninhibited, you can locally fix the code as follows. In
    SmartCopier.cs
    , change the following lines of code:

    Code (CSharp):
    1. [MenuItem("GameObject/Smart Copy Components", true)]
    2. private static bool CanCopy(MenuCommand menuCommand)
    3. {
    4.     if (menuCommand.context == null)
    5.     {
    6.         Debug.LogWarning("Please select a valid GameObject to copy components.");
    7.         return false;
    8.     }
    9.     return true;
    10. }
    into:

    Code (CSharp):
    1. [MenuItem("GameObject/Smart Copy Components", true)]
    2. private static bool CanCopy(MenuCommand menuCommand)
    3. {
    4.     return Selection.activeGameObject != null;
    5. }
    That will resolve the issue for you locally already.

    Cheers
     
  36. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    Love this asset but noticed today it froze unity entirely. There a bug that could cause this?

    Update: A fbx file with an animator freezes when you smart copy new animator on it as new. I can paste and replace without an issue. Just thought you might want to know.
     
    Last edited: Jun 4, 2021
    LithiumFox likes this.
  37. Kwinten

    Kwinten

    Joined:
    Jan 25, 2015
    Posts:
    49
    Thanks for reporting the issue. Could you perhaps do the following things for me:
    • Tell me which version of Unity and SmartCopier you are using?
    • Send me a an asset file (e.g. the .fbx asset) with which you can reproduce the issue.
    That would help me tremendously in fixing this. Thanks a lot!
     
    NeatWolf likes this.
  38. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    510
    I am also looking for a component copy system that will copy all the components of one character to another character but it would have to iterate through all the child objects of the character also. Both characters have the same hierarchy and child names. Is there anything out there that will do that?
     
  39. LithiumFox

    LithiumFox

    Joined:
    May 6, 2020
    Posts:
    5
    Also having this issue on 2019.4.29f1

    Seems to be generally any FBX file. Paste & Replace works fine, but Paste As New does not. Unfortunately since my FBX is licensed to a single person, I'm not at liberty to share it. In my case I am copying VRM components over. Paste & Replace fixed it though.
     
    browne11 likes this.
  40. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hiya a default ON/OFF ALL toggle would be great. As would guarding against missing scripts.

    Love the tool.
     
    ledshok likes this.
  41. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    Any chance this has been updated? Lost a bit of work today as I clicked the wrong one!

    Using unity 2020.3.23f1.
    Smartcopier 2.2.0

    I think the issue is the fact you are adding things to fbx files, which are protected in the new prefab system. Perhaps a simple disable it in these cases as paste and replace seems to add as new anyways almost seems like it's redundant?
     
    Last edited: Jun 15, 2022
  42. sirdavid23

    sirdavid23

    Joined:
    Jan 26, 2011
    Posts:
    22
    Hi. I'm using Smartcopy from March, 2023. I'm trying to copy all VRM collider and spring bones scripts from one modelA to ModelB. Regardless to say that ModelB (reciever) has the same head topology than modelA (source).
    This works well when both models are in the same scene. However at the time of export, if I delete modelA (source), modelB automatically loses all its script values and doesn't work anymore. It's like the script does a live copy of ModelA scripts ONLY IF IT IS PRESENT ON THE SCENE. My question is: is there a way to make smartCopy copy the scripts from the source model and keep them on the receiver model once the operation is done (so I can delete ModelA from the scene)?
     
  43. Gssev7

    Gssev7

    Joined:
    Jul 9, 2014
    Posts:
    34
    Does this copier work at runtime in a build. I want to import a 3d object and copy components on to it when its loaded.