Search the Community
Showing results for tags 'working'.
-
Hi I'm new to this wrangle node programming, I've been busting my head over why this doesn't work for three days, it's so simple therefor i must be missing out on some general vex concepts. If anyone can please point me in the right direction that would be greatly appritiated. I have a bunch of points on a grid and their moving up and down via noise. I am trying to set up a point attribute that has a value of 1 when a point if moving up (positivly in the Y axis) and a value of 0 when a point is moving down (negativly in the Y axis). This attribute is called Direction, I'm computing the logic on temporary VEX variables and then writing them out to the attributes. Here's how it looks like : // 0 is going down, 1 is going up, -1 means the point has no direction // on the first frame they have no direction so the points just take their current heights so they can use them for comparison on the second and every other frame int temporary_Direction; float temporary_Previous_Frame_Height; if(@Frame == 1) { temporary_Direction = -1; temporary_Previous_Frame_Height = @P.y; } else { temporary_Direction = @Direction; // ------------> this is where the problem is (this is here so that the temporary variable get's the value of the currently proccesing point every frame) temporary_Previous_Frame_Height = @P.y; if(temporary_Direction == -1) // If the point has no direction { if(temporary_Previous_Frame_Height < v@P.y) // If it's going up { temporary_Direction = 1; temporary_Previous_Frame_Height = v@P.y; } if(temporary_Previous_Frame_Height > v@P.y) // If it's going down { temporary_Direction = 0; temporary_Previous_Frame_Height = v@P.y; } } } // Out_Values i@Direction = temporary_Direction; f@Previous_Frame_Height = temporary_Previous_Frame_Height; // Out_Values The problem here seems to be when I declare "temporary_Direction = @Direction", for some reason on the second frame when I read @Direction the value wich is given to temporary_Direction is 0 instead of -1 wich was given to every @Direction on the first frame. Temporary_Previous_Frame_Height updates just fine but temporary_Direction doesnt. Also writing "if(temporary_Direction == -1)" doesnt seem to work either. Is my thought process even slightly right here, what am i doing wrong, are temporary variables created in vex something that exist globally and in order to use them per point we need to read each point's values or are temporary variables something that exist for every point. Also why do i have to give values to all attributes every single frame or else they will reset to 0 (hense the Out_Values section). //////////////////////////// Update Thank you everyone for replying. I've tried out the time shift sop and it work's fine now( I dont even need the Previous_Frame_Height attribute anymore). I've updated the main post with the original hip file and the one with the time shift sop. Learning about the time shift sop is great, but i would still like to improve my thought process on writing code. It would be greatly appritiated if someone can take a look at the original hip file and possibly shed some light on the problem. I've added notes inside the original hip file for clarity. Any help would be appritiated Thanks in advance Original.hip Time-Shift SOP.hip
-
Hey guys, I'm having an issue where the Alpha displays properly in the viewport but doesn't work when rendered. I've done this before, just a simple Constant shader, and it always worked. Here is what it looks like in viewport vs render: I looked at other threads and none of the solutions work in this scene. Here is the scene file: 0007_odforce.hip Thanks!
-
Hello everybody, I'm still new to Houdini and I'm tring to speed up my modelling workflow by setting hotkeys. The problem is, they don't work. The 2 first ops I tried to assign keys to are: "Polysplit" and "Edge subdivide". First weird thing, When I search the Hotkey Manager, I can't find these 2 ops. In the Houdini forum, someone told me to hold down Ctrl + Alt + Shift while clicking on a shelf tool to open Hotkey manager for that tool. So that's what I did. Then I set up "edge divide" to ALT+D. If I hover the mouse on the edge divide shelf tool, I can see my shorctut alt+D. So then, I create a new cube, select 4 of its edges, then hit ALT+D... nothing happens. I'm using an azerty keyboard, is this my problem? I set polysplit on ALT+* and I just got it working on the cube. But in other scenes it wasn't working neither... Thanks and see you soon, G
-
Hi guys i'm newcomer in Houdini, my simple code not working and don't show error in Houdini console! i changed the Tag Name to "osk" from "osm" but i don\t see error 'Bad file type' in console. import xml.dom.minidom document=""" <osk version="0.6" generator="CGImap 0.1.0" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/"> <bounds minlat="40.7432000" minlon="-73.9897000" maxlat="40.8052000" maxlon="-73.9304000"/> <node id="1420631950" lat="40.7711745" lon="-73.9792204" user="Aaron Lidman" uid="53073" visible="true" version="2" changeset="15468871" timestamp="2013-03-23T17:11:31Z"/> <node id="1420631974" lat="40.7716867" lon="-73.9779803" user="Aaron Lidman" uid="53073" visible="true" version="2" changeset="15468871" timestamp="2013-03-23T17:11:31Z"/> <node id="1420631985" lat="40.7694268" lon="-73.9788969" user="dchiles" uid="153669" visible="true" version="1" changeset="9189979" timestamp="2011-09-02T04:12:03Z"/> </osk> """ map = xml.dom.minidom.parseString(document) if (map.documentElement.tagName != "osm"); print('Bad File Type') return [/CODE] Thanks