sound_waveform_display icon indicating copy to clipboard operation
sound_waveform_display copied to clipboard

it seems like just running simple scripts turns the waveform in the timeline off I was hoping that you could update this

Open fast-blender-add-ons-dot-com opened this issue 2 years ago • 5 comments
trafficstars

this has happened in multiple occurrences....or maybe give a clue how I might update this I have a programmer that works with me And if you could give me some clue why this might be happening maybe we could update it for you and send you the code... I made a video detailing the issue https://drive.google.com/file/d/1D5mp9shqUbJw9wSL4F_X-DRPoqj-Hw_A/view?usp=sharing

import bpy

def add_all_keyframe(obj, attr="value", frame=bpy.context.scene.frame_current): if obj.type != 'MESH': return

blocks = obj.data.shape_keys.key_blocks
if not blocks: return

for k in blocks:
    k.keyframe_insert(attr, frame=frame)

add_all_keyframe(bpy.context.object) bpy.context.scene.frame_set(bpy.context.scene.frame_current) #update ui

bpy.ops.outliner.orphans_purge(do_local_ids=True, do_linked_ids=True, do_recursive=False)

Hi, The problem lies in the last line when you use the data purge. bpy.ops.outliner.orphans_purge(do_local_ids=True, do_linked_ids=True, do_recursive=False)

When you call this operator, you are purging the image of the waveform as well. The waveform image is loaded without fake user so that it's not stored in the blend file and automatically purged when closed

You have to enable fake user for the image. Since there is a use case I'll add choice in preferences in next update.

For now, here is a permanent "Fix" in code for you: Add image.use_fake_user = True after image loading (line 308 in file display_wave_image.py)

Alternatively, you can adapt your own script to purge only what's needed instead of a global orphan data purge.


For a manual quick fix in currently opened blend:

Just tick it in the outliner > data api image Alternatively, you can also adapt your own script to purge only what's needed instead of a global orphan data purge. Cheers.

Pullusb avatar Jan 25 '23 10:01 Pullusb

Thank you so much for that awesome reply I'm working on a tutorial series( and a new workflow called "making a sitcom in blender") and I'm gonna totally be pushing your sound waveform display....can u send a message when it's updated on github and til then I'll provide my updated version in the link to it in the description... You made a seriously awesome tool and that's so nice of you to support it to this capacity...

Andrew D the Creator of EXTREME PBR BLENDER ADD-ON!...is adding my Add-on that I created, SUPER SOLID MODE to a list of TOP BLENDER ADD-ONs in a panel in his, soon to be released SUPER-SECRET NEW ADD-ONs Preferences!...learn more on my GumRoad page

https://toapyandfriends.gumroad.com/l/super-solid-mode

use code to get it gratis as a thank you!(I update with new functionality every week)

toapy-and-friends-free-codes

On Wed, Jan 25, 2023, 2:31 AM Samuel Bernou @.***> wrote:

Hi, The problem lies in the last line when you use the data purge. bpy.ops.outliner.orphans_purge(do_local_ids=True, do_linked_ids=True, do_recursive=False)

When you call this operator, you are purging the image of the waveform as well. The waveform image is loaded without fake user so that it's not stored in the blend file and automatically purged when closed

You have to enable fake user for the image. Since there was a usecase I'll add choice in preferences in next update.

For now, here is a permanent "Fix" in code for you: Add "image.use_fake_user = True" after image loading (line 308 in file display_wave_image.py)

Alternatively, you can also adapt your own script to purge only what's needed instead of a global orphan data purge.

For a manual quick fix in currently opened blend:

Just tick it in the outliner > data api [image: image] https://user-images.githubusercontent.com/7763187/214537784-c1bdf260-a74f-4491-a9ce-d8f7dcdb8747.png Alternatively, you can also adapt your own script to purge only what's needed instead of a global orphan data purge. Cheers.

— Reply to this email directly, view it on GitHub https://github.com/Pullusb/sound_waveform_display/issues/5#issuecomment-1403398998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWFQGIKIYOY2RU32WYOJURLWUD6G5ANCNFSM6AAAAAAUF5DE54 . You are receiving this because you authored the thread.Message ID: @.***>

https://drive.google.com/file/d/1DcLQZ-vhpmWUVsaya4SN0RZgxvVvEbi4/view?usp=sharing OKAY I think our lines 308 differs or something because I place this in the code about where i thought it should go and it's not working Can you tell me precisely after which line to place this and at what level of indentation... I posted a link that show where I put it

It's a few lines up, just after image variable is assigned.

You probably did not have the last version. But in that case you can inspect on github directly. It's here exactly : https://github.com/Pullusb/sound_waveform_display/blob/main/display_wave_image.py#L309

Pullusb avatar Jan 27 '23 16:01 Pullusb

OKI actually got it to work with this line I was getting invalid syntax on the line that you provided

bpy.data.images[".tmp_scene_waveform.png"].use_fake_user = True

and I noticed just now I don't know if it was because of that Also I notice when you click the on button on your add on panel everything in the scene gets deselected ....wouldnt it be better if everything stayed selected just the way it was..id like that... but again thanks for how awesome you're add on is and how much more beautiful it makes blender....

On Fri, Jan 27, 2023 at 8:18 AM Samuel Bernou @.***> wrote:

It's a few lines up, just after image variable is assigned.

You probably did not have the last version. But in that case you can inspect on github directly. It's here exactly : https://github.com/Pullusb/sound_waveform_display/blob/main/display_wave_image.py#L309

— Reply to this email directly, view it on GitHub https://github.com/Pullusb/sound_waveform_display/issues/5#issuecomment-1406723229, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWFQGIN3MG4AS35VAP3DFW3WUPYMPANCNFSM6AAAAAAUF5DE54 . You are receiving this because you authored the thread.Message ID: @.***>