CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 06-07-2013, 07:55 PM   #1
try2script
Expert
portfolio
Mike
Moldova
 
Join Date: Mar 2013
Posts: 488
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-13-2013, 09:05 PM   #2
LoneRobot
Swami Lama's Lovechild
 
LoneRobot's Avatar
portfolio
Pete Addington
Technical Director
Nexus
United Kingdom
 
Join Date: Dec 2004
Posts: 1,784
Quote:
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

Code:
-- 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-03-2013 at 11:13 AM.
 
Old 06-13-2013, 10:15 PM   #3
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,427
Send a message via ICQ to denisT
Quote:
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-30-2013, 11:03 PM   #4
try2script
Expert
portfolio
Mike
Moldova
 
Join Date: Mar 2013
Posts: 488
Quote:
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!

Code:
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-02-2013, 09:33 PM   #5
try2script
Expert
portfolio
Mike
Moldova
 
Join Date: Mar 2013
Posts: 488
Please tell me how to do it!!!
 
Old 07-02-2013, 09:33 PM   #6
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:13 PM.


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