Default instance doesn't initialise using Clear button

Report bugs. Post bug workarounds or fixes

Moderator: MSandro

Post Reply
SimpleSi
Posts: 330
Joined: Jul 2nd, '17, 13:47

Default instance doesn't initialise using Clear button

Post by SimpleSi » Oct 4th, '17, 20:35

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

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Default instance doesn't initialise using Clear button

Post by JohnM » Oct 6th, '17, 21:14

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).

SimpleSi
Posts: 330
Joined: Jul 2nd, '17, 13:47

Re: Default instance doesn't initialise using Clear button

Post by SimpleSi » Oct 6th, '17, 21:55

I'll let that info sink in and mull the concept around in my head :)

Post Reply