News:

 

Topic: Instructions.txt  (Read 4914 times)

0 Members and 1 Guest are viewing this topic.

  • No avatar
  • Posts: 976
  • Polygon
September 23, 2016, 12:37:14 pm
What is the syntax of instructions that are passed to NVil via instructions.txt file?

  • No avatar
  • Posts: 976
  • Polygon
September 23, 2016, 08:16:32 pm
Anyone?
All I need is to tell NVil to launch Clipboard Paste or Clipboard Paste (Replace) command.
Or maybe I'm misunderstanding the purpose of instructions.txt. What I assumed, is that it is used for communication between external programs and NVil.
« Last Edit: September 23, 2016, 09:05:54 pm by rubberDuck »

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
September 23, 2016, 11:28:45 pm
Instruction.txt is for programers. You wrote instructions inside this file than you send to NVil special windows message, when NVil recive it, it starts to perform that instructions. It is for communication between different apps.
Is it what you are looking for?
Portfolio: www.samardac.com

  • No avatar
  • Posts: 976
  • Polygon
September 24, 2016, 12:37:37 am
Instruction.txt is for programers. You wrote instructions inside this file than you send to NVil special windows message, when NVil recive it, it starts to perform that instructions. It is for communication between different apps.
Is it what you are looking for?
This is what I'm looking for. Is there any documentation anywhere on how to issue instructions to NVil via that file?

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
September 24, 2016, 05:14:46 am
Search this forum, there is thread about it.
Portfolio: www.samardac.com

  • No avatar
  • Posts: 976
  • Polygon
September 24, 2016, 08:27:55 am
Search this forum, there is thread about it.
The problem is I already did search the forum and there isn't much about instructions.txt file. Only bits of information here and there, like some bug reports and requests regarding that file or some requests re: initialize_instructions.txt.
From what I was able to put together, I understand that the file is basically an exported composite tool. However the fact that it needs to have a .txt file extension while composite tools are in XML puzzles me.

Can you kindly point me to a thread which holds a full explanation of how to use this functionality?

  • No avatar
  • Posts: 976
  • Polygon
September 24, 2016, 02:39:05 pm
Okay, I get it. NVil Instructions.txt should contain Tool IDs.

  • No avatar
  • Posts: 976
  • Polygon
September 24, 2016, 02:54:53 pm
The file path must be like this
C:\Users\UserName\AppData\Roaming\DigitalFossils\NVil\NVil Instructions.txt
Hm... I can't get NVil to automatically read the NVil Instructions.txt file when it's placed in the %APPDATA%\DigitalFossils\NVil path. It does read it fine from NVil installation directory via File->Execute External Instruction File though. Any idea why it's stubborn when it comes to the one from %APPDATA%?

  • No avatar
  • Posts: 976
  • Polygon
September 24, 2016, 09:47:06 pm
I have a correct handle to NVil's window (I verified this by fiddling with ShowWindow() function), "NVil Instructions.txt" file is in "%APPDATA%\DigitalFossils\NVil" directory and contains a single command: "TID Object Shortcut Tools >> Create Box #".

With SendMessage() function I'm sending 41251, but nothing happens. What am I missing?

  • No avatar
  • Posts: 3705
  • Developer
  • Administrator
  • Polygon
September 25, 2016, 09:02:31 am

  • No avatar
  • Posts: 976
  • Polygon

  • No avatar
  • Posts: 976
  • Polygon
September 25, 2016, 11:31:49 pm
IStonia, do you think it would be problematic to implement a server that would listen to UDP or TCP communication incoming to a user-customizable port on localhost? So that we could issue commands to NVil through strings with that socket, similarly to insctructions from "NVil Instructions.txt" file? Or at least to tell NVil to read the instructions file by sending him a boolean, string or whatever?

Win32 API messages are nice, but Python version that comes with Houdini isn't compatible with pywin32 module (my guess, it was compiled with a differend VS than the DLLs of pywin32 were), so sending messages to NVil is complicated because it requires a separate CPython version to act as a catalyst (or pywin32 recompilation with the same compiler that Houdini Python was compiled with. And I have no idea which compiler was used to compile the latest Houdini's Python).

Socket communication on the other hand is supported by default in Python, so no external Python version would be necessary in order to send NVil a message.

What do you think about it?
« Last Edit: September 25, 2016, 11:33:57 pm by rubberDuck »

  • No avatar
  • Posts: 3705
  • Developer
  • Administrator
  • Polygon
September 27, 2016, 08:34:46 am
That sounds too complicated.

Try this
http://www.digitalfossils.com/Download/NVil-Sep-27-16.rar

Instead of sending window message, you can send a text file "NVil Message_In.txt" with this content "Execute External Instruction File" to "%APPDATA%\DigitalFossils\NVil". Make sure 3DC Applink is enabled.


  • No avatar
  • Posts: 976
  • Polygon
September 29, 2016, 09:56:26 pm
That sounds too complicated.

Try this
http://www.digitalfossils.com/Download/NVil-Sep-27-16.rar

Instead of sending window message, you can send a text file "NVil Message_In.txt" with this content "Execute External Instruction File" to "%APPDATA%\DigitalFossils\NVil". Make sure 3DC Applink is enabled.
It's okay, IStonia. I spent the last weekend and Monday familiarizing myself with Win32 API and possible solutions to the problem with Python bundled with Houdini, and I came up with a solution. I decided to use a standalone executable that is basically one module bundled with an official distro of Python and pywin32 with its DLLs, that is launched from Houdini in a separate process, and is used to notify NVil (through SendMessage()) about updated clipboard file. Works fine, at least on my workstation. :)

I will need to look for some artists that would test the AppLink before I release it though. People who use NVil as a companion program for Houdini.

  • No avatar
  • Posts: 976
  • Polygon
December 19, 2017, 11:49:24 pm
If I want to pass a program executable and several arguments to it via the Launch App(*) command, how do I do it? Path to executable contains white characters (spaces):
Code: [Select]
C:\Program Files\Side Effects Software\Houdini 16.5\bin\hython.exe
So I enclose it in double quotes. I'd like to launch it with at least one parameter (the final target are two parameters), for example:
Code: [Select]
c:\users\myprofile\documents\houdini16.5\python27libs\myscript.py
It might also contain white spaces, so I also enclose it in double quotes. When I launch the composite tool, where Launch App(*) Param input string is a combination of the two:
Code: [Select]
"C:\Program Files\Side Effects Software\Houdini 16.5\bin\hython.exe" "c:\users\myprofile\documents\houdini16.5\python27libs\myscript.py"
I get File not found error, even though both paths are valid.