Bsurface addon don't work with new builds #42774

Closed
opened 2014-12-01 12:34:04 +01:00 by brothermechanic · 22 comments

System Information
Operating system and graphics card
gentoo amd64 gtx780 x2
Blender Version
Broken: latest (from builder.blender.org, for ex e240bd3)
Worked: 435eaa7 (from builder.blender.org)

Exact steps for others to reproduce the error
1- in edit mode paint gpencil strokes
2- push "Add Surface" button
3- get error "There aren't any strokes."

**System Information** Operating system and graphics card gentoo amd64 gtx780 x2 **Blender Version** Broken: latest (from builder.blender.org, for ex e240bd3) Worked: 435eaa7 (from builder.blender.org) **Exact steps for others to reproduce the error** 1- in edit mode paint gpencil strokes 2- push "Add Surface" button 3- get error "There aren't any strokes."

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @brothermechanic

Added subscriber: @brothermechanic

#42799 was marked as duplicate of this issue

#42799 was marked as duplicate of this issue
Eclectiel L was assigned by Sergey Sharybin 2014-12-02 09:00:09 +01:00

Added subscribers: @eclectiel, @JoshuaLeung, @Sergey

Added subscribers: @eclectiel, @JoshuaLeung, @Sergey

@eclectiel, mind looking into this one? :)

@JoshuaLeung, just wondering, are there some PyAPI changes in the gpencil to which all the addons now need to adopt?

@eclectiel, mind looking into this one? :) @JoshuaLeung, just wondering, are there some PyAPI changes in the gpencil to which all the addons now need to adopt?
Member

It's not so much an API change, but rather that Grease Pencil gets created on Scene level instead of Object level by default now. At least the object_grease_scatter one we have handles this correctly, but unfortunately, not all of the ones out there are quite as vigorous.

It's not so much an API change, but rather that Grease Pencil gets created on Scene level instead of Object level by default now. At least the object_grease_scatter one we have handles this correctly, but unfortunately, not all of the ones out there are quite as vigorous.
Member

BTW, I've now added an entry to the Python API changelog about this.

BTW, I've now added an entry to the Python API changelog about this.

Added subscribers: @MassimilianoPuliero, @mont29

Added subscribers: @MassimilianoPuliero, @mont29
Member

Added subscriber: @BrendonMurphy

Added subscriber: @BrendonMurphy
Member

hi, grease pencil is a widely used tool & important to many peoples workflows.
care should be taken when breaking release addons & popular tools.
as there is no maintainer & I am responsible for it's inclusion in Blender, i'll try to fix &/or try to negotiate fixes with other addons & Blender devs.
this addon should be fixed before 2.73 release as it's wide user base would be very disappointed.

hi, grease pencil is a widely used tool & important to many peoples workflows. care should be taken when breaking release addons & popular tools. as there is no maintainer & I am responsible for it's inclusion in Blender, i'll try to fix &/or try to negotiate fixes with other addons & Blender devs. this addon should be fixed before 2.73 release as it's wide user base would be very disappointed.
Eclectiel L was unassigned by Brendon Murphy 2014-12-06 00:20:33 +01:00
Brendon Murphy self-assigned this 2014-12-06 00:20:33 +01:00

Added subscriber: @ErickNyanduKabongo

Added subscriber: @ErickNyanduKabongo

Hi Joshua,

I m kind of understand you but can you make so that Grease Pencils gets created on object as default because many artists use GP to sketch on model and many add-ons rely on that ability for now retopo workflow will get really slow. Please bring those stroke back please.

Hi Joshua, I m kind of understand you but can you make so that Grease Pencils gets created on object as default because many artists use GP to sketch on model and many add-ons rely on that ability for now retopo workflow will get really slow. Please bring those stroke back please.
Member

Hmm... maybe I'll need to implement that switch to set where these get added after all. The impression I get is that for standard (non-old-addon usage), it's better that these are not attached to the object.

Hmm... maybe I'll need to implement that switch to set where these get added after all. The impression I get is that for standard (non-old-addon usage), it's better that these are not attached to the object.

Added subscriber: @el_diablo

Added subscriber: @el_diablo

For now, one with commit rights could just change the try block on line 108 in mesh_bsurfaces.py to:

# Check if they are grease pencil    
    try:
        #### Get the active grease pencil layer.
        strokes_num = len(main_object.grease_pencil.layers.active.active_frame.strokes)   
    except:
        strokes_num = len(bpy.data.grease_pencil[0].layers.active.active_frame.strokes)
        if strokes_num > 0:
            strokes_type = "GP_STROKES"
    else:
        if strokes_num > 0:
            strokes_type = "GP_STROKES"

I'm not sure its good python there since I'm not python expert and don't know all the specifics of try/except/else blocks, but it seems to work.

EDIT:
Actually it should (maybe) use the last gpencil block created and not - [x], so I guess [-1]?

For now, one with commit rights could just change the try block on line 108 in mesh_bsurfaces.py to: ``` # Check if they are grease pencil try: #### Get the active grease pencil layer. strokes_num = len(main_object.grease_pencil.layers.active.active_frame.strokes) except: strokes_num = len(bpy.data.grease_pencil[0].layers.active.active_frame.strokes) if strokes_num > 0: strokes_type = "GP_STROKES" else: if strokes_num > 0: strokes_type = "GP_STROKES" ``` I'm not sure its good python there since I'm not python expert and don't know all the specifics of try/except/else blocks, but it seems to work. EDIT: Actually it should (maybe) use the last gpencil block created and not - [x], so I guess [-1]?
Member

Here's a stop-gap patch to the addons themselves while I work on adding the toggle for setting whether gp datablocks are attached to the scene or to active objects.

gpencil_addons_patched-02.patch

It at least gets rid of the immediate problems, but at least from my tests, some other issues were cropping up. I'm not sure if those originated from this fix, or whether they were present in the addon.

Here's a stop-gap patch to the addons themselves while I work on adding the toggle for setting whether gp datablocks are attached to the scene or to active objects. [gpencil_addons_patched-02.patch](https://archive.blender.org/developer/F130129/gpencil_addons_patched-02.patch) It at least gets rid of the immediate problems, but at least from my tests, some other issues were cropping up. I'm not sure if those originated from this fix, or whether they were present in the addon.

This issue was referenced by blender/blender@fe4d0c234e

This issue was referenced by blender/blender@fe4d0c234eddd984b653c6530f26426871380504
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit blender/blender@fe4d0c234e.

Closed by commit blender/blender@fe4d0c234e.
Member

I've committed the switch to set where these are attached to.

So, for modellers/users of these addons, the only change to your workflow should be to just set "Data Source" from "Scene" to "Object" before starting to use those addons.

if you forget to do so before starting to draw:

  1. Go to the Properties Region for the 3D View
  2. Toggle the switch from "Scene" to "Object. The Grease Pencil data/layers UI should disappear at this point
  3. Click the green pencil icon to assign the Grease Pencil datablock used to the active object instead. Or, simply draw a new stroke again.
I've committed the switch to set where these are attached to. So, for modellers/users of these addons, the only change to your workflow should be to just set "Data Source" from "Scene" to "Object" before starting to use those addons. if you forget to do so before starting to draw: 1) Go to the Properties Region for the 3D View 2) Toggle the switch from "Scene" to "Object. The Grease Pencil data/layers UI should disappear at this point 3) Click the green pencil icon to assign the Grease Pencil datablock used to the active object instead. Or, simply draw a new stroke again.

I just test new build, it works!
Thank you.

I just test new build, it works! Thank you.

Thanks a lot Johua,

Thanks a lot Johua,
Sign in to join this conversation.
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#42774
No description provided.