Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting text on multiple layers issue
#2
What a mess... no wonder you get lost in your own code with names as descriptive as "drawable" and "layer".

I couldn't completely fathom what you are trying to do but a couple of observations:

1) When you merge layers the merged layers are destroyed and the call returns a new layer which is the result of the merge. So after the merge you can no longer use the references to the initial layers (as you do in drawable.visible=false). In any case merging all visible layers is often overkill and somehow showing that you don't really know where your layers are. Your normally insert the layer where it needs to be and then merge down. You can also wonder if you need to do all that merging or if you aren't doing it too early, so you cannot check what your script dit after it crashed.

2) there are two ways to use gimp_text_fontname(): with a target drawable or without one. When you use a target drawable, the returned value from the call is a floating selection, and the proper way to handle it is to anchor it in the target drawable by calling gimp_floating_sel_anchor(floatingSel). No need to merge layers or else in that case, and an important difference with the merge is that your target layer remains the same.
Reply


Messages In This Thread
RE: Setting text on multiple layers issue - by Ofnuts - 11-13-2021, 11:47 AM

Forum Jump: