Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Generator object not drawn if origin outside of view

    Cinema 4D SDK
    r20 c++ macos
    3
    4
    491
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • fwilleke80F
      fwilleke80
      last edited by fwilleke80

      Hi,

      I just started a little plugin project for fun. It's a generator object, pretty simple stuff with only the OBJECT_GENERATOR flag, returning a geometry in GetVirtualObjects().

      I noticed something that's new to me: When the object's origin is not visible in the viewport, the whole object is not drawn anymore. The object's geometry should be well visible, but as soon as the object origin leaves the visible frame, the whole geometry vanishes.

      Any ideas what might be the reason? I thought, maybe it's a way to optimise the viewport performance, and maybe implementing GetDimension would fix it, because the object then has a reasonable bounding box. But that didn't help.

      I'm on R20, as R21 does not run on my private computer.

      Cheers,
      Frank

      www.frankwilleke.de
      Only asking personal code questions here.

      1 Reply Last reply Reply Quote 0
      • P
        PluginStudent
        last edited by

        I assume that with "geometry" you mean a PolygonObject?

        I observed this behavior when not setting up the PolygonObject correctly. E.g. not doing an update after its internal data was changed (points and polygons).

        polyObject->Message(MSG_UPDATE);
        
        1 Reply Last reply Reply Quote 1
        • r_giganteR
          r_gigante
          last edited by r_gigante

          Hi @fwilleke80, thanks for reaching out us.

          Kudos to @PluginStudent for the hint because that's likely to be the cause that prevent object to be displayed when the origin is not visible. You can experiment it by commenting out this line in the Plane-by-Polygons example.

          Please check the code and eventually report if that's not the case.

          Final notes: please Frank use the Q&A functionality to mark a thread as question and don't forget to mark the correct answer or set the thread to solved if no further effort is needed from us.

          Best, R

          1 Reply Last reply Reply Quote 0
          • fwilleke80F
            fwilleke80
            last edited by

            Oh man, it really was the missing message. Never thought it would have such weird consequences to forget that. Thanks guys!

            www.frankwilleke.de
            Only asking personal code questions here.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post