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 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?
Thank you
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!
Hey guys,
I want to set the value of a keyframe for the "Start" parameter of the sketch material under the "Animate" tab with "Draw Speed" set to "Pixels". (Sketch[c4d.OUTLINEMAT_ANIMATE_START])
Unfortunately unlike any other parameter I have seen so far, this one takes a BaseTime object as input. Because of this I cannot proceed as usual with the CKey.SetValue() method.
How would I go about this?
It worked!
I need help with the sketch material If I want to create and apply a regular material to, say, a cube I am fine using the code below:
mat = c4d.BaseMaterial(c4d.Mmaterial) # material tag = c4d.BaseTag(c4d.Ttexture) # tag tag.SetMaterial(mat) # assign material to tag obj = c4d.BaseObject(c4d.Ocube) # create cube doc.InsertObject(obj) # insert cube doc.InsertMaterial(mat) # insert material obj.InsertTag(tag) # apply tag to material
Now if I want to do the same thing with the sketch material with the analogous code:
c4d.Msketch = 1011014 # add missing descriptor for sketch material c4d.Tsketch = 1011012 # add missing descriptor for sketch tag mat = c4d.BaseMaterial(c4d.Msketch) # material tag = c4d.BaseTag(c4d.Tsketch) # tag tag.SetMaterial(mat) # assign material to tag obj = c4d.BaseObject(c4d.Ocube) # create cube doc.InsertObject(obj) # insert cube doc.InsertMaterial(mat) # insert material obj.InsertTag(tag) # apply tag to material
I get the error message:
AttributeError: 'c4d.BaseTag' object has no attribute 'SetMaterial'
I obtained the missing descriptors from the script log, but the sketch tag and material seem to behave differently than regular materials in this regard.
Help would be greatly appreciated!