3
$\begingroup$

Freestyle can be restricted to certain objects using Groups. I have a file with freestyle settings and a group named Freestyle1. I also have a separate file containing ObjectA which is also inside a group called Freestyle1 within its own file. However,when I linked ObjectA into my freestyle file, freestyle does not show up on it, and it's group does not show up as an option within dupligroups, or anywhere else.

If I link the group instead of the object, then it shows up under the freestyle group drop down menu, but as a second entry of the same group name.

I assume that what is happening is that the linked object's group is considered to be a totally different group, despite having the same name.

Is there any way around this? I want to be able to define what groups an asset belongs in within its own file, then link it into my scene file and have it work. Complex scenes simply aren't viable if I have to manually assign every object to a group every time.

If I create a proxy of the linked object, it simply has no groups.

EDIT: Test files: A scene with freestyle setup for a group named freestyle, and another file with an object also in a group named freestyle (place in same folder or re-link the suzanne from linked object.blend):

$\endgroup$
2
$\begingroup$

Try creating another group, containing your linked-in groups. Then set your Freestyle options to that "outer group". If that works, you (or someone else) could write some Python code to automatically create those groups based on the linked-in group names.

$\endgroup$
  • $\begingroup$ How do I make a group contain another group? Linked objects do not show up as in any group under the Object Data panel. Does this need to be done with a script? Would it work to have a script that takes any duplicate group names from other files and adds those objects to the group of the same name? $\endgroup$ – Drudge Feb 14 '17 at 9:48
  • 1
    $\begingroup$ If you post a URL to your file, I'll see if I can set something up for you. $\endgroup$ – dr. Sybren Feb 14 '17 at 10:34
  • $\begingroup$ I don't have a specific file, but I can set up a test file. $\endgroup$ – Drudge Feb 14 '17 at 20:36
  • $\begingroup$ A group of object groups can be created as follows. Suppose that you have three groups G1, G2 and G3 and you want to group them to form a new group G4. First, add an empty to the scene and create an instance of G1 using the dupli_group option (in the Duplication panel in the Object properties window). Repeat that for G2 and G3 as well. Then add the empties to the new group G4. Note that linked groups are automatically instanciated by the "Instance Groups" option of the linking operation. $\endgroup$ – T.K. Feb 16 '17 at 1:05
  • 1
    $\begingroup$ @Drudge Yes, that's right. So the solution suggested by Sybren will work as expected---you first link groups from other blend files, and create a new group of the empties that are dupli-groups of the linked groups. Then you specify the new group in the Selection by Group in Freestyle, and all the objects in the linked groups will be considered as members of the new group. This will nicely resolve naming collisions you might have, and no scripting would be required. $\endgroup$ – T.K. Feb 16 '17 at 14:16
1
+50
$\begingroup$

Naming collisions may occur in Blender when local and linked data blocks have the same name. When a naming collision occurs, a linked data block could be distinguished from the others by taking account of the file name of the blend file the linked data block comes from.

As far as I can see from the Blender code base, data block selectors in the Blender GUI (such as the Group selector in the Freestyle Line Set properties panel) do not take into account the blend file names when showing linked data blocks. Moreover, only one of the data blocks of the same name (i.e., only one of the groups named "Freestyle1" in your case) can be selected. Due to these limitations, you cannot fully exploit the line selection by group when naming collisions are involved.

If you resolve naming collisions yourself (e.g., by renaming the linked group to "Freestyle2"), then you can avoid the aforementioned issues. A scene render layer may have multiple line sets, so that for each of the local and linked groups, you can define a line set of its own and associate it with a line style data block (possibly linked from a separate blend file).

$\endgroup$
  • $\begingroup$ I will be linking in many characters and props, so any sort of manual changing of things will get far too tedious. It seems like my best option would be some sort of script that takes linked objects in group X, and adds them to the group of the same name that was already in the file. Do you see any options that don't involve needing to script? $\endgroup$ – Drudge Feb 14 '17 at 9:50

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.