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 156 posts.

Search results Show results as topic list.

Technical Discussion » Can $F be written in a Houdini node's parameter via Python?

User Avatar
Mohanpugaz
156 posts
Offline
 June 14, 2024 10:28:58
I just opened your hip file and had a look.

It looks like the exec() function is doing something here.

If you run the same script from the python source editor it sets the expression properly.
I dont have a solution for this case, but what i would do is make the subnet into hda and call the script from hda module so i can avoid the exec function.

Im too interested to know why this doesnt work when calling a script with exec() and how to fix.
Waiting for the experts!


import hou

switch = hou.node("/obj/geo1").createNode("switch")
exp = "$F4"
switch.parm("input").setExpression(exp)
See full post 

Technical Discussion » Extract the minimum and maximum values out of any node

User Avatar
Mohanpugaz
156 posts
Offline
 June 13, 2024 12:34:31
I think that is not straight forward inside of vops.

Two ideas i have.

1. you may use vex snippet to
iterate through all points and find maximum value. (You could also use for loop in vops)

2. You may store that value to a list/array, sort the array and get the last or first index.

Example here. You will Need to alter it to use inside vops.

int npts = @numpt;
float test_values[];
for (int i = 0; i < npts; i++) {
append(test_values, point(0, "test", i));
}

sort(test_values);

float max_value = test_values[-1];
Edited by Mohanpugaz - June 13, 2024 12:39:32
See full post 

Technical Discussion » Can $F be written in a Houdini node's parameter via Python?

User Avatar
Mohanpugaz
156 posts
Offline
 June 13, 2024 12:14:59
You should use this function.


setExpression(expression)
See full post 

Technical Discussion » How to run a python script node?

User Avatar
Mohanpugaz
156 posts
Offline
 May 31, 2024 06:34:55
I know this is pretty old post, still posting my method here so it may help people in future.

Python has this function called exec(string) which executes given string as a python code.

So you can simply do these steps

  1. create any node
  2. gear icon > edit parameter interface > create a multine string parm > optionally set it to python language for syntax highlight
  3. create a button > add a this in callback
    exec(hou.pwd().parm("your_string_parameter").eval())
    

It will get the string from multiline string parameter and runs it as python code.
obviously you can point this to parm from any node and run from that node.
this could be very handy when you want to store python codes in hip file itself. very much portable!

See full post 

Technical Discussion » Sweep Rotation Direction

User Avatar
Mohanpugaz
156 posts
Offline
 May 13, 2024 08:54:15
you can use an attribute (lets say `@twist_mask`) to control the twist, this attribute is a multiplier, so you can manipulate it as much you want such as re-mapping that using curveu attribute and use that mask to drive the twist.

Edited by Mohanpugaz - May 13, 2024 08:55:42
See full post 

Technical Discussion » Modifing Parm with Python

User Avatar
Mohanpugaz
156 posts
Offline
 May 2, 2024 08:08:37
Hi all, Ive read multiple forums regarding this but still not able to make it work.

Im trying to modify a custom `multiline string parm`
I want to change the language of it through python, say i have a dropdown to choose formatting whether python or vex.

here is what i did so far, I found the way to do this is using the .setTag() function to set {"editorlang : "python"}
i can see the tags are modified by printing my parmTemplateGroup but i couldnt see the change in the node.

Im not sure what im doing wrong, can someone help please?


import hou

n = hou.node('/obj/htip2')
g = n.parmTemplateGroup()

old_lang = g.find("code")
new_lang = old_lang
new_lang.setTags({"editorlang":"python"})

g.replace("code", new_lang)
n.setParmTemplateGroup(g)

print(new_lang.tags())
Edited by Mohanpugaz - May 2, 2024 08:09:37
See full post 

Technical Discussion » SideFX Labs conflict with Redshift houdini.env, in 19.5.569

User Avatar
Mohanpugaz
156 posts
Offline
 July 20, 2023 00:42:34
I have made two video tuts on how to install redshift and sidefx labs using the packages method, they work fine without any conflict. you can try them if you want.



See full post 

Technical Discussion » Dynamic Parameter Generation for Doors in Houdini

User Avatar
Mohanpugaz
156 posts
Offline
 July 17, 2023 05:10:47
I am afraid having too many controls would make the hda confusing and hard to use but nevertheless its good to know how to do this.

I just made a simplest example for this without using python. It might give you some insights on how you could go about it.

Since it is dynamically updating the parms each time the number of rooms increase or decrease, which ever parms you already setup might get destroyed. Hmm not really ideal, but here you go.


Image Not Found
See full post 

Technical Discussion » How to display local coordinate gnomon of packed prim?

User Avatar
Mohanpugaz
156 posts
Offline
 July 17, 2023 03:34:28
Matt's solution is great and to add to that,

I will use this button here to visualize the gnomon, i havent realized that button exists for a long time when i started with Houdini. so sharing for someone who might not know this.

See full post 

Technical Discussion » Adding Objects in Path using Primwrangle

User Avatar
Mohanpugaz
156 posts
Offline
 July 6, 2023 04:03:49
If you have multiple objects in each of the categories then you could set it up like this




Also attached .hiplc file if you wanna take a look
See full post 

Technical Discussion » Adding Objects in Path using Primwrangle

User Avatar
Mohanpugaz
156 posts
Offline
 July 6, 2023 03:51:06
to avoid merging, you would need to add the existing @name to the path
if(@name ~= "sphere*"){
s@path = concat("/shop/assets/Sphere/",s@name);
}

Edited by Mohanpugaz - July 6, 2023 03:53:57
See full post 

Technical Discussion » Solaris - Layout Node with different Variants

User Avatar
Mohanpugaz
156 posts
Offline
 July 6, 2023 03:15:43
If anyone trying to do this and couldnt find a way, here is what i figured out.

write you USD files with variants to disk(use the component builder for your advantage), then

- Create new asset database in the Layout Asset Gallery


- select a directory and give a name for your asset database


- you will get a fresh and empty gallery now



- click on the folder icon here to add your asset from disk


- in the directory input, select the parent directory of your asset you have written earlier, this should contain the .usd file inside of the dir in the same name as this dir, for example here i have my_assets_path/rock inside this rock dir i have a usd file called "rock.usd" if you use the component builder as i suggested it will write out in correct structure as needed.



- in the variant sets input, type the variant set name most cases you will need to type "geo" here



- hit ok. then your process begin, once done you will get each variant imported here in your database.





Hope that helps!
Edited by Mohanpugaz - July 6, 2023 03:17:58
See full post 

Houdini Indie and Apprentice » Accessing PDG inputs in Python expression

User Avatar
Mohanpugaz
156 posts
Offline
 July 4, 2023 01:02:35
And to get other attribute this is working well for me

result = work_item.attribValues()

for key, value in result.items():
    print(key, ' : ', value)
See full post 

Houdini Indie and Apprentice » Accessing PDG inputs in Python expression

User Avatar
Mohanpugaz
156 posts
Offline
 July 4, 2023 01:01:33
This helped me to access the output files of the upstream network. hope that might help someone.

results = parent_item.outputFiles
for i in results:
    print(i)
See full post 

PDG/TOPs » PDG - Python list to work items

User Avatar
Mohanpugaz
156 posts
Offline
 July 2, 2023 23:41:59
mestela
import hou

paths = [
'$HFS/houdini/pic/butterfly1.pic',
'$HFS/houdini/pic/butterfly2.pic',
'$HFS/houdini/pic/butterfly3.pic',
'$HFS/houdini/pic/butterfly4.pic'
]

for p in paths:
new_item = item_holder.addWorkItem()
new_item.setStringAttrib('texpath', hou.text.expandString(p))

This works perfect, the mistake I did was using the partitioner instead of the processor. silly me.

Thanks a lot for your valuable time!
See full post 

PDG/TOPs » PDG - Python list to work items

User Avatar
Mohanpugaz
156 posts
Offline
 July 1, 2023 09:42:39
Wow, Thanks a lot Matt. I was so close,and not aware of this function hou.text.expandString()
. I will try and get back.
See full post 

PDG/TOPs » PDG - Python list to work items

User Avatar
Mohanpugaz
156 posts
Offline
 July 1, 2023 01:51:36
PDG beginner here, I have a list of files in my python script, i want to create workitem or output them as attribute to process them further, please help.

Thanks!
See full post 

Houdini Indie and Apprentice » Accessing PDG inputs in Python expression

User Avatar
Mohanpugaz
156 posts
Offline
 June 28, 2023 06:44:51
Any ideas on how to do it. im facing the same roadblock right now. searching for solutions.
See full post 

Technical Discussion » How to change viewport color, disable grid from Python

User Avatar
Mohanpugaz
156 posts
Offline
 June 27, 2023 22:34:56
A quick snippet which can be added to shelf tool
this cycles between dark,light,and grey viewport bgs.

Just create a new shelf tool and add this code in the scripts section and don't forgot to set it to python.

## python snippet
def cycle_display_bg():
# init available schemes
light = hou.viewportColorScheme.Light
dark = hou.viewportColorScheme.Dark
grey = hou.viewportColorScheme.Grey

# add them to a list
schemes = [light,dark,grey]

# find the viewport display settings
viewport = hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer)
display_settings = viewport.curViewport().settings()

# apply the sceme
current_scheme = display_settings.colorScheme()

for s in schemes:
if s == current_scheme:
next_id = schemes.index(s)+1
next_id = next_id % len(schemes)
next_scheme = schemes[next_id]
display_settings.setColorScheme(next_scheme)
msg = f"viewport background set to {next_scheme.name()}"
hou.ui.setStatusMessage(msg)
return


cycle_display_bg()
### follow me on instagram @movfx

Thanks!
See full post 

PDG/TOPs » creating multiple mp4 files from flipbooks with ffmpeg top

User Avatar
Mohanpugaz
156 posts
Offline
 June 27, 2023 22:14:40
Thanks a lot Bondar Igor!
See full post 
  • First
  • 1
  • 2
  • 3
  • 4
  • Last
  • 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