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).
Hello,
I think I found a bug with the SplineMask and Sketch and Toon material. When I apply the material to it, turning its render visibility off doesn't do anything.
To replicate:
With regular splines, MoSplines etc. it works as expected.
Am I missing something? If so, help would be appreciated, if not I hope it gets fixed soon.
Thanks
Thank you for the elaborate reply, it worked! (And helped me to better understand the desc id system)
I want to create an xpresso which accesses the offset parameter of a spline field layer in a plain effector. This proves to be more difficult than I thought because, unlike e.g. a linear field, the spline field layer is not a regular object in the hierarchy.
Naively I thought this would work with the general pattern of adding a port to the xpresso node using the description id:
offset_port = gv_node.AddPort(c4d.GV_PORT_INPUT, DESC_ID_OF_PARAMETER )
But I don't know what the description id should be in this case. Or if that is even the right way to go in this situation.
Dragging the parameter into the console returns:
Plain[c4d.FIELDS,11,1011]
Help is appreciated
Oh yes that's a much better approach!
I will provide executables from now on, sorry for the trouble
To be honest I was just stuck in an inaccurate frame for how to solve this... thanks for breaking it
Hey there,
I am making use of the trick where I put a correction deformer under a generator (extrude object in this case) to make it readable by the bounding box xpresso node
However, for some strange reason it only works when I add the deformer manually to the scene. Using python to create the object somehow makes it impotent for this method. Even dragging it out of the hierarchy and back in again, refreshing xpresso etc. doesn't help with the problem.
Only creating a new deformer manually seems to do the trick.
Please help me make sense of this and fix it.
Thank you
Works like a charm, thank you!
in this thread it is explained how to set the size of the IRR.
I would also like to set parameters like the resolution.
When dragging the GUI element into the console it says:
Sniper[c4d.IRR_DETAIL]
and when I execute it without the ID I get
>>> Sniper <c4d.BaseList2D object called Sniper/Sniper with ID 430000000 at 4756143680>
How can I get access to this inside a script?
Thank you!
works like a charm, thank you!
now with the updated Vector Import object in S26 I thought there might be a more elegant way to import an SVG directly to a spline. But after playing around with it for a bit I am struggling to extract the spline from the setup using python only.
Here is my code:
vector_import = c4d.BaseObject(1057899) self.document.InsertObject(vector_import) # set file path file_path = os.path.join(SVG_PATH, self.file_name + ".svg") vector_import[c4d.ART_FILE] = file_path # extract spline from hierarchy vector_import[c4d.ART_SHOW_HIERARCHY] = True c4d.CallButton(vector_import, c4d.ART_RELOAD) c4d.EventAdd() spline = vector_import.GetDown().GetDown().GetDownLast()
The problem seems to be that even after calling the reload button and c4d.EventAdd() which makes the hierarchy containing the spline visible in the GUI, C4D does not recognise that the vector_import object now has children.
Help would be appreciated!
I found a code sample here which does the job
Sorry for the late reply, my issue went away after reinstalling C4D so I forgot about it
Thank you for your feedback
I want to link an already existing linear field to an effector. For that I need to provide/update a c4d.FieldList object. But in the SDK I don't understand how to insert objects into the list.
help would be greatly appreciated
Cheers, David
I am trying to set up pip on my new machine but keep running into this error:
Davids-MBP-2 Maxon Cinema 4D R26 % c4dpy -m get-pip.py sysctl: No such file or directory
My specs:
Thank you so much!
I was really delighted to hear that svg import is now supported natively in S25. But the only method I am aware of so far is via drag and drop.
I would like to import an svg file using only its path as input in a python script. Is there a way to do that?
Hi,
I am currently playing around with the Python thickness modifier in the Sketch and Toon material. In that context there are a lot of predefined variables like "StrokeLength", "wPnt" and "sNormalisedP".
My goal is to use these variables to generate 3D Splines that match the strokes on screen. In order to achieve this I have to find a way to access especially the three variables stated above OUTSIDE of the thickness modifier context i.e. in a normal python script.
Does anybody have an idea on how to approach this?
Thanks for the reply
@m_magalhaes said in get length of stroke:
I'm not sure to understand, you have one material for each stroke length?
You are right, I didn't consider that I can only set one speed per material which in my case corresponds to one object. In this case I want to obtain the length of the longest stroke in order to have the drawing process be finished on frame x. Besides that everything stays the same.
I found out that it is possible to use python as a modifier for thickness, color and opacity of the strokes. In this context "StrokeLength" is accessible as a predefined variable. So with that as a starting point the question becomes how to make this variable accessible outside of the modifier context so I can use it in a regular python script.
Grateful for any suggestions.
Cheers
I am trying to write a script for the sketch material that makes the "pixel" mode in Draw Speed in the Animate tab work similar to the "completion" mode. What I mean by that is that I want to be able just like in the completion mode to keyframe the beginning and end of the drawing process. But the pixel mode only lets me set the start frame and the speed in pixels.
So the goal is to have the script calculate the speed required to make the drawing end at frame x. The reason for doing this is that if I have objects with multiple different strokes of different lengths, the drawing speed varies significantly which doesn't make for a nice aesthetic in the end.
I know there has to be some place in C4D where the length of each stroke is stored in order for the completion mode to work. So the only question is if and how I could access this value in my python script.
Thank you.
I am trying to install numpy in my c4d python version on MacOS. So far I could find out that drag and drop does not work since the package is written in C. I understood that I have to build/compile the package from source for the python version of c4d.
After trying my luck with this guide and wrestling with various error messages I see that this is just too advanced for my understanding.
So if anybody could either help me out with the build or even better provide a binary that works with C4D R23, python 3.7.7 on MacOS that would be a true life saver!
P.S.: I am aware of Niklas Rosensteins Tutorial for Windows but this doesn't help me much with MacOS
I actually found the solution while posting the question but wanted to still post it in order to help others who might have the same problem. (If this is against community guidelines I apologise)
The solution is to use the CKey.SetGeData() method. Done!