Jump to content

ClausKleber

Members
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ClausKleber

  • Rank
    Peon

Personal Information

  • Name
    First
  1. Thank you Macha. in this way i already have implemented it. I had hoped that there is a possibility to use the IMG_FileTTMap or the TIL_TextureMap classes as it has been proposed in your subject topic. Now i have written my own colorLookup() function to get the bi-linear interpolated texel color. It works well but it is a little bit redundant cause such a function already exists in the TIL_TextureMap class.
  2. Evaluating textures at hitpoints

    Hi, i had a similar problem and i've written my own function evaluateUVPoint(...). I would be very interested too if someone knows an already existing HDK function to get the texture point. Anyway, this is my method which returns the texture UV coordinate of a hit position on a triangle. UT_Vector3D evaluateUVPoint(GA_Offset primOff, float u, float v, float w = 0) { UT_Vector3D uv = 0; GA_Primitive* prim = myGdp->getPrimitiveList().get(primOff); if (prim) { UT_Vector3D pt0, pt1, pt2; GA_ROHandleV3 primUV; primUV = myGdp->findPointAttribute(GEO_STD_ATTRIB_TEXTURE); // or findVertexAttribute(...) if (primUV.isValid()) { pt0 = primUV.get(prim->getPointOffset(0)); // or getVertexOffset(...) pt1 = primUV.get(prim->getPointOffset(1)); pt2 = primUV.get(prim->getPointOffset(2)); uv = (pt1 - pt0) * u; uv += (pt2 - pt0) * v; uv += pt0; } } return uv; } This works only for triangles. If someone knows a solution for quads i would be very gratefull.
  3. Get Particle Hit UV Infos of Static Body

    Thanks, i've already seen and enabled this setting, but i have figured out that the problem was the "default particle size". The collision works very well after increasing this parameter a little bit.
  4. Hello, i've a POP Solver with particles and a Static Solver of a static object on which the particles should collide. Also i have a popCollisionDetect which writes the hit infos in the particle point attributes. Allways when i put on the static solver there will no hit attributes be written. How can i get these hit attributes when i you a Rigid Body Solver or a Static Solver? Is where a way? Thanks!
  5. Hi, has someone an idea how to use the IMG_FileTTMap class (Tiled Texture Map)? I just want to load a texture, sample the color by UVs and i want to filter the image. The IMG_File class doesnt provide that and i cannot open the texture like this: IMG_FileTTMap* tex = IMG_FileTTMap::open(filename); So how can i use this class?
  6. How to save an IMG_File

    Thanks for the images(0) tip. I will do that. I have figured out that the problem was caused by the non-commercial version of Houdini. The IMG_File::saveRasterAsFile() method accepts only 768x576 px images in the nc-version. My code works well for smaller images.
  7. Hi, i'm trying to save an image or rather a PXL_Raster to a file but there will be no genereted file. IMG_File *tex = IMG_File::open("D:/test.png"); UT_PtrArray<PXL_Raster *> images; tex->readImages(images); // First try if (IMG_File::saveRasterAsFile("D:/new.png", images[0])) cout << "Success!" << endl; // is not called // Second try if (tex->writeImages(images)) cout << "Success!" << endl; // is also not called tex->close(); delete tex; What i'm doing wrong? Has someone a tip for me? Thanks!
  8. [HOM] Write geometry attribute in Python Dop

    I've found a way. It's pretty easy. You can get an editable geometry in the Python Dop: objects = hou.pwd().objectsToProcess() with objects[0].editableGeometry() as geo: for point in geo.points(): point.setAttribValue("life", 0.5)
  9. Hi, is there a way to write a point attribute in a Python Dop? I know that the usual way like objects.geometry() returns a read-only reference and only in a Python Sop you get it writable. But i want to change the attributes during the simulation. Thanks!
  10. Hello, for some time I'm trying to get the texture UV point of a point on a geometry. The UV pointattributes describes only the point on the current polygon but not the texture point. Some help would be very nice. Thanks!
  11. Hi, i am trying to write to some attributes from SIM_Data. How can i get a non-const GU_Detail? The attribute reference is always "read only". Can someone give me an advice? Here my code: SIM_GeometryCopy *geo = SIM_DATA_CAST(obj.getNamedSubData(SIM_GEOMETRY_DATANAME), SIM_GeometryCopy); if (geo) { GU_DetailHandle gdh = geo->getGeometry().getWriteableCopy(); const GU_Detail* gdp = gdh.peekDetail(); GEO_AttributeHandle h = gdp->findPointAttribute("hittime"); if (h.isAttributeValid()) { for (GA_Iterator it(gdp->getPointRange()); !it.atEnd(); it.advance()) { const GEO_Point *ppt = gdp->getGEOPoint(it.getOffset()); h.setElement(ppt); h.setF(1.3f); // this has no effect } } }
  12. Example for DOP Particle Data Access

    I've found a way to get access of the particle collision data. Maybe someone tries something similar to do so i post my code here. I have derived my class from DOP_Node. void DOP_ReadParticles::processObjectsSubclass(fpreal time, int, const SIM_ObjectArray &objects, DOP_Engine &engine) { for (int i = 0; i < objects.entries(); i++) { SIM_Object* obj = objects.findObjectById(i); SIM_GeometryCopy* geometry = (SIM_GeometryCopy*)obj.getNamedSubData(SIM_GEOMETRY_DATANAME); if (geometry) { GU_DetailHandle gdh = geometry->getGeometry().getWriteableCopy(); const GU_Detail* gdp = gdh.peekDetail(); GA_ROAttributeRef hituv = gdp->findPointAttribute("hituv"); GA_ROHandleV2 h_hituv(hituv.getAttribute()); if (h_hituv.isValid()) { UT_Vector2F uv; for (G A_Iterator it(gdp->getPointRange()); !it.atEnd(); it.advance()) { UT_Vector2F uv(h_hituv.get(it.getOffset())); // read the UV-hitposition printf("%i hitUV: (%f, %f)\n", it.getIndex(), uv.x(), uv.y()); } } } } }
  13. Example for DOP Particle Data Access

    Can someone give me an advice?
  14. Hi, could someone give me a simple code example or a link how to read the particle attributes of a DOP Network? (especially how can i get the collision data of the particles and an object?) I tried it with deriving my class from SIM_Data, but e.g. the SIM_ElectricalProperties example doesnt help me further. Thanks for your help.
  15. Hi, i want to write my own DopNetwork but i don't know how i can create it or rather from which class i should derive my custom class. In Houdini my node is only available in an already existing DopNet when i derive my node from OBJ_DopNet.h (obj/dopnet1/myNode). But i want to create my own DopNet (obj/myDopNet). Can someone give me an advice? Thank you.
×