4646 'lens_distortion' ,
4747]
4848
49+
4950def _gen_two_frame_fwd (int_list ):
5051 """
5152 Given a list of integers, create list of Frame pairs, moving
@@ -170,6 +171,7 @@ def _compile_multi_root_frames(col,
170171 attr_list ,
171172 batch_frame_list ,
172173 root_iter_num ,
174+ remove_unused_objects ,
173175 precomputed_data ,
174176 withtest ,
175177 verbose ):
@@ -192,6 +194,11 @@ def _compile_multi_root_frames(col,
192194 Number of iterations to use, when solving root frames.
193195 :type root_iter_num: int
194196
197+ :param remove_unused_objects:
198+ Should objects that are detected as 'unused' be removed from
199+ the solver?
200+ :type remove_unused_objects: bool
201+
195202 :param withtest:
196203 Compile the test/validation Action, as well as the solve Action?
197204 :type withtest: bool
@@ -233,6 +240,8 @@ def _compile_multi_root_frames(col,
233240 sol .set_auto_diff_type (const .AUTO_DIFF_TYPE_FORWARD )
234241 sol .set_use_smoothness (False )
235242 sol .set_use_stiffness (False )
243+ sol .set_remove_unused_markers (remove_unused_objects )
244+ sol .set_remove_unused_attributes (remove_unused_objects )
236245 sol .set_precomputed_data (precomputed_data )
237246
238247 cache = api_compile .create_compile_solver_cache ()
@@ -317,6 +326,7 @@ def _compile_multi_inbetween_frames(col,
317326 global_solve ,
318327 eval_complex_graphs ,
319328 anim_iter_num ,
329+ remove_unused_objects ,
320330 precomputed_data ,
321331 withtest ,
322332 verbose ):
@@ -350,6 +360,11 @@ def _compile_multi_inbetween_frames(col,
350360 Number of iterations for solving animated attributes.
351361 :type anim_iter_num: int
352362
363+ :param remove_unused_objects:
364+ Should objects that are detected as 'unused' be removed from
365+ the solver?
366+ :type remove_unused_objects: bool
367+
353368 :param withtest:
354369 Should validation tests be generated?
355370 :type withtest: bool
@@ -373,6 +388,8 @@ def _compile_multi_inbetween_frames(col,
373388 sol .set_auto_diff_type (const .AUTO_DIFF_TYPE_FORWARD )
374389 sol .set_use_smoothness (False )
375390 sol .set_use_stiffness (False )
391+ sol .set_remove_unused_markers (remove_unused_objects )
392+ sol .set_remove_unused_attributes (remove_unused_objects )
376393 sol .set_precomputed_data (precomputed_data )
377394
378395 cache = api_compile .create_compile_solver_cache ()
@@ -397,6 +414,8 @@ def _compile_multi_inbetween_frames(col,
397414 sol .set_auto_diff_type (const .AUTO_DIFF_TYPE_FORWARD )
398415 sol .set_use_smoothness (not is_first_frame )
399416 sol .set_use_stiffness (not is_first_frame )
417+ sol .set_remove_unused_markers (remove_unused_objects )
418+ sol .set_remove_unused_attributes (remove_unused_objects )
400419 sol .set_time_eval_mode (time_eval_mode )
401420 sol .set_precomputed_data (precomputed_data )
402421
@@ -422,6 +441,7 @@ def _compile_multi_frame(col,
422441 root_frame_strategy ,
423442 triangulate_bundles ,
424443 use_euler_filter ,
444+ remove_unused_objects ,
425445 precomputed_data ,
426446 withtest ,
427447 verbose ):
@@ -492,6 +512,11 @@ def _compile_multi_frame(col,
492512 will remove "Euler Flipping".
493513 :type use_euler_filter: bool
494514
515+ :param remove_unused_objects:
516+ Should objects that are detected as 'unused' be removed from
517+ the solver?
518+ :type remove_unused_objects: bool
519+
495520 :param withtest:
496521 Should validation tests be generated?
497522 :type withtest: bool
@@ -559,6 +584,8 @@ def _compile_multi_frame(col,
559584 sol .set_auto_diff_type (const .AUTO_DIFF_TYPE_FORWARD )
560585 sol .set_use_smoothness (False )
561586 sol .set_use_stiffness (False )
587+ sol .set_remove_unused_markers (remove_unused_objects )
588+ sol .set_remove_unused_attributes (remove_unused_objects )
562589 sol .set_precomputed_data (precomputed_data )
563590
564591 cache = api_compile .create_compile_solver_cache ()
@@ -596,6 +623,8 @@ def _compile_multi_frame(col,
596623 sol .set_auto_diff_type (const .AUTO_DIFF_TYPE_FORWARD )
597624 sol .set_use_smoothness (False )
598625 sol .set_use_stiffness (False )
626+ sol .set_remove_unused_markers (remove_unused_objects )
627+ sol .set_remove_unused_attributes (remove_unused_objects )
599628 sol .set_precomputed_data (precomputed_data )
600629
601630 cache = api_compile .create_compile_solver_cache ()
@@ -641,6 +670,7 @@ def _compile_multi_frame(col,
641670 batch_frame_list ,
642671 root_iter_num ,
643672 precomputed_data ,
673+ remove_unused_objects ,
644674 withtest ,
645675 verbose
646676 )
@@ -680,6 +710,7 @@ def _compile_multi_frame(col,
680710 global_solve ,
681711 eval_complex_graphs ,
682712 anim_iter_num ,
713+ remove_unused_objects ,
683714 precomputed_data ,
684715 withtest ,
685716 verbose ,
@@ -697,6 +728,7 @@ def _compile_single_frame(col,
697728 lineup_iter_num ,
698729 auto_attr_blocks ,
699730 precomputed_data ,
731+ remove_unused_objects ,
700732 withtest ,
701733 verbose ):
702734 """
@@ -727,6 +759,11 @@ def _compile_single_frame(col,
727759 pass
728760 :type lineup_iter_num: int
729761
762+ :param remove_unused_objects:
763+ Should objects that are detected as 'unused' be removed from
764+ the solver?
765+ :type remove_unused_objects: bool
766+
730767 :param withtest:
731768 Should validation tests be generated?
732769 :type withtest: bool
@@ -754,6 +791,8 @@ def _compile_single_frame(col,
754791 sol .set_auto_diff_type (const .AUTO_DIFF_TYPE_FORWARD )
755792 sol .set_use_smoothness (False )
756793 sol .set_use_stiffness (False )
794+ sol .set_remove_unused_markers (remove_unused_objects )
795+ sol .set_remove_unused_attributes (remove_unused_objects )
757796 sol .set_precomputed_data (precomputed_data )
758797
759798 cache = api_compile .create_compile_solver_cache ()
@@ -771,6 +810,8 @@ def _compile_single_frame(col,
771810 sol .set_auto_diff_type (const .AUTO_DIFF_TYPE_FORWARD )
772811 sol .set_use_smoothness (False )
773812 sol .set_use_stiffness (False )
813+ sol .set_remove_unused_markers (remove_unused_objects )
814+ sol .set_remove_unused_attributes (remove_unused_objects )
774815 sol .set_precomputed_data (precomputed_data )
775816
776817 cache = api_compile .create_compile_solver_cache ()
@@ -1278,6 +1319,7 @@ def compile(self, col, mkr_list, attr_list, withtest=False):
12781319 only_root_frames = self .get_only_root_frames ()
12791320 global_solve = self .get_global_solve ()
12801321 eval_object_relationships = self .get_eval_object_relationships ()
1322+ remove_unused_objects = eval_object_relationships
12811323 eval_complex_graphs = self .get_eval_complex_graphs ()
12821324 block_iter_num = self .get_block_iteration_num ()
12831325 root_iter_num = self .get_root_iteration_num ()
@@ -1294,8 +1336,9 @@ def compile(self, col, mkr_list, attr_list, withtest=False):
12941336 verbose = True
12951337 precomputed_data = self .get_precomputed_data ()
12961338
1339+ LOG .warn ('eval_object_relationships=%r' , eval_object_relationships )
1340+
12971341 # Pre-calculate the 'affects' relationship.
1298- # LOG.warn('eval_object_relationships: %r', eval_object_relationships)
12991342 if eval_object_relationships is True :
13001343 generator = solverutils .compile_solver_affects (
13011344 col ,
@@ -1322,6 +1365,7 @@ def compile(self, col, mkr_list, attr_list, withtest=False):
13221365 block_iter_num ,
13231366 lineup_iter_num ,
13241367 auto_attr_blocks ,
1368+ remove_unused_objects ,
13251369 precomputed_data ,
13261370 withtest ,
13271371 verbose ,
@@ -1345,6 +1389,7 @@ def compile(self, col, mkr_list, attr_list, withtest=False):
13451389 root_frame_strategy ,
13461390 triangulate_bundles ,
13471391 use_euler_filter ,
1392+ remove_unused_objects ,
13481393 precomputed_data ,
13491394 withtest ,
13501395 verbose ,
0 commit comments