Advertisement
nux95

Untitled

Jan 7th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1.  
  2.     /**
  3.      * This function returns the PLAData of a Cinema 4D object. Returned
  4.      * pointer is owned by the passed geData object and is freed with its
  5.      * destruction.
  6.      *
  7.      * @param  op      The object to get the PLAData from.
  8.      * @param  geData  This GeData object must stay alive as long as the
  9.      *                 returned PLAData object is in use.
  10.      * @return   A pointer to the PLAData of the object or nullptr if it
  11.      * could not be obtained (eg. there is not PLA animation track)
  12.      */
  13.     _melange_::PLAData* GetPLAData(_melange_::BaseObject* op, _melange_::GeData& geData);
  14.  
  15.  
  16.     PLAData* GetPLAData(BaseObject* op, GeData& geData) {
  17.         CTrack* track = op->FindCTrack(DescID(CTpla));
  18.         if (!track)
  19.             return nullptr;
  20.  
  21.         if (!track->GetParameter(CK_PLA_DATA, geData))
  22.             return nullptr;
  23.  
  24.         // TODO: Why is geData.GetType() == 0?
  25.         return static_cast<PLAData*>(geData.GetCustomDataType(CUSTOMDATATYPE_PLA));
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement