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
[Feature] texturing support for vector layer #36981
[Feature] texturing support for vector layer #36981
Conversation
Nice start! Welcome Belgacem. |
} | ||
} | ||
Qt3DRender::QTextureImage *textureImage = new Qt3DRender::QTextureImage; | ||
textureImage->setSource( QUrl::fromLocalFile( textureFilePath ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at https://stackoverflow.com/questions/50944249/create-qtextureimage-from-qimage , it seems there's a means to directly construct textures from a QImage object. If this is the case, then you could use QgsImageCache::pathAsImage()
(via QgsApplication::imageCache()->pathAsImage(...)
) here instead of directly loading from a local file.
There's two benefits to this approach
- If the image has been previously loaded then it'll save a bunch of work
- QgsImageCache supports base64 encoded image paths. This allows for embedding images directly inside a QgsProject, so that the project becomes portable and there's no path issues when you share the project (or QML style) with others. To enable this you'd also need to chance the
textureFile
widget in the ui file to aQgsImageSourceLineEdit
widget (which adds the UI for users to embed pictures).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about that. I will change the textureFile widget to QgsImageSourceLineEdit and use QgsImageCache and make another commit.
Thanks for the suggestion!
Wow, you've really "hit the ground running"!! Great start to GSOC @NEDJIMAbelgacem ! |
Awesome @NEDJIMAbelgacem |
Looking awesome @NEDJIMAbelgacem ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking great - nice work!
I have left a couple of suggestions below on how to further improve the code...
976ea24
to
3e17459
Compare
…because the user will be specifying them with different symbols anyway
…on variable Allows a model to set Project-level expression variables during execution. Especially useful with the new Export Print Layout algorithms to allow models which dynamically set variables used in a layout prior to export.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! We will probably still need to do some further work on texturing, but this one is good to go...
Added texturing support for QGIS 3D