Page MenuHome

looptools gstretch/gpencil bug
Open, Confirmed, MediumPublic

Description

System Information
Operating system: windows 7 64 bits
Graphics card: gforce 9800gt

Blender Version

Broken:

(example: 2.80, edbf15d3c044, blender2.8, 2018-11-28, as found on the splash screen)
It does not work well and if you press Gstrech it shows a bug

Worked: (optional)

Short description of error

Exact steps for others to reproduce the error
just press GStrech and they will see the error

Details

Type
Bug

Event Timeline

Stephen Swaney (stiv) triaged this task as Needs Information from User priority.Apr 17 2019, 4:21 PM

From the barely legible error, it looks like there is no Grease Pencil stroke associated with this object.

Got a .blend for us that shows the problem?

yes, try this .blend although the problem also appears with a new .blend file
I use google translate{F6954713}

.blend
compressed in zip{F6954776}

Also if you open a new file and press gstrech you will see what the bug does.
The tool is malfunctioning in general.
google translate

George Vogiatzis (Gvgeo) raised the priority of this task from Needs Information from User to Needs Triage by Developer.Apr 20 2019, 5:24 PM

From what I can tell, grease_pencil was in object or scene in 2.79.
The addon used the objects grease_pencil to stretch the vertices.
Now grease_pencil is a separate object.
The error is exactly that, object has no grease_pencil anymore.
Not sure how the annotation work. Must be in scene?

The addon needs to be updated for 2.80.
The default cube is enough for the error.

Traceback (most recent call last):
  File "D:\blender-2.80\2.80\scripts\addons\mesh_looptools.py", line 3986, in invoke
    return self.execute(context)
  File "D:\blender-2.80\2.80\scripts\addons\mesh_looptools.py", line 4016, in execute
    if get_grease_pencil(object, context):
  File "D:\blender-2.80\2.80\scripts\addons\mesh_looptools.py", line 64, in get_grease_pencil
    gp = object.grease_pencil
AttributeError: 'Object' object has no attribute 'grease_pencil'

I really do not know what is wrong, but thanks for the explanation .. And yes, with a cube you can see the error

Philipp Oeser (lichtwerk) triaged this task as Confirmed, Medium priority.Apr 23 2019, 9:44 AM

Will confirm for now, not sure yet how to convert this feature to 2.8, needs some thinking [since gpencil is indeed a separate object in 2.8]

Philipp Oeser (lichtwerk) renamed this task from looptools gstretch bug to looptools gstretch/gpencil bug.Apr 23 2019, 9:45 AM

in general, it was working with 2.80.54 (abt 6th april build), some thing changed by this time.

hi, I've been looking here: https://docs.blender.org/api/blender2.8/bpy.ops.gpencil.html

64		-     gp = object.grease_pencil
	64	+     gp = bpy.data.grease_pencils
65	65	      if not gp:
66		-         gp = context.scene.grease_pencil
	66	+         gp = context.view_layers.grease_pencils
67	67	      return gp

This led to an error here:

2844		-     layer = gp.layers.active
	2844	+     layer = context.active_gpencil_layer

which led to errors in:

2845	2846	      if not layer:

this was to do with

frame = layer.active_frame

@Philipp Oeser (lichtwerk) I'm just guessing and stuck on frame atm. maybe on the right track?

Committed 934b32af8ef7 although it only part fixes the issue.
Using the default cube I needed to subdivide an edge at least once for it to run in Spread modes.
Project function not working.
@Spivak Vladimir (cwolf3d) and @Antonio Vazquez (antoniov) are helping with the issue.

LoopTools: Gstretch fix. Grease pencil must have name 'GPencil'. Script take only the first strokes.
https://developer.blender.org/rBAb23f15603088f2e382ce9a53093b58debc3d70e6