PDA

View Full Version : Polyline translation issue



short223
01-19-2016, 09:41 AM
From my company's proprietary simulation software, we export out geometry as .wrl (vrml) files. The file contains geometry in the form of a sphere along with a chain of open polylines (with about 10 points) making a tail. We are able to import this into our other in-house rendering app directly and it retains the polyline as an open chain.

I want to bring this into Lightwave and am using Okino's Polytrans for my conversion but I am not having any success in retaining the polyline as an open chain. I've tried all the available import file options. The closest I have come has been to export it out as an OBJ file but it come in as a closed polygon. Note: The file comes in correct within Polytrans.

To add to this delimma, the file will contain over 450 individual tails on the same layer, so manually editing each tail is not a viable option (plus there will be about 50 files to edit).

Is ther a .wrl (VRML) importer for Lightwave? I notice we can export to VRML97.

Any help would be appreciated...

prometheus
01-19-2016, 10:46 AM
You might think that this is what polytrans should be able to do? maybe something you forgot in the options for some exports?

anyway...wrml doesnīt load in to lightwave..thereīs nothing in the I/O panel, only export...and loading wrml directly doesnīt work.

You could try blender, it loads exported wrml files from lightwave, then save it out in blender as obj..and import in lightwave..that works if the process is made in lightwave, then to blender and back again.

or export out obj from polytrans to blender and check how the polylines lok like in blender...but try wrml in blender first..since blender can load that as vrl.

short223
01-19-2016, 10:54 AM
I have solve this issue with the help of a couple of plugins. With the plugin: Curve From Polygon, I was able to make an open curve that matches the original polychain. Then using Curves 2 Lines, it makes all the curves into polylines for rendering. I still have to go through each of the 50 files and convert, but that is way better than going through all 450 tails and manually making polychains.

ernpchan
01-19-2016, 11:07 AM
With the plugin: Curve From Polygon, I was able to make an open curve that matches the original polychain. Then using Curves 2 Lines, it makes all the curves into polylines for rendering.

If it's my script you're talking about you're welcome to modify it so create the polylines so you'd have a one-click solution.

prometheus
01-19-2016, 11:54 AM
I have solve this issue with the help of a couple of plugins. With the plugin: Curve From Polygon, I was able to make an open curve that matches the original polychain. Then using Curves 2 Lines, it makes all the curves into polylines for rendering. I still have to go through each of the 50 files and convert, but that is way better than going through all 450 tails and manually making polychains.


50 files?...donīt you mean 50 curves in one and same layer..or was that not possible?
If you have multiply curves in lightwave in the same layer, go to setup..fiberfx and run strandmaker, it will create open polychains in another extra layer, but keeping the original curves in the original layer.

short223
01-19-2016, 12:24 PM
There are 50 files with 450 or so "tails" (in one layer). Luckily is is surfaced separately from the rest of the geometry so I can just select by the surface name to only select all the tail polys. Thanks to ernpchan's script, it properly makes the curve without the large bottom connecting line...

jeric_synergy
01-19-2016, 01:08 PM
(#aflw) I'm struggling to understand what the various elements here are: are the exported "tails" unmerged 2pt polygons?

And (again, sorry) does "Curve2Lines" make them back into 2pt polygons?

ernpchan
01-19-2016, 02:29 PM
There are 50 files with 450 or so "tails" (in one layer)...

You could modify the script to batch process a directory.

short223
01-22-2016, 06:42 AM
(#aflw) I'm struggling to understand what the various elements here are: are the exported "tails" unmerged 2pt polygons?

And (again, sorry) does "Curve2Lines" make them back into 2pt polygons?

Sorry I didn't respond to this. The file contains a one layer object that has about 450 tesselated spheres. There is also the same number of "tails" (450 of them) in the form of a flat plane consisting of about 10 points. The original data should have been a 10 point polyline chain but the conversion made it into a polygon. I then surface select the tail polygon items and apply the Curve from Poly. The I select the curves and perform the Curves to 2pt Poly and then delete the original poly tail polygons.

ernpchan: I'm sure I could alter the script but the time it would take me to get it working properly would probably be longer than it took to do it by hand. Plus I have to account for other geometry not to be converted in the file. I'll work on it for next time.

JoePoe
01-22-2016, 09:26 AM
So the Curve from Poly plug is consistently omitting the correct/unwanted segments?
That's pretty good :thumbsup:!! That, after all, is the big stumbling block here right ? (other than a clean import, that is.)

short223
01-22-2016, 10:02 AM
So the Curve from Poly plug is consistently omitting the correct/unwanted segments?
That's pretty good :thumbsup:!! That, after all, is the big stumbling block here right ? (other than a clean import, that is.)

That was a big one and I'm considering myself lucky it did it correctly. It is possible it goes by point order of creation when creating the open curve.

ernpchan
01-22-2016, 10:25 AM
It is possible it goes by point order of creation when creating the open curve.
Not just possible. That's exactly what it's doing.

JoePoe
01-22-2016, 11:03 AM
Not just possible. That's exactly what it's doing.

I figured as much.... but it's doing more than just that right?

I mean it's getting rid of the segment connection 10 to 1, but it's also getting rid of 20 to 11, and 30 to 21 etc....
And what if one strand is a point or two longer or shorter...
So it's also doing a poly island thing right. Identifying the first and last point on each individual object.
And that's the interesting part because we see so few plugs that do that. Or am I making too much of it?:)

ernpchan
01-22-2016, 12:23 PM
I figured as much.... but it's doing more than just that right?

I mean it's getting rid of the segment connection 10 to 1, but it's also getting rid of 20 to 11, and 30 to 21 etc....


I think you might be...all my script does is iterate through all the polygons, gets the points, makes curve from point. If my script is doing something more than that that's making short223's life easier then it's a happy accident.