Pjanssen
@pjanssen
New Member
Joined: Feb 14, 2024
Topics: 53 / Replies: 510
Reply
RE: sort array based on pos.X

It seems to me like this comparison function should be sufficient: fn fnComparePositionX obj1 obj2 = (in coordsys world obj1.pos).x – (in coordsys …

13 years ago
Forum
Reply
RE: Advice on script optimization

To begin with I’d say do benchmarks on parts of the algorithm to find out what the bottlenecks are. Something interesting that you could try is build…

13 years ago
Forum
Reply
RE: Script include problem

You could use forward declaring of either or both functions. So in file A you’d declare a function that is located in file B, without an implementatio…

13 years ago
Forum
Reply
RE: Compact scripts run slower

It’s difficult to explain why this would happen without knowing what kind of parser and interpreter steps are performed when executing maxscript. But …

13 years ago
Forum
Reply
RE: Getting the Parent Root of a hierarchy

If you like recursion you should give functional programming a go, for example with Haskell or Erlang. It’s lovely! Maybe you should show the exact…

13 years ago
Forum
Reply
RE: Getting the Parent Root of a hierarchy

If you write the code out over multiple lines it may become more clear: fn getRoot node = ( –Check if the node passed to the function is a valid n…

13 years ago
Forum
Reply
RE: How to create a new Utility Class?

Wouldn’t it be easier to just create a small macroscript with one or more “max export” commands calling the SDK exporter you already have? Or am I mis…

13 years ago
Forum
Reply
RE: Console logging for a max plugin

The SDK also provides a function “DebugPrint” allowing easy string formatting, which is nice.

13 years ago
Forum
Reply
RE: Macroscript icons and color scheme

Yeah finding out which color scheme is in use is not a problem. But I find having to register a #colorChanged event and copying new files a bit of a h…

13 years ago
Forum
Topic
Forum
Replies: 2
Views: 11
Reply
RE: SDK: Advice on what shoud I port

Isn’t it this, or some similar method? virtual BOOL RenderGlobalContext::IntersectWorld ( Ray & ray, int skipID, ISect & hit, ISectList &a…

13 years ago
Forum
Reply
RE: SDK: Advice on what shoud I port

A small aside, just something I noticed in your code: del_faces = #{} del_faces.count = f_count for i = 1 to f_count do ( del_faces[i] =true ) i…

13 years ago
Forum
Reply
RE: Random numbers

My guess is that if there is a random function without a seed it uses the system time internally

13 years ago
Forum
Reply
RE: Random numbers

How about doing something like taking the system time as a seed?

13 years ago
Forum
Reply
RE: scripts prevented from exposing code

It’s very useful for testing. See this (sort of) unit test I wrote to (regression-)test a struct: It is of course no replacement for try/catch, it’s …

13 years ago
Forum
Page 6 / 38