Thread: Working on some tools for Blender and Pipmak
Status: Alpha
Brought to you by:
cwalther
From: rivenwanderer <riv...@ya...> - 2008-11-04 06:56:03
|
I'm working on making some tools for getting Pipmak environments together as quickly and easily as possible. The first is a Blender Python script made from the Panorama Maker tool at http://www.alienhelpdesk.com/python_scripts/old_scripts . The tool renders panoramas for all selected cameras in a Blender scene, placing them into node subfolders where the names are taken from the names of the camera objects in Blender. The standalone auto-handle-placer doodad (needs a better name ;) ) is being written in Python for now. It first takes a list of the names of the cameras and the points where the cameras were. Here's an example, where the two cameras are named "1" and "2". 1:0.0,0.999999940395,4.0 2:0.0,0.999999940395,-10.0 This can be automatically exported from Blender with a simple script (which I'm including in the batch pano tool for now), and hopefully from most other 3D programs also. The coordinates should be like that in the diagram in Fig. 2 (page 11) of the Pipmak reference. Then it takes a file specifying which cameras are connected to which other cameras, with the assumption that it's bidirectional. For example, camera 1 connected to cameras 2, 3, and 4 would be represented as "1:2,3,4". Then, for each camera, it computes the elevation and azimuth to all the connected cameras and adds appropriate handles to the node.lua file in the subdirectory with the same name as the camera (creating the node file if it doesn't exist yet). The tool won't check for overlapping handles or anything, and not all handles will be exactly what one would want for a game, but they can be adjusted later. The two tools together should mean that I can take a modeled environment in Blender and (1) place cameras in arbitrary locations where I want nodes to be rendered from, (2) hit a button and wait for all panos to render, (3) spend a couple minutes writing down which nodes connect to which, and (4) run a script from the commandline, then be able to fully navigate the project in Pipmak. This streamlined process for the "normal" nodes (as opposed to typing out the handles in every node.lua or editing hotspots with a graphics program) should leave me with more time for working on the more complex programming parts of my games. I've got the Blender tool in a working (though still rough around the edges) state, and am hoping to get the standalone tool working in the next few days. I'll be sure to post the python code (on the wiki? or would somewhere else be preferred?) once they're in a state that's usable for people besides just me. I'm not at a point where I could write this stuff in Lua yet, but hopefully the code will be readable enough for someone (me or someone else) to port it for inclusion in the Pipmak editor someday :) -- View this message in context: http://www.nabble.com/Working-on-some-tools-for-Blender-and-Pipmak-tp20317074p20317074.html Sent from the pipmak-users mailing list archive at Nabble.com. |
From: Aidan G. <wgs...@ih...> - 2008-11-04 21:50:01
|
Sounds... amazing! Do you have plans for a way of specifying slide nodes? -Aidan rivenwanderer wrote: > I'm working on making some tools for getting Pipmak environments together as > quickly and easily as possible. The first is a Blender Python script made > from the Panorama Maker tool at > http://www.alienhelpdesk.com/python_scripts/old_scripts . The tool renders > panoramas for all selected cameras in a Blender scene, placing them into > node subfolders where the names are taken from the names of the camera > objects in Blender. |
From: rivenwanderer <riv...@ya...> - 2008-11-05 01:29:57
|
I hadn't been planning on doing auto-handle-placement with slide nodes--mostly because in the types of games I'd like to make, slide nodes would be the result of clicking on *something* rather than in a direction, if that makes sense, so I'll be more likely to want to manually trace a custom hotspot map. But a bit of Pipmak-centric scripting could certainly be done for slide nodes in Blender--an analogous batch-renderer that placed renders into the appropriate subfolders, and perhaps also generated a skeleton node.lua . Aidan Gauland wrote: > > Sounds... amazing! Do you have plans for a way of specifying slide nodes? > > -Aidan > > rivenwanderer wrote: >> I'm working on making some tools for getting Pipmak environments together >> as >> quickly and easily as possible. The first is a Blender Python script >> made >> from the Panorama Maker tool at >> http://www.alienhelpdesk.com/python_scripts/old_scripts . The tool >> renders >> panoramas for all selected cameras in a Blender scene, placing them into >> node subfolders where the names are taken from the names of the camera >> objects in Blender. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pipmak-Users mailing list > Pip...@li... > news://news.gmane.org/gmane.games.devel.pipmak.user > https://lists.sourceforge.net/lists/listinfo/pipmak-users > > -- View this message in context: http://www.nabble.com/Working-on-some-tools-for-Blender-and-Pipmak-tp20317074p20334871.html Sent from the pipmak-users mailing list archive at Nabble.com. |
From: rivenwanderer <riv...@ya...> - 2008-11-08 18:47:42
|
I've got the basics working, yay! Right now, my script only creates the node.lua file if one doesn't exist. So if you have made changes to a node and then want to re-generate handles in it, you need to rename or move the node.lua file and manually merge in your changes. Any Blender users out there who'd like to beta-test this? It would be instructive to have someone besides me use this :) -- View this message in context: http://www.nabble.com/Working-on-some-tools-for-Blender-and-Pipmak-tp20317074p20399121.html Sent from the pipmak-users mailing list archive at Nabble.com. |
From: Christian W. <cwa...@gm...> - 2008-11-08 19:52:59
|
rivenwanderer wrote: > I've got the basics working, yay! > ... > Any Blender users out there who'd like to beta-test this? It would be > instructive to have someone besides me use this :) I wouldn't call myself a Blender user as I haven't used Blender a lot, and then only as a modeler, not for rendering, so I don't have a scene ready to use it in - but I'd be interested in having a look just out of curiosity. I used a similar system in POV-Ray when I started with the demo project. -Christian |
From: Christian W. <cwa...@gm...> - 2008-11-09 09:55:36
|
rivenwanderer wrote: > http://www.nabble.com/file/p20401034/panos-for-pipmak.py panos-for-pipmak.py > http://www.nabble.com/file/p20401034/pipmak-auto-handle.py > pipmak-auto-handle.py > http://www.nabble.com/file/p20401034/connectivity connectivity Cool, works! - Is there a reason for having the panorama rendering and camera location saving in two separate steps? I'd have expected it to save the camExport file already in the rendering step. - It would be nice to have a file browser for the "path" field instead of having to type it. - For nodes that lie at different heights, the elevation of the handles is inverted: the handle that goes up on my tower is down on the floor instead of covering the top of the tower. - Node names that are not numbers must be put in quotes in the "target=xyz" line. Otherwise Lua sees them as variables, which have value nil when undefined, and nothing happens when you click on the handle (not even an error message). (For Pipmak >= r209, even numbers could be put in quotes, but that wouldn't work for 0.2.7.) -Christian |
From: rivenwanderer <riv...@ya...> - 2008-11-09 18:23:03
|
> - Is there a reason for having the panorama rendering and camera > location saving in two separate steps? I'd have expected it to save the > camExport file already in the rendering step. There isn't a good reason, it just made more sense during development :p Next version will combine them. > - It would be nice to have a file browser for the "path" field instead > of having to type it. Hm, I'll see if Blender's API has an easy way to do that. > - For nodes that lie at different heights, the elevation of the handles > is inverted: the handle that goes up on my tower is down on the floor > instead of covering the top of the tower. Oops! ^_^;; I'll fix that in the next version. Must be a sign error or something. > - Node names that are not numbers must be put in quotes in the > "target=xyz" line. Otherwise Lua sees them as variables, which have > value nil when undefined, and nothing happens when you click on the > handle (not even an error message). (For Pipmak >= r209, even numbers > could be put in quotes, but that wouldn't work for 0.2.7.) The script has a "use_pipmak_2_7" variable which I'm already using to determine whether to use az/el or caz/cel--I can use the same variable to switch off of quoting all node names or not, and allow the variable to be set via commandline args (defaulting to assuming it's the standard 0.2.7 version if it's not specified). I think that 0.2.7 and "the latest version from SVN" are the only two versions of Pipmak I'm going to care about, so I won't worry about versions between 0.2.7 and r209. Thanks for testing! -- View this message in context: http://www.nabble.com/Working-on-some-tools-for-Blender-and-Pipmak-tp20317074p20409183.html Sent from the pipmak-users mailing list archive at Nabble.com. |
From: Christian W. <cwa...@gm...> - 2008-11-09 18:56:54
|
>> - It would be nice to have a file browser for the "path" field >> instead >> of having to type it. > > Hm, I'll see if Blender's API has an easy way to do that. http://www.blender.org/documentation/248PythonDoc/Window-module.html#FileSelector -Christian |
From: rivenwanderer <riv...@ya...> - 2008-11-08 22:15:56
|
http://www.nabble.com/file/p20401034/panos-for-pipmak.py panos-for-pipmak.py http://www.nabble.com/file/p20401034/pipmak-auto-handle.py pipmak-auto-handle.py http://www.nabble.com/file/p20401034/connectivity connectivity Here are instructions on using python scripts in blender, which you'll need for the "panos-for-pipmak" file: http://www.alienhelpdesk.com/python_scripts/using_python_scripts The Blender script is still in a bit of a mess, since I mostly cannibalized it from something else. Most notably, it doesn't return the cameras to their original orientation when it's done. I also haven't made it correctly do the "1 extra pixel larger than 90 degrees" thing, because it hasn't been noticeable at a 1024 resolution :p Oh, and the cameras need to be named things that Pipmak recognizes as node names--so only numbers if you're using the build that's on the website. The "path" you set in the script UI should be the directory you intend to be the .pipmak directory for the project. That's where the script will also save the object location file, called "camExport", and where you should save the connectivity map called "connectivity" (I've attached an example). You should also execute the pipmak-auto-handle.py script from immediately inside the .pipmak project directory. The easiest way is to place a copy of the script in the directory, but you obviously don't have to. Let me know if you have any questions or run into any problems! -- View this message in context: http://www.nabble.com/Working-on-some-tools-for-Blender-and-Pipmak-tp20317074p20401034.html Sent from the pipmak-users mailing list archive at Nabble.com. |