Jump to content

Openport, Python And Win32


rdg

Recommended Posts

Hello again,

I now try to get into houdini and picked a project.

A lot of my projects depend on external data and I am now trying to get my external data into houdini.

I guess there are a lot of ways to do this.

I got the pythontohoudini-bridge working and already set some flags of objects with python. [1]

This lead me to a lot of questions:

Can I use this technique to "poll" data from python every frame and change properties over time?

If I execute openport -r "python myScript.py" 12000 in the textport the console tells me "Error running python" - where can I set the paths for houdini to look for external programs?

Can I put 'openport -r "python myScript.py" 12000' in a channel ? I guess not, as this script cannot return a value ...

Should this be triggered at frame change?

I even thought about encoding my textfiles as images and read them with chops (?) but I can not find ord/chr functions inside houdini to return the numbers to letters.

My question should be:

How can I read data from external files, that are not images, hips or the like?

thank you for your patience,

Georg

[1] http://odforce.net/wiki/index.php/PythonTo...ni#Introduction

Link to comment
Share on other sites

What kind of data are you trying to read in?

You can read in data with chops, using a file chop. Raw data can be read in simply my making a file with the .chan extension on it. Every row in the file is treated as a frame and each column is a channel.

This data can then be passed to anywhere else in Houdini you like.

Edited by sibarrick
Link to comment
Share on other sites

sibarrik,

thank you.

This helps alot and I will try this right now.

I want to parse a xml file.

I have a python script that returns ie. random chunks of tags. (Or you add arguments to the command line to have control over the picking of the chunks).

So I want houdini to call the script every frame and get some answer back.

Thats what I thought I need to do :rolleyes:

Georg

Link to comment
Share on other sites

That might be a bit more tricky. Chan files read data for an entire frame range at once.

You might want to check out the unix sop.....

Is this for a realtime thing? or can you parse everything first and then create a data file that houdini can read.

i must admit I'm still a little hazy about what you are trying to achieve.

Link to comment
Share on other sites

i must admit I'm still a little hazy about what you are trying to achieve.

me, too.

I am trying to wrap my head around the concepts of data-flow.

I have a long list of strings (names).

I want to use this strings in various context of houdini.

Sure I should shuffle the strings and write a textfile.

That way I can concentrate on more obvious problems :)

Georg

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...