Zuny Byeongjun An Posted September 24, 2012 Share Posted September 24, 2012 (edited) Hi guys. When I get two input with inlinecpp, if I don't use const on argument, it will be error. What's matter? It looks a bugs. Help me. ========================== Error..========================= # This code is called when instances of this SOP cook. node = hou.pwd() geo = node.geometry() node2 = node.inputs()[1] geo2= node2.geometry() # Add code to modify the contents of geo. import inlinecpp inlinecpp.extendClass(hou.Geometry, "pTredasde", includes=""" """, function_sources=[""" int pTree(GU_Detail * gdp, const GU_Detail * gdp2) { cout<<gdp->points().entries()<<endl; cout<<gdp2->points().entries()<<endl; return 0; } """]) print geo.pTree(geo2) =========================== OK ==================================================== # This code is called when instances of this SOP cook. node = hou.pwd() geo = node.geometry() node2 = node.inputs()[1] geo2= node2.geometry() # Add code to modify the contents of geo. import inlinecpp inlinecpp.extendClass(hou.Geometry, "pTredasde", includes=""" """, function_sources=[""" int pTree(const GU_Detail * gdp, const GU_Detail * gdp2) { cout<<gdp->points().entries()<<endl; cout<<gdp2->points().entries()<<endl; return 0; } """]) print geo.pTree(geo2) =========================================== What is problem on second one? It is just different with first one on argument. There is no const. Edited September 24, 2012 by mayalife Quote Link to comment Share on other sites More sharing options...
graham Posted September 24, 2012 Share Posted September 24, 2012 These both work fine for me. What exactly is the error you are getting? Quote Link to comment Share on other sites More sharing options...
Zuny Byeongjun An Posted September 24, 2012 Author Share Posted September 24, 2012 (edited) Thanks Graham, for your attention. In my case, it is not error only when I get a const arguments both of two input on inlinecpp module. I don't know why it does like that. When I get just one input argument, it's no problem. So I'm curious about that. It's my wrong gramma or just problem on my computer. So I can't modify first input. Edited September 24, 2012 by mayalife Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted September 25, 2012 Share Posted September 25, 2012 (edited) What is problem on second one? It is just different with first one on argument. There is no const. From inlineCpp help: In other words, only use a GU_Detail * for functions being called from a Python SOP where you can modify the geometry. For functions that do not modify the geometry, use a const GU_Detail * parameter. EDIT: On the other hand I don't know . When you "createLibrary" it also doesn't allow to have main geo not marked as "const" while geo from second input is also passed. Man, I really hate inlineCpp. Switch to HDK. It's easier to debug. Edited September 25, 2012 by mantragora Quote Link to comment Share on other sites More sharing options...
graham Posted September 25, 2012 Share Posted September 25, 2012 If you could post a hip file with your otl in it that exhibits the problem, it should be pretty easy to debug. Quote Link to comment Share on other sites More sharing options...
Zuny Byeongjun An Posted September 26, 2012 Author Share Posted September 26, 2012 Thanks all of guys. I will switch to HDK. To graham.. There is no speacial something.. I just tried to make otl with python geometry type. untitled.hipnc Quote Link to comment Share on other sites More sharing options...
graham Posted September 26, 2012 Share Posted September 26, 2012 Unfortunately your hip file is missing the otl, but I was able to see from it that you are attempting to use Windows. Running your broken block from my Windows partition I do get the compiling error, meaning it's a Windows specific issue. Things work as expected on Linux, hence my earlier replies. I've submitted a bug to SESI. Quote Link to comment Share on other sites More sharing options...
Zuny Byeongjun An Posted September 26, 2012 Author Share Posted September 26, 2012 Thanks a lot, Graham.. 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.