Python In C4D – Type Name and ID List

  **This tutorial was done by python guru Matt Pearson. Check out his website for more Python goodness**

Something I do often when writing Python, for any piece of software, is to make sure that the objects that are being worked on are of the correct type. That way I can steer clear of stupid errors right away and not have to track them down later on down the lines of the script.Thankfully C4D has two methods that solve that. First, the op.GetTypeName() which returns a string with a simple name for each object’s type. The last method is op.GetType(), which returns an integer representing each object’s type ID number.

    I have never found a nice list of all the Type Names and IDs so I have compiled a list of most, if not all, of them here for you. The list that follows contains each objects Type Name and Type ID just as C4D spit them back out at me.

 

Other tutorials

  • DirFunction
  • PythonLove

    Thanks, thats very helpful. Especially with some exotic objects. But sometimes there is a constant available, e.g. c4d.Ocube, c4d.Osphere.

  • DL Flamholc

    fantastic! thank you!