Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Everything posted by nicholas_yue

  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. 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; }
  5. 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
  6. 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
  7. Python : hou creating/adding material style sheet ?

    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
  8. Programmatically layout/home nodes ?

    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
  9. Python : hou creating/adding material style sheet ?

    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
  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. Assigning material to prim group

    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. Moana Island Scene [Dataset]

    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. VRAY_Procedural questions

    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
  16. Hi, Using GT_ subclass to display OpenGL geometry, I see vertex normal, point number and face normal Whereas using GR_ subclasses, the viewport is only able to display the raw geometry. Is there something additional I need to setup to enable them. I need them for debugging purposes as the face/point normals in my code does not look correct. Cheers
  17. Hi, I am studying the tetprim example code. I see the following code and would like to find out if the returned GL buffer always expect one to fill them in with triangles ? Therefore if we have quads, we need to split it up into two triangles per quads ? If I have misunderstood the GL buffer returned by pos->map() and that it supports n-gon, where should one specify the per-polygon vertex count ? I have had a look at the GT code and it has the concept of vertex_order[] so I am fine with that. I want to test out a GR implementation hence the above question. ============= CODE ======================= // Initialize the number of points in the geometry. myGeo->setNumPoints( 12 * num_tets); // Fetch P (point position). If its cache version matches, no upload is // required. pos = myGeo->findCachedAttribOrArray(r, posname, RE_GPU_FLOAT32, 3, RE_ARRAY_POINT, true); if(pos->getCacheVersion() != p.geo_version) { // map() returns a pointer to the GL buffer UT_Vector3F *pdata = static_cast<UT_Vector3F *>(pos->map®); if(pdata) { for(int t=0; t<num_tets; t++) { pdata[0] = pt(t*4); pdata[1] = pt(t*4+1); pdata[2] = pt(t*4+2); pdata[3] = pt(t*4); pdata[4] = pt(t*4+2); pdata[5] = pt(t*4+3); pdata[6] = pt(t*4+1); pdata[7] = pt(t*4+2); pdata[8] = pt(t*4+3); pdata[9] = pt(t*4); pdata[10] = pt(t*4+3); pdata[11] = pt(t*4+1); pdata += 12; } Cheers
  18. Answering my own post. The usage of the points to draw geometry is determined in the call myGeo->connectSomePrimsI() There are a variety of options closely related to OpenGL primitives GL_* enums. Cheers
  19. Hi, I am starting to learn about writing a custom geometry display. I started looking at the tetprim example. I have read about GR_* code in the past and also previous post on odforce.net I have only recently discover GT_* whilst looking at the tetprim. Is there an overview as to the relationship between GR and GT ? Is GT something recent ? I am guessing it is related to tessellation. Is it optional ? Cheers
  20. GT relation to GR : Custom geometry display

    I had a look at the GUI example GUI_PolySoupBox.C but I think that is not suitable for my needs. GUI_* seems to be global toggle (at least in the example). I want the frustum display only for specific camera I am connecting/associating with, rather than all the cameras in a scene. I think DM_* is the way to go for now. Is there an example of registering DM_* hook directly in a SOP or must it be via GDP+GU_* code ? Cheers
  21. GT relation to GR : Custom geometry display

    I wish to display a frustum like object associated with a camera. Looking at the tetraprim example and knowledge that GT is optional, I am down to the minimal required classes as SOP_Frustum, GU_Frustum, GR_Frustum and GEO_Frustum which I need to implement, to draw a 6 side box. If I am not interested in the SOP being renderable (i.e. in Mantra etc) as it is for feedback to the artists. Are all the G* subclasses still required or is one able to simply implement and register a draw hook in SOP_Frustum ? Cheers
  22. MacBook Air : Intel HD 5000 ?

    Hi, I saw the announcement that OS X 10.7 will be dropped in the next version of Houdini, I am guessing H14. I currently using a MacBook (2008 model, non Pro) with a GeForce 9800 card running OS X 10.7 I am a developer so I don't do production level scenes with Houdini The machine triple boots to Linux and Windows thus giving me coverage on the major OS to verify compilation etc. Anyone used H13 on recent MacBook Air with Intel HD 5000 graphics willing to share their experience? Depending on configuration, a maxed-out MacBook Air is approximately half the cost of a maxed-out MacBook Pro (Retina), hence my consideration for a lower cost alternative given that I am not using it to do production work. Cheers
  23. Hi, I came across this method which I am planning to use but there is no document about the return values. virtual int evaluateInteriorPointV4(UT_Vector4 &pos, fpreal u, fpreal v, fpreal w = 0) const; I am guessing there must be a reason for not simply returning a boolean. Cheers
  24. Hi, Given a GU_Detail which has a mesh with UV, is there in-build API to query a point position at an arbitrary UV location [assuming the input UV is within the UV range of the mesh] ? Cheers