Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Search the Community

Showing results for tags 'HDK gdp callback'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Lounge/General chat
    • Education
    • Jobs
  • Houdini
    • General Houdini Questions
    • Effects
    • Modeling
    • Animation & Rigging
    • Lighting & Rendering
    • Compositing
    • Games
  • Coders Corner
    • HDK : Houdini Development Kit
    • Scripting
    • Shaders
  • Art and Challenges
    • Finished Work
    • Work in Progress
    • VFX Challenge
    • Effects Challenge Archive
  • Systems and Other Applications
    • Other 3d Packages
    • Operating Systems
    • Hardware
    • Pipeline
  • od|force
    • Feedback, Suggestions, Bugs

Found 1 result

  1. Hello everyone, I want to be able to write a callback function that sets the cd attribute to something but i couldn't manage to get a GU_Detail that allows attribute write. Even if i was able to modify the attribute handle, i couldnt manage to get it back to main scope. Pls take a look at my code. thanks. PRM_Template(PRM_CALLBACK, 1 , &names[7] , 0 , 0 , 0, &setToPos), //This crashes houdini int SOP_myTest::setToPos(void *data, int index, float time, const PRM_Template *tplate){ SOP_myTest *me; me = (SOP_myTest *) data; OP_Context myContext(time); GU_DetailHandle gdh(me->curGdh(index)); GU_Detail *gdp = gdh.writeLock(); GA_Offset ptoff; UT_String string = NULL; UT_Vector3 colorValue; UT_Vector3 posValue; GA_RWHandleV3 colorHandle(gdp , GA_ATTRIB_POINT , "Cd"); GA_ROHandleV3 normalHandle(gdp , GA_ATTRIB_POINT , "N"); GA_ROHandleV3 posHandle(gdp , GA_ATTRIB_POINT , "P"); GA_FOR_ALL_PTOFF(gdp, ptoff){ posValue = posHandle.get(ptoff); colorHandle.set(ptoff, colorValue); } gdp->bumpAllDataIds(); return 1; } //This doesn't crash but does nothing.. GU_DetailHandleAutoWriteLock gdh(me->getCookedGeoHandle(myContext,0)); GU_Detail *gdp = gdh.getGdp(); //This also gets gdp but GA_RWHandleV3 colorHandle(gdp , GA_ATTRIB_POINT , "Cd"); does not accept const gdp. const GU_Detail *gdp = me->curGdp(index); //this crashes houdini too const GU_DetailHandle gdh = me->curGdh(index); GU_DetailHandle gdl = gdh.duplicateGeometry(); GU_Detail *gdp = gdl.writeLock(); //This gives me a const gdp too (can i convert from a const gdp to a write gdp ?) const GU_Detail *gdp = me->getCookedGeo(myContext); // This also does nothing const GU_Detail *gdp = me->getCookedGeo(myContext); GU_Detail *my_gdp = new GU_Detail; my_gdp->duplicate(*gdp);