Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: t4d on June 05, 2018, 02:16:55 AM

Title: Why is get and setting sprites image so hard in playmaker ? [SOLVED]
Post by: t4d on June 05, 2018, 02:16:55 AM
Current I doing a really GUI intensive project and I keep running int o the same problem

playmaker can limit option when dealing with Sprites IMage  Raw images image data type

an example I have texture2D i get from a Asset store asset ( screen capture manager ) But I can not use the image directly in  playmaker  I have a work around where i send it to a BOLT variable and then get to back and apply the bolt variable ?? ( seem a poor way around the problem)

Now I;m trying to the image data from a unity Sprite renderer and apply to a unity image

there seem to be no action to deal with sprites to get or set the data and set or get property doesn't seem to get the data and set to a variable ??

what am i doing wrong ?
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: t4d on June 05, 2018, 07:01:29 AM
ok what am i missing please help

I'm trying to work around this issue I'm having by trying to uses an array on textures  ( there no option for an Image array  ?? )

how do I get a picture, image, texture, sprite What ever ,.from a array and apply to a GUI image  in playmaker ??
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: djaydino on June 05, 2018, 12:48:27 PM
Hi,
You can find several 'sprite' actions on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)

But maybe there should be indeed a set sprite added to the standard actions :)
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: t4d on June 06, 2018, 01:14:06 AM
no sprite or any texture action can not access the texture2D object that I get from teh Screen capture manager (i using screen capture manager because i need to capture the GUI as well )

playmaker not give access to a Texture2D object is the problem
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: djaydino on June 06, 2018, 05:00:14 AM
Hi.
I have closed your other post as it is about the same issue.

Can you give the link to the asset that you are using?

Maybe i can make a custom action so it will store the image into a playmaker array instead, then you can use them directly.

I will also check the screenshot action if i can get it to include the ui (it is an older action from before the canvas system, that's why it does not include it in the picture)
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: t4d on June 06, 2018, 05:04:34 AM
here's the only asset i could find that captures the GUI

https://assetstore.unity.com/packages/tools/utilities/ultimate-screenshot-creator-82008 (https://assetstore.unity.com/packages/tools/utilities/ultimate-screenshot-creator-82008)

the Screen capture command in unity has a bug dating back to 2015
that why i'm using this asset
 



Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: djaydino on June 06, 2018, 06:39:46 AM
Hi.
I made a custom action that takes a screenshot including the ui.

You can get it from the attachment below.

The action name is 'Take Screenshot With Ui'

Can you test and see if it works on your end?
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: djaydino on June 06, 2018, 06:42:02 AM
Hi.
Please remove your other posts as it is related to the same issue.

It will only make it harder to solve issues if you most multiple threads.

i can remove the for you if you don't know how to remove them :)
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: t4d on June 06, 2018, 08:42:35 AM
remove what you want in replation to forum post

I've saved the image and loaded from Resources,. and now having the issues of it not updating .

it seem no matter what i tried I always find another problem


please is there a way to convert a object-Texture2D to a Texture playmaker can use ??


that is the main issues I'm fighting with it's been 3 days.. =( 
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: djaydino on June 06, 2018, 06:35:37 PM
Hi.
did you try the attachment?

The actions stores directly in a texture variable.

Resource folder is loaded at the start of the game.
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: t4d on June 07, 2018, 01:11:54 AM
I'm getting this errors

ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame.
UnityEngine.Texture2D:ReadPixels(Rect, Int32, Int32)
HutongGames.PlayMaker.Actions.TakeScreenshotWithUi:OnEnter() (at Assets/PlayMaker Custom Actions/Application/TakeScreenshotWithUi.cs:31)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2695)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2570)
HutongGames.PlayMaker.Fsm:DoTransition(FsmTransition, Boolean) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2609)
HutongGames.PlayMaker.Fsm:ProcessEvent(FsmEvent, FsmEventData) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2192)
HutongGames.PlayMaker.Fsm:Event(FsmEventTarget, FsmEvent) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2303)
HutongGames.PlayMaker.Fsm:Event(FsmEvent) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2384)
HutongGames.PlayMaker.Fsm:Event(String) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2371)
PlayMakerFSM:SendEvent(String) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:679)
UnityEngine.EventSystems.EventSystem:Update()

[d3d11] attempting to ReadPixels outside of RenderTexture bounds! Reading (0, 0, 1920, 1080) from (1933, 742)


 
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: djaydino on June 07, 2018, 03:35:33 AM
Hi,

Ah! i did not test when some ui was outside the camera view, updated the action and it should not give this error anymore.

Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: t4d on June 09, 2018, 05:04:07 AM
sorry it's not captureing the GUI and not capturing the Scene correctly =(

does not not seem to update only image is the first frame on load up
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: t4d on June 09, 2018, 05:15:49 AM
it's only capturing world space GUI, does not Screen space overlay =(

thanks for the effort
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: djaydino on June 09, 2018, 07:03:11 AM
Hi.
I just did a test on a scene with 2 canvases, 1 on world space and one in screen space overlay and i both are on my image.

Tested on unity 1.8.3f1 / Playmaker 1.9.0f5

What unity version are you using?
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: t4d on June 10, 2018, 07:23:49 AM
OK WORKING HERE AT WORK SO Thanks Much   

Just purchased your Playmaker Samples on the unity asset to say thanks =)
Title: Re: Why is get and setting sprites image so hard in playmaker ?
Post by: djaydino on June 10, 2018, 09:55:14 AM
Hi.
Thx for purchasing my asset :)

are you on a different unity version on your work?

I would like to know, so i can place it the Ecosystem :)