Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > PYTHON Development
  New Posts New Posts
  FAQ FAQ  Forum Search

ID_GV_DATA_TYPE_UNDEFINED

Author
Message
  Topic Search Topic Search
littledevil View Drop Down
Member
Member
Avatar

Joined: 2012 Feb 09
Online Status: Offline
Posts: 727
Direct Link To This Post Topic: ID_GV_DATA_TYPE_UNDEFINED
    Posted: 2013 Mar 14 at 6:31am
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.
There are holes in the sky. Where the rain gets in.
But they're ever so small. That's why the rain is thin.
Back to Top
littledevil View Drop Down
Member
Member
Avatar

Joined: 2012 Feb 09
Online Status: Offline
Posts: 727
Direct Link To This Post Posted: 2013 Mar 14 at 6:59am
just for the record, c4d.DTYPE_SUBCONTAINER was the first thing i tried, tp does accept it, but
reads it as ColorProfile.
There are holes in the sky. Where the rain gets in.
But they're ever so small. That's why the rain is thin.
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2575
Direct Link To This Post Posted: 2013 Mar 14 at 10:36am
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?
Back to Top
littledevil View Drop Down
Member
Member
Avatar

Joined: 2012 Feb 09
Online Status: Offline
Posts: 727
Direct Link To This Post Posted: 2013 Mar 14 at 10:58am
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.


Edited by littledevil - 2013 Mar 14 at 11:01am
There are holes in the sky. Where the rain gets in.
But they're ever so small. That's why the rain is thin.
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2575
Direct Link To This Post Posted: 2013 Mar 14 at 11:20am
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
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.