Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. kng_ito
    K

    kng_ito

    @kng_ito

    0
    Reputation
    27
    Posts
    33
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    kng_ito Follow

    Best posts made by kng_ito

    This user hasn't posted anything yet.

    Latest posts made by kng_ito

    RE: How to get weights from a Vertex Map tag on an uneditable object

    Hi @Manuel ,
    Sorry for asking a question that has already been resolved in another thread.
    That thread solved my question. Thank you.

    posted in Cinema 4D SDK •
    How to get weights from a Vertex Map tag on an uneditable object

    Hi,

    I tried to get the weight values from a Vertex Map tag in the documented way.
    It workd for editable polygon objects, but not for uneditable obejcts.

    The .c4d file:
    VertexMapWeightsFromUneditableObjects.c4d

    The code:

    import c4d
    
    def main():
        tag = op.GetFirstTag()
        weight = tag.GetAllHighlevelData()
        print(weight)
    
    if __name__ == '__main__':
        main()
    

    The result for uneditalble cube:

    Traceback (most recent call last):
      File "scriptmanager", line 9, in <module>
      File "scriptmanager", line 5, in main
    SystemError: <method 'GetAllHighlevelData' of 'c4d.VariableTag' objects> returned NULL without setting an error
    

    The result for editalble cube:

    [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0]
    

    Is there any way to get the weight values for uneditable objects? Thank you.

    posted in Cinema 4D SDK •
    RE: Condition that generator treats inner spline segment as a hole

    Hi @ferdinand,

    So the normal direction of the generated polygons was the point!
    Thank you for answering my curiosity and explaining how to reproduce the behavior.

    posted in General Talk •
    Condition that generator treats inner spline segment as a hole

    Hi,

    Out of curiosity, I would like to know under what conditions the inner segment of a spline behaves as a hole.
    If possible, I would like to reproduce this behavior in Python Generator.
    Any hints would be appreciated.

    Cinema 4D 2023-1-0 - [Untitled 1 _] - Main 2022-12-11 15-23-35.gif

    posted in General Talk •
    RE: Unpacking Animation Data Wrapped by the Motion System (NLA)

    Hi @ferdinand,

    Thank you for the detailed explanation and the code.
    It works perfectly and the problem is solved!

    posted in Cinema 4D SDK •
    RE: Unpacking Animation Data Wrapped by the Motion System (NLA)

    Hi @ferdinand,

    The scene file:
    GetKeyframesInMotionSystemLeyers.c4d

    The Motion System tag on the cube object has 2 Layers (Layer 0 and Layer 1).
    Layer 0 has 2 keyframes in Position . X track.
    Layer 1 has 3 keyframes in Position . Y track.

    After selecting the Cube object, run the following script.

    import c4d
    
    def main():
        # Print the name of track and the number of keyframes for each track
        tracks = op.GetCTracks()
        for track in tracks:
            curve = track.GetCurve()
            key_count = curve.GetKeyCount()
            print(track.GetName())
            print(key_count)
    
    if __name__ == '__main__':
        main()
    

    The result:

    Position . X
    1
    Position . Y
    1
    
    posted in Cinema 4D SDK •
    Unpacking Animation Data Wrapped by the Motion System (NLA)

    Hi,

    I tried to access to keyframes that are attached to layers of Motion System tag, but it seems not possible.
    Those methods used to get keyframe such as GetTracks() and GetKeyCount() only return values for Default Layer of the Motion System tag.
    Is there any way to get correct information of keyframes on Motion Manager layers? Thank you.

    posted in Cinema 4D SDK •
    RE: Get MODATA_SIZE of Mograph Particles to Build Stacks of Geometry

    Hi @ferdinand,

    I expected there to be a way to know which particle referred to which original geometry, but I didn't know how, so thanks. I should have looked more closely at the documentation. Moreover, I didn't think it could handle blended cloners.

    Anyway, thank you very much. Problem solved.

    posted in Cinema 4D SDK •
    RE: Get MODATA_SIZE of Mograph Particles to Build Stacks of Geometry

    Hi @ferdinand,

    Thank you for your quick answer. That makes sence.
    I am not sure I should continue in this thread or should open a new one, but I would like to ask about the way to access the actual size of clones.

    I am trying to create a system of stacking cubes whose scale animates, and I need to get the size of each clone to do so. Currently, the size of each clone is obtained by caching the cloner, but this causes processing delays and animation problems.

    The preview:
    https://drive.google.com/file/d/1G91Hx__2xZ_ZJhK3EJJEtF82sCc38Z9f/view?usp=sharing

    The scene file:
    StackingCubes_ProcessingDelayIssue.c4d

    The Python Effector code:

    import c4d
    
    def main():
        moData = c4d.modules.mograph.GeGetMoData(op)
        marr = moData.GetArray(c4d.MODATA_MATRIX)
    
        cloner = moData.GetGenerator()
        cached = cloner.GetCache()
        cubes = cached.GetChildren()
    
        pos_y = 0
        for i, cube in enumerate(cubes):
            height = cube.GetRad().y*2 * cube.GetMg().GetScale().y
            pos_y += height / 2
            marr[i].off = c4d.Vector(0, pos_y, 0)
            pos_y += height / 2
    
        moData.SetArray(c4d.MODATA_MATRIX, marr, False)
        return True
    

    Is there any way to get the size of clones without processing delay?
    Any advice or examples similar to this topic would be appreciated.
    Thank you.

    posted in Cinema 4D SDK •
    Get MODATA_SIZE of Mograph Particles to Build Stacks of Geometry

    Hi,

    I tried to get the sizes of clones with MoData.GetArray(c4d.MODATA_SIZE), but it returns None where the other IDs (e.g. c4d.MODATA_MATRIX) works fine.

    Is this an issue or am I doing something wrong? Any advice would be appreciated.

    2022-10-20 203713.png

    posted in Cinema 4D SDK •