Notifications
Clear all

[Closed] Change SuperClass C++

 lo1

A couple of points:

  • You should return NULL from ConvertToType, it’s expecting a pointer. This should never be called anyways, but it’s more correct.

  • You do not have to create a new Mesh on the heap each time GetRenderMesh is called. Create one static empty mesh as a class member and return it.

Great to know. I just changed them.

Thanks again

do NOT create a static mesh as a class member, such a mesh would be manipulated by each instance of your MYCLASS-objects

      SimpleObject has a data member "mesh", that's the one to use
      
  GetRenderMesh() should look like this:
Mesh* MYCLASS::GetRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete) {
   	// do something before rendering
  	     return SimpleObject::GetRenderMesh(t, inode, view, needDelete);
         }
1 Reply
 lo1
(@lo1)
Joined: 10 months ago

Posts: 0

I thought it’s inherited from GeomObject, not SimpleObject. And that the mesh should always be empty.

why not just return false from this ?

    [b]virtual int Object::IsRenderable [/b] [b]( [/b]  [b] )

[/b]no need to implement any render mesh then

1 Reply
(@angrybear)
Joined: 10 months ago

Posts: 0

This works great too

 lo1

Right. This is better.

It all depends on where you’re going with this… why shouldn’t it be a helper actually? Does it do anything at render time which affects the render?

he wants it on the “front” create page making it a helper means its towards the back. but yes it probably should be a helper

It is for a proxy loader. So yes the logo is really a helper, but the item will be geo.

Thanks for all your help again

Page 2 / 2