Execute Python script in host app

   5750   4   0
User Avatar
Member
76 posts
Joined: Jan. 2009
Offline
Hello
Does possible to execute python script in host app?
If i missed in manual, please point at article

For example HE4C4D has not curve output.

I think about creation and execution pyObject/Script inside host for creation of splines/curves.

import c4d
def main():

spline = c4d.BaseObject(c4d.Ospline)
spline.ResizeObject(num)
for index in xrange(num):
stuff to create structure/form of spline
spline.SetPoint(index, pos)
return spline

example in c4d


http://oi62.tinypic.com/25s1lxv.jpg [oi62.tinypic.com]
i'm sorry for my English
User Avatar
Member
402 posts
Joined: March 2013
Offline
It may be possible, however, it is not recommended nor supported.

The only reason this might work is that Houdini Engine might be using the host's python modules (in your case, C4D's python) and so you can import c4d modules and use them in your asset.

However, there are two major drawbacks to this approach.

One is that there is no way to test your asset inside Houdini so you have to build your asset blindly and hope it works in C4D.

The other problem is that the approach might stop working in future versions of the plugin. There are plans to move Houdini Engine into a separate process to improve reliability and allow for multiple Houdini Engine sessions at the same time. If Houdini Engine runs in a different process than C4D your assets will no longer have access to C4D's python modules and your solution will stop working.

So, in brief, executing python scripts in host app is not supported.
User Avatar
Member
76 posts
Joined: Jan. 2009
Offline
Thanks for reply.
Argh, i hope at pyScript Object in h15, looking at teaser. seems i miss

Damian, i also thinking about reflection in in-line c++ in h to c4d(not only python). One c4d developer has experience in reflection code to another and he support c4d core commands:
1. https://github.com/Remotion/reflect [github.com]
2. http://www.c4dpp.org [c4dpp.org]
i'm sorry for my English
User Avatar
Member
402 posts
Joined: March 2013
Offline
In-line C++ access from Houdini to C4D is equally not supported and mostly likely not possible in most circumstances.

I recommend you instead submit feature requests to Maxon/C4D for the types of operations you want to do on the C4D side or via the Houdini Engine plugin. There might be more reliable ways to achieve the same affect without connecting the two runtimes in such tight way.
User Avatar
Member
76 posts
Joined: Jan. 2009
Offline
Hello damian
Thank you

i'm sorry for my English
  • Quick Links