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

Forums: create a mix material with one RGBA image and lua - UPDATED
Forum for OctaneRender Lua scripting examples, discussion and support.

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

Postby bepeg4d » Sat Feb 01, 2014 12:35 am

bepeg4d Sat Feb 01, 2014 12:35 am
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 390 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 391 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.
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: create a mix material with one RGBA image and lua

Postby niuq.cam » Sat Feb 01, 2014 12:44 am

niuq.cam Sat Feb 01, 2014 12:44 am
Bravo Beppe. :D
User avatar
niuq.cam
Licensed Customer
Licensed Customer
 
Posts: 482
Joined: Fri Jul 22, 2011 8:37 am

Re: create a mix material with one RGBA image and lua

Postby Tugpsx » Sat Feb 01, 2014 4:44 am

Tugpsx Sat Feb 01, 2014 4:44 am
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.

scripttest1.JPG
Script test maps
Dell Win Vista 32 | NVIDIA Quadro NVS135M | Core2 Duo T7500 2.20GHz | 4GB
CyberPowerPC Win 7 64| NVIDIA GTX660Ti (3G) GTX480(1.5G) | 16GB
Tugpsx
Licensed Customer
Licensed Customer
 
Posts: 1145
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL

Re: create a mix material with one RGBA image and lua

Postby glimpse » Sat Feb 01, 2014 6:17 am

glimpse Sat Feb 01, 2014 6:17 am
Thanks, Beppe.
User avatar
glimpse
Licensed Customer
Licensed Customer
 
Posts: 3715
Joined: Wed Jan 26, 2011 2:17 pm

Re: create a mix material with one RGBA image and lua

Postby grimm » Sat Feb 01, 2014 6:38 am

grimm Sat Feb 01, 2014 6:38 am
Excellent! Go Beppe, go! :D
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: create a mix material with one RGBA image and lua

Postby bepeg4d » Sat Feb 01, 2014 9:07 am

bepeg4d Sat Feb 01, 2014 9:07 am
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 390 times

Capture-simple-skin-lua.JPG

ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: create a mix material with one RGBA image and lua

Postby Tugpsx » Sat Feb 01, 2014 4:50 pm

Tugpsx Sat Feb 01, 2014 4:50 pm
Awesome will give yours a go.
Dell Win Vista 32 | NVIDIA Quadro NVS135M | Core2 Duo T7500 2.20GHz | 4GB
CyberPowerPC Win 7 64| NVIDIA GTX660Ti (3G) GTX480(1.5G) | 16GB
Tugpsx
Licensed Customer
Licensed Customer
 
Posts: 1145
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL

Re: create a mix material with one RGBA image and lua

Postby Tugpsx » Sat Feb 01, 2014 5:01 pm

Tugpsx Sat Feb 01, 2014 5:01 pm
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.
Dell Win Vista 32 | NVIDIA Quadro NVS135M | Core2 Duo T7500 2.20GHz | 4GB
CyberPowerPC Win 7 64| NVIDIA GTX660Ti (3G) GTX480(1.5G) | 16GB
Tugpsx
Licensed Customer
Licensed Customer
 
Posts: 1145
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL

Re: create a mix material with one RGBA image and lua

Postby bepeg4d » Sat Feb 01, 2014 5:17 pm

bepeg4d Sat Feb 01, 2014 5:17 pm
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 391 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
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: create a mix material with one RGBA image and lua

Postby stratified » Sat Feb 01, 2014 11:22 pm

stratified Sat Feb 01, 2014 11:22 pm
Great work Bepe. I think you created a nice little tool, useful for many artists.

cheers,
Thomas
User avatar
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand
Next

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 4 guests

Thu Mar 28, 2024 7:37 pm [ UTC ]