Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] Corona Goodies - User Contributions => Topic started by: John_Do on 2023-12-22, 17:10:56

Title: Bitmap shader conversion scripts
Post by: John_Do on 2023-12-22, 17:10:56
Hey guys,

Here are some custom scripts for you, just in time for Christmas !

- C4D Bitmap to Corona Bitmap
- Corona Bitmap to C4D Bitmap
- Update normals filtering
- Sort Corona Materials by Type
- Select Corona Materials by Type


I wrote them a quite some time ago but with the perspective of releasing more scripts next year, I've improved them in many ways and while they're not perfect (details here (https://skimat.notion.site/Documentation-1f0490843df04740b5f55100da89e701)), I hope they will be useful to some of you.

INSTALLATION, USAGE AND LIMITATIONS
Read the docs (https://skimat.notion.site/Documentation-1f0490843df04740b5f55100da89e701?pvs=74)

WHAT IT DOES
Convert Bitmaps Scripts
(https://i.imgur.com/22BTZXn.png)(https://i.imgur.com/iUQS6zW.png)

Pretty self explanatory, convert all the bitmaps shaders in the material in one way or another ( C4D Bitmap >< Corona Bitmap )

Update Normals Filtering
(https://i.imgur.com/ERhfGRV.png)

Change the normals filtering method to Roughness Modulation over the selected materials.
Note that Roughness modulation comes with some limitations, mainly when mixing Corona shaders with Cinema ones. More info here : https://support.chaos.com/hc/en-us/articles/19161682524305

Sort Corona Materials by Type
(https://i.imgur.com/lUtld9v.png)

Sort all Corona Materials in the scene by type using dedicated layers

Select Corona Materials by Type
(https://i.imgur.com/ZLGquS5.png)

Select all the Corona Materials of the chosen type

---
Updates
2024.01.17 : Original scripts updated, two new scripts
Title: Re: Bitmap shader conversion scripts
Post by: John_Do on 2023-12-22, 18:16:22
Some moving pictures to get a better feel of the script

(https://i.imgur.com/4lopDEJ.gif)
Title: Re: Bitmap shader conversion scripts
Post by: Beanzvision on 2023-12-22, 18:45:43
Thanks for sharing John, looks very handy indeed :)
Title: Re: Bitmap shader conversion scripts
Post by: BatRM on 2023-12-22, 20:05:29
Thank you very much John_Do, the bitmap converter is really a time saver!
Title: Re: Bitmap shader conversion scripts
Post by: Evolist_ua on 2023-12-25, 12:07:08
Wow, thanks a lot!

Now we need to wait for the developers to fix the bug with bitmap+ transformation in layer shader
Title: Re: Bitmap shader conversion scripts
Post by: John_Do on 2024-01-17, 19:49:15
I've just update the archive with the latest version of the scripts, and wrote somewhat of a documentation (https://skimat.notion.site/Documentation-1f0490843df04740b5f55100da89e701).

For the bitmap conversion scripts the Layer Shader is now supported ( even when nested inside another Layer Shader ) BUT the undo is broken in this specific case, something on the Python SDK side which could be investigated. So be careful and use the other conversion script to go back.

Updated the Normals Filtering script with a dialog box to choose the filtering method. Also new icon.

(https://i.imgur.com/NNyyKY9.gif)

And I've added two scripts to sort Corona Materials in your scenes. Not the most exciting thing but it has been useful for me once or twice, so maybe for you too.

(https://i.imgur.com/U3KenaY.gif)
(https://i.imgur.com/nxneXK1.gif)

Title: Re: Bitmap shader conversion scripts
Post by: katzenwaffe on 2024-02-06, 20:19:32
Theese scripts are totally awesome! Love it!!

Good work!
Title: Re: Bitmap shader conversion scripts
Post by: Beanzvision on 2024-02-07, 11:19:22
Is this not working for S22? Seems to be fine in 2023/24 ;)
Title: Re: Bitmap shader conversion scripts
Post by: John_Do on 2024-02-07, 13:10:19
Is this not working for S22? Seems to be fine in 2023/24 ;)

I don't know, I haven't tested the scripts on anything other than the latest 2024.1/2024.2. Did you try it on S22 ?
Title: Re: Bitmap shader conversion scripts
Post by: Beanzvision on 2024-02-07, 17:36:34
I did but no luck. Not to worry though ;)
Title: Re: Bitmap shader conversion scripts
Post by: John_Do on 2024-04-12, 16:52:10
I'm still planning to release more scripts, here is a little work in progress :

Smart creation
(https://i.imgur.com/AnNU00a.gif)

Creating multiple shaders at once
(https://i.imgur.com/oVjSdZh.gif)

Works also with only one node
(https://i.imgur.com/MREnEhl.gif)

Even if there is no node selected
(https://i.imgur.com/8mjNX6Q.gif)

And all the commands can be assigned to a keyboard shortcut! 🥰
Title: Re: Bitmap shader conversion scripts
Post by: Beanzvision on 2024-04-12, 20:49:53
Excellent stuff :)
Title: Re: Bitmap shader conversion scripts
Post by: tuami on 2024-04-15, 15:33:06
I'm still planning to release more scripts, here is a little work in progress :


whoa i need this! would be great if there are more shaders to be found there, thanks keep doing great helpful work :)
Title: Re: Bitmap shader conversion scripts
Post by: John_Do on 2024-05-07, 18:03:01
Moar progress, even if I'm a bit slow lately because of ongoing projects :

Implemented the thing as a plugin

(https://i.imgur.com/cTAAwdA.png)

New commands to add often used shaders

(https://i.imgur.com/rdQyAPl.gif)
(https://i.imgur.com/VqcI71S.gif)

More shaders available for insertion in existing node tree, some with unique behaviors
(https://i.imgur.com/dJtxWaq.gif)
(https://i.imgur.com/IPiXaO5.gif)
(https://i.imgur.com/MSnGX4m.gif)

Added something for the tidy maniacs
(https://i.imgur.com/aOU1VSY.gif)

Finally solved something that was bothering me from a long time

Create mask directly from the active selection and (almost) never bother again with ID numbers
(https://i.imgur.com/cuhZ6Qy.gif)

It works on objects and materials, and can create one mask for each selected element or a shared one
(https://i.imgur.com/cuhZ6Qy.gif)
(https://i.imgur.com/ps0L2sg.gif)

For sure it's not really useful if you can leverage Cryptomatte but otherwise, it makes the process a bit simpler and faster.