10
$\begingroup$

Imagine you have a rig that consists on bones and everything, and that in that setup you also include curve objects to do some physics simulation. All these rig objects would be part of a group for linking How can you bake the cache of those physics when you link the group in the animation file?

$\endgroup$
6
$\begingroup$

Yes this can be done.

However the solution is admittedly awkward, and this is an areas Blender could be improved.

Initial Bake

  1. Make sure the point cache has External and Use Lib Path option enabled,
    this way each library object can have its own cache when instanced in other files.

  2. Now for the trick In the file that links this data in.

    1. In the Properties Space, Select the object category.
    2. Pin the object (Pin icon, top left corner of space).
      Pin icon
    3. Now, you can use the object ID selector to select a new object, one that is in the library and need the simulation to be baked.
    4. Now navigate to he buttons and run the bake operation.

Note, This is really a hidden feature which we are not proud of!

Setting Parameters

To just execute the bake locally often isn't enough, you probably want to change the frame range and may even want to tweak physics settings based on the environment.

In this case the only option is to use a Python script which overrides these settings on load, give it a name that won't conflict with other Python modules and enable Registered in the text header so it runs on load.

Heres an example: my_init.py

import bpy
scene = bpy.context.scene
obj = bpy.data.groups["MyLinkedCharacter"].objects["HairDo"]
obj.particle_systems["ParticleSystem"].point_cache.frame_start = scene.frame_start
obj.particle_systems["ParticleSystem"].point_cache.frame_end = scene.frame_end

This script can be run manually at any time to update the settings.


Note

Rather then having single text-blocks per-file, the open-movie Sintel used a single Python script that loaded for all files, called finals_config.py. I'd recommend using a single script to manage this otherwise you can't easily see whats happening without opening up every blend file although this script become messy over the course of the project so its not a great starting point, more a reference as to what can be done.

$\endgroup$
  • $\begingroup$ You write: "Use Lib Path option enabled", but answer below tell disabled. $\endgroup$ – Cenda Mar 1 '17 at 9:58
2
$\begingroup$

I just found solution ( it is same as above, but for me much better for understand :) )

If you go to the Object properties in your linked scene, there's a dropdown menu that allows you to select objects. Make sure the cloth object is selected. It'll have an L next to it indicating it's a linked object. Then you can click the little pin icon which will pin the object selected in the dropdown menu to the properties panel even if you select another object. Now switch to the Physics tab with the cloth bake settings and you should be able to press Bake.

enter image description here

$\endgroup$
  • $\begingroup$ This was a bit confusing. Thanks for clarifying - added your image to own answer. $\endgroup$ – ideasman42 Feb 18 '15 at 21:34
0
$\begingroup$

VERY IMPORTANT NOTE

1) The "Use Lib Path" must be disabled, otherwise the cached files will be written for the linked source at the source blend file path, as opposed to what should be, which is per scene file at the scene file path.

2) After Caching the linked file, save the main scene file, go to where it's saved, right-click on the cache folder and make the folder and all its contents "Read-Only". If you don't, Blender deletes them one by one when you scrub the timeline (for reasons unknown, at least to me... :-/)

3) Then, it's safe to send the file to a render farm and whatnot...

AJ

$\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.