NodeData return depending on rendering or not



  • On 18/01/2013 at 15:50, xxxxxxxx wrote:

    meh,

    subject text length is to short for a propper description. i want a NodeData instance -
    more specifically a ObjectData instance to behave differently when GetVirtualObjects
    is being called for the editor view and when it is called for editor or external rendering. 
    think of some sort of special LOD, like it is being implemented for the c4d Hair object.

    i know how to determine if an editor or external (pictureviewer) rendering has been
    started (c4d.CheckIsRunning), but i do not think, that this is the correct approach,
    because all data have been already collected at that point.
    so how do i determine if there is going to be a rendering and how do i return the
    correct data ? i know that c4d creates a copy of the docment for external rendring.
    most important would be for me to provide correct external rendering, correct editor
    rendering could be viewed as shomewhat optional.

    as a sidenote. i actually do not want to create more data on rendering, but less,
    or in other words - filter the current data, which is quite time consuming.



  • On 18/01/2013 at 16:12, xxxxxxxx wrote:

    Hi Ferdinand,

    you could try to catch the  MSG_MULTI_RENDERNOTIFICATION  message. I'm not sure when
    exactly it is catched sent, but it may be what you search for.

    Best,
    Niklas



  • On 18/01/2013 at 16:36, xxxxxxxx wrote:

    hi nikklas,

    worked like a charm, i do not know how i could overlook thiat id, i have checked the msg ids 😊
    just for the record, you will have to set your object as 'dirty' in order to get his work.

    def Message(self, node, mid, data) :
        if mid == c4d.MSG_MULTI_RENDERNOTIFICATION:
            self.IsFiltered = True
            node.SetDirty(c4d.DIRTY_DATA)
        return True
      
     def GetVirtualObjects(self, op, hierarchyhelp) :
    if self.IsFiltered:
    		self.IsFiltered = False
    	return Something
    else:
    	return SomehingElse
    


  • On 19/01/2013 at 08:01, xxxxxxxx wrote:

    Doesn't MSG_MULTI_RENDERNOTIFICATION get sent for both the editor & the external renderer?
    I'd like to know how to tell which renderer is about to execute in Python too.
    But I don't understand how the code you posted can tell which specific rendering action will occur?

    In C++ we use the RenderNotificationData struct to determine if the editor, or external renderer is about to execute. But I don't see anything like that in the Python sdk. And I don't see how your example tells which specific type of render is going to occur.

    -ScottA



  • On 19/01/2013 at 08:10, xxxxxxxx wrote:

    i think you misunderstood me, i do not want to distinguish between viewport and external
    rendering. i just want to alter my ObjectData output if there is an upcoming render.

    for rendering full precision , for openGl not.

    however, you cann still use CheckIsRunning if you want to determine if or how long there is
    a viewport/external rendering going on. but that is only after the rendering has been started.



  • On 19/01/2013 at 08:32, xxxxxxxx wrote:

    So there's no way to determine which renderer is about to occur with Python?

    -ScottA



  • On 19/01/2013 at 11:18, xxxxxxxx wrote:

    I don't know for sure, but it might be possible if you check whether the
    nodes document is in Cinemas opened-documents list (editor render) or not
    (external or picture view render). Note that this is just a wild guess and I haven't checked this.

    Best, Niklas


Log in to reply