Hi All,
I am trying to find a way to import curves into Maya.
Specifically:
I want to convert a raster image into vector curves and then import those curves in maya as nurbs curves.
Anything that is even simpler would be amazing.
Thanks
Hi All,
I am trying to find a way to import curves into Maya.
Specifically:
I want to convert a raster image into vector curves and then import those curves in maya as nurbs curves.
Anything that is even simpler would be amazing.
Thanks
My personal findings so far is using this python lib to covert raster to svg
but maya imports svg as meshes, not curves.
From what I can tell, importing illustrator (.ai) files is the only way to import curves. Please inform me if I am wrong.
update: looks like there is a way to create curves from imported svg. Will post more as I gather info.
This is a dead end as it only generates liner curves. I need to be able to generate a single curve that represents a complex shape.
I ended up converting png to vector data directly in maya and then using the data to generate the nurbs curve. Ended up using numpy and Pillow and potrace libraries. Ended up being a much simpler solution.
I was looking at doing a similar thing a while back, but started to look at the possibility of writing a simple SVG parser in python to reconstruct basic cubic NURBS curves in Maya. I didn’t get very far before I moved onto something else, but I’m keen to know if there’s anything more you can detail about the specifics of your solution, in case I need to revist this process myself at some point?
For example, how did you convert bitmap png into vector data directly in Maya? was that vector data then just a simple set of values you could pass directly into the curve creation (using cmds.curve
or the API)?
I ended up using the potrace python library. Then I just took the output data directly and used it to set the curve points. Worked out well.