Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
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()
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) )
@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
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
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
@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
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
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)
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
@x_nerve Thanks!
Thank you everyone, and I'll make sure to tag my posts next time.