Yep, that's the issue I mentioned in my first post, first sentence.
Thanks for confirming that it is indeed a bug!
Yep, that's the issue I mentioned in my first post, first sentence.
Thanks for confirming that it is indeed a bug!
Hi,
I just installed 2024 and I can't get the "send to IDE" button to work anymore. It just does nothing.
VS Code connects and I can actually write stuff in VS Code and use "Execute in C4d", but I can't send from C4D.
Also, when starting VS Code I get this error: "Incorrect path for c4d.path, autocompletion will not work" even though I did update the path to "C:\Program Files\Maxon Cinema 4D 2024" . Autocompletion actually works even though it says it will not.
2023 still works fine.
Any ideas how to fix it?
Thank you very much!
For now I think I just commented out the part that does the "current state to object" on the hierarchy. That's the part that causes the issue I think.
I only need the first child, and it would be nice if I could get it to work similar to how the Spline Mask object works which operates on the splines even if they are under a null, but I need to understand more before being able to do that.
Somewhat related, although not a SDK question, but if you don't mind, do you know why "current state to object" and "make editable" produce different results on splines? I'm not sure, but I think this started happening some versions ago, I seem to remember it was not the case.
As far as I understand, there's no equivalent to "make editable" in scripting, right?
I'm guessing there's no shortcut way to update the object whenever any change occurs in the hierarchy, right?
@ferdinand said in Problem with plugin example:
Hello @filipst,
Thank you for reaching out to us. The example you quoted documents itself as:
Retrieves the first child object and offset all its points on the y-axis by a specific value. Tangents are unaffected.
This plugin is not intended to look anything beyond the dirtyness of the first child.
# Checks if childSpline can be interpreted as a Spline. if not childSpline.GetInfo() & c4d.OBJECT_ISSPLINE and not childSpline.IsInstanceOf(c4d.Ospline) and not childSpline.IsInstanceOf(c4d.Oline): return None # Checks if the dirty of the child changed opDirty |= op.IsDirty(c4d.DIRTYFLAGS_DATA | c4d.DIRTYFLAGS_MATRIX) childDirty = child.GetDirty(c4d.DIRTYFLAGS_DATA | c4d.DIRTYFLAGS_MATRIX | c4d.DIRTYFLAGS_CACHE)
To also evaluate other children for their data or other dirty states, you would have to add addtional checks here. There should also be one extra step you have to take for
DIRTYFLAGS_MATRIX
, i.e., the case that you want to react not only to data container changes of the input objects but also transform changes.GetVirtualObjects
andGetContour
will not be called for pure matrix changes on scene objects out of the box. You would have to overwrite ObjectData.CheckDirty to manually flag yourself as dirty when such event occurs so that the cache building is being invoked.Cheers,
Ferdinand
Thank you, I thought modifications to the child of an object were included in the detection for that object.
I'll see if I can figure it out.
Would the suggestions you gave also fix the fact that removing a child of the first child (or adding another child) doesn't update the object either or does that need to be checked a different way?
Hi,
I think I found an issue with this:
https://github.com/PluginCafe/cinema4d_py_sdk_extended/blob/master/plugins/py-osffset_y_spline_r16/py-osffset_y_spline_r16.pyp
If the spline (or splines) are under a null and that null is the child of the offset spline object, the offsetting works as expected... all splines get moved. But if I try to change the position of the splines, for example, or anything about the objects under the null, it's not working. It just gets "stuck" in whatever state they were when they were put under the offset object. The only way to update is to take the null with the children from under the offset object and then putting it back it.
Any suggestions on how to fix this? I'm guessing it must be something related to "dirty" detection, but that code is really complicated, I can't quite figure it out so far.
Thank you.
Hi,
How can I encrypt a python plugin to .pypv and .pype? I think .pype was the extension for older versions?
I searched, but weirdly I didn't find anything. I thought it would be in the SDK documentation, but couldn't find it there either. Sorry if I missed it.
Thank you.
Thank you, it works!
Another question if you don't mind. What's the best/recommended way to limit one of these values based on other values?
For example, like how the corner radius on the Rectangle spline that comes with C4D is limited by the width or height of the rectangle?
Where in the plugin would the code for this go?
Hi,
I'm trying to learn how to write a Python plugin that generates a spline, using the examples you have on Github.
I'm basing it mostly on the "py-double_circle_r19" example.
One of the things I'm having issues with is with the custom controls.
I can add them, for example like this in the .res file:
REAL PYROUNDRECT_HEIGHT { UNIT METER; MIN 0.0; }
REAL PYROUNDRECT_WIDTH { UNIT METER; MIN 0.0; }
but they only have a text box, no slider. How do I add sliders to them?
Thank you.