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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Is it possible to print Unity scenes?

Discussion in 'General Discussion' started by PantonVentura, Jun 20, 2018.

  1. PantonVentura

    PantonVentura

    Joined:
    Apr 26, 2018
    Posts:
    42
    Is there any built-in functionality or some external asset that supports the printing of scenes within a Unity game/app?

    Does it extend beyond just simply dumping the screen? Preferably I'd want support for pagination etc.
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Scenes are just text files. You can open them up and print with your favourite text editor.

    If you instead mean you want to take save renders of the screen for printing, the no. A default tool doesn't even make sense, what angle and camera positions should it render from?

    The good news is it's trivially easy to write something like this.
     
  3. PantonVentura

    PantonVentura

    Joined:
    Apr 26, 2018
    Posts:
    42
    Thanks for the info.

    No, I’m not interested in printing text files but actual images of the scenes in my app.

    I’m encouraged that you say that writing something which meets my requirements is trivial but could you also give me a few pointers on just how I would implement such a feature?

    As you may have guessed, I’m a Unity n00b :)
     
  4. verybinary

    verybinary

    Joined:
    Sep 23, 2015
    Posts:
    373
    Option 1: play your game, find a spot you want printed, press the PrintScreen button on your keyboard(google for modifiers for "only one display" or "only the active window" and paste into ms paint

    Option 2: Your scene might have gotten modeled in a modeling program, open the scene up, set your camera where you want it, and render it
     
  5. 1Piotrek1

    1Piotrek1

    Joined:
    Mar 14, 2014
    Posts:
    130
    PantonVentura and Kiwasi like this.
  6. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    You can write a simple script to do that. I do print screen a lots. I share mine for you.
    Fill in output file name and current scene resolution multiplier amount and hit play.
    Press space bar to snapshot. You can change to any keys as you like.
    The output images file name suffix will be +1 every time you shoot.

    Code (CSharp):
    1. public class Screenshot : MonoBehaviour
    2. {
    3.     public string fileName = string.Empty;
    4.     public int superSize = 1;
    5.     int number = 1;
    6.  
    7.     void Update()
    8.     {
    9.         if (Input.GetKeyDown(KeyCode.Space))
    10.         {
    11.             ScreenCapture.CaptureScreenshot (fileName+"_"+number+".png", superSize);
    12.             number++;
    13.         }
    14.     }
    15. }
     
  7. PantonVentura

    PantonVentura

    Joined:
    Apr 26, 2018
    Posts:
    42
    Thanks to everyone who replied. I think I can achieve what I need with the helpful info provided :D