Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Community Reputation

0 Neutral

About megalith

  • Rank
  • Birthday 11/16/1984

Contact Methods

  • Website URL
  1. Mouse Events

    Good news! Ondrej over at the sidefx forums answered the question and gave the solution, so if anyone ever needs to do this, you can find his reply here: Finding Camera Solution. ~Joel
  2. Mouse Events

    Can't believe I'm responding to my own message so quickly, but after posting it, I figured out the answer to my own question. Kinda hate it when that happens. Anyways, here is the solution I came up with. It now seems to make a lot of sense. Here is the code I have: // This event happens when you are dragging the mouse or // when the mouse button is released int MSS_Pen::handleMouseEvent(UI_Event *event) { // Get the renderer for this particular viewport RE_Render *re = event->target->getRenderer(); // This gives you the window that the mouse event was // generated from UI_Object *target = event->target; // Bottom-left corner is (0, 0) int x = event->state.values[1]; int y = event->state.values[2]; // event->type is always going to be UI_EVENT_VALUE_CHANGE in // a mouse event handler, so we need to check the reason for // the event instead. if ( event->reason == UI_VALUE_START ) { // Start creating the curve } else if ( event->reason == UI_VALUE_ACTIVE ) { // Add the points } else if ( event->reason == UI_VALUE_CHANGED ) { // Finish creating the curve } return 0; } My question on the other forum still holds, however, so if anyone has any ideas on how to do that one, please do tell! I'm guessing it has something to do with the target, but getting such a generic UI_Object makes it an obscure solution. I've looked through the headers for possible solutions, but so far no luck. So if any of you with more experience with the HDK can shed some light on it, that would be awesome! Thanks! ~Joel
  3. Mouse Events

    Hey all, Been struggling through figuring out various aspects of the HDK. Already posted on the SideFX forums, but so far no response--you can see it here. Instead of double-posting, I have a similar question instead. In the signature of handleMouseEvent, you have access to UI_Event. What I want to do is somehow distinguish between the start of dragging and the end. The first can be done easily enough if you have the second. The function does not get called on mouse-down, but only seems to get called during a drag or on the mouse-up. I figured that the event->type (UI_EventType) would tell me what I needed, but it is always UI_EVENT_VALUE_CHANGE. The only way to tell the difference that I can see so far is that the value (event->value) is no longer a valid float array, but that is a pretty terrible, hacky, way to see the type of event. Is there some other way to tell? Any help on this would be immensely appreciated! Thanks! ~Joel
  4. Well, We're Back

    Woohooo!! RSS feed! Thank you sir.
  5. Well, We're Back

    Sure glad it's back already! Thanks guys! Great job as usual! ~megalith
  6. Which Scripting Language To Learn?

    Personally, I think it's a good idea to have a book for reference and for introductory material. Most people I know who are just starting out find having a book next to them while programming to be really useful. Perhaps later on you will start to rely only on online references, but a book is a good thing to have nonetheless. As for online material, this is a pretty useful sidebar for getting information quickly: http://projects.edgewall.com/python-sidebar/ Learning other scripting languages and other programming languages in general becomes much easier after you master one language. Sometimes it'll just be learning new syntax while other times it may be learning new concepts like if you get into functional languages like Haskell, but for the most part, the concepts you will learn from Python or Ruby will carry over to other languages very well. Hope that helps a bit. Good luck! ~megalith
  7. Nvidia 81.95 Drivers Bad

    Thanks for the warning edward...was just about to install them. It's unfortunate when newer drivers create incompatibilities. ~megalith
  8. Scripting Challenge: Using "dot" For Layout

    Alas, a beta release! Please understand this is just a preliminary version, so if it explodes I apologize in advance. For now I've just compiled a win32 version, but if this works well and once it's more finalized I'll compile a linux version as well. Sorry for the large size (861kb), but there are quite a few dependencies needed for GraphViz. Since I'm using GraphViz as a library now, you don't need the executables, which is nice, but you pay for it in size. Alright, some installation instructions. In the archive are two directories: 'bin' and 'dependencies'. The 'bin' directory has the plug-in itself, so just put that in $HOME/houdini8.0/dso. You then need to place the files in the 'dependencies' folder into the 'bin' directory of Houdini. Now once you start Houdini you should have access to a new command called 'oplayoutGV'. So inside a texport, navigate to the level you want to layout and simply execute: oplayoutGV. The next step for the plugin would be to make it a bit easier to use, so any ideas or suggestions on improvements are welcome! And if you find any bugs, please let me know. Hope it works for you all! ~megalith EDIT: Changed the attachment to the release version, so that those without the vs2003 debug runtime libraries don't have to download them. LayoutCommand.zip
  9. Scripting Challenge: Using "dot" For Layout

    Alright, the HDK version is working!! It's at where the script was, but since now I have access to the width and height of each node, I have a few more tweaks to make. GraphViz defaults to having a huge separation between nodes, since it works with much larger node sizes by default, so there's quite a bit to change it seems. Almost there! ~megalith
  10. Scripting Challenge: Using "dot" For Layout

    Totally agree with that. Don't want to diverge too far from the original challenge, but if this is something more people are interested in, I think we should make another challenge or something to promote that effort. Using just HScript does indeed suck for this as there is a lot of string parsing, so I'm going to implement it with the HDK next. In the meantime, if anyone wants, I'll post the Python script. ~megalith
  11. Scripting Challenge: Using "dot" For Layout

    Yay! It's working! It's a Python script at the moment, so the next step is to add error handling, documentation, and then consider moving it to pure HScript (which would kindof suck) or to HDK. Would be cool if there were some sort of interface that gave the user access to some of the power of GraphViz...hm...
  12. Scripting Challenge: Using "dot" For Layout

    Yeah, you're right. I just made a simple script that parses the operators, passes it to dot, reads in the new data and sends it back to Houdini...not really that slow at all. I do need some more involved networks, though. Anyone have anything insanely complex that I can test it with? I know it may not be necessary to make a plugin, but it still might be worth considering. Something really integrated into the Houdini workflow so that organizing your networks isn't such a pain.
  13. Scripting Challenge: Using "dot" For Layout

    At the moment, I'm just concerned about the speed of using hscript or some scripting language. If anyone finds another 3rd party library for this type of thing please let us know (I'd be interested anyway), but GraphViz will definitely do everything we need. Doing a few tests right now, so I should know really soon if it's fast enough.
  14. Scripting Challenge: Using "dot" For Layout

    Hehe....yeah, I'm not going to the HDK yet as I want to do a few tests first to see how fast it's going to be. In this case, I don't see scripting being limiting at all, and you can probably do the whole thing in HScript...but I'm not positive about that yet.
  15. Scripting Challenge: Using "dot" For Layout

    Sounds like a good idea Jason. I'll poke around with it some as well. I've only really used GraphViz with doxygen before, so I'm not very familiar with it. Should be fun though! Is using the HDK out of the question?...please say no. ~megalith