Forgot your password?   Click here   •   No account yet?   Please Register    •   Or login using  
EN Login
SideFX Homepage
  • Products
    • What's New in 19.5
      • Overview
      • Solaris
      • Karma
      • Character FX
      • Pyro FX
      • FLIP Fluids
    • Houdini
      • Overview
      • FX Features
      • CORE Features
      • Solaris
      • Houdini Indie
    • Houdini Engine
      • Overview
      • Engine Plug-Ins
      • Batch
    • PDG
      • Overview
      • FAQ
    • Compare
    • SideFX Labs
    • Partners
  • Industries
    • Film & TV
    • Game Development
    • Motion Graphics
    • Virtual Reality
  • Community
    • Forum
    • News Feed
    • Project Profiles
    • Gallery
    • Contests & Jams
    • Houdini HIVE Events
    • Event Calendar
    • User Groups
    • HEX Interview Show
  • Learn
    • Getting Started
    • My Learning
    • Learning Paths
    • Tutorials
    • Tech Demos
    • Talks & Webinars
    • Schools & Training
    • Education Programs
      • Overview
      • Students
      • Instructors
      • Administrators
  • Support
    • Customer Support
    • Help Desk | FAQ
    • System Requirements
    • Documentation
    • Changelog / Journal
    • Report a Bug/RFE
  • Get
    • Buy
    • Download
    • Content Library
    • Contact Info
 
Advanced Search
Forums Search
Found 335 posts.

Search results Show results as topic list.

Technical Discussion » Python States and Handles

User Avatar
sanostol
558 posts
Offline
 Dec. 31, 2020 06:59:55
Hello,

some questions about the python states and how to deal with handles properly.

1. The python state handle example creates a static and a dynamic handle. when You drag the static xform handle the connected parameters get a direct connection to the handle, as soon as You move the handle You, the connected parameters are highlighted in the parameter window and update during interaction.




I would like to have this behavior with a dynamic handle as well, but I could only come up with a slightly looser connection, by adding updates to the "onHandleToState" and "onStateToHandle" methods. Is there a better way to do this. Best would be to have it to behave the same way like a static handle.


2. I want to align the handle to a specific point on a input curve. The curve has a rot attribute with the rotation vector in it. I added a method to set the pivot on the handle. Now I want to call this method as soon as I enter the state, but could not find a way. the "onEnter" method seemed to be the right point for this, but i could not get access to the parameters of the handle and the node, the state is working on.

I called the methods on the "onHandleToState" and "onStateToHandle" methods but this does not work right and feels just wrong . The handle is transformed correctly as soon as I move it slightly.

Is there a way to call this initial method as soon as the states is entered?

"""
State:          handle a
State type:     handle_a
Description:    handle a
Author:         mmatzeder
Date Created:   December 31, 2020 - 09:53:26
"""

# Usage: Make sure to add 6 float parameters to the node:
# newparameter, newparameter2, newparameter3, newparameter4, newparameter5, newparameter6.
# Select node and hit enter in the viewer.

import hou
import viewerstate.utils as su

def positionHandle(node, parms):

    parms["px"] = node.node("Out").geometry().points()[0].position().x()
    parms["py"] = node.node("Out").geometry().points()[0].position().y()
    parms["pz"] = node.node("Out").geometry().points()[0].position().z()   
    parms["pivot_rx"] = node.node("Out").geometry().points()[0].attribValue("rot")[0]
    parms["pivot_ry"] = node.node("Out").geometry().points()[0].attribValue("rot")[1]
    parms["pivot_rz"] = node.node("Out").geometry().points()[0].attribValue("rot")[2]

class State(object):
    def __init__(self, state_name, scene_viewer):
        self.state_name = state_name
        self.scene_viewer = scene_viewer

        self.xform_handle = hou.Handle(self.scene_viewer, "Xform")

    def onEnter(self, kwargs):
        self.xform_handle.show(True)
        print self.xform_handle

    def onHandleToState(self, kwargs):
        """ Used with bound dynamic handles to implement the state 
        action when a handle is modified.
        """
        node = kwargs["node"]
        handle = kwargs["handle"]
        parms = kwargs["parms"]
        mod_parms = kwargs["mod_parms"]
        prev_parms = kwargs["prev_parms"]
        ui_event = kwargs["ui_event"]
        self.log(parms)
        if handle == self.xform_handle.name():
            positionHandle(node, parms)
            node.parm("tx").set(parms["tx"])
            node.parm("ty").set(parms["ty"])
            node.parm("tz").set(parms["tz"])
            node.parm("rx").set(parms["rx"])
            node.parm("ry").set(parms["ry"])
            node.parm("rz").set(parms["rz"])
            
    def onStateToHandle(self, kwargs):
        """ Used with bound dynamic handles to implement the handle 
        action when a state node parm is modified.
        """

        handle = kwargs["handle"]
        parms = kwargs["parms"]
        node = kwargs["node"]

        if handle == self.xform_handle.name():
            positionHandle(node, parms)
            parms["tx"] = node.parm("tx").evalAsFloat()
            parms["ty"] = node.parm("ty").evalAsFloat()
            parms["tz"] = node.parm("tz").evalAsFloat()
            parms["rx"] = node.parm("rx").evalAsFloat()
            parms["ry"] = node.parm("ry").evalAsFloat()
            parms["rz"] = node.parm("rz").evalAsFloat()
        self.log(parms)


def createViewerStateTemplate():
    """ Mandatory entry point to create and return the viewer state 
        template to register. """

    state_typename = kwargs["type"].definition().sections()["DefaultState"].contents()
    state_label = "handle a"
    state_cat = hou.sopNodeTypeCategory()

    template = hou.ViewerStateTemplate(state_typename, state_label, state_cat)
    template.bindFactory(State)
    template.bindIcon(kwargs["type"].icon())


    template.bindHandle( "xform", "Xform")



    return template



I attached a little hip with embedded assets, thanks for Your time
Edited by sanostol - Dec. 31, 2020 07:06:31
See full post 

Technical Discussion » Wrapping my head around Python classes

User Avatar
sanostol
558 posts
Offline
 Dec. 29, 2020 10:05:37
the function does not really create a node, it just gives You back a reference to a existing node.

there is a function node.createNode() that actually creates a node, but it also returns a object reference.
Edited by sanostol - Dec. 29, 2020 11:05:00
See full post 

Houdini Lounge » Vellum cloth sim smooth

User Avatar
sanostol
558 posts
Offline
 Dec. 29, 2020 03:46:31
can You post a picture with "shaded with wireframe"?
See full post 

Houdini Lounge » Vellum cloth sim smooth

User Avatar
sanostol
558 posts
Offline
 Dec. 28, 2020 09:33:49
Hi, its hard to tell without wireframe, but did You check the normals.
there are several ways to improve the result.




most of the mentioned stuff is done by the vellum post process, but You could try wire this by Yourself as well and try some different orders of the operations.
See full post 

Houdini Lounge » Playback during file cache?

User Avatar
sanostol
558 posts
Offline
 Dec. 28, 2020 09:28:18
maybe I got You wrong, but You can use a fileSOP set to write mode, and playback You sim on this node. It will write the result of Your sim to disk, while it displays it. But unless Your sim is quite fast, it would be better to run it in a separate process and playblast it later or look at the cached files
See full post 

Houdini Lounge » how do i get these handles?

User Avatar
sanostol
558 posts
Offline
 Dec. 28, 2020 09:16:26
The circles are a distance handle, the other one is a vector handle. both work together. the distance handle is hooked to a float parameter and a vector parameter, the vector handle is only hooked to the vector parameter
See full post 

Technical Discussion » cops: how to normalize a normal map?

User Avatar
sanostol
558 posts
Offline
 Dec. 28, 2020 09:05:00
If Your normal maps is not normalized You can do it in a vopcop2filter in a COPNetwork, connect the RGB float channels to a "float to vector" node, normalize the output and write it back to the output channels
GlobalRGB>floattovector>normalize>vectortofloat>RGBOutput
See full post 

Technical Discussion » How do I export OBJ from Cache or DOP

User Avatar
sanostol
558 posts
Offline
 Dec. 28, 2020 08:56:42
rop geometry should work, even in apprentice. Is there a error message?
See full post 

Technical Discussion » Python States: Is it possible to switch states?

User Avatar
sanostol
558 posts
Offline
 Dec. 27, 2020 13:05:24
Cool, thank You, I will try that way.
See full post 

Technical Discussion » Python States: Is it possible to switch states?

User Avatar
sanostol
558 posts
Offline
 Dec. 27, 2020 07:59:52
Hello,

let's say I have a tool that needs a drawn curve to work on it, resample attributes modifications and so on.
My goal is to have one state, named "modify state" for instance, that allows me to have all the handles and parameter interfaces to work on that curve, and one state to actually draw that curve with a "stroke state".
The "modify state" should have a button that clears the previous stroke and sets the tool into the "stroke state" until the stroke is finished. Now it should return to the "modify state"
Is that possible at all?
I tried this one in a the python state:
self.scene_viewer.setCurrentState("sidefx_stroke") # assuming that I can access this one as well
self.scene_viewer.enterCurrentNodeState()
it does not throw any error, but:
print self.scene_viewer.currentState()
still returns the normal state
any hints where to look at?

thanks for You time
Edited by sanostol - Dec. 27, 2020 08:00:20
See full post 

Technical Discussion » Is vellum scale dependent?

User Avatar
sanostol
558 posts
Offline
 Dec. 3, 2020 16:45:31
Hi John, thanks for Your help.
This does solve the problem, but would it be possible to have a world scale parameter here?
Your solution does fix the problem at the price of 4 steps to get a result, that is faster and, at least on the at the first impression, easier to achieve in another scale.

would this be possible at all to have something like a global scale parameter?

martin

Edit:
As soon as You adjust gravity to the new scale it behaves quite similar
Edited by sanostol - Dec. 4, 2020 06:25:06
See full post 

Technical Discussion » Is vellum scale dependent?

User Avatar
sanostol
558 posts
Offline
 Dec. 2, 2020 16:00:18
I have to work on rather small object/creature, about 10cm, and I can not get the attributes for stiffness to work like it it would be in a 100cm scale
so I prepared a little test setup to demonstrate my current problem


the box has a stiffness attribute ranging from 0.001 (blue) to 200 (red). The upper box is scaled down by factor 10 before it goes into the solve.
The lower box is the desired motion, but somehow the sharp contrast in stiffness does not appear in the scaled down sim version?
I can not see any way to prevent this, other than creating it in a scaled up version, but I would prefer to stay in real world scale

thanks for Your time

Martin
Edited by sanostol - Dec. 2, 2020 16:04:19
See full post 

Solaris » Instances and motionblur

User Avatar
sanostol
558 posts
Offline
 Sept. 22, 2020 04:31:18
Thanks for Your time, in 18.0.566 it You file also works with cache option.

Another question, I still have is rendering with v blur?

this does not work in any case here

Edit:
The problem gets even more unpredictable as soon as particle are reaped as they die. Another point for v blur approach. But still found no way to use vblur

As soon es I keep all dead particles I the motion blur does work again. But now I have to deactivate/hide them with the prune node based on the “dead” attribute.
My initial guess was to use the “usd_flattenedprimvarelement” vex function to get the right value for the instance, but I need a index, and @elemnum does not work. the documentation is vague, to say at least.
I think it is not supported yet, but I do hope im wrong.
Edited by sanostol - Sept. 22, 2020 06:13:19
See full post 

Solaris » Instances and motionblur

User Avatar
sanostol
558 posts
Offline
 Sept. 21, 2020 17:02:24
I tried the cacheLop, but maybe ( I mean chances are good ) I'm doing something wrong here.

The network looks like this for all cases, just the last one works
Edited by sanostol - Sept. 21, 2020 17:08:33
See full post 

Solaris » Instances and motionblur

User Avatar
sanostol
558 posts
Offline
 Sept. 21, 2020 06:59:26
Should it work at all in version 18? As Karma is still beta and Solaris quite new, it would be good to know if I just keep running against a solid “not yet” wall.
Thanks for any hints
See full post 

Solaris » Instances and motionblur

User Avatar
sanostol
558 posts
Offline
 Sept. 17, 2020 08:01:33
This should be working, right? What do I miss here.
I tried both motion samples and v attribute and both have no effect. What do I have to add here.
In addition also vblur on a mesh seems to work not the way I at least would expect it, only the tree with samples on a mesh do blur at all.
Please have a look at the stage in the file
Thank You
See full post 

Solaris » Transfering attributes from usd graph objets to instances

User Avatar
sanostol
558 posts
Offline
 Sept. 17, 2020 04:58:41
Hello,

I have some issues with instancing and usd. When the “instance To Point” node is set to Internal Sop as Location Source all Point Attributes on the Target Points are copied as expected. “test”, “Cd2 and ”v“ in my example.

But if I use the first input as target, I can not copy them. On point is that the attributes on the target points are renamed to ”primvars:test“, ”primvars:displayColor“, ”velocities“. This happens with sop sources and abc file sources as well.

So how do I copy the attributes, I tried ”primvars:test" but it does not work

I attached a file showing my problem, its a archive with hip, 2 bgimages for houdini and a abc.

Thanks for Your help
See full post 

Solaris » slow VolumeLop for writing usd files

User Avatar
sanostol
558 posts
Offline
 July 9, 2020 05:03:33
Hi
i read in some VDB data with the volumeLOP and it takes quite some time to write out a complete usd sequence. It seems, the lop does read in the volume for every frame, that takes quite some time.
Is there a way to speed this up, maybe by providing bound information and field descriptions?
the fields setup will not change over time

thanks
Martin
See full post 

PDG/TOPs » Cooking top nodes by script

User Avatar
sanostol
558 posts
Offline
 April 9, 2020 19:06:47
Thank You!
EDIT:

The “executeGraph” method works fine in a running session, all the PDGNodes are accessible. But I tried to use it in a hda “on loaded” event and again, I get a None back from “getPDGNode” method
The “exectueGraph” method seems to have no effect in a “on loaded” event
is there a way to get that running in this kind of event?
Edited by sanostol - April 10, 2020 08:39:50
See full post 

PDG/TOPs » Cooking top nodes by script

User Avatar
sanostol
558 posts
Offline
 April 8, 2020 16:35:02
Hi, I try to cook nodes with a python script, but … well, it could run better

I attached a file. I would like to open that file and run this python script:
top = hou.node('/obj/topNet/wedge1')

print top.path()
top.setDisplayFlag(True)
top.getPDGNode().cook(True)
work_items = top.getPDGNode().workItems
print (work_items)

when You run it directly after opening the file, it fails, top.getPDGNode() results in None.
after cooking the top nodes with the ui and deleting the results, the script works.
I wonder, what is going on here. Tt seems that a initial cool by hand, does initialize something so the getPDGNode does work. How can I do this?

thanks for any hints
Martin
See full post 
  • First
  • 1
  • 2
  • 3
  • 4
  • Last
  • / 17
  • Quick Links
Search links
Show recent posts
Show unanswered posts
PRODUCTS
  • Houdini
  • Houdini Engine
  • PDG
LEARN
  • Learning Paths
  • Tutorials
  • Talks & Webinars
  • Schools & Training
  • 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
  • Press
  • T-Shirt Store
  • Careers
  • Internships
  • Contact Us
Copyright © SideFX 2023. All Rights Reserved.

Choose language