Maxscript delegate problem

Maxscript delegate problem

Anonymous
Not applicable
536 Views
3 Replies
Message 1 of 4

Maxscript delegate problem

Anonymous
Not applicable
Hi,

I have a very strange problem which is driving me mad . I have a class which extends from another and I use 'delegate' to access the parent.

The problem im having is that maxscript thinks that delegate is the current class and not the parent, this results in errors as im using delegate.color etc and it says color is not a property of class. This was working fine but for some reason its just stopped working but I havent changed any of the code which makes it stranger, just installed max2009.

If I do class.delegate in the maxscript listener the result is as expected, but not when the script is run at startup on my object when the scene loads.

Just a vague description if my explanation didnt make it very clear

class Parent
(
#filename filename
)

class Child extends Parent
(
-- for some reason delegate is Child and not Parent so fails
delegate.filename = "file"
)


Any help would be greatly appreciated.
Thanks
Mike
0 Likes
537 Views
3 Replies
Replies (3)
Message 2 of 4

keithm
Enthusiast
Enthusiast
This is within a scripted plugin?
0 Likes
Message 3 of 4

Anonymous
Not applicable
Hi, im on another account, at work now, dont have password for one at home 🙂

Its not a scripted plugin as such, I have a shader class which is extended from the directx shader in max and I have a referenceshader class which is extended from the shader. The problem is happening because max thinks for some reason that delegate of the referenceshader is itself and not shader so when I try to access any properties on it, it errors. Delegate is behaving like 'this' 😕

Another thing, it seems to be just specific scenes which are broke, some other scenes work fine.
0 Likes
Message 4 of 4

keithm
Enthusiast
Enthusiast
Aahh... you're off in that mysterious directx shader world... Sorry I haven't work with those at all...
0 Likes