Giter Site home page Giter Site logo

hpaste's People

Contributors

pedohorse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hpaste's Issues

Make it working not only via Shelf but also via Menu

As a user who is not using Shelf or strive to minimize it usage as much as possible since it uses so much space I hide it in 99% of time. So I am trying to add Submenu in the Edit menu to get access to main commands instead of Shelf.
Unfortunately currently the scripts are working only from Shelf.
It would be nice to make it possible to invoke scripts from menu as well.
Currently I am getting this error when trying to invoke Paste or Paste Web commands from the menu.
Snag_3ba48e
Snag_3c3ab3

I am using this code to generate Submenu file โ€“ MainMenuCommon.xml

<?xml version="1.0" encoding="UTF-8"?>

<mainMenu>
    <menuBar>
    <subMenu id="edit_menu">
    <subMenu id="hpaste_menu">
    <label>HPaste</label>
    <insertAfter>h.paste</insertAfter>
    <scriptItem id="hpaste_copy">
        <label>Copy</label>
        <scriptCode>
<![CDATA[
try:
    from PySide2.QtWidgets import QApplication
except:
    from PySide.QtGui import QApplication

import hpaste

def do():
    try:
        nodes=hou.selectedItems()
    except:
        nodes=hou.selectedNodes()
    if len(nodes) == 0:
        hou.ui.displayMessage("No nodes are selected!",severity=hou.severityType.Error)
        return
    try:
        s=hpaste.nodesToString(nodes)
    except RuntimeError as e:
        hou.ui.displayMessage("Error: %s"%str(e),severity=hou.severityType.Error)
        return
    except RuntimeWarning as e:
        hou.ui.displayMessage("Warning: %s"%str(e),severity=hou.severityType.Warning)
    except Exception as e:
        hou.ui.displayMessage("Internal Error: %s"%str(e),severity=hou.severityType.Error)
        return

    if hou.applicationVersion()[0] > 15:
        hou.ui.copyTextToClipboard(s)
    else:
        qapp = QApplication.instance()
        qapp.clipboard().setText(s)
    
do()
]]>
        </scriptCode>
        </scriptItem>
    <scriptItem id="hpaste_paste">
        <label>Paste</label>
        <scriptCode>
<![CDATA[
try:
    from PySide2.QtWidgets import QApplication
except:
    from PySide.QtGui import QApplication

import hpaste
import hpaste.hpasteoptions as opt

def do(pane):
    if hou.applicationVersion()[0] > 15:
        s = hou.ui.getTextFromClipboard()
    else:
        qapp = QApplication.instance()
        s = qapp.clipboard().text()

    geonode = None
    for _ in range(2):
        try:
            hpaste.stringToNodes(s, ne=pane, hou_parent=geonode)
        except hpaste.InvalidContextError as e:
            nec, snc = e.contexts()
            if snc == 'Sop' and nec == 'Object':
                if hou.ui.displayMessage("Error: %s" % str(e), severity=hou.severityType.Warning, buttons=('Create geo node', 'Cancel'), default_choice=0, close_choice=1) == 0:
                    if geonode is not None:
                        raise RuntimeError('are we in an infinite loop?')
                    geonode = e.node().createNode('geo')
                    if pane is not None:
                        geonode.setPosition(pane.cursorPosition())
                    pane = None
                    continue
            else:
                hou.ui.displayMessage("Error: %s"%str(e),severity=hou.severityType.Error)
                return
        except RuntimeError as e:
            hou.ui.displayMessage("Error: %s"%str(e),severity=hou.severityType.Error)
            return
        except RuntimeWarning as e:
            hou.ui.displayMessage("Warning: %s"%str(e),severity=hou.severityType.Warning)
        except Exception as e:
            hou.ui.displayMessage("Internal Error: %s"%str(e),severity=hou.severityType.Error)
            return
        break

do(kwargs['pane'])
]]>
        </scriptCode>
        </scriptItem>
    <scriptItem id="hpaste_webcopy">
        <label>Copy Web</label>
        <scriptCode>
<![CDATA[
from hpaste.hpasteshelffunctions import hcopyweb
hcopyweb()
]]>
        </scriptCode>
        </scriptItem>
    <scriptItem id="hpaste_webpaste">
        <label>Paste Web</label>
        <scriptCode>
<![CDATA[
from hpaste.hpasteshelffunctions import hpasteweb
hpasteweb(kwargs['pane'])
]]>
        </scriptCode>
        </scriptItem>
    </subMenu>
    </subMenu>
    </menuBar>
</mainMenu>

Stop requiring access to private gists

Private gists are private. There's no reason this application should require access to them. It's sketchy, potentially a security vulnerability, etc.

Erro Collection - houdini 18

Good afternoon my friend.
I'm having a type of error in houdini18 which is as follows:

I cannot add nodes to my collection.
Then I have to go back to houdini 17, have him add it to my collection and then he appears on 18.

When you order your collection to be added at 18, he does not open the window to enter the name and send it.

Thank you very much .. Your plugin is fantastic.

make async!

uploading must become async in case of long upload times

  • a small borderless dragable window will popup
  • right click on it will be able to disable the upload
  • must not steal focus
  • must not be annoying

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.