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 CLOSED
 
Thread Tools Search this Thread Display Modes
Old 07 July 2006   #1
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
 
Old 07 July 2006   #2
Hi.

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 mtl.name
	)
)


Hope that helps.
 
Old 07 July 2006   #3
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.
 
Old 07 July 2006   #4
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 04:38 PM.


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