Hello.
Sorry for digging up this old topic, but I spent half of the Sunday trying to figure out how to use tangent-space normal map (or even object-space normal map) with Mantra PBR. With no success.
I read the OD|Force topic that was linked here, but Eetu's solution isn't compatible with PBR. And it's not obvious for a new Houdini user, like me, how to change the network to make it work, or even how to use this solution with Mantra Surface shader.
There's not much information about this topic on the Internet. There are some tutorials and forum threads here and there, but none of them worked for me.
I'm surprised that setting-up normal maps in Houdini is so complicated and normal maps don't work out-of-the-box.
Maybe someone could share some tips on how to make them work correctly with Mantra PBR + Mantra Surface?
—–
Below - an example:
Generic 3D-Coat head geo with Mantra Surface shader and tangent-space normal map applied. 3D-Coat's Maya 2013+ normal map preset was used to generate and export normal map (Angled & Square, Delaunay Triangulation, Maya tangent-space), but I also tried other presets, as well as normal maps generated in xNormal. With no success and comparable results.
Note the strange shading and faceting.
(Ignore the grain)
Found 466 posts.
Search results Show results as topic list.
Technical Discussion » Mantra surface normal bump
- ajz3d
- 466 posts
- Offline
Houdini Indie and Apprentice » Adaptive subdivision and UV-smoothing
- ajz3d
- 466 posts
- Offline
Hello guys.
Can someone please shed some light on what kind of UV-smoothing Houdini applies when it adaptively subdivides a surface in render-time?
Also, can we choose between different UV-smoothing methods?
Can someone please shed some light on what kind of UV-smoothing Houdini applies when it adaptively subdivides a surface in render-time?
Also, can we choose between different UV-smoothing methods?
Houdini Indie and Apprentice » Sweep and taper
- ajz3d
- 466 posts
- Offline
Great example! Thank you.
May I ask why did you decide to use VOP SOP to create ramps and pscale attributes, instead of using standard SOP nodes? Does VOP SOP offer better performance, or is it just your personal preference?
May I ask why did you decide to use VOP SOP to create ramps and pscale attributes, instead of using standard SOP nodes? Does VOP SOP offer better performance, or is it just your personal preference?
Houdini Indie and Apprentice » Sweep and taper
- ajz3d
- 466 posts
- Offline
badhairdayThanks, but unfortunately not. Unless I missed something, in your example all X-sections seem to get scaled in a uniform manner.
Something like this?
I'm sorry, maybe I did not express myself clearly. What I meant is something like this (see picture).
This probably would require three separate ramps for X, Y and Z scale. How to connect them to Sweep node?
Houdini Indie and Apprentice » Sweep and taper
- ajz3d
- 466 posts
- Offline
Many thanks, Buki. A very helpful scene.
—
I wonder, what if I wanted to scale the cross-section non-uniformly?
—
I wonder, what if I wanted to scale the cross-section non-uniformly?
Houdini Indie and Apprentice » Sweep and taper
- ajz3d
- 466 posts
- Offline
Hello.
How can I taper a cross-section as it nears the end of a curve on which I sweep it?
How can I taper a cross-section as it nears the end of a curve on which I sweep it?
Houdini Indie and Apprentice » Houdini and Python IDE
- ajz3d
- 466 posts
- Offline
Thanks Chronon.
I tried RPC with Eclipse and PyCharm. While it seems to work initially, eventually the connection is dropped with the following error on IDE's side:
Traceback (most recent call last):
File “<input>”, line 1, in <module>
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\netref.py”, line 90, in __getattribute__
return syncreq(self, consts.HANDLE_GETATTR, name)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\netref.py”, line 45, in syncreq
return conn().sync_request(handler, oid, *args)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 337, in sync_request
seq = self._send_request(handler, args)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 158, in _send_request
self._send(consts.MSG_REQUEST, seq, (handler, self._box(args)))
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 153, in _send
self._channel.send(data)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\channel.py”, line 50, in send
self.stream.write(buf)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\stream.py”, line 115, in write
count = self.sock.send(data)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\stream.py”, line 46, in __getattr__
raise EOFError(“stream has been closed”)
EOFError: stream has been closed
And on Houdini's side it looks like this:
Exception in thread Thread-5:
Traceback (most recent call last):
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\threading.py”, line 808, in __bootstrap_inner
self.run()
File “CPROGRA~1/SIDEEF~1/HOUDIN~1.509/houdini/python2.7libs\hou.py”, line 67520, in __threadRun
self.__run()
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\threading.py”, line 761, in run
self.__target(*self.__args, **self.__kwargs)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\utils\server.py”, line 110, in _authenticate_and_serve_client
self._serve_client(sock, credentials)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\utils\server.py”, line 127, in _serve_client
conn.serve_all()
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 312, in serve_all
self.serve(0.1)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 304, in serve
self._dispatch(data)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 274, in _dispatch
self._dispatch_request(seq, args)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 233, in _dispatch_request
self._send_reply(seq, res)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 161, in _send_reply
self._send(consts.MSG_REPLY, seq, self._box(obj))
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 181, in _box
cls = getattr(obj, “__class__”, type(obj))
NameError: Unknown C global variable
However, I found a workaround for code completion in PyCharm using docstring type hints. This does not eliminate the unresolved attribute references warning when it comes to enums in kwargs, but it does show me full lists of methods available to objects.
I tried RPC with Eclipse and PyCharm. While it seems to work initially, eventually the connection is dropped with the following error on IDE's side:
Traceback (most recent call last):
File “<input>”, line 1, in <module>
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\netref.py”, line 90, in __getattribute__
return syncreq(self, consts.HANDLE_GETATTR, name)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\netref.py”, line 45, in syncreq
return conn().sync_request(handler, oid, *args)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 337, in sync_request
seq = self._send_request(handler, args)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 158, in _send_request
self._send(consts.MSG_REQUEST, seq, (handler, self._box(args)))
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 153, in _send
self._channel.send(data)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\channel.py”, line 50, in send
self.stream.write(buf)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\stream.py”, line 115, in write
count = self.sock.send(data)
File “C:\Program Files\Side Effects Software\Houdini 13.0.509\python27\lib\site-packages\rpyc\core\stream.py”, line 46, in __getattr__
raise EOFError(“stream has been closed”)
EOFError: stream has been closed
And on Houdini's side it looks like this:
Exception in thread Thread-5:
Traceback (most recent call last):
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\threading.py”, line 808, in __bootstrap_inner
self.run()
File “CPROGRA~1/SIDEEF~1/HOUDIN~1.509/houdini/python2.7libs\hou.py”, line 67520, in __threadRun
self.__run()
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\threading.py”, line 761, in run
self.__target(*self.__args, **self.__kwargs)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\utils\server.py”, line 110, in _authenticate_and_serve_client
self._serve_client(sock, credentials)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\utils\server.py”, line 127, in _serve_client
conn.serve_all()
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 312, in serve_all
self.serve(0.1)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 304, in serve
self._dispatch(data)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 274, in _dispatch
self._dispatch_request(seq, args)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 233, in _dispatch_request
self._send_reply(seq, res)
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 161, in _send_reply
self._send(consts.MSG_REPLY, seq, self._box(obj))
File “C:\PROGRA~1\SIDEEF~1\HOUDIN~1.509\python27\lib\site-packages\rpyc\core\protocol.py”, line 181, in _box
cls = getattr(obj, “__class__”, type(obj))
NameError: Unknown C global variable
However, I found a workaround for code completion in PyCharm using docstring type hints. This does not eliminate the unresolved attribute references warning when it comes to enums in kwargs, but it does show me full lists of methods available to objects.
Houdini Indie and Apprentice » Houdini and Python IDE
- ajz3d
- 466 posts
- Offline
I realized that I didn't actually formulate a question.
So, has anyone been able to configure his Python IDE for full code completion? Not only when it comes to hou module itself, but also for objects of classes inside this module? Or this is as far as one can get?
So, has anyone been able to configure his Python IDE for full code completion? Not only when it comes to hou module itself, but also for objects of classes inside this module? Or this is as far as one can get?
Houdini Indie and Apprentice » Houdini and Python IDE
- ajz3d
- 466 posts
- Offline
I've browsed the forum in search for an answer to my question, but I was unable to find a thread that would explain how to configure one's Python IDE to completely support HOM. I don't expect miracles, like running or debugging HOM code directly from IDE, but at least I'd like it to support full code completion.
I tried with Eclipse with PyDev and PyCharm, but all I get is a mere hou module code completion. Whenever I try to assign an object to a variable, like in:
node = hou.node('/obj/geo1/')
node.setName('someName')
I get no code completion in the second line after the dot. No list of methods whatsoever.
Also, if I try to use enums (in kwargs), I usually get “Unresolved attribute reference” warnings all over the place. Like in case of hou.stringParmType.FileReference or hou.parmNamingScheme.Base1.
It's not critical, but it hinders the development of modules.
And yes, I have followed advices from various threads and have added Houdini's soho and python2.7libs directories to my interpreter paths. To no avail.
I tried with Eclipse with PyDev and PyCharm, but all I get is a mere hou module code completion. Whenever I try to assign an object to a variable, like in:
node = hou.node('/obj/geo1/')
node.setName('someName')
I get no code completion in the second line after the dot. No list of methods whatsoever.
Also, if I try to use enums (in kwargs), I usually get “Unresolved attribute reference” warnings all over the place. Like in case of hou.stringParmType.FileReference or hou.parmNamingScheme.Base1.
It's not critical, but it hinders the development of modules.
And yes, I have followed advices from various threads and have added Houdini's soho and python2.7libs directories to my interpreter paths. To no avail.
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
Okay, I think it had something to do with script caching or whatever, because when I deleted everything from the Type Properties->Scripts, I noticed that the HDA was still working as if nothing has happened(!). Saving operator type and locking it up didn't help either. I had to delete the HDA node from my scene and restart Houdini. And only then it finally forgot that blasted script.
Then, I pasted the newest version of the script and now everything is working perfectly fine. Phew!
Then, I pasted the newest version of the script and now everything is working perfectly fine. Phew!
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
Hm. This is weird. I just created a simple scene for testing purposes and it works just fine there - no stripping occurs. The code I used is exactly the same as in my main HDA. :shock:
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
Brilliant! This explains a lot! Thank you for taking your time to create this example.
However, there's a problem when I pass the callback script as an arg:
myButton = hou.ButtonParmTemplate('my_button',
‘My Button’,
script_callback=“hou.node('/obj/myHDA').hdaModule().test('foo!')”,
script_callback_language=hou.scriptLanguage.Python)
If I do this, and then click the button, I'm presented with a “NameError: name ‘test’ is not defined” error. And when I inspect the callback field of my button inside the control node, I see that it only stores the:
test(“foo!”)
function call, stripped of the path to my HDA node. So no wonder it can't find the function.
Do you have any suspicions as to why this happens?
However, there's a problem when I pass the callback script as an arg:
myButton = hou.ButtonParmTemplate('my_button',
‘My Button’,
script_callback=“hou.node('/obj/myHDA').hdaModule().test('foo!')”,
script_callback_language=hou.scriptLanguage.Python)
If I do this, and then click the button, I'm presented with a “NameError: name ‘test’ is not defined” error. And when I inspect the callback field of my button inside the control node, I see that it only stores the:
test(“foo!”)
function call, stripped of the path to my HDA node. So no wonder it can't find the function.
Do you have any suspicions as to why this happens?
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
Hello.
I need to ask another question. I don't want to create another thread, so I'll just post here as it's still regarding Python in Houdini.
I have an HDA node with Python code in its Type Properties->Scripts. It basically contains a class and a dozen of functions with which I generate a network of OBJ and SOP nodes, with “one control node to rule them all”.
I create interface parameters of this control node from within the code inside my HDA. However, amongst those parameters there are some buttons to which I'd like to assign callback scripts. And this the problematic part, because the code of my HDA is invisible to the control node, so I can't just assign a function from my main script to the callback, because it will simply be inaccessible.
There are also some lists containing instances of various nodes that I need to pass to the callback function for processing.
I found this thread on OD|Force forum: http://forums.odforce.net/topic/9607-buttons-callback-script/?hl=%2Bscript+%2Bcallback [forums.odforce.net]
Some suggestions are made there to simply import Python module. But how do I import a module that is embedded into my HDA?
How should I approach this problem? What's the right way of doing it?
I need to ask another question. I don't want to create another thread, so I'll just post here as it's still regarding Python in Houdini.
I have an HDA node with Python code in its Type Properties->Scripts. It basically contains a class and a dozen of functions with which I generate a network of OBJ and SOP nodes, with “one control node to rule them all”.
I create interface parameters of this control node from within the code inside my HDA. However, amongst those parameters there are some buttons to which I'd like to assign callback scripts. And this the problematic part, because the code of my HDA is invisible to the control node, so I can't just assign a function from my main script to the callback, because it will simply be inaccessible.
There are also some lists containing instances of various nodes that I need to pass to the callback function for processing.
I found this thread on OD|Force forum: http://forums.odforce.net/topic/9607-buttons-callback-script/?hl=%2Bscript+%2Bcallback [forums.odforce.net]
Some suggestions are made there to simply import Python module. But how do I import a module that is embedded into my HDA?
How should I approach this problem? What's the right way of doing it?
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
As a workaround I ended up using the hou.InterruptableOperation class to display a progress window with some info on what is going on. The class is so clever that apart of user-specified string, it even provides some info on what Houdini is currently doing under the hood.
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
Hi.
I have one more question, loosely related to this subject.
I've noticed that any print() functions and parameter changes are displayed AFTER the script reaches its end. Is there any way that I can feed them to standard output or, when it comes to parameters display, update them during run-time?
I have this String parameter called ‘hdaStatus’ in my HDA node, which I want to display information on what the HDA is currently processing, and I'm breaking my head trying to figure out how to do it. There's a line in which I'm loading a hi-res geometry and before it, I placed the:
self.hdaNode.parm('hdaStatus').set('Loading reference mesh. This may take a while…')
…but the UI representation of the ‘hdaStatus’ parameter updates AFTER the script finishes its job.
I have one more question, loosely related to this subject.
I've noticed that any print() functions and parameter changes are displayed AFTER the script reaches its end. Is there any way that I can feed them to standard output or, when it comes to parameters display, update them during run-time?
I have this String parameter called ‘hdaStatus’ in my HDA node, which I want to display information on what the HDA is currently processing, and I'm breaking my head trying to figure out how to do it. There's a line in which I'm loading a hi-res geometry and before it, I placed the:
self.hdaNode.parm('hdaStatus').set('Loading reference mesh. This may take a while…')
…but the UI representation of the ‘hdaStatus’ parameter updates AFTER the script finishes its job.
Technical Discussion » Viewport blocking problem.
- ajz3d
- 466 posts
- Offline
CyberikaI too have noticed this particular problem. The cursor changes into a hand, like in View mode, and stays like this even when I hoover over different pane tab types. I can't select anything, click on buttons, etc.
One more thing. Sometimes whole interfaces of houdini converts to viewport navigation area. I mean even if my mouse is outside of viewport I can tumble, dolly and track camera so this way all panels are inactive.
Most of the time minimizing Houdini window, changing focus, repeatedly tapping ALT and ESC escape keys in no particular order - helps. Sometimes though, I need to restart Houdini.
There are also times when the cursor permanently changes into arrows that you see when resizing windows. This fortunately doesn't prevent me from using UI components.
I'm on Houdini Apprentice 13.0.498 and Win7 Pro 64-bit.
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
Excellent! This is exactly what I was looking for!
Many thanks Master Joker386. Your help was invaluable.
Many thanks Master Joker386. Your help was invaluable.
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
Thank you Joker386, but that's not what I'm after.
I just took another look at the hou module and I think it's the hou.ParmTemplate class I should look into. I need to test it out.
I just took another look at the hou module and I think it's the hou.ParmTemplate class I should look into. I need to test it out.
Houdini Indie and Apprentice » Python: Is it possible to dynamically edit interface parms?
- ajz3d
- 466 posts
- Offline
Is it possible to dynamically create, edit, hide/show, remove and create dependencies (disable/hide when…) between interface parameters of nodes with just python code?
Simple example:
geo = hou.node('/obj').createNode('geo')
null = geo.createNode('null')
file = hou.node(geo.path()+'/file1')
Let's say I need to hide the copyinput and cacheinput parms of my null SopNode, create a button and a Float parameter that will reference data of some other node. Or maybe promote reload parameter (button) of the file SopNode to my geo node.
Can it be done?
Simple example:
geo = hou.node('/obj').createNode('geo')
null = geo.createNode('null')
file = hou.node(geo.path()+'/file1')
Let's say I need to hide the copyinput and cacheinput parms of my null SopNode, create a button and a Float parameter that will reference data of some other node. Or maybe promote reload parameter (button) of the file SopNode to my geo node.
Can it be done?
Houdini Indie and Apprentice » Automatic geometry separation, depending on group membership
- ajz3d
- 466 posts
- Offline
pezetkoThanks for your reply, Pezetko.
Put * in the Group Mask parameter of for each sop to process all groups.
If you want just save them, put File SOP inside forEach and set the name based on current loop (FORIDXVALUE or FORVALUE stamp expression).
I'm running into some problems with this one.
I use “$HIP/output/$FORVALUE.obj” string as a “Geometry File” parameter inside file SOP. I expected from $FORVALUE to assume values of each PrimGroup.name() of the input, similar to loops:
for primGroup in geo.primGroups(): # (…)
with $FORVALUE stamp being the equivalent of the primGroup variable in the example above. Turns out I'm wrong, because when I place the file node just before the ‘each’ node inside the forEach SOP, all I get is just one output file called ‘.obj’ - it doesn't even have a name, just an extension. It contains all groups from the input. What am I doing wrong here?
Yes, this is how I do it ATM.
import hou
#select file sop
selectedNode = hou.selectedNodes()
groups = selectedNode.geometry().primGroups()
for group in groups:
blastNode = selectedNode.createOutputNode('blast')
blastNode.setName(“keep”+group.name())
blastNode.parm('group').set(group.name())
blastNode.parm('negate').set(1)
I understand that it is not possible to fork the flow into n-streams without scripting?
-
- Quick Links