I figure addWarning and addError are protect methods of OP_Node. They can only be called during cookMySOP(), am I right?
is there a way I can add warning to other OPs instead itself?
something like:
OP_ROP* myRop = OPgetDirector()->findROPNode(“/out/myMantra/”);
myRop->addError(ROP_MESSAGE, “some message”);
Found 58 posts.
Search results Show results as topic list.
Technical Discussion » Add message/Warning/Error to a OP via HDK
- laiwayne
- 58 posts
- Offline
Technical Discussion » Mantra property: camra and renderer question
- laiwayne
- 58 posts
- Offline
I tried to run these two lines in my python filter code.
print mantra.property('renderer:name')
print mantra.property('camera:name')
they both returned me .
Its understandable I got “Mantra” when I asking for a randerer name, but why do I also get Mantra when I asking for a camera name?
Or is there a way that I can get the rendering camera?
ex. I have more than one camera in my ifd. Is there a way I can get the camera name when that camera ifd block is rendered?
print mantra.property('renderer:name')
print mantra.property('camera:name')
they both returned me .
Its understandable I got “Mantra” when I asking for a randerer name, but why do I also get Mantra when I asking for a camera name?
Or is there a way that I can get the rendering camera?
ex. I have more than one camera in my ifd. Is there a way I can get the camera name when that camera ifd block is rendered?
Technical Discussion » Run python scripts in a Custom ROP OTL
- laiwayne
- 58 posts
- Offline
this is a good idea! thank you!
but I am still wondering is there a way we can make our own ROP otl being executed by render command in hscrip?
but I am still wondering is there a way we can make our own ROP otl being executed by render command in hscrip?
Technical Discussion » Run python scripts in a Custom ROP OTL
- laiwayne
- 58 posts
- Offline
edward
Why not just use the pre-render script parm?
Pre-render script requires a ROP as a base which I want that is my ROP OTL. I do not want to add the script in a Mantra ROP or Geometry ROP because I do not need to render out any image or bgeo. All I need is get the values from the OTL parm and pass it to my script.
Technical Discussion » Run python scripts in a Custom ROP OTL
- laiwayne
- 58 posts
- Offline
Is there a way what I run python scripts when a custom ROP OTL is running (rendering)?
I have tried to create a button which has a callback script and the button links to the render button( which is gray out in the type properties ), so the callback script runs when the render button is pushed. However, if I run a Hscript “render” on that custom ROP, this will just execute the render operation and has no effect on my button, which means no callback script runs as I expect.
basically, what I want is something like python type OTL ROP. and can be executed by Hscript “render” command.
I have tried to create a button which has a callback script and the button links to the render button( which is gray out in the type properties ), so the callback script runs when the render button is pushed. However, if I run a Hscript “render” on that custom ROP, this will just execute the render operation and has no effect on my button, which means no callback script runs as I expect.
basically, what I want is something like python type OTL ROP. and can be executed by Hscript “render” command.
Technical Discussion » add callback event /hou.nodeEventType error
- laiwayne
- 58 posts
- Offline
Technical Discussion » add callback event /hou.nodeEventType error
- laiwayne
- 58 posts
- Offline
I wanna make a python callback in a Houdini OTL.
here is the code embed in the Python Module Section:
import hou
node = hou.node(“/obj/mySOP”)
def setUpCallback(node):
node.addEventCallback(hou.nodeEventType.ChildCreated, onNodeChange)
def onNodeChange(**kwargs):
if kwargs == hou.nodeEventType.ChildCreated:
print kwargs
however, every time I run the setUpCallback(node) the error message pop out:
File “/home/prisms/builder-new/Nightly11.0/dev/hfs/houdini/python2.6libs/hou.py”, line 6084, in addEventCallback
return _hou.Node_addEventCallback(*args)
TypeError: in method ‘Node_addEventCallback’, argument 2 of type ‘std::vector<HOM_EnumValue *,std::allocator<HOM_EnumValue * > > const &’
anyone has an idea about this ?
here is the code embed in the Python Module Section:
import hou
node = hou.node(“/obj/mySOP”)
def setUpCallback(node):
node.addEventCallback(hou.nodeEventType.ChildCreated, onNodeChange)
def onNodeChange(**kwargs):
if kwargs == hou.nodeEventType.ChildCreated:
print kwargs
however, every time I run the setUpCallback(node) the error message pop out:
File “/home/prisms/builder-new/Nightly11.0/dev/hfs/houdini/python2.6libs/hou.py”, line 6084, in addEventCallback
return _hou.Node_addEventCallback(*args)
TypeError: in method ‘Node_addEventCallback’, argument 2 of type ‘std::vector<HOM_EnumValue *,std::allocator<HOM_EnumValue * > > const &’
anyone has an idea about this ?
Technical Discussion » OTL/ brush tool
- laiwayne
- 58 posts
- Offline
That is sad. thank you again.
So is there anyway that I can create my own paint style SOP? python type SOP OTL? tweak regular paint SOP then save as a custom paint OTL? VEX? or I have to dig into the HDK land?
So is there anyway that I can create my own paint style SOP? python type SOP OTL? tweak regular paint SOP then save as a custom paint OTL? VEX? or I have to dig into the HDK land?
Technical Discussion » OTL/ brush tool
- laiwayne
- 58 posts
- Offline
cool, thanks graham.
I was trying to force the paint SOP being selected inside my OPT- Node.setSelected().
The way you provided seems still needs to change current selection - Node.setCurrent().
Is there anyway that I can keep my OTL as current node and I also can get the brush tool and paint?
I was trying to force the paint SOP being selected inside my OPT- Node.setSelected().
The way you provided seems still needs to change current selection - Node.setCurrent().
Is there anyway that I can keep my OTL as current node and I also can get the brush tool and paint?
Technical Discussion » OTL/ brush tool
- laiwayne
- 58 posts
- Offline
I am trying to create an otl which can paint colors on a geometry(some thing like paint sop), but I found that the brush tool handle only can be accessed when the paint sop node is selected. Is there a way that I can use the brush tool/ handle when I select my OTL? or I can tweak the paint sop node and save my tweaked version paint SOP as a sop OTL?
Technical Discussion » python object type
- laiwayne
- 58 posts
- Offline
In HDA PythonModule section, I know the functions we write is a “function type.”
for example, in an OTL, right click-> type properties->Scripts->PythonModule
we write a function called count():
def count(a = 0):
a = a + 1
return a
and in the houdini python shell we type this:
>>>import inspect
>>>myfunction = hou.node(“/obj/myOTL”).hdaModule().count
>>>inspect.isfunction(myfunction)
this returns True, so we know the count() is a function in houdiniPython
everything is good here, but I am wondering what type this is
hou.node(“/obj/myOTL”).hdaModule()
this is not a module, class, neither a method. How hodiniPython define it?
for example, in an OTL, right click-> type properties->Scripts->PythonModule
we write a function called count():
def count(a = 0):
a = a + 1
return a
and in the houdini python shell we type this:
>>>import inspect
>>>myfunction = hou.node(“/obj/myOTL”).hdaModule().count
>>>inspect.isfunction(myfunction)
this returns True, so we know the count() is a function in houdiniPython
everything is good here, but I am wondering what type this is
hou.node(“/obj/myOTL”).hdaModule()
this is not a module, class, neither a method. How hodiniPython define it?
Technical Discussion » top level of PyhonModule
- laiwayne
- 58 posts
- Offline
Technical Discussion » top level of PyhonModule
- laiwayne
- 58 posts
- Offline
from functools import wraps
import inspect
def foo(func):
print “wrap”
@wraps(func)
def with_logging(*args, **kwargs):
print func.__name__ + “ wrapped”
return func(*args, **kwargs)
print “wrapII”
print inspect.getmodule(func), func.__name__
setattr(inspect.getmodule(func), func.__name__, with_logging)
return with_logging
def toWrap(x):
print x + x * x
foo(toWrap)
toWrap(2)
so, run this code outside houdini is okay, but error raised inside type properties.
this will make my question more clear
Technical Discussion » top level of PyhonModule
- laiwayne
- 58 posts
- Offline
no, sadly the error message shows up.
“AttributeError: ‘None’ object has no attribute ''functionName”
seems “None” module has no attribute.
“AttributeError: ‘None’ object has no attribute ''functionName”
seems “None” module has no attribute.
Technical Discussion » top level of PyhonModule
- laiwayne
- 58 posts
- Offline
Wrap a function form other external module code.
the code would be setarrt(module, function_name, wrapper)
so the error message is: “None” object has no attribute function_name
because there is a __main__ top level module when I run the wrap module in a regular Python shell, it runs without error.
the code would be setarrt(module, function_name, wrapper)
so the error message is: “None” object has no attribute function_name
because there is a __main__ top level module when I run the wrap module in a regular Python shell, it runs without error.
Technical Discussion » top level of PyhonModule
- laiwayne
- 58 posts
- Offline
Here is a simple script in my OTL Operator Type Properties:
=====================================
import inspect
def runFunction():
print inspect.getmodule(runFunction)
runFunction()
=====================================
when I run this scripts inside Operator Type Properties, it returns “None”.
However, that is not what i expect. I thought I would get at least a “hou” or “PyhonModule” module.
It returns me “__main__” if I run this script in a regular python shell outside houdini. It is the way I want.
Does there anyone know the reason why houdini has a “None” top level and is there any way to cheat houdini, to created a fake temp top level module inside my OTL Operator Type Properties?
=====================================
import inspect
def runFunction():
print inspect.getmodule(runFunction)
runFunction()
=====================================
when I run this scripts inside Operator Type Properties, it returns “None”.
However, that is not what i expect. I thought I would get at least a “hou” or “PyhonModule” module.
It returns me “__main__” if I run this script in a regular python shell outside houdini. It is the way I want.
Does there anyone know the reason why houdini has a “None” top level and is there any way to cheat houdini, to created a fake temp top level module inside my OTL Operator Type Properties?
Houdini Indie and Apprentice » is there a way to change Rotate Axis
- laiwayne
- 58 posts
- Offline
Pagefan
On object level use the rotate channels, on sop level use a transform sop…
I mean rotate Axis not rotate channel
Houdini Indie and Apprentice » is there a way to change Rotate Axis
- laiwayne
- 58 posts
- Offline
Wolfwood
You can use the ‘ key to reorient the handle any way you like. Hit ’ again to reattach it to the geometry.
thank you. but that didnt work. since I rotate the handle, the geometry is in same position and rotation. ' key seems only rotate the handle not the geo.
Houdini Indie and Apprentice » is there a way to change Rotate Axis
- laiwayne
- 58 posts
- Offline
is there a way to change Rotate Axis?
not Pivot position, does houdini has a thing like Maya Rotate Axis(under Transform Attributes)?
not Pivot position, does houdini has a thing like Maya Rotate Axis(under Transform Attributes)?
Technical Discussion » Exporting Houdini Particles to Maya
- laiwayne
- 58 posts
- Offline
RatmannAllegro
I've got access to Maya, so I'll be sure to test :-)
Thanks Rick and Mark
edit: Except I'm on the 10.0.295 still :*(
Well you're in luck, cuz I just downloaded the silly thing and compiled it for you :-P
Let me know if this works for you, I won't have access to my machine all day since I'll be at work , so if something doesn't work I won't be able to update until tonight.
thanks for sharing. this dso seems export Houdini particles into a .bin file.
Does maya read a .bin file? or is there anyway to convert .bin to .pdc ?
-
- Quick Links