I’m using the Python mode in Processing, but I’m guessing this might be an issue in other processing modes as well:
I’ve imported some SVGs exported from Illustrator (as well as other hand coded SVGs) and I’m having problems changing the strokeWeight on the characters. Here is my test code:
Here is my simple SVG that Processing opens and displays without problem. I have been using several other SVGs for testing as well to make sure the file itself is not introducing a complication.
Hi pxlmnkeee!
Try using the disableStyle() method to be able to change the settings for the shape. That should fix your issue. I’ve included it in your code as follows:
If you place your file “svgTest.svg” inside your sketch’s folder or its subfolder “data/”, PApplet::loadShape() method will find it w/o any those os shenanigan boilerplate!
YES! That was the nugget I was looking for. I had seen it mentioned in another unrelated post, but didn’t think style would apply since I wasn’t setting a style explicitly in the SVG itself.
Thanks GoToLoop! I’m going to have hundreds of SVG files so I’ve built a folder structure in the data folder to keep things organized. I just left the os boilerplate code in there. I’m trying to get in the good habit of using os subroutines to work with file paths, and I’ve had problems accessing things directly in the data folder in Processing’s Python mode.
I’m sort of using a similar approach with os module. I have noticed that any time you make a change in the Processing IDE for Python mode, your sketch path switches to a temp folder. When you save after a code change, then your sketch path goes back to the one that has data folder. It’s usually an issue for my workflow, as I don’t like saving after every code change. Your existing code manages to skip the hassle of saving by setting a universal path for your data, which is great.