MESH_CHECK (dmodeling.h)



  • On 06/09/2016 at 11:16, xxxxxxxx wrote:

    Hello MAXON-Development-Team,

    I have a question where I couldn't find an answer myself, not in the SDK docus (neither the one for Python nor in the C++ SDK) and also not with "Google" searches or anywhere else:

    How can we access and use the MESH_CHECK_...-functions with Python?
    Though I found all of the related enumerations in "dmodeling.h" but I couldn't figure out how to use them.
    Unlike the snap and quantize functions that are also listed in "dmodeling.h" and that can be accessed through "c4d.modules.snap".

    Any help here is highly appreciated!

    Kind regards,
    Tom

    PS: I couldn't even find any solution for C++.



  • On 06/09/2016 at 22:14, xxxxxxxx wrote:

    may be

    import c4d
    from c4d.modules import snap
      
    def main() :
        # Read all Snap Settings
        bc = snap.GetSnapSettings(doc)
    #  print all settings
    #  for key, val in bc:
    #     print key,"=",val
        # Modify MESH_CHECK_ENABLED
        bc.SetBool(c4d.MESH_CHECK_ENABLED,True)
        # Write all Snap Settings
        snap.SetSnapSettings(doc, bc)
        c4d.EventAdd()    
      
    if __name__=='__main__':
        main()
    


  • On 07/09/2016 at 06:27, xxxxxxxx wrote:

    Hi,

    anion's solution is correct.
    I just want to add that this works only with R17 SP3 and upward, as there was fix for SetSnapSettings() needed.



  • On 07/09/2016 at 08:06, xxxxxxxx wrote:

    Okay thank you both so far but I fear that I maybe expressed myself a bit ambiguous.

    In fact I'm looking for the functions so that I can use them to select eg. manifold edges from inside a python script or plugin.

    With what i found out myself (and the things you told me) I'm just able to activate/deactivate the options in the GUI so that the mesh checking results are visible in the editor, to change the colors and to get the number of affected elements.

    But I couldn't find out how to actually get the concerning selections.
    I even wasn't able to trigger the select buttons from the gui to make them select the relevant elements. I mean by code just to be absolutely clear. Of course I can push them manually in the GUI and they'll do what they are supposed to do. 😉

    I hope the functions itself that are used there will be integrated in the SDKs soon like for the snapping there are e.g. c4d.modules.snap.GetSnapSettings(), c4d.modules.snap.SetSnapSettings(), c4d.modules.snap.SetQuantizeStep() and so on.

    By the way in my opinion it's also a bit strange that the mesh checking is a part of the snap module at all. I don't really see how these two things are related.

    I hope it's a bit clearer now and sorry that I obviously was too vague in the first place.



  • On 07/09/2016 at 21:33, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    (https://plugincafe.maxon.net/topic/9647/12970_callbutton--in-mesh-checking-menu&PID=51326#51326)]
    Unfortunately it is currently not possible to access these buttons via CallButton(). Sorry.



  • On 08/09/2016 at 00:32, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Originally posted by xxxxxxxx

    (https://plugincafe.maxon.net/topic/9647/12970_callbutton--in-mesh-checking-menu&PID=51326#51326)]
    Unfortunately it is currently not possible to access these buttons via CallButton(). Sorry.

    I don't insist in using CallButton(). 😄

    And this info was pre R17 R3 and Andreas also said they changed/fixed something meanwhile.

    Originally posted by xxxxxxxx

    I just want to add that this works only with R17 SP3 and upward, as there was fix for SetSnapSettings() needed.

    Of course this doesn't have to be related to this problem too but it could be.

    And if it's not I'd say it's time for another fix! 😉

    Kind regards,
    Tom



  • On 08/09/2016 at 03:17, xxxxxxxx wrote:

    Hi,

    @anion: Thanks for doing my job, really appreciated :) I knew I should have posted the link to the original threads, but somehow I didn't...
    Future readers see also here on enabling Mesh Check and on CallButton() and Mesh Check.

    @Phoenix: Unfortunately anion is right. The fix in R17 SP3 really only addressed a problem with SetSnapSettings(). The problem with not being able to use CallButton() for Mesh Check is not really a bug, but rather a missing feature. I know, in the end it makes no difference for you. Actually it is even a bit worse, as you wouldn't have means to access the selections, either. But at least we are aware of this gap and it is being looked into it.


Log in to reply