Notifications
Clear all

[Closed] callback problem #nodeNameSet

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

10 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

use #nodeRenamed callback instead of #nodeNameSet

Not that I know off, maybe you could use a timer? Not very nice, but might do the trick…

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?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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


fn catchRename event: = 
(
 format "%: %
" event (callbacks.notificationParam())
)
fn eventRename event nodes = 
(
 nodes = for n in nodes collect (node = GetAnimByHandle n)
 format "%: %
" 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?

I also used to rename from command panel, but I was using it with 3dsmax2008. may be thats the problem.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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.

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

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

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

Thanks, i will check the links