Navigation

    • Register
    • Login
    • Search
    1. Home
    2. baca
    B

    baca

    @baca

    1
    Reputation
    48
    Posts
    76
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

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

    Best posts made by baca

    RE: Blend matrices

    If anyone interested:

    def MatrixBlend(mxA, mxB, t):
        quatA = c4d.Quaternion()
        quatA.SetMatrix(mxA)
    
        quatB = c4d.Quaternion()
        quatB.SetMatrix(mxB)
    
        return utils.MatrixMove( utils.MixVec(mxA.off, mxB.off, t) ) * utils.QSlerp(quatA, quatB, t).GetMatrix() * utils.MatrixScale( utils.MixVec(mxA.GetScale(), mxB.GetScale(), t) )
    
    posted in Cinema 4D SDK •

    Latest posts made by baca

    Object Generator as Particles

    Hi,

    I'd like to create Python Generator with point cloud. And make it possible to render it as particles using "RS Object" -> "Particles".
    Similar to Emitter and Matrix object.

    "Particles" tab of "RS Object" is optional, and not appears everythere.
    Are there any options to make it possible?

    posted in Cinema 4D SDK •
    RE: PointObject.CalcVertexMap(self, modifier)

    @abetred

    PointObject.CalcVertexMap(self, modifier)
    is applied to PointObject like Polygon or Spline, and as a parameter it takes Modifier Object with "Restriction" tag applied to it.

    So basically when you develop OBJECT_MODIFIER plugin, and "Restriction" tag is applied to your plugin - you would be able to support these restrictions.

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

    @kng_ito said in How to get weights from a Vertex Map tag on an uneditable object:

    First tag might be invisible tag.
    So you need to specify tag, and check if it's exist, like so:

    def main():
        tag = op.GetTag(c4d.Tvertexmap)
        if tag:
            weight = tag.GetAllHighlevelData()
            print(weight)
    

    But most probably generator's weight tag contents would be irrelevant to what you expect to see.

    posted in Cinema 4D SDK •
    RE: Cinema 4D R2023 - c4d.plugins.RegisterObjectPlugin issue

    @m_adam said in Cinema 4D R2023 - c4d.plugins.RegisterObjectPlugin issue:

    As explained in the post I linked the limitation is about Python and for each plugin type you have a limitation of 50 (call to RegisterXXXPlugin), wherever they are installed.
    So you can have 50 ObjectData and 50 TagData. But you can't have 51 ObjectData (the number of C++ plugins does not count).
    And there is no workaround.

    The limitation is there since R11.

    Thanks Maxime,

    Any suggestion how to properly handle that kind of issues --
    just catch exception and warn user using message box somehow?

    Would it be reasonable to switch to NodeData from ObjectData --
    does RegisterNodePlugin has separate 50 plugins registrations?

    What's the logic behind plugin initialization order -- alphabetical, date-based, random?

    posted in Cinema 4D SDK •
    RE: Cinema 4D R2023 - c4d.plugins.RegisterObjectPlugin issue

    Hi @m_adam, thanks I seen this thread.

    So issue is relates to the total python plugins amount installed in user's plugins folder?
    My customer argues that in R26 there're even more plugins are installed, but it works fine...

    posted in Cinema 4D SDK •
    Cinema 4D R2023 - c4d.plugins.RegisterObjectPlugin issue

    Windows users reports that C4D R2023.1 my python plugins are throw issues into console:
    OSError:cannot handle more than 50 object plugins from c4d.plugins.RegisterObjectPlugin(...) line.

    C4D R26 has no such issue with same plugin.

    posted in Cinema 4D SDK •
    RE: How to read Field driven VertexMapTag's

    @khor Hi,

    From my python experience Primitives has no points/polys so vertex tags has no data count, so and GetDataAddressR() is None

    The bad thing is that vertex tag is not evaluating but just cloned onto it's cache (with the Fields property!).
    So if Vertex Tag has Use Deformed Points is on, then all values would be zero at the time of execution Deformers for ex.

    Considering that you need to retrieve tag of same type + same name from the cached object (in wide mean, so prefer to retrieve deform cache over just cache), and crossfinger everyone use unique tag names per object.

    I believe that's why all new features uses string input fields rather than link field.
    But that's actually great.

    posted in Cinema 4D SDK •
    RE: Normal Move command has no effect in R2023

    @m_adam thanks!

    posted in Cinema 4D SDK •
    Normal Move command has no effect in R2023

    Hi everyone,

    R2023 has issue with normal modeling commands, like Normal Move.
    R26, R25 and previous still working fine.

    For ex. this Python Generator has no effect over polygon objects:

    from typing import Optional
    import c4d
    
    doc: c4d.documents.BaseDocument # The document evaluating this python generator
    op: c4d.BaseObject # The python generator
    hh: Optional["PyCapsule"] # A HierarchyHelp object, only defined when main is executed
    
    def main() -> c4d.BaseObject:
        childOp = op.GetDown()
        cloneOp = (childOp.GetDeformCache() or childOp.GetCache() or childOp).GetClone()
    
        if cloneOp.CheckType(c4d.Opolygon):
            cloneOp.GetPolygonS().SelectAll(cloneOp.GetPolygonCount())
    
            bc = c4d.BaseContainer()
            bc.SetData(c4d.MDATA_NORMALMOVE_VALUE, 100.0)
            c4d.utils.SendModelingCommand(
                command=c4d.ID_MODELING_NORMALMOVE_TOOL,
                list=[cloneOp],
                mode=c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,
                bc=bc,
                doc=doc,
            )
    
        childOp.Touch()
        return cloneOp
    
    posted in Cinema 4D SDK •
    RE: Touch input objects withot resetting its cache

    @ferdinand said in Touch input objects withot resetting its cache:

    NBIT_EHIDE

    Sorry Ferdinand,
    I might be not a great explainer... But that not I actually need.
    This bit only hides object in Editor, in Render it's still visible.

    So Touch() is the only way to truly hide the object.
    My only issue is that I'm trying to hide all nested objects with Touch().
    And when I'm doing it I'm also touching the grandchildren, and this cause their parent to be rebuilt.
    I'm looking for a way to skip objects which already touched by their parent generator.

    To be clear, here's the use case:
    +--Null whole tree has to be hidden
    | +--Loft has BIT_CONTROLOBJECT, has OBJECT_INPUT — not hidden yet, has to be hidden
    | | +--Circle has BIT_CONTROLOBJECT — already hidden by parent Loft, has to be skipped
    | +--Loft has BIT_CONTROLOBJECT, has OBJECT_INPUT — not hidden yet, has to be hidden
    | | +--Cube has BIT_CONTROLOBJECT — not hidden by parent Loft, has to be hidden
    +--...
    +--MY_GENERATOR has object link pointing to Null, it wants to hide this Null

    If I'll try to Touch() Circle spline, then it's parent Loft would be continuously regenerating, so MY_GENERATOR would be also continuously regenerating, because source dirtiness is changed.

    If I'll try to skip Touch() children of objects with OBJECT_INPUT set, then Cube under Loft would be visible - because it wasn't touched by its parent Loft as Cube is not a spline object.

    So either I go into regeneration loop, either I'm not hiding objects.
    But I want both performance and hide.

    posted in Cinema 4D SDK •