Skip to content

Commit 9ca5d5a

Browse files
committed
Fix Houdini sample code
1 parent 705999b commit 9ca5d5a

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

examples/source_houdini/houdini_module.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
* (c) Andriy Babak 2022
33
*
44
* date: 05/08/2022
5-
* modified: 05/08/2022 17:13:48
5+
* modified: 05/08/2022 18:55:46
66
*
77
* Author: Andriy Babak
88
* e-mail: ababak@gmail.com
99
* ------------------------------
1010
* description: Sample Houdini module
1111
* ------------------------------
1212
* Call from Houdini Python:
13-
* import cgcpp
14-
* cgcpp.call("/obj", lib="houdini_module", func="ls")
15-
*
16-
* # Result: ['/obj/box1', '/obj/sphere1']
17-
*/
13+
* >>> import cgcpp
14+
* >>> cgcpp.call("/", lib="d:/cgcpp/out/houdini_module", func="ls")
15+
* ['/obj', '/out', '/ch', '/shop', '/img', '/img/comp1', '/vex', '/mat', '/stage', '/tasks', '/tasks/topnet1', '/tasks/topnet1/localscheduler']
16+
*/
17+
1818

1919
#include <iostream>
2020
#include <boost/format.hpp>
@@ -30,6 +30,15 @@
3030
using namespace std;
3131
namespace py = boost::python;
3232

33+
py::object raise_attribute_error(const string &error_message)
34+
{
35+
PyErr_SetString(
36+
PyExc_AttributeError,
37+
error_message.c_str());
38+
py::throw_error_already_set();
39+
return py::object();
40+
}
41+
3342
void traverse(OP_Network *parent, py::list &result)
3443
{
3544
OP_Node *node;
@@ -43,7 +52,7 @@ void traverse(OP_Network *parent, py::list &result)
4352
cout << full_path << "\n";
4453
if (node->isNetwork())
4554
{
46-
traverse(node, result);
55+
traverse((OP_Network *)node, result);
4756
}
4857
}
4958
}

0 commit comments

Comments
 (0)