Notifications
Clear all

[Closed] 3dsmax 2019.1 Scripting issues

The code below is direcetly from 3ds Max 2019 Help file(it exist in the help files of the older versions too)


unregisterRedrawViewsCallback GW_displayObjectNames
fn GW_displayObjectNames =
(
  gw.setTransform (matrix3 1)
  for o in objects where not o.isHiddenInVpt do
    gw.text o.pos (o as string) color:yellow
  gw.enlargeUpdateRect #whole  
)
registerRedrawViewsCallback GW_displayObjectNames

Execute it in 3ds Max 2019.1 and in the Maxscript Listener will be printed an error message:


-- Error occurred in anonymous codeblock; filename: ; position: 52; line: 1
-- Runtime error: registerRedrawViewsCallback() expected function, got: undefined
-- MAXScript callstack:
--    thread data: threadID:5748
--    ------------------------------------------------------
--    [stack level: 0]
--    In top-level
GW_displayObjectNames()
OK

The script will work. But this error not occurs in any of the previous versions of 3ds Max, including 3ds max 2019(without the latest update – 2019.1).

2 Replies

Looks like some new null/undefined check in unregisterRedrawViewsCallback maybe ?

Anyways, having the first line throw the error looks correct and even better than before
because at first run aMax does’nt know anything about GW_displayObjectNames yet

1 Reply
(@miauu)
Joined: 11 months ago

Posts: 0

I prefer the old way but who am I.