Isotropix Forums

Copy Materials with dependencies via python

Clarisse Scripting related topics

Copy Materials with dependencies via python

Unread postby ThomasGeorgeRutter » Thu Sep 26, 2019 10:04 am

When right clicking on an item, you are able to "Copy with Dependencies", this doesn't appear to be exposed in the api's. Am I just being dumb and it exists somewhere that I'm just unable to find?

Context:

I need to copy an entire material graph to tweak settings in the material and also textures that will be fed into the graph. There are many remap and other utility nodes in between the texture node and the material's inputs.

If it were possible to have on the shading layer, or material itself, a rule to somehow override the "Max Resolution" of any textures connected, that would also help.
ThomasGeorgeRutter
 
Posts: 2
Joined: Tue Sep 24, 2019 3:11 pm

Re: Copy Materials with dependencies via python

Unread postby anemoff » Thu Sep 26, 2019 4:09 pm

Hi,

The API is on ix.application:

python code

# copy current selection
ix.application.copy(True) # True = with dependencies, False = without

# or specify the list of objects to copy
ix.application.copy(object_paths, True)


Cheers,
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 230
Joined: Wed Jan 13, 2016 10:10 am

Re: Copy Materials with dependencies via python

Unread postby ThomasGeorgeRutter » Thu Sep 26, 2019 5:29 pm

Thank you!

I'm assuming there is no way to have on the material a way to override any incoming texture resolutions? You would just have to edit that attribute on the texture itself?
ThomasGeorgeRutter
 
Posts: 2
Joined: Tue Sep 24, 2019 3:11 pm

Re: Copy Materials with dependencies via python

Unread postby dboude » Fri Sep 27, 2019 9:56 am

Hi,

Yes, you have to edit the map file itself to change the max resolution (assuming you are talking about mipmap level).

You could type TextureMapFile in the search box of the browser then select all the textures and set it by hand.

Or you can create an empty object (ix.cmds.CreateObject("Controller", "ProjectItem")) and add a custom attribute on it. Then you can bind the mipmap level of all your texture to this custom attribute using Seexpr. You could place this controller at the root (project://Controller) so it can be reachable in any case.

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


Return to Scripting