Is there a way to bulk search/replace a text string inserted by a plugin (for game development), within an object, across all objects, across all collections?
Example: Collection 1 ( .. 2, 3, 4... have about 20 of them)
- Object 1
- Object 2
- Object 3 etc... 100's of them
Each object might have >= 0 of any combination of strings inserted like...
- /foo/Hoo/Fix/This/Part/123
- /foo/Hoo/Fix/This/Part/4
- /foo/Hoo/Fix/This/Part/abc
(I do not have a list of all the possible strings)
Now I'd like to bulk edit all objects within all Collections by searching-case-matching for
- /Fix/This/Part/
to be replaced with
- /Fixed/
so the final outcome for all these string in all objects in all collections are changed to:
- /foo/Hoo/Fixed/123
- /foo/Hoo/Fixed/4
- /foo/Hoo/Fixed/abc
Hoping there is a clever way to do this instead of me having to open each object and fix each of these strings one at a time ... and that's very risky too!
Thanks for the help!!
C.active_object['my_custom_prop']in the console (left side) & you will see the value of my_custom_prop – Blunder Sep 09 '22 at 07:54Is there a sample python find/replace script you know of that I can reuse please? -- there are a number I found that read and replace things in text files, but this is not a test file issue. Specific to find/replace things in the properties window, do you know of a sample script anywhere that finds and replaces text in that are contained in the properties window (in a specific plugin) please?
– Mark777 Sep 09 '22 at 19:45import bpy context = bpy.TheNameOfMyPlugin txt.replace("/findThis/", "/ReplaceItWithThis/")Will that find/replace ALL instances of findThis? -- which is essentially the need. findThis is very unique to the whole project. Also, will this work in 1 collection only, or across all Collections of objects? I'll test this, but good to know if on right/wrong track?
– Mark777 Sep 12 '22 at 17:47– Mark777 Sep 12 '22 at 18:56
` – Mark777 Sep 12 '22 at 18:56
`SyntaxError: invalid syntax
– Mark777 Sep 12 '22 at 18:57