Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    BaseContainer <> operator conflict?

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 266 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 19/05/2009 at 04:30, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Need to check.
      In a coffee expression plugin tag or a regular COFFEE tag I have a Userdata.
      Thing is, if I try to set it to a value (like current frame as in the
      included code) it doesn't update the Userdata if "inside" a BaseContainer
      call and the basecontainer is a constant variable.
      I can print the Userdata from "within" the bc and it's correct,
      but not actually set the correct value of the Userdata.
      Setting the Userdata before or after the bc is ok.

      Should this be considered normal? To me it looks inconsistent
      (Since it prints)
      Cheers
      Lennart

      > \> const var MYMEMORY_ID = 1000001; \> \> main(doc,op) \> { \> var frame = doc->GetTime()->GetFrame(doc->GetFps()); \> var pos = op->GetMg()->GetV0(); \> \> ////// before container \> var bc = op->GetContainer(); \> \> op#ID_USERDATA:1 = frame; // not work "inside" bc \> println(op#ID_USERDATA:1); // works "inside" bc \> \> var memopos = bc->GetData(MYMEMORY_ID); \> if(!memopos) memopos = pos; \> bc->SetData(MYMEMORY_ID,pos); \> op->SetContainer(bc); \> ///// after container \> } \>

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 25/05/2009 at 08:33, xxxxxxxx wrote:

        The problem with your code is that you directly access the user data with the # operator but at the end of your code you overwrite the container again. Since the user data are stored in the container as well you overwrite the user data. I recommend to only use the # operator or to put the var bc = op- >GetContainer(); line after you have accessed the user data.

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • First post
          Last post