Render to Picture Viewer with fields problem.



  • Hello! I'm developing a deformer plugin which is using fields. The problem is that i don't see any result in renderer. In viewport everything is ok. When i click on "Render View" everything renders exactly how it should, but when i try rendering my scene with "Render to Picture Viewer" it renders every object but without fields influence.
    It is probably something with my code. Does anyone know how to properly use fields in developing deformer/modifyer plugin? Should I add some function at the end of ModifyObject() which will apply fields while rendering.



  • Hi @Danchyg1337, I would say the problem can come from anywhere, but especially ModifyObject and or Execute or GetDDescription.

    Since you are referring to animation, what is animated, the original mesh you are deforming? The deformer matrix/parameter? The fields?
    How did you embed the Field in your modifier?

    Ther is a lot of place for interpretation, but without code we can't really help you.
    If you are worried to share code publicly you can send us an email at sdk_support@maxon.net

    Cheers,
    Maxime.



  • Hello my friend,

    I am not an expert in python/plugins but before we get into details, I would like to say that is well known that what you see in picture viewer and in render view (viewport render) is different ESPECIALLY when there are dynamics, deformers etc.
    I suppose you have a kind of animation , so i suggest to low down your render settings (and your output size) and render some frames (lets say a sequence of 5,10,20 or 30 frames). See the result and then you will see if there is a problem with the fields...

    I hope you find the solution.

    Cheers



  • Hi,

    your question is not really answerable in this state, you should provide:

    1. The language
    2. The environment
    3. The code or a code sample.

    A NodeData plugin behaving differently in a render than in the viewport is often tied to the plugin erroneously relying in some way on the active document. Since nodes are not only being executed for the active document, for example while rendering - which happens in a cloned document, this will lead to unintentional behavior.

    Cheers,
    zipit



  • @Danchyg1337 said in Render to Picture Viewer with fields problem.:

    The problem is that i don't see any result in renderer. In viewport everything is ok.

    Without knowing anything about your plugin: "stuff works in viewport but not in renderer" sounds like you are using GetActiveDocument() in a NodeData plugin.

    And you should not.



  • @zipit @PluginStudent Sorry guys, that was late night for me when i was creating this topic and i forgot to set tags.
    Language is C++ and plugin is
    ObjectData with OBJECT_MODIFIER | OBJECT_CALL_ADDEXECUTION.
    I'm not sure which part of code i should provide because i don't know where problem can be.
    Plugin works fine, everything compiles. I can animate fields with my plugin but these animations aren't going to renderer.
    Show in renderer checkbox set ON.

    These are plugins' virtual functions.

    virtual Bool Init(GeListNode* node);
    virtual Bool ModifyObject(BaseObject* mod, BaseDocument* doc, BaseObject* op, const Matrix& op_mg, const Matrix& mod_mg, Float lod, Int32 flags, BaseThread* thread);
    virtual Bool GetDDescription(GeListNode *node, Description *description, DESCFLAGS_DESC &flags);
    virtual void CheckDirty(BaseObject* op, BaseDocument* doc);
    virtual Bool AddToExecution(BaseObject *op, PriorityList *list);
    virtual EXECUTIONRESULT Execute(BaseObject *op, BaseDocument *doc, BaseThread *bt, Int32 priority, EXECUTIONFLAGS flags);
    


  • Hi @Danchyg1337, I would say the problem can come from anywhere, but especially ModifyObject and or Execute or GetDDescription.

    Since you are referring to animation, what is animated, the original mesh you are deforming? The deformer matrix/parameter? The fields?
    How did you embed the Field in your modifier?

    Ther is a lot of place for interpretation, but without code we can't really help you.
    If you are worried to share code publicly you can send us an email at sdk_support@maxon.net

    Cheers,
    Maxime.



  • @m_adam Thank you for reply. I would probably send my code to your email to try to figure it out better.
    What i see so far is that in renderer, fields returns 0 for each point they sample.
    I have a function which samples fields and accepting a result to each vertex. For example imagine extrude with fields. In viewport i see extruded points, but in renderer everything is flat, like there is no field or it is so far to make any extrusion and returns 0. for each point. Second is more likely due to my tests.