create a mix material with one RGBA image and lua - UPDATED

Forum for OctaneRender Lua scripting examples, discussion and support.
User avatar
bepeg4d
Octane Guru
Posts: 10326
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

hi all,
finally i have updated the script with the interface and refined the options,
i hope you could find it useful in some way:
bg4dCreateMixMat-1_00.lua
(23.99 KiB) Downloaded 438 times
bg4dCreateMixMat-help.jpg
note for c4d users: in order to import the material from standalone to the integrated plugin, it's necessary to "ungroup" the material, from this:
Schermata 2014-02-25 alle 18.39.20.jpg
to this:
Schermata 2014-02-25 alle 18.39.56.jpg
then, if saved as .ocs, the material can be imported into c4d.
Schermata 2014-02-25 alle 19.00.51.jpg
ciao beppe

--old version--
hi,
here is my first lua script (with the help of jedi master thomas stratified kenobi )
it's a simple script that asks for an RGBA image and creates all the nodes and inputs for the classic mix material between a glossy and a diffuse, suitable for one-poly leaves or grass, using only one texture.
i hope you can find it useful.
bg4d-organic-alpha-mat.lua
(5.12 KiB) Downloaded 439 times
Capture-organic-lua-01.JPG
Capture-organic-lua-02.JPG
ciao beppe
Last edited by bepeg4d on Tue Feb 25, 2014 6:20 pm, edited 1 time in total.
Tugpsx
Licensed Customer
Posts: 1150
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL
Contact:

Thanks for sharing, I modified mine to include jpg images. BTW you may have accidentally created a great skin shader without realizing it. Just tested it on Daz character.
Script test maps
Script test maps
Win 11 64GB | NVIDIA RTX3060 12GB
User avatar
glimpse
Licensed Customer
Posts: 3740
Joined: Wed Jan 26, 2011 2:17 pm
Contact:

Thanks, Beppe.
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Excellent! Go Beppe, go! :D
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
bepeg4d
Octane Guru
Posts: 10326
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

olà my friends :D
i'm glad to hear that you like it ;)
@tugpsx: i have create a variation more suitable for skin, basically i have removed the opacity nodes and added a second texture load for normal map, plus a different approach for specular and roughness.
i hope you can find it useful ;)
bg4d-simple-skin-normal-mat.lua
(5.09 KiB) Downloaded 437 times
Capture-simple-skin-lua.JPG
ciao beppe
Tugpsx
Licensed Customer
Posts: 1150
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL
Contact:

Awesome will give yours a go.
Win 11 64GB | NVIDIA RTX3060 12GB
Tugpsx
Licensed Customer
Posts: 1150
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL
Contact:

Thanks for the script, Can I make a few suggestions that all can benefit from. You may need to update the prompt since it appears to prompt for both diffuse and normal texture but the requests ask for the same type. You could also make an interface to select both before the script runs. I know you were trying to keep it simple so again thanks.
Win 11 64GB | NVIDIA RTX3060 12GB
User avatar
bepeg4d
Octane Guru
Posts: 10326
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

Tugpsx wrote:Thanks for the script, Can I make a few suggestions that all can benefit from. You may need to update the prompt since it appears to prompt for both diffuse and normal texture but the requests ask for the same type.

oops. sorry, corrected ;)
bg4d-simple-skin-normal-mat.lua
(5.09 KiB) Downloaded 445 times
You could also make an interface to select both before the script runs. I know you were trying to keep it simple so again thanks.
about the interface, you are right, it would be a big step for me, but i need to increase my skill first :D
but is something i want absolutly to try.
thanks for looking at my scripts, very apreciated ;)
ciao beppe
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Great work Bepe. I think you created a nice little tool, useful for many artists.

cheers,
Thomas
Post Reply

Return to “Lua Scripting”