Announcement

Collapse
No announcement yet.

Console Plugin - IronPython Interactive Console

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Utilities] Console Plugin - IronPython Interactive Console

    This is an Interactive Console for SBPR Studio to allow custom python scripts to be used to manipulate SBPR Studio and script scene changes and create screenshots. (This is the sister project to the same plugin for HoneySelect but necessarily different due to versions of Unity used.)

    I added a custom feature for creating Transparent background screenshots examples from included libraries are attached.

    In theory this can be a very powerful plugin for understanding and manipulating the Studio. I was not actively trying make it possible to create new behaviors in the game though I guess that is theoretically possible.


    To install:
    Download and unpack the sb-console-v1.0.7z file from the link below into the HoneySelect game folder. The plugin requires IPA to be installed so install the MF Patch + EMF Patch.

    To use:
    Press the Ctrl+` (backquote) keys at the same time. For international users you can change the console startup options from the Plugins\Console\Console.ini file if you dont have easy access to the backtick or prefer a different key. There is also an option to open on start.

    You can close the console using ^Z (Control-Z) + Enter or running quit(). I will note that once the console is closed after opening I cannot restart the console and have it work properly so that is disabled. The Studio will close if you close the console using the X button.

    I should note that manipulating Unity objects directly from the Console can crash the studio. I've introduced a library called coroutine to help run python functions properly in unity. If you put too much in a function then unity block and you never see anything so its best to only use the unity wrapper for short operations. You can look at the included examples for details.

    Examples:
    There is an example of manipulating the scene and taking screen captures (to png with transparent background) in the Lib folder named hanimtest.py. I've attached examples of the transparent background image that is generated. The algorithm I used is not a truly proper transparency test

    You can run it with following commands:
    >>> import hanimtest
    >>> hanimtest.run()

    You can just get screenshots using:
    >>> import sb
    >>> sb.capture()

    The website for the code and released version is here: Github Download. The real plugin code is in the unity-console repo under the same account while this link is most just the scripts.

    Its kinda hard to get a list of commands that would be possible and useful. Personally I use Reflector but the free dotPeek from jetbrains works extremely well.

    Its basically unsupported but I'll continue updating it for a little while.

    Note: I tried to use the build in mechanism for transparent backgrounds however I ran into issues with hair being too transparent so added a "fix" to attempt correction but its very imperfect if you look closely. Anyway the source is available for the screen shot in python if anyone can figure out or recommend a fix. You use import screenshot; screenshot.capture('', False) to disable the transparency and will generate a better capture with black background. Unlike HoneySelect I cannot figure out how to change background color from black to white to attempt a different approach.
    Console Screenshot Transparency issue Screenshot with fix
Working...
X