Michael Betke Posted July 22, 2010 Share Posted July 22, 2010 I need someone who can do a .lua based solution to place cables or wires in the editor. This function is needed in for a project I'm working on. I need to do lots of power-cables and can't do them in 3dmax because of the irregular and modular layout of the project. Maybe someone can do something which uses the road system and I can place "cable_nodes". The wire which needs to be places should be 3-sided and have the ability of adding a material to my cable/wires. It's no need to have them physical interacting. Is it possible? What would it cost? If someone will do it for free and offer the community I would donate of course. I need this done in approximatly two weeks. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
Michael Betke Posted July 23, 2010 Author Share Posted July 23, 2010 Noone? Come on guys I know there are some specialists out there. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
cocopino Posted July 23, 2010 Share Posted July 23, 2010 Ok, Michael. I'll give it a go. Have to start doing things with LUA anyway sooner or later. It will cost you... a couple of 3d trees. But since you already gave some of those to the community earlier I'll let you off the hook this time. Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Michael Betke Posted July 23, 2010 Author Share Posted July 23, 2010 I have no problem with passing you my 4 released asset packs. It's more than a fair deal I think. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
cocopino Posted July 23, 2010 Share Posted July 23, 2010 Here's what I've got so far: http://cocopino.eu/download/Cable.zip (unpack in your LESDK/models folder) Obvious problems are that the cables are gone when saving & loading the scene and that the texture shouldn't scale. Does anybody know if there's a LUA function that is triggered when loading/dragging an instance of an object into the scene? I would guess "Spawn" but this doesn't do anything for me. Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
cocopino Posted July 26, 2010 Share Posted July 26, 2010 Hi Michael, I changed the name of the node mesh so there can be no confusion going on name-wise. Here's how it works: When dragging a node onto your scene, the editor will give it a name like cablenode_3. If there is another cablenode present in the scene, having an index number of 1 digit lower (in this case cablenode_2), the lua script will load a mesh (cables_mesh.gmf) between those two nodes and then scale it. You can use any mesh you like for this, but it has to be exactly 1 Leadwerks unit long in z-direction. The nodes can be made visible/invisible by changing the material to cablenode_diffuse.mat/cablenode_invisible.mat. The thickness of the cables can be changed by changing the property "Thickness". The material of the cables can be changed by changing the property "Material File". Note however that scaling the material may make the texture look bad. I'm hoping for a positive answer on my question about this in another thread to change that. Is this more or less what you're looking for? Cable.zip Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Michael Betke Posted July 26, 2010 Author Share Posted July 26, 2010 I tried your first cable download. I'm out at the moment so I cant try your lates version now. One important thing is some kind of iteration to the model. Like a spline. For example: I want to connect a house with my electricity pole. So I need two points. A and B. If I connect them I would get a straight line. But a wire is hanging a bit. To solve this I would need to place lots of nodes and place allign them each. This would take a lot of time. I would prefer to place the two nodes A and B, open properties, define the number of sides, and a "hanging" value to define the bend value of my wire. A "bend shift" to have the lowest point a bit more left or right would be the ultimate bonus. I think this would be the best wire/cable feature for most peoples needs. But like I said. I have no idea if it's possible. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
MasteR Posted July 28, 2010 Share Posted July 28, 2010 Something like this? Not done is LUA but in C++, its got a lot of work to make it perfect mind you but I could work on it and pass it onto another forum member to implement into LUA when its done. Quote AMD Athlon 64 X2 Dual Core 6000+ (3.0 GHz) 4 GB DDR2 RAM 2 x NVIDIA GeForce 9500 GT 512 MB (SLI 1.0 GB) Windows XP Pro Link to comment Share on other sites More sharing options...
cocopino Posted July 28, 2010 Share Posted July 28, 2010 This weekend I'll probably have my LUA implementation done; It has a lowest Y value and a lowest segment value so you can make it bend realistically when one of the nodes is higher placed up than the other. Wouldn't mind looking at your code though MasteR. Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
MasteR Posted July 28, 2010 Share Posted July 28, 2010 you are both welcome to the code here. cocopino if you could combine this with your LUA node implementation then I'm sure you'll make the community very happy. Quote AMD Athlon 64 X2 Dual Core 6000+ (3.0 GHz) 4 GB DDR2 RAM 2 x NVIDIA GeForce 9500 GT 512 MB (SLI 1.0 GB) Windows XP Pro Link to comment Share on other sites More sharing options...
cocopino Posted July 28, 2010 Share Posted July 28, 2010 I purposely don't use physics at all in my solution, because Michael stated he didn't need it, and it will most likely mean more calculations for the engine. I'm going to pursue that as well so both physics/non physics solutions will be available. Cool huh Michael? Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Michael Betke Posted July 30, 2010 Author Share Posted July 30, 2010 Its cool. Ar the Moment im in holidays and Typung from my mobile. Will check back in à Fee days Guss but it Looks awesome. Never thought of lua beeing so powerful! Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
cocopino Posted July 30, 2010 Share Posted July 30, 2010 Its cool. Ar the Moment im in holidays and Typung from my mobile. Will check back in à Fee days Guss but it Looks awesome. Never thought of lua beeing so powerful! Enjoy and have another beer! Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
cocopino Posted August 3, 2010 Share Posted August 3, 2010 Ok, another version here, not really polished but it should be workable. The code has become a bit of a mess, a lot of optimization can be done there. But as soon as you stop dragging nodes around, there won't be any impact on FPS (apart from the few polygons that are added to the scene of course) Cable.zip Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Michael Betke Posted August 5, 2010 Author Share Posted August 5, 2010 I checked the cable and it works very good so far. There are also some flaws with the node. If I move or delete a ode it seems I get two wires for some reason. If I delete two nodes the wire is still present in the editor. Do I have to set up both nodes in the same way, or is one node enough? I assume if I export a thinner model the value for thickness will make more sense? Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
cocopino Posted August 6, 2010 Share Posted August 6, 2010 I see now I didn't test this very well, sorry. - If I delete two nodes the wire is still present in the editor. Yes, the wires are not freed at first (they are when saving and reloading the scene) - Do I have to set up both nodes in the same way, or is one node enough? There's always two nodes needed to create a line, and they need to have an incremented number, e.g.: cablenode_3 + cablenode_4 will create a line between those two. - I assume if I export a thinner model the value for thickness will make more sense? The thickness is nothing more than a multiplier, I can also make the multiplier go below 1 to make the cable less thick. One thing I didn't test at all is that the values you type in are values for all nodes/cables. This wasn't what I wanted, I'd like to be able to give all cables different values. So still WIP! Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Michael Betke Posted August 6, 2010 Author Share Posted August 6, 2010 The thickness is nothing more than a multiplier, I can also make the multiplier go below 1 to make the cable less thick. This would be very helpfully! - Do I have to set up both nodes in the same way, or is one node enough? There's always two nodes needed to create a line, and they need to have an incremented number, e.g.: cablenode_3 + cablenode_4 will create a line between those two. I was refering to the values. Like I place two nodes and enter my settings in the first of the two nodes. Or do I have to place, write values to node1, then go to node2 and enter the same values to make it working properly. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
cocopino Posted August 9, 2010 Share Posted August 9, 2010 New version again Michael, we'll get there eventually! (I hope ) It still needs two nodes with incremented numbers, eg: cablenode_3 + cablenode_4 When changing node values, these values will apply to all nodes that haven't been set yet. So you have to set the values only once, but you still have control over all cables. Non-used segments will be removed when changing "Number of Segments" to a lower number. Thickness can be 0.1 now. Cable.zip Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Michael Betke Posted August 9, 2010 Author Share Posted August 9, 2010 I really like it. One thing I noticed is the first wire segment right beside the node. It seems to not hang like it should and looks a bit like a fishing pole. The previous version had them hang correctly. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
cocopino Posted September 27, 2010 Share Posted September 27, 2010 Hi Michael, Do you get better results using this alternative lua script? (note that you may have to click apply in properties to see your cables) cables_cablenode.lua Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Michael Betke Posted September 27, 2010 Author Share Posted September 27, 2010 Looks good but it defaults to 30 segments? A little bit much I guess. Sometimes I use 8 or 15. Depending on lenght and curvature. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
Michael Betke Posted September 27, 2010 Author Share Posted September 27, 2010 ahh noticed some other errors. 1. There is a stair effect on my old cables. I have to press around 3-5 times "Apply" before something happens and the effect is gone. 2. Depending on the bending of the cable there is an obvious disconnected effect of each element. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.