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

[Question] does not display custom icon #427

Closed
PavelBlend opened this issue Feb 8, 2019 · 3 comments
Closed

[Question] does not display custom icon #427

PavelBlend opened this issue Feb 8, 2019 · 3 comments
Labels

Comments

@PavelBlend
Copy link

Hello.
I have a question: under what circumstances should the custom icon be displayed?
Once I launched a blender and saw a custom icon in the Physics tab, which is on the flip_fluids_addon\icons\ path.
But it was once and more I did not see him.
Whenever I start a blender, I see the standard icon in the form of a drop.

@rlguy
Copy link
Owner

rlguy commented Feb 8, 2019

Hey PavelBlend,

The custom icon should always be displayed on the button:

icon_show

Unless it is enabled on an object, then it will show X:

icon_x


If you are not seeing the custom icon, then there might have been a problem when the addon loads the icon. I noticed a small problem in the code, but it did not affect how my icon loads.

Would you be able to replace your flip_fluids_addon/properties/flip_fluid_properties.py file with this modified version:

flip_fluids_addon/properties/flip_fluid_properties.py

And then open Blender and let me know what is shown in the system console (Blender > Window > Toggle System Console) and if the custom icon is displayed. The modified file might output some information that looks like this:

Read prefs: C:\Users\ryanl\AppData\Roaming\Blender Foundation\Blender\2.79\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.79\python
DEBUG #427:  Loading custom icon
DEBUG #427:  Icon path C:\Users\ryanl\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\flip_fluids_addon\icons\flip_fluids_logo.png
DEBUG #427:  Icon exists True
DEBUG #427:  Icon name 'flip_fluids_logo'
DEBUG #427:  Icon object <bpy_struct, ImagePreview at 0x00000235389D4278>
DEBUG #427:  Icon value 900
DEBUG #427:  Icon retrieve <bpy_struct, ImagePreview at 0x00000235389D4278>

@rlguy rlguy added the bug label Feb 8, 2019
@PavelBlend
Copy link
Author

PavelBlend commented Feb 9, 2019

I am using version 9.0.5.3.
I copied your file and the console does not display anything (since the self.is_custom_icons_loaded variable is always True for me).
Then I modified your code and the icon appeared.
I sent you a modified file by mail (the one you used when searching for beta testers).
I do not know why your code does not work.
I just noticed that the self.is_custom_icons_loaded variable doesn't change, and I took it out of the class.

@rlguy
Copy link
Owner

rlguy commented Feb 11, 2019

Hey PavelBlend,

Thanks for the update! I understand the problem now and was able to reproduce the issue of the custom icon not loading.

The self.is_custom_icons_loaded variable could be saved into the .blend file as True with File > Save Startup File. For the code to work, the is_custom_icons_loaded variable needs to always be False when Blender is loaded which is why it works as a global variable.

I have changed how the icon is loaded. I have removed the variable and the addon will now always load/reload the icon when Blender starts up or when a scene is loaded. This fix will be included in the next update (v1.0.5).

- Ryan

@rlguy rlguy closed this as completed Feb 11, 2019
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