3
$\begingroup$

Since 2.83, Grease Pencil objects can interact with light sources.

In my tests, it seemed that this only applies to Grease Pencil objects that were created with Blender 2.83?

Is that correct? If not, what do I have to consider?

$\endgroup$
0
4
+100
$\begingroup$

That's correct. The Grease Pencil has been rewritten from scratch and lights are only affecting Grease Pencil Objects created in Blender 2.83.

Quote from the official Blog Post (5. Converting Old Files):

When you load a file, Blender tries its best to convert missing settings/features to their new equivalent (e.g. 2.7 Groups → 2.8 Collections). But sometimes there isn’t a one to one equivalent, especially if the feature has been replaced completely. In the new system, for example, the Light Effect modifier is replaced by light objects, this case needs to be handled manually.


Some new properties/data seems to be missing in the old version of the Grease Pencil Object thus lights can't illuminate the old strokes. However, there is a workaround:

  1. Create a new Blank grease pencil object (ShiftA > Grease Pencil > Blank)
  2. Replace its data-block with the old one (Object Properties > Data-Block dropdown)

    enter image description here

  3. And copy all transforms (location, rotation and scale) from the old one to the newly created object (you can use 'Copy Attributes' Add-on for that).

Following script does all of that in one go. Select all appended objects and just run the script:

enter image description here

import bpy

C = bpy.context
D = bpy.data

for old_gp_obj in C.selected_objects:
    if old_gp_obj.type == 'GPENCIL':
        # Create new gp object based on the old data
        new_gp_obj = D.objects.new("{}_converted".format(old_gp_obj.name), old_gp_obj.data)
        # Copy transforms
        new_gp_obj.matrix_world = old_gp_obj.matrix_world.copy()
        # Get and link to collection
        old_gp_coll = old_gp_obj.users_collection[0]
        old_gp_coll.objects.link(new_gp_obj)
        # Hide old object in viewport
        old_gp_obj.hide_set(True)

Notice that old objects are hidden after running the script.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.