How to resize a rectangular spline to fit text using Python?
-
Hello everyone, what code or function can help me achieve this task? As the text changed, the rectangular spline changed its size according to the bounding box.
-
Hi @SmetK ,
Please check out our Support Procedures, namely the "Asking Questions" category. Without a proper context there're too many unknowns to meaningfully proceed with the answer. Is it a parametric spline or an arbitrary one? Are you considering bounding box in a local or in a global space? Please share your scene setup as well as the code snippet that fails to achieve your goal.
From the first glance it looks like you're interested in GetRad() function for retrieving the bounding box size and the c4d.PRIM_RECTANGLE_WIDTH parameter to set in your spline object, for example in the following way:
newWidth: float = 100 op[c4d.PRIM_RECTANGLE_WIDTH] = newWidth c4d.EventAdd()
Cheers,
Ilia -
@i_mazlov Hi, thanks for the reply! My situation is like in the screenshot. I have a parametric spline and text that the spline should fit to. I guess I'm interested in local coordinates, although global ones would be useful. There is no code. I just saw how they do it through xpresso, but it looks complicated.
-
@i_mazlov I tried the GetRad() method. This is exactly what I need, thanks!