UserData Insert New Data



  • Hey Everyone,

    I hope this finds everyone well. I'm trying my best to learn about the interaction of UserData on objects with a very basic understanding of python(if that haha), I was reading this thread and playing around with it: https://plugincafe.maxon.net/topic/11467/access-custom-user-data-by-name-not-by-id
    and I'm now trying to figure out what functions to call to update the UserData without having to delete the UserData, edit the value then execute the script again. My guess is to use the SetUserDataContainer.
    I attached what my best guess is right now, gonna keep messing and researching the forums.
    Thanks for your time!

    Cheers!

    MattG

    Pythontesting.c4d
    Screenshot 1.PNG



  • Hi @geese780 when you say "update the User Data) you mean to define a value or changing its kind or some internal parameters like the parameter name?

    If you only want to define a value then you can define it as any parameters in Cinema 4D see Python Console Parameter.
    Otherwise, you are correct and should redefine the UserData Container and depending on what's you are trying to do, you may need to remove/re-add the user data.

    Cheers,
    Maxime.



  • Hey My Friend!

    Thank you for the response. So, thinking I understood this, I'm able to change the value within the console, but am still getting an error on the line with that syntax inside the script, I'm sure I'm missing something, I'm gonna re-trace my steps here. What I'm trying to do overall goes back to my first post about the OSC thing, so my thinking is figure out how change the value in a UserData Field on a specified piece of mesh, and then assign a variable to listen to the OSC integer, once I cross that bridge haha, but this is where I believe I shoudl start....I think...haha. Here's a screenshot showing my findings.

    Thanks again for your time Maxime!

    Cheers!

    MattG

    Screenshot 1.PNG



  • Hey Guys!

    I think I figured it out! Will resoond if there's any questions!

    Cheers!

    MattG