listen when a material from slot a is copied to slot b

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 06 June 2013   #1
listen when a material from slot a is copied to slot b

is it possible to listen this action - when drop mat from slot a to slot b then ...

When I drop I get this message meditMaterials[8] = copy meditMaterials[7]

I want a function like onload, onmerge ... or may be somehow else!

If this is not possible, then is it possible to listen the action of applying a material to selected object? For example, I want to make smth when you press btn apply, but before the material would be applied - among! Srry for hard questions!
 
Old 06 June 2013   #2
Originally Posted by try2script: then is it possible to listen the action of applying a material to selected object? For example, I want to make smth when you press btn apply, but before the material would be applied



You can use materialstructed in the nodeevent system

-- to remove
matCallbackItem = undefined
gc light:true

fn matCallbackFn1 ev nd = (
format "Material Changed! %\n" ev 
	for i in nd do 
	(
		node = getanimbyhandle i
		format "% | % \n" node.name node.material 
	)
)

matCallbackItem = NodeEventCallback mouseUp:true delay:1000 materialStructured:matCallbackFn1 
__________________
Regards,
Pete

Read my technical blog - lonerobot.net

Last edited by LoneRobot : 07 July 2013 at 11:13 AM.
 
Old 06 June 2013   #3
Originally Posted by try2script: is it possible to listen this action - when drop mat from slot a to slot b then ...

When I drop I get this message meditMaterials[8] = copy meditMaterials[7]

I want a function like onload, onmerge ... or may be somehow else!

If this is not possible, then is it possible to listen the action of applying a material to selected object? For example, I want to make smth when you press btn apply, but before the material would be applied - among! Srry for hard questions!

everything is possible. but i don't clearly understand what you want to do and why you need a callback... do you want to prevent a material change for specific nodes? or do you want to prevent a change of the material ediror materials order?
tell me what you really want to do
 
Old 06 June 2013   #4
Originally Posted by denisT: ...tell me what you really want to do


I want to automatically rename material when I drop material from slot a to slot b! Please help!

matCallbackItem = undefined
gc light:true

fn matCallbackFn1 ev nd = (
format "Material Changed! %\n" ev 
	for i in nd do 
	(
		node = getanimbyhandle i
		format "% | % \n" node.name node.material 
	)
)


this doesn't work
 
Old 07 July 2013   #5
Please tell me how to do it!!!
 
Old 07 July 2013   #6
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 02:51 PM.


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