Jump to content


  • Posts

  • Joined

  • Last visited

Personal Information

  • Name
    Nicholas Yue

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

nicholas_yue's Achievements


Newbie (1/14)



  1. I would like to add a parameter which I will can fill in with information from geometry files I load ? What kind of PARM should I design it with that will allow me to dynamically add items and also register some call back so that I know what options the user have chosen ?
  2. I would like my file chooser in my C++ SOP plugin to only show up certain file extensions. What is the recommended way ?
  3. Hi, I have been able to create NURBS surfaces in the HDK via GU_PrimNURBSurf* nurb_surface = GU_PrimNURBSurf::build(&gdp,num_rows,num_columns); I would like to add trim curves to trim the surface Is there any example code which illustrate associating trim curves with a NURBS surface in HDK ? Cheers
  4. I have an alembic file which has curves which I generated (programmatically). The default constructor is to create cubic curves. However, when render it in Mantra, it looks segmented and not smooth. Is there some special curves setting in Mantra ? Here is the Alembic file curves.abc
  5. Hi, With the following code, I can write out a single bezier curve but anything more than one, the second bezier curves are not in the bgeo file being written out. The point count indicates that it is aware of additional points associated with the second curve. #include <string> #include <GU/GU_Detail.h> #include <GU/GU_PrimRBezCurve.h> #include <UT/UT_Version.h> #include <GEO/GEO_Point.h> #include <OpenEXR/ImathVec.h> #include <vector> typedef std::vector<Imath::V3d> V3dContainer; void create_single_bezier_curve(const std::string& bgeo_filename) { GU_Detail gdp; V3dContainer cvs; cvs.push_back(Imath::V3d(0,0,0)); cvs.push_back(Imath::V3d(1,1,0)); cvs.push_back(Imath::V3d(2,1,0)); cvs.push_back(Imath::V3d(3,0,0)); GA_Size num_points = cvs.size(); for ( size_t i = 0; i < num_points; ++i ) { GA_Offset pt = gdp.appendPointOffset(); gdp.setPos3(pt, cvs[i][0], cvs[i][1], cvs[i][2]); } GU_PrimRBezCurve* bezier_curve = GU_PrimRBezCurve::build(&gdp,num_points); if (bezier_curve) { for ( size_t i = 0; i < num_points; ++i ) { bezier_curve->setVertexPoint(i,gdp.pointOffset(i)); } gdp.save(bgeo_filename.c_str(), NULL); } } void create_multilpe_bezier_curves(const std::string& bgeo_filename) { GU_Detail gdp; V3dContainer cvs; // Curve 0 cvs.push_back(Imath::V3d(0,0,0)); cvs.push_back(Imath::V3d(1,1,0)); cvs.push_back(Imath::V3d(2,1,0)); cvs.push_back(Imath::V3d(3,0,0)); // Curve 1 double y_offset = 2.0; cvs.push_back(Imath::V3d(0,0 + y_offset,0)); cvs.push_back(Imath::V3d(1,1 + y_offset,0)); cvs.push_back(Imath::V3d(2,1 + y_offset,0)); cvs.push_back(Imath::V3d(3,0 + y_offset,0)); cvs.push_back(Imath::V3d(4,0 + y_offset,0)); // Store all the points GA_Size num_points = cvs.size(); for ( size_t i = 0; i < num_points; ++i ) { GA_Offset pt = gdp.appendPointOffset(); gdp.setPos3(pt, cvs[i][0], cvs[i][1], cvs[i][2]); } // Setup curve 0 GA_Size num_points_curve_0 = 4; GU_PrimRBezCurve* bezier_curve_0 = GU_PrimRBezCurve::build(&gdp,num_points_curve_0); if (bezier_curve_0) { for ( size_t i = 0; i < num_points_curve_0; ++i ) { bezier_curve_0->setVertexPoint(i,gdp.pointOffset(i)); } } // Setup curve 1 GA_Size num_points_curve_1 = 5; GA_Offset curve_offset_1 = 4; // because the first 4 points is for curve 0 GU_PrimRBezCurve* bezier_curve_1 = GU_PrimRBezCurve::build(&gdp,num_points_curve_1); if (bezier_curve_1) { for ( size_t i = 0; i < num_points_curve_1; ++i ) { bezier_curve_1->setVertexPoint(i,gdp.pointOffset(i+curve_offset_1)); // bezier_curve_1->setVertexPoint(i,curve_offset_1); } } gdp.save(bgeo_filename.c_str(), NULL); } int main(int argc, char *argv[]) { create_single_bezier_curve("single_bezier_curve.bgeo"); create_multilpe_bezier_curves("multiple_bezier_curves.bgeo"); return 0; }
  6. I think some of the question can be answer with the following screenshot. Material Style sheet are shop/mantra parameter on a per node basis. Now I have to go find out how to programmatically create shop_materialstylesheet for a given node. Maybe something like this
  7. Hi, I am programmatically generating Houdini scene (HIP) files After creating and connecting nodes, I'd like to perform a layout and home so that when the user open up the scene, it is not one ball of nodes in the center. Is there a way to do that in Hython calls, what about C++ ? Cheers
  8. Am I correct to understand that Material Stylesheets operate at a global level and the association with the OBJ nodes are defined within the json text ? i.e. in a HIP file, there can be only one Material Style Sheet? How does one retrieve a given Material Stylesheets (so that I can call asJSON() to study the format) ? If there are multiple stylesheets, how does one assign them to Nodes ? Cheers
  9. Hi, I am looking for way to create Material Stylesheet programmatically using Python. However, most of the search hit on stylesheet talks about UI stylesheet. Is there specific code example which illustrate how one could create and manipulate them ? Cheers
  10. Hi, I am experimenting using Material Stylesheet in assigning shaders to prim group in packed primitive. I am using the Moana Island dataset as my experimental input and hence their prim group names (which contains number) I noticed that if I use wild card to match the names and skip the numbers, the material assignment is successful whereas if the value contains numbers, the match does not succeed and hence the assignment is not perform. Is this a known limitation or a bug ? I am very new to material stylesheet usage. Cheers
  11. Hi, I have the following geometry with prim group. I wish to assign a specific material to a specific prim group, I am using an Attribute Wrangler SOP to perform the VEX operation but can't work out the variable name I should be using to do the comparison printf('%s',s@path); printf('nicholas test\n'); // if(match('*sphere*', s@path)) s@shop_materialpath = '/mat/red'; Cheers
  12. Using the above, I am unable to get a render that matches what was show for shotcam in the PDF that came with the dataset. Is setting the rotation correct in using the "look" values ?
  13. Hi, At work, we have commercial licenses of Houdini (H9) [network license] I want to learn more about the pipeline features in H14 so I installed the apprentice version. Houdini and Mantra works fine with the local license but hython (from the command line, not the Python shell within Houdini) complains that there is no license. Does hython defaults to network license (hence picking up older H9) rather than honor $HFS/houdini/Licensing.opt unless told to do so specifically via some hython specific environment variable ? Cheers
  14. Hi, In the method ::cookMySop(OP_Context &context) is there a way to differentiate between geometry data changes e.g. points x,y,z change, vs topology changes ? I am writing a SOP which takes input from a node like the Alembic SOP. On initial input connection or reconnection, it's a brand new data input so I am making provision to compute my internal stuff from scratch but when the user drag the time line or hit play, I hope to avoid making the assumption that the topology remains the same but if it does, I want to skip the much heavier construction from scratch. Does Houdini pass on such status between nodes which we can query ? Cheers
  15. Hi Alexey, I have started learning about Mantra procedural recently. I see the benefit of bounding box differently. In addition to it's useful in REYES-like algorithm, the bounding box may be useful (in ray-tracer like PBR) for e.g (1) Determining the relative level-of-detail so it can decide on geometry generation techniques, quality and/or quantity (2) Possibly subdivide (like octree) to smaller chunk for more efficient memory foot print. Naturally, the feasibility of the above will depend largely on the inputs (upstream source or external file etc) and influence to some extent by the production pipeline constraints. Cheers
  • Create New...