Isotropix Forums

Creating materials through Python - possible or not?

Clarisse Scripting related topics

Creating materials through Python - possible or not?

Unread postby gerdhofer » Thu Apr 04, 2019 6:04 pm

Hello,

I think I read somewhere here in the forum that it's not possible to create materials through scripting, but I'm not sure anymore if this is just imagination or a fact. Maybe one of you can confirm that?

Thanks,
Gerd
gerdhofer
 
Posts: 28
Joined: Thu Aug 30, 2018 11:05 am

Re: Creating materials through Python - possible or not?

Unread postby ayanik » Thu Apr 04, 2019 7:57 pm

You can create and assign built-in Clarisse material/texture nodes through scripting. There are several scripts in this forums which show you how to. The easiest way is to just create the material in Clarisse and see and use the functions which were called in the log.

However you cannot create a new custom material type with Python if that's what you're asking. For that you'll need access to the C++ SDK, but since the C++ SDK is not accessible for common people I don't know what can be done with it.
ayanik
 
Posts: 58
Joined: Wed Nov 26, 2014 9:10 pm

Re: Creating materials through Python - possible or not?

Unread postby bvaldes » Fri Apr 05, 2019 8:07 am

Hi,

ayanik is right for everything. You can create material items my using the ix.cmds.CreateObject() but you can't create your own material in python (like disney shader or something else). For that you will need the C++ SDK that is not available for now.

Best regards
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 384
Joined: Mon Sep 26, 2016 10:44 am

Re: Creating materials through Python - possible or not?

Unread postby gerdhofer » Fri Apr 05, 2019 2:15 pm

Thank you very much ayanik and bvaldes! I was really just looking for the creation of built-in material types like standard or reflective. Great to see that it's possible. Most probably I was reading about the restrictions with custom materials and thought that's valid for built-in materials as well.
gerdhofer
 
Posts: 28
Joined: Thu Aug 30, 2018 11:05 am

Re: Creating materials through Python - possible or not?

Unread postby bvaldes » Mon Apr 08, 2019 8:31 am

Hi,

Most of the actions are written in the log in python. So if you want to mimic an action in python, do it by hand, and take a look to the log. There is sometimes an issue: it's written cmds.Something(...) instead of ix.cmds.Something(...). So if the ix is missing, add it when you want to execute your code.

Regards
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 384
Joined: Mon Sep 26, 2016 10:44 am

Re: Creating materials through Python - possible or not?

Unread postby gerdhofer » Thu Apr 11, 2019 4:43 pm

Just saw your tip with watching the log for Python commands. This makes common scripting tasks much easier, so big thanks for that.
gerdhofer
 
Posts: 28
Joined: Thu Aug 30, 2018 11:05 am

Re: Creating materials through Python - possible or not?

Unread postby dboude » Thu Apr 11, 2019 4:48 pm

Other tip, you can press CTRL + Space in the script editor. It will pop up the completion. (experimental)

Cheers ;)
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 941
Joined: Mon Jul 03, 2017 10:51 am

Re: Creating materials through Python - possible or not?

Unread postby gerdhofer » Thu Apr 11, 2019 6:21 pm

Oh, that's amazing. Thanks for sharing :-)
gerdhofer
 
Posts: 28
Joined: Thu Aug 30, 2018 11:05 am


Return to Scripting