Jump to content

Sign in to follow this  
impylse

Convert "Rotate Vector" node into Python

Recommended Posts

Hey guys!

How would this "Rotate Vector" node be converted from COFFEE to Python?

main()
{
	InMatrix->SetRotHPB(Rotation);
	var ov = InMatrix->GetMulV(InVector);
	OutVector=ov;
}

 

Share this post


Link to post

This is already converted in later versions, but here is the code

 

import c4d

def main():
    global OutVector
    newMatrix = c4d.utils.HPBToMatrix(Rotation)
    newMatrix.off = InMatrix.off
    OutVector = newMatrix.MulV(InVector)

 

Share this post


Link to post
  • Topic Author
  • 1 hour ago, Hrvoje said:

    This is already converted in later versions, but here is the code

     

    
    import c4d
    
    def main():
        global OutVector
        newMatrix = c4d.utils.HPBToMatrix(Rotation)
        newMatrix.off = InMatrix.off
        OutVector = newMatrix.MulV(InVector)

     

    Oh sorry, i didnt realize they had it converted. I heard that C4D dropped COFFEE support after R19 so i figured its better to convert my rig to python so when i open it later in R20 it would work.

    Thank you so much!

    Share this post


    Link to post

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    Sign in to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×
    ×
    • Create New...