how to XOR

  • On 19/04/2014 at 07:09, xxxxxxxx wrote:

    I can XOR a vector

    pxvec = pxvec ^ vecmask

    how do I XOR a single axis

    pxvec.x = pxvec.x  ????  vecmask.x


  • On 19/04/2014 at 09:42, xxxxxxxx wrote:

    pxvec.x = pcvec.x * vecmask.x

    Vector XOR just multiplies componentwise.


  • On 22/04/2014 at 04:35, xxxxxxxx wrote:


    I couldn't make sense of the SDK syntax '__rxor__(self,other)'

    or the example

    I thought % was a modulo operator?

    Vector.\__rxor\_\_(self, other)[](file:///Users/paultaylor/Documents/Media/3D/Programming/Python/

    Multiplies two vectors together componentwise and set the left hand vector to the result:

    import c4d
    v_result = c4d.Vector(1,2,3)%c4d.Vector(2,3,4)
    #v_result => Vector(2,6,12)
    _<_t_<__<_t_>_<_<_t_>_lgroup>Param : The other argument.
    Return type: [Vector](file:///Users/paultaylor/Documents/Media/3D/Programming/Python/


  • On 22/04/2014 at 09:09, xxxxxxxx wrote:

    Well, that's a typo in the docs. The modulo operator performs the cross product.
    Thanks for the notice.


  • On 23/04/2014 at 11:43, xxxxxxxx wrote:

    So how do you form this with the example above pls?

    can't figure the syntax


    xvec.x = pcvec.x__rxor__(vecmask.x)


  • On 24/04/2014 at 03:15, xxxxxxxx wrote:

    I don't get what you are trying to do. Vector.__rxor__() is only called in some special cases, see

    If you want to multiply two vectors componentwise, use the ^ operator. The * operator on Vectors
    performs the dot-product. If you want to multiply one component of a vector with another, use
    the * operator. You can't multiply a  vector component componentwise as there is only one component
    which is the value itself.


Log in to reply