save/load prefabs online for 3dconfigurator with playmaker

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
christomaker
Posts: 5
Joined: Fri Jan 26, 2018 5:09 pm

save/load prefabs online for 3dconfigurator with playmaker

Post by christomaker »

Thank you very much Joel for your quick answer.

I purchased easysave2.
My goal is a 3d configurator online in unity with playmaker.
I try to download some fbx online which are child of the same object in my scene (i have 30 fbx models - each one < 1.5 mo) and when i download 1 fbx model, this one must replace another model (child of the same object already and ever at the same position in the scene), etc... :

1/ I succeed the firt step with my own website : "ES2.php and MySQL database are working correctly."

2/ But after what is the right method ?
METHOD A (you wrote it in 2014) :
- "Import your FBX into a Unity project (any project will do; you can delete it afterwards).
- Save it to a file using Easy Save 2 (either from an Editor script or a Runtime script). This will convert it to the correct format.
- You could then load dynamically from this file using ES2.Load<Mesh> instead of loading the FBX file."
METHOD B :
-convert my fbx models in prefabs with textures
-"to enable Auto Save for a prefab, right click it in project and select 'Easy save 2 / Enable Auto save for prefab."
- does it work in webgl and can I download and upload these prefabs to my server ?
- it is necessary to use a "list" and how ?
- Does the prefab go into the mysql table ?
- it is possible in the future to have a sheet with a list of prefabs with their charateristics in order to import it as sql table ?

But for now I can't begin in playmaker because I don't know what is the best choice to answer to my goal.
i need a step by step example because i'm not a coder !

I forgot : I will have a dropdown list in my UI and each prefab will have a button in order to dowload it : and if I click on another button, another prefab replace the previous one.

Thank you very much
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: save/load prefabs online for 3dconfigurator with playmak

Post by Joel »

Hi there,

Unfortunately the ways you've described would not be possible with PlayMaker actions alone because PlayMaker does not have a Mesh data type.

However, I've created a couple of scripts for you below which Uploads/Downloads the Mesh and Material of the GameObject it's attached to. You will need to specify a different filename for each Mesh you upload. Note that the filename does not need to have an extension, and spaces are allowed, so your filename could be something like "My File Name".

You will also need to insert your server details (much like you do in the action).

To get all of the filenames of the Meshes on the server into an PlayMaker FsmArray, you can use the DownloadFilenames action. You can then loop over this list and display it in your GUI, though you will need to ask on the PlayMaker forums if you require more information on doing this.

Each script has a Run method, which performs the Upload/Download. You can use PlayMaker's Call Method action to call the Run method on the script to start uploading/downloading. You could also use the Set Property action to change the filename field on each of the scripts to upload/download a particular script.

Hope this helps!

All the best,
Joel
Attachments
DownloadMeshAndMaterial.cs
(953 Bytes) Downloaded 412 times
UploadMeshAndMaterial.cs
(1.33 KiB) Downloaded 410 times
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
christomaker
Posts: 5
Joined: Fri Jan 26, 2018 5:09 pm

Re: save/load prefabs online for 3dconfigurator with playmak

Post by christomaker »

Hi Joel,

Thank you very much.

But where to put your 2 scripts in order to have access to them in playmaker's action panel ?

Bye,

Christomaker
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: save/load prefabs online for 3dconfigurator with playmak

Post by Joel »

Hi there,

The scripts are not actions, so you will not be able to access them in the action panel. As mentioned, it's not possible to achieve what you want purely with PlayMaker actions, because PlayMaker does not have the required Mesh variable.

You need to drag the scripts to the GameObjects you want to save the Mesh and Material of, and then fill in the fields with your details. You can then use PlayMaker's Call Method action to call the scripts Run method, which will make the script upload or download your Mesh and Material.

If you need to change the filename at runtime, you can use PlayMaker's Set Property action to change the filename field of the script.

If you need to get an FSMArray of all of the filenames on the server so you know what you can download, you can use the Download Filenames action to do so.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
christomaker
Posts: 5
Joined: Fri Jan 26, 2018 5:09 pm

Re: save/load prefabs online for 3dconfigurator with playmak

Post by christomaker »

Hello,

1/ I succeed the firt step with my own website : "ES2.php and MySQL database are working correctly."

2/ I succeed in upload and download my mesh + materials with Unity.3.0f3 :
- Mesh and material downloaded from server successfully.
- ES2InvalidDataException: Easy Save 2 Error: The file provided does not contain data that is readable by Easy Save. Please make sure that file was created by Easy Save.
ES2Reader.Next () (at Assets/Plugins/Easy Save 2/Scripts/Readers/ES2Reader.cs:527)

- Mesh uploaded to server successfully.
- Material uploaded to server successfully.

3/ Then I desactivated the dowload and upload and I used only the "download filenames" .Even if I publish my scene online, nothing happen's when I click on my UI button with the fsm action "Download Filenames" ,
in order only to download directly my gameobject from my website (I published my gameobject.fbx with Filezilla with extension and another test without extension) but it doesn't work.
Please see attached file (jpg).

Perhaps I made a mystake by creating a variable with the same name of the filename to put the requested tag ?

Please keep in mind that I want first all my 3d on my website and then the user can download each 3D on demand . It is right ?
Or should I in an home scene first upload all my 3D (all shared 3d beetwen several configurators; I need this system) and then in a second and in a third scene (configurators) the user will be able to download each 3D on demand ? Should I then use global variables for each 3D downloaded ?
How to change the position of a 3D downloaded on x, y , z ?

Thank you very much Joel.

Christomaker
Attachments
download filenames.jpg
download filenames.jpg (91.34 KiB) Viewed 11063 times
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: save/load prefabs online for 3dconfigurator with playmak

Post by Joel »

Hi there,

Judging by the error message, your server is rejecting the POST data, because the "ES2.php and MySQL database are working correctly" message is only returned when no POST data is received. Could you please check with your server provider that the POST requests are not being rejected? They should have access to server logs which confirm this.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
christomaker
Posts: 5
Joined: Fri Jan 26, 2018 5:09 pm

Re: save/load prefabs online for 3dconfigurator with playmak

Post by christomaker »

Hi Joel, I had a chat with my provider :

Christomaker: "Could you please check that the POST requests are not being rejected? You should have access to server logs which confirm this."
Christomaker: perhaps there is something to do in the cpanel ,
Steliana S.: We checked the logs and I confirm that there is nothing on the servers that rejects this request
Steliana S.: The logs show that it is not related to the mod_sec but to the file itself
Christomaker: my file is myobject.fbx at the same folder's ES2.php file
Steliana S.: If you would like, I can also provide you with the logs
Steliana S.: There is no set up on the server that is blocking the request
Christomaker: Yes I agree Can you provide me the logs ?
Last edited by christomaker on Fri Mar 16, 2018 8:33 pm, edited 3 times in total.
christomaker
Posts: 5
Joined: Fri Jan 26, 2018 5:09 pm

Re: save/load prefabs online for 3dconfigurator with playmak

Post by christomaker »

Oh !! I remember that during the whole process I renamed the file "myobject.fbx" on my server by "myobject" !
Could these explain that error ?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: save/load prefabs online for 3dconfigurator with playmak

Post by Joel »

That wouldn't explain why no POST data is being received by the server.

Would it be possible for you to PM me a very basic test project which replicates the error, with your server details, so I can test it at my end?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Locked