Notifications
Clear all

[Closed] Run a script ,A warning,Why?

Hi,All
I download a script from scriptspot, I run it, found a warning,Why ,hope help
Thanks!!


/*
Simple deformation-type modifier plugin
Created: June 22 2009
Modified:
Author: P. Karabakalov [ http://project3d.narod.ru ]
Compatibility: 3D Studio Max Release 4.0 and higher
*/
plugin simpleMod Dimension
name:“Dimension”
classID:#(0x66a31f0c, 0x514b5f06)
version:1
(
parameters main rollout:params
(
type type:#integer ui:rtype default:1
sX type:#float ui:ssX default:1
sY type:#float ui:ssY default:1
sZ type:#float ui:ssZ default:1
)
rollout params “Parameters”
(
radiobuttons rtype labels:#(“Relative”,“Absolute”)
group “Scale / Size”
(
spinner ssX “X: ” range:[0.01,10000,1]
spinner ssY “Y: ” range:[0.01,10000,1]
spinner ssZ “Z: ” range:[0.01,10000,1]
)
)
rollout roAbout “About” rolledUp:true
(
label lb_a “Author: ” across:2
hyperlink hl_url “P. Karabakalov” address:“ http://project3d.narod.ru ” offset:[-15,0]
label lb_v “Version: 1.0 (22-06-2010)”
)
on map i p do
(
case type of
(
1: (p *= [sX,sY,sZ] ; p)
2: (p /= (extent / [sX,sY,sZ]) ; p)
)
p
)
)


5 Replies

Yes, I’m the author of this scrited plugs and posted at ScriptSopt that this problem exist:

“Disadvantage:
The Garbage Collection don’t like this modifier.
Recommended to collapse the modifier stack and restart the Max.”

So, am too will glad if someone can tell why the GC don’t like it.
Thanks

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

GC doesn’t like it because of quick memory leaking…
on map loop with every call you create new point3 copy of p. It causes the leaking.
more memory friendly (but slower) way is:


p.x *= x
p.y *= y
p.z *= z

then


p *= [x,y,z]

Thanks Panayot ! I see. if collapse the modifier stack ,Will not happen

The only time I had such a message was when I was working with dotnet and async threads.

Have you tried increasing the “Initial heap allocation” under Cuztomize/preferences/MAXScript?
I wonder if that “fixes” it…

Interesting… Thanks.