Post-Processing and Material Presets


#1

EDITED 15 July 2016

We (mostly @mauricesvay :wink: ) have created a userscript to allow saving, importing and exporting presets for Post-Processing filters and Materials. You can use it to easily copy settings from one model to another, or one material to another.

It works by injecting JavaScript in the page, so you need a userscript extension like Tampermonkey (Chrome) or Greasemonkey (Firefox).

  1. Install [Tampermonkey].(https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en)
  2. Go to your Tampermonkey Dashboard.
  3. Install the script. The easiest way is to create a new script and copy and paste the code it from my GitHub: https://github.com/PadreZippo/post-processing-presets-sketchfab/blob/master/user.js
  4. You should also add the raw code to the "Update URL" so that you automatically get updates installed: https://raw.githubusercontent.com/PadreZippo/post-processing-presets-sketchfab/master/user.js
  5. Save the script and go to any model editor page

You will find new buttons in the Post-Processing panel in the Scene tab as well as the top of the Materials tab.

Save will store the current settings and prompt you for a name. I don't have any checks for duplicates right now, so be careful!
Delete will remove the active preset. You can only delete custom presets, not the default ones that come with it.
Export will give you a JSON dump of the active preset - you can copy and paste this to share your filters
Import will prompt for a JSON dump - try out someone else's filters!

Post your presets! Report your bugs! Enjoy :smile:


Export settings
Save lighting information when reupload model?
Can I save the materials?
Changing material settings for multiple bodies simultaneously...?
Save 3D settings as default or preset
Duplicating models
Can I download a model with the post-processing filters added?
Would love this feature
Cloning / Duplicating Existing Scenes To Reuse
(Mauricesvay) #2

Awesome sunglasses


(Mo Systeme) #3

Very cool ! It works very fine ok_hand THANKS !
Waiting for some presets like this in the MATERIALS +1


(Ahurig) #4

That's just mind-blowing! AGAIN!


(Ahurig) #5

and it works so well... damn that's hell of a nice enhancement! Congrats sunglasses


(Shaderbytes) #6

please please please make this available to materials and dynamic lights!!! wink


#7

@shaderbytes I started playing with it a little bit.

Materials:
I think setting textures with this method will be impossible, but colors/workflow/values will be ok.

Lights:
I can create lights with specific settings, but I can't think of a way to define light positions without making API calls.

Is that useful?
How do you imagine it would work?


(Shaderbytes) #8

FOr the materials , the textures are not really an issue , since they are applied to the slots via the uploader already, so yes colors and all other values would be excellent.

For the lights , Just call the same methods the current onscreen gizmo's are calling to update the light object's properties wink Are you saying you dont have any isolated methods to handle updating spatial representation of a light? Of coarse I have no Idea of the logical structure for your internal objects, This is all javascript right? so no real classes or interfaces etc .. but within that loose nature do you imply some of these OOP/Component strategies ?

So :

Does a light have a position/rotation value ?
or does a light have an object attached that has a position/rotation value?
Does it have its own method to update each of these values?
or does some other area of the API manage these lights and their properties?


#9

The lights object is included in the JSON payload (e.g. when saving model settings)

It's possible to patch these values (although it's undocumented and unstable). I can import/export presets and attach them to the userscript like I'm doing to post-processing, but it's not part of the GUI, so I would have to actually send requests, patch the settings, and refresh the page each time you switch lighting preset. I think it would also require your API token. Super messy.

Obviously this could be done natively in a much more user-friendly way (like the current lighting presets). In the context of this userscript I'd rather not mess around with it.


#10

TL;DR

This plugin uses JavaScript to push buttons on the page for you. If it's not in the editor GUI, it's not within its current framework.


Feature request: Presets
(Shaderbytes) #11

Ah I see .. so its a external hack .. I did not realize this. I was thinking in lines of the actual API being manipulated to provide the extended functionality... not simulating GUI events. Its a clever hack I guess to get some things done faster but not to extend functionality as you mentioned.


(Mauricesvay) #12

I've started to extend the Chrome script to import/export materials. I haven't tested it thoroughly yet, but you can try it there: https://raw.githubusercontent.com/mauricesvay/post-processing-presets-sketchfab/master/user.js

To install the script, you need the Tampermonkey extension, then go to Tampermonkey > Dashboard > Utilities > URL and paste the url.

However, I need to warn you: this is work in progress and this is not an official extension. It works on your material, and can mess with them. If something goes wrong, simply reload the editor without "Save settings". You'll lose any unsaved change of course.


(Shaderbytes) #13

Hey Thanks Maurice!

I will give it a spin on the new model im doing as soon as I have something to upload. I will give you feedback on anything I see going wrong as well.

chat soon


(Tbrazilc4d) #15

Wonderful, James / Tiago!
I can not thank. I hope this will become native as soon as possible.
Thank you!!


(x4fab) #16

Thank you! Here is a little fork:
https://raw.githubusercontent.com/gro-ove/post-processing-presets-sketchfab/master/user.js

Now it can export/import all materials and also save them in local storage.


How can I do a transparency texture effect?
(Extradom) #17

How can I import material? What I need import after press IMPORT button? I import link to JSON file and I paste exported files and I have information: Material is not valid :frowning: How it's works?


(Rcornell65) #18

Does this still work? I've installed the script but still have no export/import buttons in the material tab. Any ideas?


(Shaderbytes) #19

There were changes in the internal coding that broke this tool .. a repair is in progress


(Rcornell65) #20

Thanks, looking forward to it!

Any idea if this will ever be a fully supported feature? The functionality is crucial to using the platform at work.


(Shaderbytes) #21

Yeah , I basically use it all the time .. I suffered on the last job because of having to manually copy material settings across some uploads. Not sure if it would become official .. it seems like a good candidate @mauricesvay .. any input on this?