Preview window flashing
Posted: Sun May 31, 2020 12:45 am
In my project I have lots of models that are meant to stay briefly on the screen and then expire, for example various explosions, item pickup notifications, score indicators and similar. All these items have a same base model that is set to remove itself when its timer reaches 1, very simple stuff like this:
The problem is that many of these "perishable effect" type of models have minor adjustments in the OnRender step which depend on the timer that is defined in base model, so as soon as a model of that type is selected, the preview window starts flashing and an access violation is reported in the console. In the example above, simply click on the m_Explosion model in the Project Tree to see the effect.
This might look like just a minor nuisance in this particular code above, but some models "flash" more than others and this makes it unpleasant to work. Anyway I am not sure this is happening to anybody else other then my computer & me, so just to show what I'm talking about here is a recording. So are such components meant to always be kept disabled in the Project Tree? (I assume I am not expected to always make a local copy of the timer variable in base model ) But then I can't live preview RenderParticle effect
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
<Content>
<Model Name="m_Base">
<Definitions>
<Variable Name="timer_Expire"/>
</Definitions>
<OnUpdate>
<Condition Expression="return (timer_Expire);">
<OnTrue>
<RemoveModel/>
</OnTrue>
</Condition>
</OnUpdate>
</Model>
<Model Name="m_Explosion" BaseModel="m_Base">
<OnUpdate>
<AnimatorSimple Duration="1" AutoStart="255" ToValue="1"/>
</OnUpdate>
<OnRender>
<Condition Expression="return (timer_Expire>0.2 && timer_Expire<0.7);">
<OnTrue>
<UseMaterial/>
<RenderNet/>
</OnTrue>
</Condition>
</OnRender>
</Model>
<Material Name="Material1"/>
</Content>
</ZApplication>
This might look like just a minor nuisance in this particular code above, but some models "flash" more than others and this makes it unpleasant to work. Anyway I am not sure this is happening to anybody else other then my computer & me, so just to show what I'm talking about here is a recording. So are such components meant to always be kept disabled in the Project Tree? (I assume I am not expected to always make a local copy of the timer variable in base model ) But then I can't live preview RenderParticle effect