cinetec_tech Posted August 10, 2014 Share Posted August 10, 2014 hi: Currently i'm working on a editor plugin. but feel confused with the user interface prefix parameter. in the editor plugin sample when you create a ui. interface = new UserInterface(replace(source,".cpp",".ui"),getName() + "::"); it seems the getName() should match the namespace of your script. example if your namespace is AAA and getName string is BBB, in your UI file , no matter which namespace you use , it's always error. is this a bug? it's just that when i have 2 editor plugin which i want to use the same namespace prefix , i can't load the other one. example in first plugin, namespace is AAA::Tools , second plugin AAA::Modify, in this case, I have to use AAA as the getName string. and as result, I can't load both plugin into the editor since they have same getName() string. Ideally, i should able to use different getName(), so first plugin return "AAA_Tools". second one return "AAA_Modify". Link to comment
silent Posted August 11, 2014 Share Posted August 11, 2014 Hi, it seems the getName() should match the namespace of your script We've made two plugins samples, which you can find in attachement. Both of these examples are not using the same name as a namespace. You need just to unpack contents of this folder into <SDK>/data. So, overall file structure will be looking like this: <SDK>/data/temp/1 - first plugins example <SDK>/data/temp/2 - second plugins example Please, check them and tell if one of this solutions is suitable for you. Thanks! plugins_test.zip How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
yang.zhang Posted August 13, 2014 Share Posted August 13, 2014 thanks silent. I will take a look at the workaround Link to comment
cinetec_tech Posted September 15, 2014 Author Share Posted September 15, 2014 Thanks for the samples! Now I know namespace more than ever. I have another question about namespace. In this code, 'interface = new UserInterface(replace(source,".cpp",".ui"),getName()+"::");', I don't wanna that prefix 'getName+"::"', and use this code, 'interface = new UserInterface(replace(source,".cpp",".ui"));', is that possible? If it's possible, what must I do in the '.cpp' and '.ui' file? Link to comment
unclebob Posted September 16, 2014 Share Posted September 16, 2014 Hi there! Yup, it's possible. One thing you should know if you're working with edtior plugins — each of them has its own unique namespace with the name that was returned from plugins' getName() function. That said, if you want to skip prefixes then you should care about correct namespace names by yourself in .ui file. Link to comment
cinetec_tech Posted September 17, 2014 Author Share Posted September 17, 2014 Sorry, if I skip the prefix, whatever I set the namespace and variable name in .ui file, it's always goes to "Unkown variable". I have no idea where's wrong. Link to comment
silent Posted September 17, 2014 Share Posted September 17, 2014 Could you please provide sample plugin that you are currently using? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
cinetec_tech Posted September 17, 2014 Author Share Posted September 17, 2014 Hi, I find out the problem. I need to add the namespace which returned from getName() to the variables in .ui file, but it is still wrong if getName() return NULL. I really wanna is : I need to call "Unigine::Widgets::Track" in editor plugins, but I don't wanna add any namespace at front of it, like "AAA::Unigine::Widgets::Track", as typeinfo(this) returns. Maybe there is no ways. Anyway, thanks a lot. Link to comment
cinetec_tech Posted September 17, 2014 Author Share Posted September 17, 2014 I'll prepare a sample for you later Link to comment
Recommended Posts