Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: dudebxl on October 04, 2015, 04:36:21 PM

Title: take camera screenshot[SOLVED]
Post by: dudebxl on October 04, 2015, 04:36:21 PM
[EDIT] "Take camera screenshot" action is now available on the Ecosystem.

2 actions:


on ecosystem or https://snipt.net/dudebxl/takecamerascreenshot/

Req: Unity 5 (or Unity 4 pro)
Note: Will not capture the uGUI in screenshot. A bug within Unity itself preventing non-world-space UI items from being captured

any problems post here. thx
Title: Re: take camera screenshot
Post by: richardh on December 06, 2015, 07:05:37 PM
Downloaded this from the ecosystem tonight (Dec 2015) but get the following error:

Quote
Assets/PlayMaker Custom Actions/Application/TakeCameraScreenshot.cs(157,40): error CS0117: `System.IO.File' does not contain a definition for `WriteAllBytes'

I'm using unity 5.1.2
Title: Re: take camera screenshot
Post by: dudebxl on December 06, 2015, 08:58:51 PM
Which build are you in? Try pc or mobile build and see if it works.. I dont think action works in webplayer mode due to security reasons. Let me know...
Title: Re: take camera screenshot
Post by: richardh on December 07, 2015, 05:59:00 PM
Yes, I'm using it for a Webplayer (PC) build.
Title: Re: take camera screenshot
Post by: dudebxl on March 12, 2016, 10:47:41 PM
*** update - Default folder bug corrected (on both actions).
Title: Re: take camera screenshot
Post by: nilton_felicio on March 28, 2016, 02:47:34 PM
It is possible to know when the Take camera screenshot Texture ready?
That's quickly ?

I would like to follow up with another action only after the Take camera screenshot Texture was ready.
Maybe a progress bar .. While it was being prepared .


I would like to create the Take camera screenshot Texture particular area only. That is only a camera . Not the entire screen. It is possible?
Title: Re: take camera screenshot
Post by: dudebxl on March 28, 2016, 07:30:49 PM

just move to the next state when it is done (finish).. You can build your own progress bar using the states

These actions are only for camera and not screenshot. So place the camera however you want and take a picture from that camera.
Title: Re: take camera screenshot
Post by: unclebob on September 13, 2016, 07:41:37 AM
Hi

using 5.2 pro and windows 7 pro and this action TakeCameraScreenshot

Get this in editor when running scene

Assets/PlayMaker Custom Actions/Application/TakeCameraScreenshot.cs(139,90): error CS0103: The name `saveTexPath' does not exist in the current context

Three times in

(137,57)
(138,83)
(139,90)

Code: [Select]
if (useMypictures.Value == true)saveTexPath = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)+"/";
else if (!useMypictures.Value && !useDefaultFolder.Value) saveTexPath = filePath.Value;
else if (!useMypictures.Value && useDefaultFolder.Value == true) saveTexPath = Application.persistentDataPath;

Suggestions please??

Cheers

Unclebob
Title: Re: take camera screenshot
Post by: dudebxl on September 13, 2016, 11:43:40 AM
OK, my bad, confused with another action. It has been corrected, please update action.
Title: Re: take camera screenshot
Post by: t4d on May 20, 2018, 05:23:07 AM
Note: Will not capture the uGUI in screenshot. A bug within Unity itself preventing non-world-space UI items from being captured

any way to Capture the GUI today ?  unity 2018 ?
Title: Re: take camera screenshot
Post by: jeanfabre on May 23, 2018, 02:12:05 AM
Hi,

 the bug seems to be still present...

 Bye,

 Jean
Title: Re: take camera screenshot
Post by: nFighter on August 23, 2018, 04:08:20 PM
Hello there! I have a quite weird issue.

I'm using FullBodyIK to change head rotation and aiming. But when I make a screenshot it render hair objects (separate obj attached to character skeleton) where they would be without implementing IK.

As I imagine it's something related to the scripts execution order, update/late update and maybe time for execution, but I don't know what to do, actually.

In my Script Execution Order: AimIK placed before PlayMakerFSM. I tried  to make a screenshot with time multiplayer 0, so it's not even relate on my fps, everything was paused at that moment.


(https://snag.gy/RvbGix.jpg)
Title: Re: take camera screenshot
Post by: nFighter on August 23, 2018, 04:15:54 PM
I also have a screenshot with exactly the same frame, but with Motion Blur turned on in a PostProcessing. As you can see it somehow blends and smear the hair objects from the proper position and without IK position. So it definitely make a screenshot a little bit faster then all the necessary scripts in frame are calculating.

(https://snag.gy/CQ1J9O.jpg)
Title: Re: take camera screenshot
Post by: jeanfabre on August 24, 2018, 03:27:55 AM
Hi,

ok, I have pushed on the Ecosystem a version of TakeScreenshot called TakeScreenShotLateUpdate that should do the job.

 also, check TakeCameraScreenshot and TakeCameraScreenshotTexture custom actions also on the ecosystem, they give you more possibilities ( only portion of the content since it comes from a camera you setup)

let me know how it works out

 Bye,

 Jean
Title: Re: take camera screenshot
Post by: nFighter on August 24, 2018, 10:56:54 AM
Yes! Perfect! Thanks a lot, it works  ;D ;D ;D
Title: Re: take camera screenshot
Post by: nFighter on August 24, 2018, 12:16:57 PM
Did you pay attention, that putting the action to LateUpdate fixed the UI issue? New action grab the UI perfectly  ;D ;D ;D

Hi,

 the bug seems to be still present...

 Bye,

 Jean
Title: Re: take camera screenshot[SOLVED]
Post by: jeanfabre on August 24, 2018, 01:16:10 PM
hi,

 no, I did not test it!! cool!!!

Bye,

 Jean
Title: Re: take camera screenshot[SOLVED]
Post by: playmakertester on April 02, 2021, 10:57:06 AM
Hello.

Please let me know about this Action.
I tried it and found that this Action does not work with

When Screen Setup is set as follows
Res Width=500
Res Height=100
When the Screen Setup is set to the following, the intended range (Res Width, Res Height) is captured with the Camera at the center (as shown in Image 1).

When Screen Setup is set as follows (2)
Res Width=100
Res Height=500
Regardless of the position of the Camera, the height includes all the height that the Camera is capturing, and only the width expands (as shown in Figure 2).

It seems that this problem occurs when the width is longer than the height.

What I would like to do is to capture only the intended area (in the format shown in image 3) with Camera at the center, as in image 1, even in case 2.