symek Posted January 12, 2008 Share Posted January 12, 2008 (edited) object has no attribute setPosition This means only that python cannot find "setPosition" name in object's dictionary. "attribute misleads here. Python doesn't care if this a method or attribute... As Hammy already figured out, another problem comes from variable type expected by setPosition method. Look on function's declaration. It expects one sequence of floats (vector, tuple etc) not three floats. Which example you're trying to mimic? Edited January 12, 2008 by SYmek Quote Link to comment Share on other sites More sharing options...
Tamis Posted January 12, 2008 Author Share Posted January 12, 2008 thnx hammy that works ! how did you know: "hou.pwd().geometry().points()" was a array ? SYmek: i was tryng to mimic your litle code: geo = hou.pwd().geometry() for pt in geo.points(): pos = pt.position() pt.setPosition([pos[0]+2, pos[1], pos[2]]) btw do you guys know if there is like a Module browser aplication out there for python to brows moduals(in a grhapical way) ? that would sure make life easyr because if i say dir(hou) i already become dissy because of the amount of tekst the console prints out. Quote Link to comment Share on other sites More sharing options...
symek Posted January 12, 2008 Share Posted January 12, 2008 (edited) I think this code is not mine but anyway... points() returns list (not an array) because it's called points not point - so there will be many of them Seriously you should use "print" statement for debugging purposes. If you open python shell, houdini will sent python stdout there. So you can use "print" inside Python SOP to see what is happening there. HOM's help is not very handy. I think something more like a python's doc server would be better. I just don't know how to force it to see hou modules... specially under Windows. In Linux it's enough to add houdini path to python path I suppose. Edited January 12, 2008 by SYmek Quote Link to comment Share on other sites More sharing options...
Tamis Posted January 12, 2008 Author Share Posted January 12, 2008 you mean make python see hou under windows ? enviorment variable: PYTHONPATH C:\Program Files\Side Effects Software\Houdini 9.0.794\houdini\scripts\python sadly it needs a .dll or something so you won't be able to use it in the Python Shell but you can use the path brouwser witch is kinda cool. Quote Link to comment Share on other sites More sharing options...
symek Posted January 12, 2008 Share Posted January 12, 2008 you mean make python see hou under windows ?enviorment variable: PYTHONPATH C:\Program Files\Side Effects Software\Houdini 9.0.794\houdini\scripts\python sadly it needs a .dll or something so you won't be able to use it in the Python Shell but you can use the path brouwser witch is kinda cool. ye, that is what I was meant. I went through this path . I also asked SESI on the very beginning of HOM to prepare HOM help in similar way, so you can see all objects methods on one page with one look - this is crucial for a programming. Nice method listing in current help simply doesn't work. That's funny somehow that such a small issue can make a whole HOM Help unusable. Personally I use exclusively dir(object) way. cheers, sy. Quote Link to comment Share on other sites More sharing options...
Tamis Posted January 13, 2008 Author Share Posted January 13, 2008 (edited) i made an atempt at what i have in mind witch would be cool for fast nav. sure will make live alot easyr. maby also a drag and drop solution to make fast path shortcuts. Edited January 13, 2008 by Tamis Quote Link to comment Share on other sites More sharing options...
symek Posted January 13, 2008 Share Posted January 13, 2008 maby also a drag and drop solution to make fast path shortcuts. drag and drop? It's already there! Try . Quote Link to comment Share on other sites More sharing options...
Tamis Posted January 13, 2008 Author Share Posted January 13, 2008 (edited) ooh crap, thats nice.... btw: do you know how to find the neighbours of a point? probably not implemented yet tho. Edited January 13, 2008 by Tamis Quote Link to comment Share on other sites More sharing options...
symek Posted January 14, 2008 Share Posted January 14, 2008 (edited) It seems like findClosestPoint() is not being implemented yet. In such a case you can use hscript command with hou.hscriptExpression() method. You could also simple loop through points to find smallest distance. This would be the slowest solution in terms of computation but it's even interesting comparison between hscript command (HOM in future) and pure python computation. I suspect this wouldn't be very efficient when it came to heave geometry. Anyway I'm pretty sure VEX would leave behind the rest of competitors here. Edited January 14, 2008 by SYmek 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.