Search Unity

copying properties from play mode onto prefabs

Discussion in 'Cinemachine' started by mradfo21, May 18, 2018.

  1. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    One thing that'd be an awesome additions is the ability to copy properties from something in game to a prefab on disc. Cinemachine's Composer doesn't abide by the normal "Paste Component Values" you can usually do from the gear menu

    upload_2018-5-18_12-38-23.png


    I believe this is because Cinemachine was expected to be used as a bunch of cameras sitting in a scene. They were never meant to be dynamically instantiated. The Save During Play mode is awesome! But if you find yourself using instantiated cameras there's 0 way to copy parameters tweaked during runtime.

    basically this section you have to copy by hand each time:

    upload_2018-5-18_12-40-33.png

    would be great to get some way to copy these parameters and paste them!
     

    Attached Files:

  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Actually you can copy/paste the whole vcam component, it will include all the Body/Aim/Noise subcomponents
     
  3. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    weird..

    so here i've edited things in game and im liking it:
    upload_2018-5-18_14-15-12.png


    and heres the prefab - notice its values are different (they are the bad ones)


    upload_2018-5-18_14-15-44.png

    i choose "Paste Values"

    and only this section will update

    upload_2018-5-18_14-16-10.png
     

    Attached Files:

  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    oh, that's supposed to work. What version Unity and CM?
     
  5. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    2018.1.0f1

    cm 2.1.10

    i believe
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    If you're on 2018 you should upgrade Cinemachine to the latest (2.1.13), available on package manager.
    To upgrade without losing any of your work:
    1. Open an empty scene,
    2. Delete your Cinemachine asset,
    3. Then import it from the package manager.
    Of course, make a backup first, just in case.
     
  7. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    so i did this... and cinemachine fails to compile

    upload_2018-5-24_11-48-9.png

    what.. do i have to do to make CM actually compile?
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    You have to follow the instructions :p
    Delete the CM asset from your project before importing new one with package manager
     
  9. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    but i did? I just deleted the Cinemachine folder.. was that not the asset?

    sorry maybe i misunderstood the directions
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    So now you need to start over.
    Uninstall CM from Packman
    Delete the CM asset
    Reinstall CM from packman.
    If you don't do it in the right sequence there will be metafile hell.
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Yes it is, but I see in your log that the complaining files are Assets/Cinemachine/blabla... so clearly you didn't delete the folder
     
  12. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    hu.. so yeah i still get the same errors

    upload_2018-5-24_11-52-40.png

    now the cinemachine asset

    thats just this folder right?
    upload_2018-5-24_11-53-3.png




    do i need to delete, restart, then try this?
     
  13. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Just delete it. No restart needed. Do you have some kind of version control that's putting it back?
     
  14. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    i use unity collaborate
     
  15. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    yeah even restarting still keeps those errors
     
  16. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    collaborate must keep the meta files?

    upload_2018-5-24_11-56-58.png
     
  17. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    so deleting the .meta files didn't change the compile errors. So are the files

    CinemachinePostFX.cs
    CinemachineMixer.cs

    not used by cinemachine but included by mistake somehow in my setup?
     
  18. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    going back to the asset store version
     
  19. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    wow... so the asset store doesn't compile now either. So this has totally bricked my project...

    upload_2018-5-24_12-5-14.png


    i love unity. i love unity *tells self
     
  20. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    after trying the package manager version again i get NEW errors..

    upload_2018-5-24_12-10-40.png


    whats going on?
     
  21. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    ok so after updating to 2018.1.1f i was able to use the package manager.

    but some code i'd written has these errors

    Gregoryl I know im probably an annoying thorn in the side but any chance you could help me with these?
    upload_2018-5-24_12-39-56.png

    what did the orbital transposers m_HeadingBias get changed to?

    and what did Recentering become?

    transposer.m_RecenterToTargetHeading.m_enabled = enabled;
     
  22. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    aw... so the code isn't included with cinemachine anymore? how should I figure out how to modify anything through c#?
     
  23. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    oh man... aaaand it reset every camera in the game. oh boy..
     
  24. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    @mradfo21 Sorry I didn't mean to drop out... missed this thread. Have you solved the issues? It looks to me as though you were not successfully deleting old versions of CM before installing new ones.
     
  25. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    The original issue of the properties not being copy-able still persists sadly. But it's cool, i'm adjusting to CM. Its very mean to prefabs. I tend to lose alot of work (especially when it corrupts the prefabs on disc) but if I can get things slugged into version control then I can just revert and use that as the baseline so i've got a workflow going!

    I'm bad at following up on some of these things myself as i'm also trying to move this slice forward. I'm gonna get you a simple demo repro of the blending problems I was having in another thread soon!
     
  26. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I'm actually facing the same issue where subcomponent values are not copied when either copying the values or the vcam as new.
    Anything I'm missing ?
     
  27. eldorno

    eldorno

    Joined:
    Sep 1, 2016
    Posts:
    4
    @Gregoryl I'm also having this issue in my project. Unity 2021.1.11f1, CM 2.8.4. I'm going 'Copy Component' on one CinemachineVirtualCamera, 'Paste Component Values' on another CinemachineVirtualCamera. It often does nothing at all; sometimes it sets the correct Body/Aim type but with all the default values; very, very occasionally it actually copies everything correctly.

    I was hoping to go through my scenes and replace all of my VCams with a basic VCam prefab, with overridden values copied from the original VCams, so in the future I'd be able to easily tweak things like CinemachineCollider settings, project-wide; and would probably also use Prefab Variants for, say, all VCams which use POV Aim, so I can later tweak angle limits, input sensitivity, etc, project-wide. Realistically, I would need to be able to use the Copy/Paste Component Values function for this - the alternative is manually entering the many, many properties for dozens of VCams, which sounds like a nightmare, especially since the Copy/Paste supposedly should work. :confused:
     
  28. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    It should work in prefab edit mode (double click on prefab), then Paste Component Values. Does that work?