Forgot your password?   Click here   •   No account yet?   Please Register    •   Or login using  
EN Login
SideFX Homepage
  • Products
    • What's New in H20.5
      • Overview
      • VFX
      • Copernicus
      • Animation
      • Rigging
      • Lookdev
    • Houdini
      • Overview
      • FX Features
      • CORE Features
      • Solaris
      • PDG
    • Houdini Engine
      • Overview
      • Engine Plug-Ins
      • Batch
    • Karma Renderer
    • Compare
    • SideFX Labs
    • Partners
  • Industries
    • Film & TV
    • Game Development
    • Motion Graphics
    • Virtual Reality
    • Synthetic Data for AI/ML
  • Community
    • Forum
    • News Feed
      • Overview
      • Project Profiles
      • Houdini HIVE Events
      • Contests & Jams
    • Gallery
    • Event Calendar
    • User Groups
    • Artist Directory
  • Learn
    • Tutorials
      • Overview
      • My Learning
      • Learning Paths
      • Tutorial Library
    • Content Library
    • Tech Demos
    • Talks & Webinars
    • Education Programs
      • Overview
      • Students
      • Instructors
      • Administrators
      • List of Schools
      • Resources
  • Support
    • Customer Support
    • Licensing
      • Overview
      • Commercial
      • Indie
      • Education
    • Help Desk | FAQ
    • System Requirements
    • Documentation
    • Changelog / Journal
    • Report a Bug/RFE
  • Try | Buy
    • Try
    • Buy
    • Download
    • Contact Info
 
Advanced Search
Forums Search
Found 2 posts.

Search results Show results as topic list.

Houdini Engine API » HDAs Changing script language from Hscript to Python

User Avatar
p.vazquez
2 posts
Offline
 June 6, 2025 17:44:44
Solved it, just needed to include:
setExtraFileOption(name, value, type_hint = hou.fieldType::NoSuchField)
as seen on the documentation.

So now it's just:
hda_def.addSection("PythonModule", str(scriptPA))
hda_def.setExtraFileOption('PythonModule/IsPython', True)
hda_def.addSection("OnCreated", str(scriptOC))
hda_def.setExtraFileOption('OnCreated/IsPython', True)
Edited by p.vazquez - June 6, 2025 17:46:05
See full post 

Houdini Engine API » HDAs Changing script language from Hscript to Python

User Avatar
p.vazquez
2 posts
Offline
 June 4, 2025 18:16:19
Hello, been working on automating some HDAs parameters creation using the following python script:

import hou 

def python_module_script():
    pythonScript1 = 'def onCreated(node):\n    node.setColor(hou.Color((0.0, 0.0, 0.0)))\n    node.setUserData("nodeshape", "diamond")'
    pythonScript2 = 'kwargs["node"].hdaModule().onCreated(kwargs["node"]);'
    return pythonScript1, pythonScript2


hda_node = subnet.createDigitalAsset(
    name=hda_name,
    hda_file_name=hdalib_dic + hda_name + ".hda",
    description=hda_name,
    min_num_inputs=0,
    max_num_inputs=0,
    install_path=hdalib_dic,
    ignore_external_references=True,
    create_backup=True,
)

hda_node.setName(hda_name)
hda_def = hda_node.type().definition()

scriptPM, scriptOC = python_module_scripts()

hda_def.addSection("PythonModule", str(scriptPM))
hda_def.addSection("OnCreated", str(scriptOC))

What I want to include is to make sure the scripting language on the Edit Operator Type Properties menu > scripts > Edit as dropdown changes from Hscript to Python, does anybody know how to do that?
See full post 
  • Quick Links
Search links
Show recent posts
Show unanswered posts
PRODUCTS
  • Houdini
  • Houdini Engine
  • Houdini Indie
LEARN
  • Talks & Webinars
  • Education Programs
SUPPORT
  • Customer Support
  • Help Desk | FAQ
  • Documentation
  • Report a Bug/RFE
  • Sales Inquiry
LEGAL
  • Terms of Use
  • Privacy Policy
  • License Agreement
  • Accessibility
  • Responsible Disclosure Program
COMPANY
  • About SideFX
  • Careers
  • Press
  • Internships
  • Contact Info
Copyright © SideFX 2025. All Rights Reserved.

Choose language