PDA

View Full Version : callback problem #nodeNameSet


bkravi
10-16-2009, 05:11 PM
Hi,

I am using #nodeNameSet callback to check if the user has changed the name of any object.

the problem is that this callback runs immidiatly as you enter a single alphabetic character.

what I want is to somehow make it run only when I hit enter or change my focus from the text input field to somewhere else. is it possible?

Thanks
ravi

MarcoBrunetta
10-16-2009, 05:48 PM
Not that I know off, maybe you could use a timer? Not very nice, but might do the trick...

denisT
10-16-2009, 06:22 PM
I am using #nodeNameSet callback to check if the user has changed the name of any object.

the problem is that this callback runs immidiatly as you enter a single alphabetic character.

what I want is to somehow make it run only when I hit enter or change my focus from the text input field to somewhere else. is it possible?


use #nodeRenamed callback instead of #nodeNameSet

bkravi
10-17-2009, 05:07 AM
denisT:

Both of them #nodeNameReset and #nodeRenamed are same.

in maxscript documentation it is mentioned as follows-

"It is more reliable to use the #nodeNameSet callback introduced in 3ds Max 7!"

so I hope there will some another way to execute them when you hit enter after renaming object.

MarcoBrunetta : Any try with the timer function?

denisT
10-17-2009, 02:55 PM
denisT:

Both of them #nodeNameReset and #nodeRenamed are same.

in maxscript documentation it is mentioned as follows-

"It is more reliable to use the #nodeNameSet callback introduced in 3ds Max 7!"

so I hope there will some another way to execute them when you hit enter after renaming object.

MarcoBrunetta : Any try with the timer function?

here are all that I know event mechanisms to catch "rename" event:


fn catchRename event: =
(
format "%: %\n" event (callbacks.notificationParam())
)
fn eventRename event nodes =
(
nodes = for n in nodes collect (node = GetAnimByHandle n)
format "%: %\n" event (for n in nodes collect n.name)
)
callbacks.removescripts id:#rename_calls
callbacks.addscript #nodeRenamed "catchRename event:#nodeRenamed" id:#rename_calls
callbacks.addscript #nodeNameSet "catchRename event:#nodeNameSet" id:#rename_calls
if _nodeEventCallback != undefined do _nodeEventCallback.enabled = off
_nodeEventCallback = NodeEventCallback nameChanged:eventRename
_nodeEventCallback.enabled = on


all three methods fire on Enter pressed or Focus Changed if you change the name from Command Panel (max 2009 and 2010)...

how do you change (set) node's name?

bkravi
10-17-2009, 03:02 PM
I also used to rename from command panel, but I was using it with 3dsmax2008. may be thats the problem.

denisT
10-17-2009, 03:22 PM
I also used to rename from command panel, but I was using it with 3dsmax2008. may be thats the problem.

I remember that versions before max 2009 fire rename events for every symbol enter... you can't do anything with that. it's how the rename callbacks work.

denisT
10-17-2009, 03:28 PM
probably i could write some c++ and SDK plug-in to catch event form command panel edit text but i don't have time now and i never had max2008 SDK

ps. max2008 is one the worst max versions, we skipped it indignantly :)

bkravi
10-17-2009, 03:56 PM
Thank you denisT,

got it, now I must have to move to 2009.

C++ stuff is great, I always wanted to use some SDK stuff for speed but I have no knowledge of using SDK, but have solid foundation in C, will it help me to learn the C++ and SDK stuff?

if you know any link for tutorials or anything that can help me learn it....will be great.

Thanks for valuable help...
ravi

denisT
10-17-2009, 07:09 PM
Thank you denisT,

got it, now I must have to move to 2009.

C++ stuff is great, I always wanted to use some SDK stuff for speed but I have no knowledge of using SDK, but have solid foundation in C, will it help me to learn the C++ and SDK stuff?

if you know any link for tutorials or anything that can help me learn it....will be great.

Thanks for valuable help...
ravi

check this for start:
http://area.autodesk.com/blogs/chris/3ds_max_sdk_resources

bkravi
10-17-2009, 07:26 PM
Thanks, i will check the links

CGTalk Moderation
10-17-2009, 07:26 PM
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.