It makes the variable available for other functions and can be used in the lightloop to check if a light should affect specular color or not.
I thought the parameters have to be function parameters, but I simply tried it this way and it worked. So I suppose it was more a unexpected behaviour that it worked at all. And now it works as it has to … and my code does not work any more.
Found 43 posts.
Search results Show results as topic list.
Technical Discussion » vcc changes
- haggikrey
- 45 posts
- Offline
Technical Discussion » vcc changes
- haggikrey
- 45 posts
- Offline
For my shader translator tool I used this in pre-Houdini12 vex function:
void myLight( int illuminateDiffuse; int illuminateSpecular)
{
export int __nondiffuse = illuminateDiffuse == 0;
export int __nonspecular = illuminateSpecular == 0;
}
This code worked fine with Houdini 11 vcc compiler. Now I get a syntax error. It seems that the “export” statement is wrong here now. Is that correct?
void myLight( int illuminateDiffuse; int illuminateSpecular)
{
export int __nondiffuse = illuminateDiffuse == 0;
export int __nonspecular = illuminateSpecular == 0;
}
This code worked fine with Houdini 11 vcc compiler. Now I get a syntax error. It seems that the “export” statement is wrong here now. Is that correct?
Technical Discussion » HDK: speedup creating geometry
- haggikrey
- 45 posts
- Offline
Thanks, meanwhile I tried another approach. The reason is indeed the point access in the loop. Now I create a GEO_Point() and do a particle->appendParticle() which is really fast too.
And.. yes you are right, the indices are wrong
Concerning geo files from maya. You are right, the geo format ist not too complicated. But I'd like to be able to write all types of geometry like nurbs, meshes, particles, curves, fluids as geo and as bgeo files. And to write clean bgeo files, this would take several weeks to find out how it has do be done correctly. Maybe I'll switch to an open source format like alembic, partio or field3d for data exchange. But at the moment I'll concentrate on clean export and on shaders. Then I'll streamline the procedures.
And.. yes you are right, the indices are wrong
Concerning geo files from maya. You are right, the geo format ist not too complicated. But I'd like to be able to write all types of geometry like nurbs, meshes, particles, curves, fluids as geo and as bgeo files. And to write clean bgeo files, this would take several weeks to find out how it has do be done correctly. Maybe I'll switch to an open source format like alembic, partio or field3d for data exchange. But at the moment I'll concentrate on clean export and on shaders. Then I'll streamline the procedures.
Technical Discussion » HDK: speedup creating geometry
- haggikrey
- 45 posts
- Offline
Hi,
I want to export my particles from maya to houdini to use it in mantra. Now I wrote an exporter which will export a simple particle file format. Then I start a houdini standalone which reads this file and crates a .geo file. At the moment it works fine, but it is really extremly slow. I have about 145000 particles. These are written from maya in less than a second and the creation of a houdini .geo file taks more than 5 minutes! This leads me to the conclusion that there must be something wrong with my code. I do the following:
GU_Detail gdp;
GU_PrimParticle *particle;
int defaultId = -1;
GB_AttributeRef idAttr = gdp.addPointAttrib(“id”, sizeof(int), GB_ATTRIB_INT, &defaultId);
UT_Vector3 vel(1,2,3);
GB_AttributeRef velAttr = gdp.addPointAttrib(“v”, sizeof(UT_Vector3), GB_ATTRIB_VECTOR, &vel);
float pscale = 1.234;
GB_AttributeRef scaleAttr = gdp.addPointAttrib(“pscale”, sizeof(float), GB_ATTRIB_FLOAT, &pscale);
particle = (GU_PrimParticle *)GU_PrimParticle::build(&gdp, numParticles);
int sizeId = 0;
for( uint i = 0; i < numParticles; i++)
{
uint index = i * 3;
particle->getVertex(i).getPt()->setPos(posList, posList, posList);
particle->getVertex(i).getPt()->setValue<UT_Vector3>(velAttr, UT_Vector3(velList,velList,velList));
particle->getVertex(i).getPt()->setValue<float>(scaleAttr, sizeList);
}
First I create an GU_Detail with the necessary points and attributes. The data is read from the file in posList, velList and sizeList. And the loop takes a long time. It would be great if there would be a faster way to assign the values to the points. Without the attributes it takes about 40sec with both attributes, more than 5 minutes.
Thanks for any tips.
haggi
I want to export my particles from maya to houdini to use it in mantra. Now I wrote an exporter which will export a simple particle file format. Then I start a houdini standalone which reads this file and crates a .geo file. At the moment it works fine, but it is really extremly slow. I have about 145000 particles. These are written from maya in less than a second and the creation of a houdini .geo file taks more than 5 minutes! This leads me to the conclusion that there must be something wrong with my code. I do the following:
GU_Detail gdp;
GU_PrimParticle *particle;
int defaultId = -1;
GB_AttributeRef idAttr = gdp.addPointAttrib(“id”, sizeof(int), GB_ATTRIB_INT, &defaultId);
UT_Vector3 vel(1,2,3);
GB_AttributeRef velAttr = gdp.addPointAttrib(“v”, sizeof(UT_Vector3), GB_ATTRIB_VECTOR, &vel);
float pscale = 1.234;
GB_AttributeRef scaleAttr = gdp.addPointAttrib(“pscale”, sizeof(float), GB_ATTRIB_FLOAT, &pscale);
particle = (GU_PrimParticle *)GU_PrimParticle::build(&gdp, numParticles);
int sizeId = 0;
for( uint i = 0; i < numParticles; i++)
{
uint index = i * 3;
particle->getVertex(i).getPt()->setPos(posList, posList, posList);
particle->getVertex(i).getPt()->setValue<UT_Vector3>(velAttr, UT_Vector3(velList,velList,velList));
particle->getVertex(i).getPt()->setValue<float>(scaleAttr, sizeList);
}
First I create an GU_Detail with the necessary points and attributes. The data is read from the file in posList, velList and sizeList. And the loop takes a long time. It would be great if there would be a faster way to assign the values to the points. Without the attributes it takes about 40sec with both attributes, more than 5 minutes.
Thanks for any tips.
haggi
Technical Discussion » HDK and boost/filesystem
- haggikrey
- 45 posts
- Offline
Problem seems to be solved now. I simply had some wrong settings in my Visual Studio project. Now I use all flags from hcustom and it seems to work.
Technical Discussion » HDK and boost/filesystem
- haggikrey
- 45 posts
- Offline
I'd like to use boost/filesystem in my houdini standalone application.
Unfortunatly the necessary boost libs are not included, only the header files.
Okay, no problem, I downloaded the boost_1.37 source and built the complete stage. An example console application using filesystem works fine.
But as soon as I include something like #include <GU/GU_Detail.h> the application fails to run (Error 0xc000007b). Now I have no idea what do do.
I'd really appreciate any ideas.
Unfortunatly the necessary boost libs are not included, only the header files.
Okay, no problem, I downloaded the boost_1.37 source and built the complete stage. An example console application using filesystem works fine.
But as soon as I include something like #include <GU/GU_Detail.h> the application fails to run (Error 0xc000007b). Now I have no idea what do do.
I'd really appreciate any ideas.
Technical Discussion » will mantra read alembic files
- haggikrey
- 45 posts
- Offline
Is there any info if mantra will be able to read alembic files directly? Or does archives for mantra ifd files still have to be in geo/bgeo format?
Would be nice to know for my translator.
Would be nice to know for my translator.
Technical Discussion » HDK H11 only vc8?
- haggikrey
- 45 posts
- Offline
Technical Discussion » HDK H11 only vc8?
- haggikrey
- 45 posts
- Offline
Technical Discussion » HDK in Maya
- haggikrey
- 45 posts
- Offline
Oh, thanks a lot for this info. Thats really important. Then I will more concentrate to write a HDK standalone to write out my geometry. Thats not the direct way, and it will need some overhead, but it should work.
Thanka again.
Thanka again.
Technical Discussion » HDK in Maya
- haggikrey
- 45 posts
- Offline
Hi,
I'm currently writing export tools for maya to enable geo/bgeo export for any type of geometry.
At the moment I use the old GPD library from sourceforge, but it is recommended to use the hdk to write plugins.
Well I want to write a plugin but for maya. Can I simply use hdk libraries from inside a maya plugin? And if yes, how? I simply tried to implement the headers from an hdk standalone example, but I get compilation errors.
I'd appreciate any help.
I'm currently writing export tools for maya to enable geo/bgeo export for any type of geometry.
At the moment I use the old GPD library from sourceforge, but it is recommended to use the hdk to write plugins.
Well I want to write a plugin but for maya. Can I simply use hdk libraries from inside a maya plugin? And if yes, how? I simply tried to implement the headers from an hdk standalone example, but I get compilation errors.
I'd appreciate any help.
Technical Discussion » Using compiled vex shaders in ifd file
- haggikrey
- 45 posts
- Offline
I have written some shaders as text and saved them in vfl files. Then I compile them into a otl files called shaders.otl.
Now I want to use these shaders in a mantra ifd file for rendering, but I'm unsure how to use them. I added a path to the otl in the ifd file:
ray_loadotl cmantra/project/shaders/shaders.otl
Then later in the ifd file, I try to use the shader like this:
ray_start object
ray_transform 17.980289 0 0 0 0 17.980289 0 0 0 0 17.980289 0 0 0 0 1
ray_geometry /meshes/plane
ray_property object surface simpleLambert_surface
ray_property object name “plane”
ray_end
Of course this does not work, I get an error:
mantra: VEX error: Unable to open simpleLambert_surface.vex Path not found
mantra: VEX error: Unable to load simpleLambert_surface Path not found
I think I'm not familiar enough with the correct implementation of shaders and surfaces in houdini, so any hint how I can make my shader work or whre I can find more information would be appreciated.
I was able to import my otl into mantra as new library. There I can create a new shop/surface node and there it appears in “digtal assets”. If I then create a shop node, I can assign and render from within houdini and the result looks promising. But I'd like to avoid this procedure if possible and use the shader directly in the ifd file.
Now I want to use these shaders in a mantra ifd file for rendering, but I'm unsure how to use them. I added a path to the otl in the ifd file:
ray_loadotl cmantra/project/shaders/shaders.otl
Then later in the ifd file, I try to use the shader like this:
ray_start object
ray_transform 17.980289 0 0 0 0 17.980289 0 0 0 0 17.980289 0 0 0 0 1
ray_geometry /meshes/plane
ray_property object surface simpleLambert_surface
ray_property object name “plane”
ray_end
Of course this does not work, I get an error:
mantra: VEX error: Unable to open simpleLambert_surface.vex Path not found
mantra: VEX error: Unable to load simpleLambert_surface Path not found
I think I'm not familiar enough with the correct implementation of shaders and surfaces in houdini, so any hint how I can make my shader work or whre I can find more information would be appreciated.
I was able to import my otl into mantra as new library. There I can create a new shop/surface node and there it appears in “digtal assets”. If I then create a shop node, I can assign and render from within houdini and the result looks promising. But I'd like to avoid this procedure if possible and use the shader directly in the ifd file.
Houdini Indie and Apprentice » Initial State for dynamics
- haggikrey
- 45 posts
- Offline
Unfortunatly I was unable to find the example. Do you have an idea what name the example file maybe could have?
Houdini Indie and Apprentice » Initial State for dynamics
- haggikrey
- 45 posts
- Offline
I now use a dynamics file written with the file node to create an initial state .sim file.
Works fine.
But I have one problem. I have a simple scene. I have some cubes that build a wall. Then I want to shoot a sphere into the wall. In my dop I have the sphere as well as my cubes and the floor plane.
Because I first want the cubes to settle before I shoot the sphere into the wall, I first set the sphere rbd to not active.
Then I simulate. The boxes settle and the last written file is used as initial state for my dop network. But now I want the sphere to be an active rigid body and let it collide with my wall.
Unfortunatly my sphere does not move because the initial state seem to overwrite my active checkbox or something like this.
I hope I could explain what the problem is.
I've added the scene file. Simply go into the dop network, turn off the active setting for the sphere, let the simulation write some files and use one file as initial state. Then make the sphere active again and try to simulate. Nothing happens.
Any ideas?
Works fine.
But I have one problem. I have a simple scene. I have some cubes that build a wall. Then I want to shoot a sphere into the wall. In my dop I have the sphere as well as my cubes and the floor plane.
Because I first want the cubes to settle before I shoot the sphere into the wall, I first set the sphere rbd to not active.
Then I simulate. The boxes settle and the last written file is used as initial state for my dop network. But now I want the sphere to be an active rigid body and let it collide with my wall.
Unfortunatly my sphere does not move because the initial state seem to overwrite my active checkbox or something like this.
I hope I could explain what the problem is.
I've added the scene file. Simply go into the dop network, turn off the active setting for the sphere, let the simulation write some files and use one file as initial state. Then make the sphere active again and try to simulate. Nothing happens.
Any ideas?
Houdini Indie and Apprentice » Stamp into Point DOP
- haggikrey
- 45 posts
- Offline
The tutorials on the sidefx side cover this topic.
Something like “basic_stamp.mov” should show what you need.
Something like “basic_stamp.mov” should show what you need.
Houdini Indie and Apprentice » Best method to fill a glass of water
- haggikrey
- 45 posts
- Offline
Thanks a lot. I'll have a lot to learn.
Isnt the separation of .15 a bit high if I want to get a detailed fluid? Especailly as soon as my glass will be hit by an object and the fluid will be flow around?
Isnt the separation of .15 a bit high if I want to get a detailed fluid? Especailly as soon as my glass will be hit by an object and the fluid will be flow around?
Houdini Indie and Apprentice » Loading scene error msg
- haggikrey
- 45 posts
- Offline
All is done in H9.1.95, no other version was ever used for saving or loading the scene. Anyway, it seems not to affect my scenes.
Houdini Indie and Apprentice » Initial State for dynamics
- haggikrey
- 45 posts
- Offline
Houdini Indie and Apprentice » Initial State for dynamics
- haggikrey
- 45 posts
- Offline
Fine, you helped a lot. And because I now know how to read the node information, the example files are much more helpful than before
I could read something about a “Dynamics output driver”, that writes similiar to the file node the simulation data to disk. But I could not find this node.
Any tips?
I could read something about a “Dynamics output driver”, that writes similiar to the file node the simulation data to disk. But I could not find this node.
Any tips?
Houdini Indie and Apprentice » Loading scene error msg
- haggikrey
- 45 posts
- Offline
Well, these files are not from an previous version of houdini. I only work with houdini 9.1, nothing else. Okay, I have installed 9.0 on my disk, so maybe houdini has problems with this configuration.
-
- Quick Links