Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. mastergog
    M
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    mastergog

    @mastergog

    0
    Reputation
    36
    Posts
    19
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    mastergog Follow

    Posts made by mastergog

    • RE: LineObject custom segment colors

      @ferdinand

      Hey I recently noticed that when I get over 2 million points and 1 million segments the viewport freezes. The UI is still responsive so I can reduce the lines in my object and it starts drawing in the viewport again.

      So I'm wondering if this is expected for this amount of points and segments? I haven't found anything that is obviously wrong in my implementation yet.

      Regards,
      Georgi.

      posted in Cinema 4D Development
      M
      mastergog
    • RE: LineObject custom segment colors

      @ferdinand thank you for the suggestions, totally forgot to write back.

      Grouping the LineObject objects by a few shades worked out pretty well.

      Regards,
      Georgi.

      posted in Cinema 4D Development
      M
      mastergog
    • RE: LineObject custom segment colors

      Hey @PluginStudent, yeah that's an alternative but I want to avoid overriding Draw() unless there's no other way.

      posted in Cinema 4D Development
      M
      mastergog
    • LineObject custom segment colors

      Hi guys,
      Using C++, R23. I've got an ObjectData plugin that represents a volume in the viewport.
      One of the representations is a velocity field, which is just a bunch of lines with colors.
      I'm inserting a LineObject in GetVirtualObjects() to do the job, and it is being generated and working as expected, but I'm not sure how to pass my custom colors.
      Is there something like the VertexColorTag for a PolygonObject or an alternative routine?

      Regards,
      Georgi.

      posted in Cinema 4D Development
      M
      mastergog
    • RE: Difficulty with cloners and and lifetime of objects

      All right, thank you for all the help.

      I'll close this now.

      posted in Cinema 4D Development
      M
      mastergog
    • RE: Difficulty with cloners and and lifetime of objects

      @zipit yes ok seems I got this now, after completely disregarding the fact that object is part of the Cloner's cache.

      So for my original problem of creating just X amount of materials for X amount of clones, that won't be doable. I'll just have to create as many as new objects are created and then just clean them all up at some point.

      For the clean up mechanism, I have this dummy object which links to my original object and its material. The original object also links to the dummy object. The dummy objects are inserted in the a scene hook and at some point I iterate them and check if they link to nullptr object to determine whether the original object is still part of the document and whether to release the associated materials.

      Do you think there's easier way to achieve this?

      posted in Cinema 4D Development
      M
      mastergog
    • RE: Difficulty with cloners and and lifetime of objects

      @zipit said in Difficulty with cloners and and lifetime of objects:

      # This is the cache of the node, it will also contain an MAXON_CREATOR_ID,
      # but it will NOT always be the same, since caches can change in "shape 
      # and form", so there is no way to maintain this continuity.
      # I assume this is what you are trying to do, or at least a good part of
      # it. This cannot be done, because you are basically asking here the 
      # caches to be static.
      if cache is not None:
          print ("cache uuid:", uuid_1.hex())
      

      you are right, assuming you mean with cloned objects generators with caches

      Ooooh maybe I misunderstood your point slightly.
      My 9 objects in the cloner would always be different because they are part of the cache of the Cloner object.
      If they stand on their own it is a different story, and the UUIds are persistent.

      Hope i'm getting it right now ?

      posted in Cinema 4D Development
      M
      mastergog
    • RE: Difficulty with cloners and and lifetime of objects

      Hey @zipit happy holidays and thank you for the reply, I understand how this id works now.

      However this ID seems to not be persistent for cloned objects. If I put my object in a cloner in instance mode grid array 3,1, 3 dimensions GetVirtualObjects(BaseObject* object...) would get called 9 times with 9 different objects. There are 9 different UUIDs and this is ok.

      But then every subsequent call to GetVirtualObjects(BaseObject* object...), after I change some setting or simply move the object, there will be a different set of 9 UUIDs, so I can't really rely on them anymore. So with the cloner this reallocation boundary changes the UUIDs.

      Is there a way around it?

      EDIT: If I go in edit mode and change the settings of each instance in the cloner separately then the UUIDs seem to be persistent, but that's just in edit mode.

      posted in Cinema 4D Development
      M
      mastergog
    • RE: Difficulty with cloners and and lifetime of objects

      @zipit yes thank you for the script. What I need seems to be exactly the Node uuid.

      But I'm struggling with the C++ equivalent. I have this signature: Bool FindUniqueID(Int32 appid, const Char*& mem, Int& bytes ) const and I use it like so :

              const Char* value = nullptr;
      	Int size = sizeof(Int32);
      	if (object->FindUniqueID(MAXON_CREATOR_ID, value, size)) {
      		/// do stuff with value
      	}
      

      I was expecting *(Int32*)value to be my unique ID but it is always the same. for all objects in the scene.
      This is not the case your Python script, each node has its own ID, so I guess I'm using this wrong ?

      Regards,
      Georgi.

      posted in Cinema 4D Development
      M
      mastergog
    • RE: Difficulty with cloners and and lifetime of objects

      Hey thanks for the reply.

      1. Yes I am aware. My workflow is with ExecuteOnMainThread() to be safe, just didn't include it in the details.

      The crux of my question is exactly as you guessed. How to get unique ID's for each object so I can build a hashmap. These ID's should be consistent between reallocations of the node during the lifetime of its GUI representation. And they should be unique even for objects that are cloned.
      The context is that I have volume caches which I load into ram using a separate DLL and I want to synchronize those with the objects in the scene. To load and free them just once, when it is most appropriate.

      This Add/FindUniqueID is something I had missed so far and I'm looking at the previous threads as you advised. In some of the threads you refer to FindUniqueID returning a hash, but in C++ it seems I have to create the ID myself and add it to the object with AddUniqueID(Int32 appid, const Char* const mem, Int bytes) which include some extra parameters.
      How would I go about letting Cinema create the hash?

      Regards,
      Georgi.

      posted in Cinema 4D Development
      M
      mastergog