Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not import uv values from a mesh shape imported from a .lxs #392

Closed
tonka3000 opened this issue Jun 17, 2020 · 4 comments
Closed

Could not import uv values from a mesh shape imported from a .lxs #392

tonka3000 opened this issue Jun 17, 2020 · 4 comments
Assignees
Labels

Comments

@tonka3000
Copy link

Hey,

I have a question about the .lxs (1.x format) import mechansim in 2.3. I've try to port an old generator and the only problem I get is an error for a shape (trianglemesh) which has float uv.

Shape exmaple:
Shape "trianglemesh" "point P" [0 0 0 0 210 0 210 0 0 210 210 0 ] "normal N" [0 0 -1 0 0 -1 0 0 -1 0 0 -1 ] "integer indices" [2 0 1 2 1 3 ] "float uv" [0 1 0 0 1 1 1 0 ]

If've looked at the source code here

if ((uvsProps.GetSize() == 0) || (uvsProps.GetSize() != pointsProp.GetSize()))
	throw runtime_error("Wrong trianglemesh/mesh uv list length: " + objName);

In 1.x uv where x,y 2D coords, but in 2.x it seems that that there are 3 value pair required, because of following line uvsProps.GetSize() != pointsProp.GetSize()), so the points array size needs to be the same as the uv array.

I can not find any information about how the uv needs to be in 2.x (also for the new file format), so maybe this is a bug or the are now 3 values per point in the .lxs importer.

Greetings

Tonka

@Dade916 Dade916 self-assigned this Jun 17, 2020
@Dade916 Dade916 added the bug label Jun 17, 2020
@Dade916
Copy link
Member

Dade916 commented Jun 17, 2020

It is a cut&paste bug (all other vectors have 3 values), I should have fixed the problem in the latest sources.

This problem was probably never spotted because the preferred (and faster) method to define large meshes, both in old Lux and LuxCore, is to use external .ply files instead that inlining information inside the .lxs file.

@tonka3000 tonka3000 changed the title [question/bug?] Correct way of using uv in a mesh imported from a .lxs Could not import uv values from a mesh shape imported from a .lxs Jun 17, 2020
@tonka3000
Copy link
Author

Thanks for your answer and fix.

.ply is definitely the better way but I have to support both. I used a single .lxs to make it easy to stream it to another device. I'm not aware that can make a single inlined file (if required) with the new format.

@Dade916
Copy link
Member

Dade916 commented Jun 17, 2020

You can serialize a complete scene in a single binary file with LuxCore API, it is used, among other things, for network rendering, saving/resuming rendering, etc.

If you use LuxCoreUI, you can load any scene (in .lxs format too) and export in text or binary formats.

@tonka3000
Copy link
Author

Cool. Thanks for the info 🙏

@Dade916 Dade916 closed this as completed Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants