Author Topic: Command Line question  (Read 175 times)

0 Members and 1 Guest are viewing this topic.

Offline carterhickmandesigns

  • Newbie
  • *
  • Posts: 48
Command Line question
« on: February 10, 2019, 10:18:08 pm »
I am trying to evoke a script thru python on the command line and getting 'lux' not defined.  If I am running the script via command line do I need to import the lux and lux.math modules?  If so how?  I have looked thru the 'bin' folder and the 'modules' folders but no luck so far.

The script is very simple and trying to run it on a scene that is already open.  I feel like I need to import a module or something.  Can you tell I am new to command line stuff  ;D

# AUTHOR
# VERSION 0.0.0
# Write description of the script here, and put your code after these lines.

print ("testing")
lux.setCamera('Camera 1')


Thanks in advance
Carter

Offline carterhickmandesigns

  • Newbie
  • *
  • Posts: 48
Re: Command Line question
« Reply #1 on: February 12, 2019, 06:53:02 pm »
Anybody?

Offline HamedHem

  • Newbie
  • *
  • Posts: 11
Re: Command Line question
« Reply #2 on: March 27, 2019, 01:06:44 am »
From KeyShot Scripting Documentation :

Running KeyShot on the command-line: keyshot.exe (optional file to open) -script <python script file> (optional script arguments..)

Here is an example on how to run script from CLI
/Applications/KeyShot8.app/Contents/MacOS/keyshot -script /Desktop/test.py

There is no need to import KeyShot main modules in script, to make sure it's working fine with your scene file , add your scene file path to the command :

/Applications/KeyShot8.app/Contents/MacOS/keyshot  /Desktop/sample_scene.bip -script /Desktop/test.py

regards.