CheckType get wrong



  • On 28/02/2017 at 14:49, xxxxxxxx wrote:

    Don't know if it's a bug or not (that take me a while to figured this but)
    Here is a log from the console..

      
    Arnoldcylinderlight.CheckType(5102)
    True
    Arnoldcylinderlight
    <c4d.BaseObject object called 'Arnold cylinder_light/Arnold Light' with ID 1030424 at 0x000001179A329C10>
    

    Why CheckType return True?
    Using GetType working fine

    if Arnoldcylinderlight.GetType() != 5102:
    

    while not CheckType don't.

    if not Arnoldcylinderlight.CheckType(5102) :
    


  • On 01/03/2017 at 02:27, xxxxxxxx wrote:

    Hi,

    This is not a bug. The documentation states that C4DAtom.CheckType() checks if the atom is an instance of a base type. And it should be true that an Arnold Light is an instance of c4d.Olight base type ( 5102 ).
    Note C4DAtom.IsInstanceOf() does exactly the same as C4DAtom.CheckType() but its name is better.



  • On 01/03/2017 at 02:35, xxxxxxxx wrote:

    Thanks you for the informations for acheving that I was sure we must use C4DAtom.GetClassification()
    Then for me the only solution is by doing if Arnoldcylinderlight.GetType() != 5102:

    It's jsut curiosity since I get everything working ^^.


Log in to reply