plugins folder, now you see me, now you don't.
-
Hi there,
I am finalizing the update of my plugins to R21, and am working on the documentation right now, especially the part about explaining how/where to "install" plugins.
However, my recent experiences have somewhat conflicting results, to the point I am starting to wonder if I am becoming delusional, or my eyes and mind are just playing tricks on me.I remember from the early days of R20, when installing the application there was NO plugins folder being created, nor in the main application installation folder, nor in the user's location (where library, scripts, prefs, ... are stored by default).
If a user wanted a similar location as was default available in pre-R20 times, one had to create that folder manually and add it as an entry into the Plugins section of the Cinema4D Preferences.And now comes the weird part ...
On my main development machine, which had the originally release R20.0xx installed, I had manually created this "plugins" folder in my user location, and added that path as an entry in the Plugins section of the preferences. Plugins are thus available in that folder, and when I start Cinema 4D, in the console I see each plugin printing its "welcome-message", indicating it's loaded and ready to perform.
In the meantime I had upgraded to R20.057 and behavior remains the same: plugins get loaded, with welcome-messages in console window.For various reason R21 is installed on a different machine.
On that same machine, I now have installed R20.059 in order to compare behavior of my plugins between the two Cinema 4D releases.
Strange thing is that after the installation the plugins folder already exists in my user's location. No need to manually create one. Was this change added in recent updates?
More strangely: when I add the path to the plugins folder in the preferences, and restart Cinema 4D I get conflicts in the console windows telling me the plugin IDs are colliding. As if the plugins are loaded twice (twice from the same location, since only a single path was added to the preferences). When I remove the paths from the preferences and restart Cinema 4D, all is fine, no collisions ... and yet the plugins are loaded.
So R20.059 creates a plugins folder, and internally already knows about that path without the need to add it to the preferences?
R20.057 might create a plugins folder, no way to test this as I already had such folder before upgrading to R20.057, but it doesn't complain about colliding plugin IDs. as such it ignores duplicate paths. And when removing the path from the preferences it still does load the plugins. Nice!Now R21.026 does also create a plugins folder in the user's location (again: Nice!), and when this path is added to the preferences it doesn't complain about colliding pluginIDs. When removing the path from preferences the plugins still get loaded. Just as with R20.057 it seems to internally know about this "default" path, and ignores the duplicate when it's added by the user.
Both R20.057 and R21.026 behave identical where they know about the default path and ignore duplicates. While R20.059 knows about the default path but cannot handle duplicates.
So, R20.0xx did not create the default plugins folder, and obviously didn't internally know about.
Then R20.057 (or earlier) introduced the default plugins folder creation and internally knew about this, ignoring duplicate paths in the preferences.
Then R20.059 came along, still creating the default plugins folder but breaks the "ignoring duplicate paths".
Finally R21.026 creates the default plugins folder and again ignores duplicates.Could this be confirmed, please.
-
@C4DS said in plugins folder, now you see me, now you don't.:
Now R21.026 does also create a plugins folder in the user's location (again: Nice!), and when this path is added to the preferences it doesn't complain about colliding pluginIDs. When removing the path from preferences the plugins still get loaded. Just as with R20.057 it seems to internally know about this "default" path, and ignores the duplicate when it's added by the user.
Well, I am probably not of much use here, but I can at least confirm that R21 does know about some plugin paths internally. Actually, when you start C4D in debug mode, you will see the current plugin paths in one of the debug outputs: first come the two plugin folders from the installation directory and the user directory (whether they exist or not - I do not have a plugin folder in the installation directory), then the ones that are set manually in the preferences. I don't have issues with duplicate loads either, so obviously the paths are collated before C4D tries to load anything.
-
Hi Daniel, thanks for reaching out us.
I've spent some time to see how the different builds behaved and these are my findings.
The following builds have been run with a clean installation (their respective preferences folder were deleted) both on macOS and Windows- 20.011_RB245938
- 20.026_RB251664 (SP1)
- 20.028_RB255810 (SP1HF01)
- 20.030_RB257898 (SP1HF01)
- 20.057_RB269127 (SP2HF01)
- 20.059_RB272827 (SP2HF02)
- 21.022_RB288344 (RC)
- 21.026_RB290015 (RCHF01)
They ALL showed the following behaviors:
- the
plugins
folder is created in the user preference folder at the first start of the application; - the plugins found inside the
<user prefs>/plugins
are loaded automatically without the need to specify the search path inside Preferences -> Plugins;
The sole different behaviors have been spotted when the
<user prefs>/plugins
is included in the search path in Preferences -> Plugins:- in R20.xxx no plugin is loaded twice resulting in no duplicated IDs;
- in R21.xxx plugins are loaded twice resulting in duplicated IDs;
Unfortunately the above behaviors, and I can't explain why, are pretty different compared to yours and this might require a deeper discussion to understand what's causing this.
With regard to your initial question on where/how to install a plugin our recommendations are:
- do not install a plugin in the Cinema 4D application folder
- do not install a plugin in the Cinema 4D user's preferences folder
- do install a plugin in a custom folder where the user has proper access rights;
- modify the search path in Preferences -> Plugins (in R21 a
plugins.json
file is created in the user preference folder to programmatically achieve this)
Final, and personal, recommendation is to take advantage of installation scripts/tools, rather than of simply unzipping an archive, to:
- install different plugin versions for different Cinema versions by shipping a single package;
- check for elevated rights during installation
- suggest initial path where the plugin can be installed
- perform post-installation scripts to finalize the installation process by setting paths, flags or creating links.
Best, Riccardo
-
@r_gigante
Thanks for taking the time to perform all these tests.From this I have at least learned that the plugin folder is created during the first launch of the application. It can thus be after the installation of the original R20.0xx (apparently R20.011) I had been looking for a plugins folder in order to already "install"plugins, prior to launching the application.
I am sorry that all this time spent doesn't provide for a conclusive answer, since both our findings are contradicting. I will spend some time rechecking my findings, just to make sure ...
However, the recommendations for plugin installation is quite a surprise, in particular the second bullet:
"do not install a plugin in the Cinema 4D user's preferences folder".
That is exactly the location where the plugin folder gets created at first launch of the application, so I am confused this location is not recommended. -
Further testing.
R20.059
Step 1.- plugins available in <user_prefs>\plugins and copied to D:\R20plugins
- preferences has paths to both, both checkboxes enabled.
Relaunch Cinema 4D, which reports colliding pluginIDs in the console window
Step 2
- plugins available in <user_prefs>\plugins and in D:\R20plugins
- preferences has paths to both, <user_prefs>\plugins unchecked, D:\R20plugins checked
Relaunch Cinema 4D, plugins loaded, no collisions reported in console
Step 3
- plugins available in <user_prefs>\plugins and in D:\R20plugins
- preferences has paths to both, <user_prefs>\plugins checked, D:\R20plugins unchecked
Relaunch Cinema 4D, plugins loaded, no collisions reported in console
Step 4
- plugins available in <user_prefs>\plugins and in D:\R20plugins
- preferences has paths to both, both unchecked
Relaunch Cinema 4D, plugins loaded, no collisions reported in console
R21.026
Step 1- plugins available in <user_prefs>\plugins and in D:\R21plugins
- preferences has paths to both, both checkboxes enabled.
Relaunch Cinema 4D, colliding pluginIDs reported in console
Step 2
- plugins available in <user_prefs>\plugins and in D:\R21plugins
- preferences has paths to both, <user_prefs>\plugins unchecked, D:\R21plugins checked
Relaunch Cinema 4D, colliding pluginIDs reported in console
Step 3
- plugins available in <user_prefs>\plugins and in D:\R21plugins
- preferences has paths to both, <user_prefs>\plugins checked, D:\R20plugins unchecked
Relaunch Cinema 4D, plugins loaded, no collisions reported in console
Step 4
- plugins available in <user_prefs>\plugins and in D:\R20plugins
- preferences has paths to both, both unchecked
Relaunch Cinema 4D, plugins loaded, no collisions reported in console
Current results of R21 seem to fit your findings, I must have mixed up results of R21.026 with those of R20.059
Meaning that, indeed, R20.057 (on one machine) matches with the results of R20.059 (on the other machine), no collisions when duplicate paths.However, I don't understand step 3 on R21.026 doesn't report colliding pluginIDs.
I just don't get it. -
Hi Daniel, thanks for following up.
I've reproduced your cases and I warmly encourage you to test them again since I found a few discrepancies.
- R20.059
- case 1: behavior confirmed
- case 2: behavior not confirmed: I got collision since the plugins are loaded by default from the
<user prefs>/plugins
folder (even though unchecked) and from the<whatever>/R20plugins
folder still checked in the search path. This behavior is consistent with the finding in my previous post since R20.xxx loads by default anything it finds in the<user prefs>/plugins
folder - case 3: behavior confirmed
- case 4: behavior confirmed
- R21.026
- case 1: behavior confirmed although I see two collisions for every plugin. This is correct since Cinema loads the plugins 3 times, the first by default from
<user prefs>/plugins
, the second because of the presence of the<user prefs>/plugins
in the search path, the third because of the presence of the<whatever>/R21plugins
in the search path - case 2: behavior confirmed
- case 3: behavior not confirmed: I got collision since the plugins are loaded by default from the
<user prefs>/plugins
folder (even though unchecked) and from the<user prefs>/plugins
folder still checked in the search path. This behavior is consistent with the finding in my previous post since R21.xxx doesn't exclude the <user prefs>/plugins folder if is specified in the search path - case 4: behavior confirmed
- case 1: behavior confirmed although I see two collisions for every plugin. This is correct since Cinema loads the plugins 3 times, the first by default from
Finally with regard to
However, the recommendations for plugin installation is quite a surprise, in particular the second bullet:
"do not install a plugin in the Cinema 4D user's preferences folder".
That is exactly the location where the plugin folder gets created at first launch of the application, so I am confused this location is not recommended.we think that plugins preferences or user-dependent plugin files might be stored in the
<user prefs>/plugins
while the actual plugin should be stored in a more convenient location. Last but not least although not planned in the short future, the <user prefs> folder might change in structure and location (usually it depends on OS) and this might cause side effects to plugins stored over there.Best, Riccardo
- R20.059
-
Tested again, same results.
R20.059
case 2: <user_prefs>\plugins unchecked, D:\R20plugins checked
-> restart -> no collisionR21.026
case 3: <user_prefs>\plugins checked -> no collision.
I really don't get this as I remember having had collisions when I first tried this.I have tried following:
Removed all paths from the preferences, restart Cinema 4D. Obviously, plugins are loaded due to the default folder, and no collisions since no other path is defined.
I then add the <user_prefs>\plugin folder again, checkbox enabled. Restart -> no collisions.Went a step further:
I had the <user_prefs>\plugins folder added, then added the <user_prefs> folder (without the "plugins" subfolder) -> restart -> no collisionWent even crazier:
With above 2 paths available (and enabled), I added D:\R21plugins
-> restart -> collisions !!!Final case:
removed the D:R21plugins, then copied the plugins in the <user_prefs>
resulting in
<user_prefs>\plugins
<user_prefs>\plugins - Copy
Added both paths to the preferences, both enabled -> restart -> collisions
Removed the copy path from the preferences keeping only <user_prefs>\plugins
-> restart -> no collisionCannot explain the behavior.
I think I will stop the whole topic here, it seems to make no sense at all.
-
I'm sorry Daniel you're giving it up here, but I dunno how I can be of any further help. I will ask today to one of the other members of the team to replicate the same steps on his system to see if they are consistent with my findings or yours to grant information correctness for those coming in the future and reading the post.
Best, R.
-
hello,
I've tested with R20.059 and 21.026 and the behavior are the same than @r_gigante. (we talked about it to be sure)
Cheers,
Manuel -
@r_gigante
I am not actually giving up, just mentioning that it doesn't seem to make sense pursuing with this topic. As it seems we're not experiencing the same behaviour, as if we're using a different version (although it seems to be the same version number) or we're performing different actions.Now, I added a new plugin and could not reproduce my previous result with R20.059, as it now always seem to collide whatever I try.
However, with R21 -which was mentioned should always collide- ... well now I get no collisions. According to the printscreen I made you can notice the only path added to the preferences is the <user_prefs>\plugins, exactly the same as the "internal default", still the console shows no collisions.According to both of you, this is not reproducible at your end. Still I am getting this result. I must then have done something differently than both of you?
Note, the screenshot is right after launching Cinema 4D, and opening the console window and the preference window. No changes performed, simply opening the windows. -
hello,
with the same parameters, I got collision. Would it be possible to test with our sdk ?
(it should not be different but at least you would test with the same plugin than us)Cheers,
Manuel -
@m_magalhaes
I have built the sdk samples and copied the res folder and the created xdl64 file into
C:\Users\Daniel\AppData\Roaming\Maxon\Maxon Cinema 4D R21_64C2B3BD\plugins\sdkStarting Cinema 4D without any paths in the preferences and plugins get loaded. No message in the console.
Then adding the path:
C:\Users\Daniel\AppData\Roaming\Maxon\Maxon Cinema 4D R21_64C2B3BD\plugins
to the preferences, restarting Cinema 4D ...
Plugins get loaded, no message in the console window. Thus no collision. -
Hi Daniel, thanks for following up again.
Just to be sure nothing get's neglected I've recorded a video showing that also doing your steps is consistent with what me and Manuel have reported with regard to R21
You can see the video here.Best, Riccardo
-
Thanks for video.
I have a slight suspicion about the reason we have different results. Similar to that other discussion point about memory leaks that you guys also can't seem to replicate.
But to figure this all out I will need to purchase some extra hardware ... might take a while before I get the funds collected. I will then report back, in both topics. -
I now have upgraded the original laptop which was running R20.057, and now have Windows 10.
As such with a clean install, I have now R20.059 installed (clean, not updated) and R21.026 (also clean, not updated from 21.022).
Both versions have plugins installed in the <user_prefs>/plugins folder. Without any path added to the Cinema 4D preferences they both load the plugins as is.For testing purposes I have added the path to this folder in both releases.
With R20.059 I get collisions, which I didn't get with R20.057 on this same laptop running Windows 8.1
With R21.026 I do not get collisionsI thus experience the same results as those I had with the original installs on "the NUC" (see the memory-leak topic). I had hoped the results would be different, as was clarified by the memory-leak topic, but alas the presence of a dedicated/discrete graphic card has no impact on the result this time.
But still, I now have 2 machines which both have clean installs and provide same results as to collisions/no-collisions, and still contradict the results you both have experienced. And this for both R20.059 and R21.026.
I am not sure were to go from here?
-
hello,
I confirm it's strange.
Could you use the g_console=true and g_logfile=d:\logfile.txt as said in this page
(both will contain the same lines)Send us the logfile ([email protected]) if you don't want to share that in public.
Cheers,
Manuel