Does anyone have an example GU_PolyExtrude snippet of code, showing how to use the extrusion? I can't find anything apart from the HDK doc page in the forum, via Google, or on OdForce.
I'm a pretty poor programmer, but it's fun to learn and experiment
Thanks!
Example usage of GU_PolyExtrude code
2096 4 0- goldleaf
- Staff
- 4177 posts
- Joined: Sept. 2007
- Offline
- edward
- Member
- 7736 posts
- Joined: July 2005
- Offline
- goldleaf
- Staff
- 4177 posts
- Joined: Sept. 2007
- Offline
Ah, thanks for that nudge, Edward! I've got my code in an inlinecpp module, and it extrudes to no where, but it works!
When setting up a GU_PolyExtrudeXformCallback, I see *user_data is required, but I don't understand what that's supposed to be. Could you provide another bit of help for that?
Thank you!
When setting up a GU_PolyExtrudeXformCallback, I see *user_data is required, but I don't understand what that's supposed to be. Could you provide another bit of help for that?
Thank you!
I'm o.d.d.
- edward
- Member
- 7736 posts
- Joined: July 2005
- Offline
- goldleaf
- Staff
- 4177 posts
- Joined: Sept. 2007
- Offline
Ah, I see! I've got it working now, very basic, but it's a good start! Thank you!
Here's the little snippet of code that worked for me, in case anyone else could use it. I have it wrapped inside of an inlinecpp module:
The hip file has everything inside, you just need to make sure you can compile HDK code, and you should see what's in the attached image.
Thanks edward!
Here's the little snippet of code that worked for me, in case anyone else could use it. I have it wrapped inside of an inlinecpp module:
import inlinecpp, hou test = inlinecpp.createLibrary("test", includes="""#include <GU/GU_Detail.h> #include <UT/UT_Matrix4.h> #include <GU/GU_PolyExtrude.h> """, function_sources=[ """void extrudeFaces(GU_Detail *gdp, UT_DMatrix4 *xform) { GU_PolyExtrudeParms parms; UT_Matrix4 mat(*xform); parms.setLocalXform(mat, NULL); gdp->polyExtrude(parms); }""",])
The hip file has everything inside, you just need to make sure you can compile HDK code, and you should see what's in the attached image.
Thanks edward!
Edited by goldleaf - June 9, 2017 15:06:45
I'm o.d.d.
-
- Quick Links