def node_OnCreated(node): # Skip asset internal nodes if (node.isInsideLockedHDA()==True): return if LYNX_analytics.enabled(lambda : int(1-hou.ui.displayMessage(title="LYNX | Analytics",text="We use Google Analytics to collect data about our tools. \n You can find out more about what data is collected on the LYNX GitHub Page. \n Do you want to enable data collection?", buttons=("Yes", "No")))): node_hda_file_path = node.type().definition().libraryFilePath() LYNX_analytics.event_send(hou.applicationPlatformInfo(),hou.applicationName(),hou.applicationVersionString(),hou.licenseCategory().name(),"Plugin", "SideFX/Houdini/otls/"+os.path.split(node_hda_file_path)[-1], str(node.type().name()), 0)
def keyGen(): ''' This function generates a validation key for host app''' if hou.isApprentice(): return 'app' else: if hou.applicationName() == 'hindie': return 'ind' else: return 'com'
def node_OnCreated(node): # Skip asset internal nodes if (node.isInsideLockedHDA() == True): return if enabled(): node_hda_file_path = node.type().definition().libraryFilePath() LYNX_analytics.event_send( hou.applicationPlatformInfo(), hou.applicationName(), hou.applicationVersionString(), hou.licenseCategory().name(), "Plugin", "SideFX/Houdini/otls/" + os.path.split(node_hda_file_path)[-1], str(node.type().name()), 0)
def __init__(self, connected): QtGui.QFrame.__init__(self) self.CLIENT_TYPE = [ HComHoudiniUtils.CLIENT_TYPE.HOUDINI, hou.applicationName() + " " + hou.applicationVersionString() ] self.updateUiThread = HComHoudiniWidgets.UiUpdaterThread() self.updateUiThread.update_ui_signal.connect(self._updateUi) self.updateUiThread.append_message_signal.connect( self._appendMessageToTab) self.updateUiThread.input_data_signal.connect(self._getInputData) self.updateUiThread.data_received_update.connect( self._dataReveivedUpdate) self.updateUiThread.start() self.connected = connected if hou.session.HCOM_TABS != {}: self.USER_TABS = hou.session.HCOM_TABS else: self.USER_TABS = {} if not self.connected: self.hcc = False self.ID = "" else: self.hcc = hou.session.HCOMCLIENT[0] self.ID = hou.session.HCOMCLIENT[1] self.mainLayout = QtGui.QVBoxLayout() self.mainLayout.setSpacing(10) self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal) self.centralLayout = QtGui.QVBoxLayout() self.centralWidget = QtGui.QWidget() self.__init_header() self.__init_userList() self.__init_centralWidget() # Set Layout self.splitter.setSizes([100, 500]) self.splitter.setStyleSheet( '''QSplitter::handle:vertical{height: 2px}''') self.mainLayout.addWidget(self.splitter) self.setLayout(self.mainLayout)
def __init__(self, connected): QtGui.QFrame.__init__(self) self.CLIENT_TYPE = [HComHoudiniUtils.CLIENT_TYPE.HOUDINI, hou.applicationName() + " " + hou.applicationVersionString()] self.updateUiThread = HComHoudiniWidgets.UiUpdaterThread() self.updateUiThread.update_ui_signal.connect(self._updateUi) self.updateUiThread.append_message_signal.connect(self._appendMessageToTab) self.updateUiThread.input_data_signal.connect(self._getInputData) self.updateUiThread.data_received_update.connect(self._dataReveivedUpdate) self.updateUiThread.start() self.connected = connected if hou.session.HCOM_TABS != {}: self.USER_TABS = hou.session.HCOM_TABS else: self.USER_TABS = {} if not self.connected: self.hcc = False self.ID = "" else: self.hcc = hou.session.HCOMCLIENT[0] self.ID = hou.session.HCOMCLIENT[1] self.mainLayout = QtGui.QVBoxLayout() self.mainLayout.setSpacing(10) self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal) self.centralLayout = QtGui.QVBoxLayout() self.centralWidget = QtGui.QWidget() self.__init_header() self.__init_userList() self.__init_centralWidget() # Set Layout self.splitter.setSizes([100,500]) self.splitter.setStyleSheet('''QSplitter::handle:vertical{height: 2px}''') self.mainLayout.addWidget(self.splitter) self.setLayout(self.mainLayout)
def host_info(self): """ :returns: A {"name": application name, "version": application version} dictionary with informations about the application hosting this engine. References: latest: http://www.sidefx.com/docs/houdini/hom/hou/applicationVersion """ host_info = {"name": "houdini", "version": "unknown"} if hasattr(hou, "applicationVersionString"): host_info["version"] = hou.applicationVersionString() else: # Fallback to older way host_info["version"] = ".".join([str(v) for v in hou.applicationVersion()]) if hasattr(hou, "applicationName"): host_info["name"] = hou.applicationName() return host_info
def houVer(): houTypeRaw = hou.applicationName() houApp = hou.isApprentice() houType = "houdiniDefault" addedWarning = 0 if houTypeRaw == "houdini" and houApp == True: houType = "Houdini Apprentice" addedWarning = 1 elif houTypeRaw == "houdini": houType = "Houdini" addedWarning = 0 elif houTypeRaw == "hescape": houType = "Houdini Escape" addedWarning = 1 elif houTypeRaw == "engine": houType = "Houdini Engine" addedWarning = 0 print "Launching " + houType + " Version: " + hou.applicationVersionString( ) if addedWarning == 1: print "Warning: Dynamics not accessible in this version."
def get_product(cls): """e.g. houdini.""" return hou.applicationName()
# Copyright (c) 2021 Christian Corsica. All Rights Reserved. import hou import setup # if in batch mode, don't load deferred eval since it is only available in graphical mode if hou.applicationName() == 'hbatch': pass else: import hdefereval hdefereval.executeDeferred(setup.piperTools)
def load_example(source, launch=False): global index, manager global _PYTHON_PANEL_EXAMPLE # Convert string to boolean # launch = str(launch).lower() == "true" if bookish_app is None: # If the flask app is None, then houdinihelp.initialize() was not # called. # # If initialize() was not called, then this function must be running # inside a central help server. In which case, we will not be able to # load examples in this process. So we raise an exception and exit # early. raise Exception("Cannot load example from a central help server.") import hou ext = paths.extension(source) if ext not in (".hda", ".otl", ".pypanel"): hou.ui.displayMessage("Don't know how to load example file %r" % source, severity=hou.severityType.Error) return if launch: # Launch a new Houdini to load the example # We'll use the HScript 'unix' command instead of shelling out # from Python just so we know $HFS will work... command = "unix %s %s %s" % (hou.applicationName(), load_script_path, source) hou.hscript(command) elif source.endswith(".pypanel"): # We need to open a Python Panel in the desktop which can only be done # by the main thread. So we register a callback with Houdini's event # loop to guarantee that the actual work is executed in the main thread. _PYTHON_PANEL_EXAMPLE = source hou.ui.addEventLoopCallback(_load_python_panel_example) else: # Load the OTL into Houdini and instantiate the first Object asset we # find inside hou.hda.installFile(source) target_hda = None hda_defs = hou.hda.definitionsInFile(source) for hda in hda_defs: if hda.nodeTypeCategory().name() == "Object": target_hda = hda break if target_hda is None: hou.ui.displayMessage("Could not find example HDA in OTL file %r" % source, severity=hou.severityType.Error) nodetypename = hda.nodeType().name() objnet = hou.node("/obj") hda_node = objnet.createNode(nodetypename, exact_type_name=True) # Make sure that the HDA node is unlocked so that the user can play # around with it. propagate = True hda_node.allowEditingOfContents(propagate)