- Hydrocallis changed review status to Awaiting Review
- 1 mo
Perfect for artists, technical directors, and anyone working on complex Blender projects, File ID Search helps you maintain a clear overview of your file structure and dependencies.
In the Outliner, set the display type to "Blender File".
In the Outliner, select the Blender file for which you want to check the users.
The list in the Tool Panel of the 3D View will update. Click on the desired file, and the list of user files associated with it will be displayed below.
The function acquisition method within ID search is changed to a tuple format of data information and the name of the data.
This extension requests the following permission:
Access file data for ID searching and display
Before full code review it would be good to review functionality first.
Flagging this extension as potentially slowing down Blender in ways that impact usability.
The depsgraph_update_post
hook (runs often) and performs a potentially expensive operation (accessing selected ID's from the outliner UI).
The logic here also seems incorrect, there is an operator to update this data too, so it seems like depsgraph_update_post
is just trying to make the data update often.
Another issue is the use of generated data str(list(search(file)))
and later use of eval(..)
on that string. Generally we try to avoid eval(..)
as it can be made to execute arbitrary code in ways that are difficult to predict.
It looks like json
encode/decode would be a safe alternative although it may be even simpler to make the data run-time only and not store it in the scene.
Converted to Draft
Ready for review
Thank you for your review and advice. We have addressed the following points:
eval(..)
was problematic from a security standpoint.re
function.We would appreciate your confirmation on these changes.
@campbell
Thank you for your confirmation!
I understand that object names containing single quotes are automatically enclosed in double quotes. While I have thought of using the re function to handle this, I'm still unclear on the specific way to manage this with JSON (I understand that JSON saves it as a string).
If possible, could you kindly provide a code example of how to handle this with JSON? I apologize for any inconvenience and appreciate your assistance.
Thank you!
Converted to Draft
Ready for review
@campbell Bug fixed. Please check. Thank you.
I have changed the code. Please check it.
Converted to Draft
Ready for review
Hey everyone,
Just a heads-up about a recent change regarding the licensing of add-ons on the Blender extension platform. Moving forward, all add-ons will need to be released under the GNU/GPL 3.0 license (SPDX:GPL-3.0-or-later). This is mainly to keep things simple and consistent across the board.
Previously, we accepted various licenses as long as they were compatible with Blender’s distribution. However, to avoid any confusion and streamline the process, all add-ons using the bpy API should now be presented as GPL 3 (the same license the Blender bundle is distributed). Regardless of whether the original code was under GPL 2, or something else like MIT or ZLIB.
Existing add-ons versions won't be affected. However, new updates will need to comply to the revised requirements.
Thanks for understanding, and feel free to reach out if you have any questions.
@campbell Thank you for your time.
We have changed the data acquisition method to a tuple and inserted the name of the object in it as follows ret = tuple((repr(o), o.name) for o in col if o.user_of_id(ID))
Thanks.
Converted to Draft
Ready for review
I'm just a user/community member but I have some feedback.
I see there's a language barrier issue here, because I see there are some Japanese comments. "File IDs" are not a thing. "Files" are .blend files. What you're referring to as "Files" and "File IDs" are in fact called data-blocks. In its current state, the add-on is extremely confusing. I suggest to change the add-on's name, description, code, and UI accordingly, to use the word "data-block". In Blender's code, data-blocks are sometimes referred to as "IDs", but never in the UI, and never as "File IDs".
Also, you can make some of your code a lot simpler. Try this:
def search(id):
return bpy.data.user_map()[id]
Yep, that's all you need. Should be a lot faster too.
There are some other code quirks too, but not that important.
UX-wise, since this add-on relies heavily on the selection in an Outliner, I would just put the UI in the Outliner, rather than the 3D View's sidebar. For example, you could add a button in the Outliner's header, or the Outliner's right-click menu, and that button could summon a pop-up window showing the users. Then it's easy to figure out which outliner the user cares about, because it will just be bpy.context.area
.
Also note that I have implemented pretty much this exact functionality in the 3D Viewports Pie Menu add-on's Relationship/Delete pie, bound to the X key.
@Mets I heard a shocking story!I
was originally inspired to create this add-on when I was asked to standardize blender file names when distributing blender files, but I didn't realize it already existed...! (I didn't know it already existed... (Hopefully, it is a standard blender feature...)
I will use your add-on. I will remove this add-on soon...! Thank you so much.
I will try to follow your advice and make improvements when I have time...!Thanks.
I will mark this as Awaiting Changes to clear out from the queue. When/if you feel like you want to return this project mark for review again, or if you change name of the extension delete this one and upload new one.
@nickberckley Understood. Thank you for your time.
Sign in to comment.
Ready for review