Access violation error when selecting a mesh

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

Post Reply
User avatar
Ats
Posts: 711
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Access violation error when selecting a mesh

Post 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>
Last edited by Ats on Sun Jul 24, 2022 8:15 pm, edited 1 time in total.
User avatar
Kjell
Posts: 1910
Joined: Sat Feb 23, 2008 11:15 pm

Re: Access violation error when cselecting a mesh

Post 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
User avatar
Ats
Posts: 711
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Access violation error when cselecting a mesh

Post 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:
Post Reply