Page 1 of 1

Access violation error when selecting a mesh

Posted: Sun Jul 24, 2022 12:31 pm
by Ats
I have a bug in my project, and it crashes ZGE without warning if I click the Model/ModelState/Definitions/Mesh in the left column.
The problem comes from the MeshExpression that has access to a variable in the definitions of the Model.

I made a strip down example. Contrary to my project, it doesn't crash ZGE entirely, but displays an error window when I select the mesh.

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
  <Content>
    <Model Name="Model">
      <Definitions>
        <Variable Name="Variable"/>
      </Definitions>
      <States>
        <ModelState Name="ModelState">
          <Definitions>
            <Mesh Name="Mesh">
              <Producers>
                <MeshSphere/>
                <MeshExpression VertexColors="255">
                  <Expression>
<![CDATA[//
C.R = Variable;
C.G = Variable;
C.B = Variable;]]>
                  </Expression>
                </MeshExpression>
              </Producers>
            </Mesh>
          </Definitions>
        </ModelState>
      </States>
    </Model>
  </Content>
</ZApplication>

Re: Access violation error when cselecting a mesh

Posted: Sun Jul 24, 2022 12:51 pm
by Kjell
Hi Ats,
Ats wrote: Sun Jul 24, 2022 12:31 pmI have a bug in my project, and it crashes ZGE without warning if I click the Model/ModelState/Definitions/Mesh in the left column. The problem comes from the MeshExpression that has access to a variable in the definitions of the Model.
This issue is a little annoying yes. It's caused by the fact that when you preview the mesh before previewing the model in which the variable is defined, the variable isn't allocated yet. So if you first click on the model component ( to preview that first ) and then click on the mesh, it won't crash.

Would be nice if this could be fixed somehow yes.

K

Re: Access violation error when cselecting a mesh

Posted: Sun Jul 24, 2022 3:10 pm
by Ats
Thanks for the tip. At least I can continue working on the project without fearing that it might be corrupted or something :lol: