Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. noseman
    3. Posts
    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups

    Posts made by noseman

    RE: "Cubic Bias" interpolation...

    Thanks Ferdinand!

    posted in Cinema 4D SDK •
    RE: "Cubic Bias" interpolation...

    @ferdinand

    ...This also applies to the interpolation modes you quoted, while they are technically close, they are not exactly what the gradient type is doing internally.

    haha, of course.
    Would it make sense to add this to the github examples at some point?

    Thank you @ferdinand

    posted in Cinema 4D SDK •
    "Cubic Bias" interpolation...

    I had a question on Twitter relating C4D Gradients.
    On the Github examples:
    https://github.com/PluginCafe/cinema4d_cpp_sdk_extended
    ... we have the old, R20 interpolations but is missing "Cubic Bias".

    case 0: return g1; break;
    case 1: return g1 + (g2 - g1) * per; break;
    case 2: return g1 + (g2 - g1) * Ln(per * 1.7182819 + 1.0); break;
    case 3: return g1 + (g2 - g1) * (1.0 - Ln((1.0 - per) * 1.7182819 + 1.0)); break;
    case 4: return g1 + (g2 - g1) * Smoothstep(0.0_f, 1.0_f, per); break;
    

    Does anyone know what it is?
    Thanks

    posted in Cinema 4D SDK •
    How to get a MoGraph Selection using a Python Effector...

    Thanks to the help of @m_adam I have the simplest code that allows you to get the MoGraph Selection data from a MoGraph Generator with a MoGraph Selection.
    In the attached project, I have a Matrix Object with a MoGraph Selection Tag and the Python effector that prints the selection data to the console.
    This implementation requires you drag the Selection Tag into the "Selection" link (Effector Tab->Selection).
    Because the method is based on the Tag Name, make sure the Selection Tag has a nice unique name to avoid any confusion.
    The code is fully Commented for your convenience (or inconvenience for that matter)...

    import c4d
    from c4d import gui
    
    from c4d.modules import mograph as mo
    
    
    def main():
        moData = mo.GeGetMoData(op) #Get MoGraph Data
    
        moSelTagName = op[c4d.ID_MG_BASEEFFECTOR_SELECTION] #Get the MoGraph Selection Tag Name from the Effector's "Selection" Link
    
        # Retrieve the first tag attached to the generator (the Matrix) matching the name
    
        moSelTag = None # initialize the "moSelTag" Variable
    
        for tag in gen.GetTags(): # Go through All tags on the MoGraph Generator...
            # "gen" is a Global Variable holding the MoGraph Generator (e.g. the cloner object which executes the Python Effector)
    
            if not tag.IsInstanceOf(c4d.Tmgselection): # if the tag is NOT a MoGraph Selection, try the next tag
                continue
    
            # if the previous is FALSE, then the Tag is a MoGraph Selection
            if tag.GetName() == moSelTagName: # Does the Tag found above have the same name as the Linked Selection Tag?
                moSelTag = tag # If the above is true, then set the Variable to that Tag and Break the Original Loop to continue down
                break
    
        if moSelTag: # If after all of the above we have a valid tag in the Variable, then do the following:
            sel = mo.GeGetMoDataSelection(moSelTag) #Get the Mograph Selection from the Tag
            selData = sel.GetAll(moData.GetCount()) #Get the Data from the Mograph Selection
            print(selData) # Print the Data
    
    
    # Execute main()
    if __name__=='__main__':
        main()
    

    Get Mograph Selection data 01A.c4d

    posted in Cinema 4D SDK •
    RE: How to make a Python Plugin...

    @mikeudin Have you managed to make the plugin converter work with the latest versions?
    One of the reasons I started this thread was that I couldn't... hopefully it was some error I made.
    If you have some information, please share.
    Cheers

    posted in Cinema 4D SDK •
    How to make a Python Plugin...

    I always wanted to be able to convert Scripts to Plugins but didn't know how. Thanks to some great people, here is the bare minimum code required to make a Cinema 4D Python Plugin.
    Save this as a .pyp file, and put it in a folder in the Plugins. It should appear in the Extensions menu.
    Mind you, this ONLY functions like a Script, click-run-done. No UI, no Attributes, nothing...

    There's a ton of other stuff you can read here:
    https://developers.maxon.net/docs/Cinema4DPythonSDK/html/misc/pluginstructure.html

    import c4d
    from c4d import gui
    
    class HelloWorldCommand(c4d.plugins.CommandData):
        def Execute(self, doc):
    
            #Put your executable Code here...
            c4d.gui.MessageDialog("Hello World!")
    
            return True
    
    if __name__ == "__main__":
        c4d.plugins.RegisterCommandPlugin(
            id=1059500, #Get Unique ID from https://plugincafe.maxon.net/c4dpluginid_cp
            str="HelloWorld",
            info=0,
            dat=HelloWorldCommand(),
            help="put some Help test here...",
            icon=c4d.bitmaps.InitResourceBitmap(5126)
            )
    
    posted in Cinema 4D SDK •
    RE: There is a bug and some issues in the inner extrude tool res/.h files (S22 and R21)

    Maxon has decided to move all Labs plugins to Cineversity, and the Labs website is no longer available.
    As far as the Py Parametric plugins, they are on hold until I create a tutorial for them, which I'm planning for this week.
    Would it be a stretch if I asked for the "Disconnect" tool to be added if possible?
    In any case, whenever you make a change, let me know and I'll make sure they get updated.
    Thanks

    EDIT: you can email me directly. noseman[at]noseman[dot]org

    posted in Cinema 4D SDK •
    RE: There is a bug and some issues in the inner extrude tool res/.h files (S22 and R21)

    Extrude inner Subd 0 is the most common way it's used in modeling.
    As far as the Subdivide, the animation would be a good reason to allow for 0 (no SubD)
    5b65d164-5d27-41fc-b7a8-0607a1689c83-image.png
    ef241d24-0382-41e1-b894-4ef651c03cd8-image.png

    posted in Cinema 4D SDK •
    RE: There is a bug and some issues in the inner extrude tool res/.h files (S22 and R21)

    Hi Manuel,
    I was about to make some new tutorials for Cineversity for the Py-Parametric tools and came across this. I can't set the minimum Subdivisions to 0.
    Has this been looked at?
    Thanks

    posted in Cinema 4D SDK •
    RE: Get Point Positions of Selected N-Gon or Polygon

    @x_nerve Thanks!

    posted in General Talk •
    RE: Get Point Positions of Selected N-Gon or Polygon

    Thank you everyone, and I'll make sure to tag my posts next time.

    posted in General Talk •
    Get Point Positions of Selected N-Gon or Polygon

    What's the simplest way to get all point positions of a selected Polygon (including N-Gons)?
    Cheers

    posted in General Talk •
    RE: iterating on multiple Tmgselection tags

    Replying to my own question. We need to define it using

    mo.GeGetMoDataSelection(Tag)
    

    Code that works.

    import c4d
    from c4d.modules import mograph as mo
    
    def main():
        Cloner =  op.GetObject()
        md = mo.GeGetMoData(Cloner)
        AllTags = Cloner.GetTags()
        
        for Tag in AllTags:
    
            if Tag.GetType() == c4d.Tmgselection:
                print Tag
                SelTag = mo.GeGetMoDataSelection(Tag) #This is the new line
                print SelTag.GetCount()
    
    posted in Cinema 4D SDK •
    iterating on multiple Tmgselection tags

    When I use this Script:

    MoSelectionTag =  mo.GeGetMoDataSelection(op)
    Count = MoSelectionTag.GetCount()
    

    I can get the moSelection Tag (Tmgselection) Count. So far so good.
    But if I have more than 1 moSelection Tags, I need to iterate all tags, find the Tmgselection and get the Count for each one.
    Why doesn't this code work? How do I iterate through the tags and get the count of each Tmgselection?
    This code is in a Python Tag.

    import c4d
    from c4d.modules import mograph as mo
    
    def main():
        Cloner =  op.GetObject()
        md = mo.GeGetMoData(Cloner)
        AllTags = Cloner.GetTags()
        
        for Tag in AllTags:
    
            if Tag.GetType() == c4d.Tmgselection:
                print Tag
                print Tag.GetCount()
    

    it throws an Error:
    'c4d.BaseTag' object has no attribute 'GetCount'

    Cheers

    posted in Cinema 4D SDK •
    RE: Selecting Different components but in Different modes

    Full disclosure, I just realized that in "Axis Modification" Tool, when in Polygon mode, if you hover over an edge and click, it places the Axis there...
    I guess most of what I was trying to do is already there...

    "The path to wisdom, is paved with errors..."
    [just made that up...] Noseman

    posted in Cinema 4D SDK •
    RE: Selecting Different components but in Different modes

    Thank you very much.
    The "swizzling" can be achieved with the Axis Center:
    177b4293-85c1-4e3d-8029-6265bec36b85-image.png
    using these settings.
    BUT the code you posted is very valuable for me to evolve my spaghetti coding... copy from here, and paste there 🙂

    Thanks Again!

    posted in Cinema 4D SDK •
    RE: Selecting Different components but in Different modes

    thank you so much for the detailed reply, and helping me save a lot of time by not doing it that way after all 🙂
    I am trying to come up with a "shortcut" method for something I'm doing a tutorial on.
    All the functionality is already possible inside C4D, but to set it up you need to do a bunch of things and set a bunch of settings.
    The "manual" way is:

    1. Use Axis Center to align and Center the Object Axis to the Selected Edge.
    2. Set the Modeling Axis to "Object"
    3. Change Component mode to Polygons
    4. Select your Polygons
    5. Use Quantizing to Move or Rotate the said Polygons.
      All this could be possible via a script, instead of doing Matrix math 🙂
      Thank you very much again for your input!
    posted in Cinema 4D SDK •
    Selecting Different components but in Different modes

    Here's a number of "loaded" questions, as I have a goal in mind:
    Is it possible to do the following things via a script, when we're in Polygon Component Mode:

    1. when the script is activated, although we are still in Polygon mode, can we see Edge selection highlights when the cursor is hovering over some edge
    2. by clicking on that edge, could we set the Modeling Axis to align to the Center of the edge, and the modeling Z Axis to align to that edge?
    3. After the Click (on the edge) can we exit the script and use that Axis as the modeling Axis?
      Would those be possible?
    posted in Cinema 4D SDK •
    RE: Using Python Node to Traverse Deep Hierarchy... fail

    Ah, you probably expect the toroids to also rotate around their own axis

    exactly. Thanks

    posted in Cinema 4D SDK •
    RE: Using Python Node to Traverse Deep Hierarchy... fail

    @m_adam said in Using Python Node to Traverse Deep Hierarchy... fail:

    The main issue is Python GvNode is not designed to work as an iteration node

    Thanks. That answers my question.

    posted in Cinema 4D SDK •