How to know if a material is default or not in python?

Discussions concerning programming of SOFTIMAGE©
antonieo
Posts: 7
Joined: 13 Apr 2011, 03:37

How to know if a material is default or not in python?

Post by antonieo » 04 Dec 2012, 08:11

Hello folks, I've met a tiny question, it would really be helpful if you'd like to teach me.

Every time, once a new geometry object is created in the scene, a default material (normally it's "Scene_Material") is always assigned to it.
My question is how to know whether a material is default (which always be used by new created objects).

Sorry for my poor English.

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: How to know if a material is default or not in python?

Post by xsisupport » 04 Dec 2012, 11:01

antonieo wrote:Hello folks, I've met a tiny question, it would really be helpful if you'd like to teach me.

Every time, once a new geometry object is created in the scene, a default material (normally it's "Scene_Material") is always assigned to it.
My question is how to know whether a material is default (which always be used by new created objects).

Sorry for my poor English.

Code: Select all

si = Application
print si.Selection(0).Material.IsEqualTo( si.ActiveProject.ActiveScene.Root.Material )
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage