Lastly, also at SIGGRAPH I spoke to Dalai Felinto and Hans Goudey, and I've taken up the task of adding to the Python API the ability to set the individual control points of hair curves.
That is what Thomas is missing to convert the diffeomorphic hair tools to the new hair system, because it can't be accessed via python, so far. So thank you if you take this, let us know of your progress.
Lastly, also at SIGGRAPH I spoke to Dalai Felinto and Hans Goudey, and I've taken up the task of adding to the Python API the ability to set the individual control points of hair curves.
That is what Thomas is missing to convert the diffeomorphic hair tools to the new hair system, because it can't be accessed via python, so far. So thank you if you take this, let us know of your progress.
That's exactly what stopped me too. Interestingly, the Python API to modify existing curves and points is there already, just not to create new curves and points. I think I've found the class that creates hair curves and am working on exposing it to the Python API. Blender is interesting. DAZ Studio is hard to develop for because there's no documentation. Blender is hard to develop for because while there is documentation and a strong community, it is very large and complex and still has a lot of C code that feels very old. I'm on it, but it will take a little time.
This all sound amazing. It would really be great to be able to load and transfer Daz content to Blender without touching Daz Studio.
Have to thank all people that help to use Daz content in Blender like Thomas and TheMysteryIsThePoint! Thanks again also to Padone to support with his tips.
Yes, I really can't thank either Thomas or Padone enough... this DAZ/Blender sub-community is really a shining spot in what is otherwise darkness for me.
Lastly, also at SIGGRAPH I spoke to Dalai Felinto and Hans Goudey, and I've taken up the task of adding to the Python API the ability to set the individual control points of hair curves.
That is what Thomas is missing to convert the diffeomorphic hair tools to the new hair system, because it can't be accessed via python, so far. So thank you if you take this, let us know of your progress.
Blender is pure genius. Before you understand the way the build system automatically generates the Python API for you, it is incredibly frustrating. After you understand, it is pure genius.
So, I think I'm about half done... I've added the API call to add a strand with the requested number of points:
PYTHON INTERACTIVE CONSOLE 3.10.12 (main, Jun 21 2023, 01:30:38) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)]
Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, gpu, blf, mathutils
Convenience Imports: from mathutils import *; from math import *
Convenience Variables: C = bpy.context, D = bpy.data
Update: I got stuck on how to make a Python API that accepts a two dimensional array, so Hans Goudey put me out of my misery by just doing it himself :) It's already in his personal fork of Blender, if you build Blener from source:
This call will add 3 curves to the hair curves object, with 42, 30, and 49 points respectively. He correctly reasoned that the call doesn't have to arrange any points because the API to do that part already exists. The added curves have all of their points at (0,0,0) and these points can then be manipulated with the existing Python API. I'm currently re-writing my hair exporter so I have called the new API and it seems to work, but I haven't actually manipulated any of the new points.
I don't know what the timeframe is for this to make it into the main tree and a release.
Thank you Donald for the news, it's good to hear that the task is proceeding fine. There's no rush so I guess we'll wait for the official version to come out.
p.s. I'm not sure it's a good idea to place all the points at zero. I mean the curve has to be interpolated some way and placing all to zero sounds like bad. May be a bunch of lines from zero to infinity and beyond is better LOL. But of course I trust Hans already considered this so I'm probably worrying for nothing.
Great job Donald. Looking forward to it, because I switched from Win7 to Win11 with a new hardware and will be able to use the newest Blender versions. I still need some time to set up everything as needed.
Hans was a real bro and merged the code into main on the September 23rd, which beat the Bcon3 deadline of the 27th, so it should be in Blender 4.0 which drops on November 7th.
I've already used it extensively and it works perfectly. Hans, and Dalai (who put me into contact with Hans) are both champs.
I definitely agree. We really need some tutorials for the changed interface and features of Blender 4.0. Nevertheless, these are fantastic news and I'm looking forward to use it. A big thanks for your efforts!
Comments
That sounds great.
That is what Thomas is missing to convert the diffeomorphic hair tools to the new hair system, because it can't be accessed via python, so far. So thank you if you take this, let us know of your progress.
That's exactly what stopped me too. Interestingly, the Python API to modify existing curves and points is there already, just not to create new curves and points. I think I've found the class that creates hair curves and am working on exposing it to the Python API. Blender is interesting. DAZ Studio is hard to develop for because there's no documentation. Blender is hard to develop for because while there is documentation and a strong community, it is very large and complex and still has a lot of C code that feels very old. I'm on it, but it will take a little time.
double post deleted
This all sound amazing. It would really be great to be able to load and transfer Daz content to Blender without touching Daz Studio.
Have to thank all people that help to use Daz content in Blender like Thomas and TheMysteryIsThePoint! Thanks again also to Padone to support with his tips.
Yes, I really can't thank either Thomas or Padone enough... this DAZ/Blender sub-community is really a shining spot in what is otherwise darkness for me.
Blender is pure genius. Before you understand the way the build system automatically generates the Python API for you, it is incredibly frustrating. After you understand, it is pure genius.
So, I think I'm about half done... I've added the API call to add a strand with the requested number of points:
PYTHON INTERACTIVE CONSOLE 3.10.12 (main, Jun 21 2023, 01:30:38) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)]
Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, gpu, blf, mathutils
Convenience Imports: from mathutils import *; from math import *
Convenience Variables: C = bpy.context, D = bpy.data
>>> curves = D.objects["Curves"]
>>> curves.data.add_curve( 40 )
>>>
and I've found the relevant curve manipulation code in source/blender/blenkernel/intern/curves.cc to do the actual resizing.
Actually getting the code approved and pushed aside, I think I'll have it working soon.
That's wonderful news Donald, thank you for your work and for keeping us up to date with the progress.
Update: I got stuck on how to make a Python API that accepts a two dimensional array, so Hans Goudey put me out of my misery by just doing it himself :) It's already in his personal fork of Blender, if you build Blener from source:
https://projects.blender.org/HooglyBoogly/blender
And the branch name is curves-rna-api
Hans' call is simpler than what I envisioned:
curves.data.add_curves( [ 42, 30, 49 ] )
This call will add 3 curves to the hair curves object, with 42, 30, and 49 points respectively. He correctly reasoned that the call doesn't have to arrange any points because the API to do that part already exists. The added curves have all of their points at (0,0,0) and these points can then be manipulated with the existing Python API. I'm currently re-writing my hair exporter so I have called the new API and it seems to work, but I haven't actually manipulated any of the new points.
I don't know what the timeframe is for this to make it into the main tree and a release.
Thank you Donald for the news, it's good to hear that the task is proceeding fine. There's no rush so I guess we'll wait for the official version to come out.
p.s. I'm not sure it's a good idea to place all the points at zero. I mean the curve has to be interpolated some way and placing all to zero sounds like bad. May be a bunch of lines from zero to infinity and beyond is better LOL. But of course I trust Hans already considered this so I'm probably worrying for nothing.
Hans was a real bro and merged the code into main on the September 23rd, which beat the Bcon3 deadline of the 27th, so it should be in Blender 4.0 which drops on November 7th.
I've already used it extensively and it works perfectly. Hans, and Dalai (who put me into contact with Hans) are both champs.
Open Source For The Win.
Thank you for the news, just tried and seems to work, though I fear 4.0 will be a mess to work with due to the many api changes. Reported to Thomas.
https://bitbucket.org/Diffeomorphic/import_daz/issues/1764/
Oh my, 6 more days to wait :D
I definitely agree. We really need some tutorials for the changed interface and features of Blender 4.0. Nevertheless, these are fantastic news and I'm looking forward to use it. A big thanks for your efforts!