ID_GV_DATA_TYPE_UNDEFINED



  • On 14/03/2013 at 06:31, xxxxxxxx wrote:

    hey,

    could someone please explain how ID_GV_DATA_TYPE_UNDEFINED is meant to be used ?
    i have created a data channel of undefinied type. but when i try to read this channel 
    the console returns TypeError: Unknown type of data channel: .

    i need to attach a basecontainer to a tp particle. the brute force solution would be to 
    attach a null object to each particle and store the data in this null object, but i would 
    prefer to use basecontainers.

    thanks for your help.



  • On 14/03/2013 at 06:59, xxxxxxxx wrote:

    just for the record, c4d.DTYPE_SUBCONTAINER was the first thing i tried, tp does accept it, but
    reads it as ColorProfile.



  • On 14/03/2013 at 10:36, xxxxxxxx wrote:

    Hi Ferdinand,

    I'm sorry, I don't get the context. Where are you using c4d.ID_GV_DATA_TYPE_UNDEFINED and
    c4d.DTYPE_SUBCONTAINER? Could you show an example?



  • On 14/03/2013 at 10:58, xxxxxxxx wrote:

    sure:

    def createDataChannel(self) :
          qlvl = False
          ...
          if not qlvl:
                # c4d.DTYPE_SUBCONTAINER doesn't work as a dtype, tp reads it as the ColorProfile datatype.
                qpos = tp.AddDataChannel(c4d.ID_GV_DATA_TYPE_UNDEFINED , "qlvl")
      
    def getStepData(self, pid, split) :
          # both lines raise a runtime error as described
          data  = tp.GetPData(pid, cid)
          tp.SetPData (pid, cid, bc)
    

    i think ID_GV_DATA_TYPE_UNDEFINED is meant to be used with customdatatypes. but i 
    cannot believe, that it is impossible to insert a basecontainer into the data 
    channel of a particle.



  • On 14/03/2013 at 11:20, xxxxxxxx wrote:

    Hi Ferdinand,

    I doubt this is possible. There is not BaseContainer datatype for channels, nor can we access
    C++ specific custom datatypes (we can not perform any casts in Python and also can not create
    wrapper classes, etc.)

    A possible workaround would be to use a dictionary associating particle-IDs with BaseContainers
    and removing items at an appropriate time if the particle does not exist anymore.

    Best,
    -Niklas


Log in to reply