Comments (4)
Checking on Windows 10 with VS 2022 and nightly, I can confirm the error :
no instance of overloaded function ofApp::loadModel matches the argument list
The loadModel function takes a string as an argument.
void ofApp::loadModel( string filename );
from openframeworks.
Are you working with an up to date master?
I just checked with the nightly on macOS and it compiles without the .string() appended.
from openframeworks.
@lvdpower are you on windows? it may be related to recent changes with file paths. can you provide the file path you are dragging (does it contain unicode?), as well as the exact error you are getting?
from openframeworks.
well it's a perfect example. the loadModel function is given an fs::path, which on windows implicitly turns into a wstring.
now the question is: does the underlying assimp lib support windows wide char paths? if so, the path properties should be maintained down to the underlying lib call. if not, I suggest the same pattern we just discussed here:
// pseudo, for a lib that does not support wchar
loadModel(fs::path filename) {
if (auto name_as_string = ofPathToString(filename)) { // explicit conversion with try-catch turning into an optional
// GOOD: the path is either native std::string, or contains no untranslatable wchar unicode
// do the thing with *name_as_string
} else {
// we're on windows, and the path contains untranslatable wchar
// somehow inform user that the given path is not digestible by the library
}
}
this introduces the <optional> pattern which is a simple and effective way of dealing with "disappointments". note that this won't work right now as the current implementation of ofPathToString is not <optional>.
if the lib supports wchar:, presumably (invented API):
loadModel(fs::path filename) {
auto charpath = filename.native().c_str(); // on windows auto is wchar, else is char
LibObject object;
#ifdef WIN32 // or maybe an if constexpr switch based on type
LIB_loadfromwchar(charpath, &object);
#else
LIB_loadfromchar(charpath, &object);
#endif
// object contains data
}
all this might seem a bit overkill, but if we want transparent unicode wchar support in OF it means pushing the of::path properties as down and as close to the consumer as possible.
from openframeworks.
Related Issues (20)
- shadow the C++20 std::numbers in of::numbers
- [actions] ideas HOT 1
- ofSignedNoise(float x) always returns zero
- [idea] VerticalSync outside of GLFW
- ofAVFoundationVideoPlayer thread priority
- [MSVC] OpenFrameworks failed to build error MSB3073: xcopy /Y /E "C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\dll\x64\*.dll" HOT 7
- [MSVC] OpenFrameworks failed to build with "ofxAssimpAnimation.obj : error LNK2001: unresolved external symbol "public: struct aiNode" HOT 2
- ofGLFWWindowSettings::monitor has no effect (with Windows) HOT 6
- ofxSvg current svgtiny.lib does not work - Visual Studio HOT 8
- assimp3DModelLoaderExample text mirrored in Visual Studio HOT 3
- problem with iOS examples assimpExample & iPhoneGuiExample based on MyGuiView.storyboard
- macOS XCode build failed with unkown argument "-index-store-path" and cannot specify -o when generating multiple output files HOT 1
- ofCairoRenderer - ofTranslate not reset in a new frame
- math PI define issue HOT 3
- emscripten complied libpugixml issue HOT 1
- ofGLFWWindow - settings.monitor not right no macOS, depending on main window size
- CI problem with VS jobs related to freetype / brotli HOT 1
- OF_FBOMODE_NODEFAULTS doesn't set identity matrices
- [suggestion] folder organization - libs separated from openFrameworks & openFrameworksCompiled HOT 1
- Github Actions Cache HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openframeworks.