get if a material in the medit is assigned to an objects or not

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  07 July 2006
get if a material in the medit is assigned to an objects or not

Hello everybodies.

I try to find a way to get if a material in the medit is assigned to an objects or not.
I want to convert non-assigned material in the medit in vray.
But i don't know how to have this information.

Do you know how to do it.
Or i have to make a function for it.

Thank you a lot for your help
  07 July 2006

I don't know if exists a better way to do it but you could try this:

fn mtlExistsInScene mtl = (
	for obj in objects do (
		if mtl == obj.material do
			return true
	return false

Then, if, for example, you want to know if a material in the material editor exists in the scene you could do:

mtlIndex = 0
for mtl in mEditMaterials do (
	if (mtlExistsInScene mtl) do (
		mtlIndex += 1
		format "Mtl in slot #% (\"%\") does exist in the scene\n" mtlIndex

Hope that helps.
  07 July 2006
Hello HalfVector.

i made a Function too to get this information.

You learn me what's "return" is use for

It's not a probleme if there is a "return false" after the "if" condition.
It don't crush the other "return".
There is a risk that the function gives all times "false" as "return".

Thanks a lot for your help Halfvector

Last edited by BebeteLANUITE : 07 July 2006 at 06:18 PM.
  07 July 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 08:06 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.