Arthur~Chiu Posted March 5, 2014 Share Posted March 5, 2014 i write a custom rop ,i want to output arbitrarily attribute to my custom file. such as float .or vector point attribute someone can help me ,thansks Quote Link to comment Share on other sites More sharing options...
edward Posted March 6, 2014 Share Posted March 6, 2014 Here's a good reference page: http://www.sidefx.com/docs/hdk13.0/hdk_dataflow_sop.html Untested. bool foo(OP_Context &context, const char *sop_path, const char *vector_attrib_name, UT_Vector3Array &data) { SOP_Node *sop = CAST_SOPNODE(OPgetDirector()->findNode(sop_path)); if (!sop) return false; // ERROR! not a valid sop node path GU_DetailHandle gd_handle = sop->getCookedGeoHandle(context); if (gd_handle.isNull()) return false; // ERROR! failed to cook GU_DetailHandleAutoReadLock gd_lock(gd_handle); const GU_Detail* gdp = gd_lock.getGdp(); GA_ROAttributeRef attrib = gdp->findPointAttribute(vector_attrib_name); if (attrib.isInvalid()) return false; // ERROR! wrong attrib name if (!gdp->getPointAttributeAsArray(attrib.get(), gdp->getPointRange(), data)) return false; // ERROR! wrong type? return true; } Quote Link to comment Share on other sites More sharing options...
Arthur~Chiu Posted March 6, 2014 Author Share Posted March 6, 2014 can output all attribute ? Quote Link to comment Share on other sites More sharing options...
edward Posted March 7, 2014 Share Posted March 7, 2014 http://forums.odforce.net/topic/19577-get-all-the-available-point-attributes/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.