Page 1 of 1

Default instance doesn't initialise using Clear button

Posted: Oct 4th, '17, 20:35
by SimpleSi
The default instance of a class doesn't run its initialise method when Clear is pressed

e.g in this example
0.png
Pressing clear makes the instance blink out and automatically come back but it doesn't run its initialise method

If I add a delete block and run it - then when it is next created - it does run its the initialise method of course but I think it should do it on Clear as well

Re: Default instance doesn't initialise using Clear button

Posted: Oct 6th, '17, 21:14
by JohnM
The "clear" button actually doesn't make a new instance, it just deletes all but the currently selected instance. (The fact that the instance thumbnail momentarily disappears is just an artifact; the instance isn't actually deleted.) GP doesn't call initialize on the selected instance because that instance already exists.

To get a single initialized instance, hit the "+" to make a new instance, then "Clear" (to remove any uninitialized instances).

Re: Default instance doesn't initialise using Clear button

Posted: Oct 6th, '17, 21:55
by SimpleSi
I'll let that info sink in and mull the concept around in my head :)