Hi,<br><br>The main intention of the comment there in DNA is to make sure that nobody attempts to use BLI_addtail/head, BLI_remlink, etc. on the Action Groups list. <br><br>This was really an attempt at getting channels to exist in more than one linked list at a time, with the actions-channels belonging to the action&#39;s chanbase list still (to reduce the overhead of having to add code to check in groups for channels AND in the action still because not all channels will be grouped). As a result, groups merely store pointers to the channels which mark the start/end of that group&#39;s list. This works because all the channels are arranged in such a way, that all of a group&#39;s channels are stored together in sequence, and these bunches of channels are stored after each other in the same way that the groups are ordered. Un-grouped channels are at the end of the list.<br>
<br>Therefore, adding/deleting/reordering channels/groups in Actions MUST go through the API functions for this (I still have to restore these in 2.5), otherwise, there is a very high chance of leaks (i.e. lost channels). That&#39;s why the comment there exists... <br>
<br>Now, if you&#39;re iterating over these channels in a group, to find the endpoint, you don&#39;t check for NULL as that will be the last channel in the Action. Rather, you check if the channel&#39;s group is still the group that you&#39;re looking at. I&#39;ll double check the RNA wrapping later :)<br>
<br>Regards,<br>Joshua<br><br><div class="gmail_quote">On Thu, Jan 8, 2009 at 1:10 AM, Roland Hess <span dir="ltr">&lt;<a href="mailto:me@harkyman.com">me@harkyman.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Revision: 18396<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;root=bf-blender&amp;revision=18396" target="_blank">http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;root=bf-blender&amp;revision=18396</a><br>

Author: &nbsp; harkyman<br>
Date: &nbsp; &nbsp; 2009-01-07 14:10:31 +0100 (Wed, 07 Jan 2009)<br>
<br>
Log Message:<br>
-----------<br>
Conflicts resolved. Hadn&#39;t used the Resolve command last time. Brilliant.<br>
<br>
Modified Paths:<br>
--------------<br>
 &nbsp; &nbsp;branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c<br>
<br>
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c<br>
===================================================================<br>
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c &nbsp; &nbsp; 2009-01-07 11:27:17 UTC (rev 18395)<br>
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c &nbsp; &nbsp; 2009-01-07 13:10:31 UTC (rev 18396)<br>
@@ -30,20 +30,166 @@<br>
&nbsp;#include &quot;rna_internal.h&quot;<br>
<br>
&nbsp;#include &quot;DNA_action_types.h&quot;<br>
+#include &quot;DNA_constraint_types.h&quot;<br>
+#include &quot;DNA_scene_types.h&quot;<br>
<br>
+<br>
&nbsp;#ifdef RNA_RUNTIME<br>
<br>
-#else<br>
+#else<br>
<br>
+void rna_def_action_channel(BlenderRNA *brna)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; StructRNA *srna;<br>
+ &nbsp; &nbsp; &nbsp; PropertyRNA *prop;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; srna= RNA_def_struct(brna, &quot;ActionChannel&quot;, NULL);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_struct_sdna(srna, &quot;bActionChannel&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_struct_ui_text(srna, &quot;Action Channel&quot;, &quot;A channel for one object or bone&#39;s Ipos in an Action.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;name&quot;, PROP_STRING, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Name&quot;, &quot;&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_struct_name_property(srna, prop);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_group&quot;, PROP_POINTER, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_pointer_sdna(prop, NULL, &quot;grp&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_struct_type(prop, &quot;ActionGroup&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_flag(prop, PROP_NOT_EDITABLE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Action Group&quot;, &quot;Action Group that this Action Channel belongs to.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;ipo&quot;, PROP_POINTER, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_struct_type(prop, &quot;Ipo&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_flag(prop, PROP_NOT_EDITABLE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Ipo&quot;, &quot;Ipo block this Action Channel uses.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; /* constraint channel rna not yet implemented */<br>
+ &nbsp; &nbsp; &nbsp; /*prop= RNA_def_property(srna, &quot;constraint_channels&quot;, PROP_COLLECTION, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_collection_sdna(prop, NULL, &quot;ConstraintChannel&quot;, NULL);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_struct_type(prop, &quot;ConstraintChannel&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Constraint Channels&quot;, &quot;Ipos of Constraints attached to this object or bone.&quot;); */<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_channel_selected&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, ACHAN_SELECTED);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Selected&quot;, &quot;Action Channel is selected.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_channel_highlighted&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, ACHAN_HILIGHTED);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Highlighted&quot;, &quot;Action Channel is highlighted.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_channel_hidden&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, ACHAN_HIDDEN);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Hidden&quot;, &quot;Action Channel is hidden.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_channel_protected&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, ACHAN_PROTECTED);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Protected&quot;, &quot;Action Channel is protected.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_channel_expanded&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, ACHAN_EXPANDED);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Expanded&quot;, &quot;Action Channel is expanded.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_channel_show_ipo&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, ACHAN_SHOWIPO);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Show Ipo&quot;, &quot;Action Channel&#39;s Ipos are visible.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_channel_show_constraints&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, ACHAN_SHOWCONS);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Show Constraints&quot;, &quot;Action Channel&#39;s constraints are visible.&quot;);<br>
+}<br>
+<br>
+void rna_def_action_group(BlenderRNA *brna)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; StructRNA *srna;<br>
+ &nbsp; &nbsp; &nbsp; PropertyRNA *prop;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; srna= RNA_def_struct(brna, &quot;ActionGroup&quot;, NULL);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_struct_sdna(srna, &quot;bActionGroup&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_struct_ui_text(srna, &quot;Action Group&quot;, &quot;Groups of Actions Channels.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;name&quot;, PROP_STRING, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Name&quot;, &quot;&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_struct_name_property(srna, prop);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; /* dna warns not to treat the Action Channel listbase in the Action Group struct like a<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal listbase. I&#39;ll leave this here but comment out, for Joshua to review. He can<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;probably shed some more light on why this is */<br>
+ &nbsp; &nbsp; &nbsp; /*prop= RNA_def_property(srna, &quot;action_channels&quot;, PROP_COLLECTION, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_collection_sdna(prop, NULL, &quot;channels&quot;, NULL);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_struct_type(prop, &quot;ActionChannel&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Action Channels&quot;, &quot;DOC_BROKEN&quot;);*/<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_group_selected&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, AGRP_SELECTED);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Selected&quot;, &quot;Action Group is selected.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_group_protected&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, AGRP_PROTECTED);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Protected&quot;, &quot;Action Group is protected.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_group_expanded&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, AGRP_EXPANDED);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Expanded&quot;, &quot;Action Group is expanded.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;custom_color&quot;, PROP_INT, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_int_sdna(prop, NULL, &quot;customCol&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Custom Color&quot;, &quot;Index of custom color set.&quot;);<br>
+}<br>
+<br>
&nbsp;void RNA_def_action(BlenderRNA *brna)<br>
&nbsp;{<br>
 &nbsp; &nbsp; &nbsp; &nbsp;StructRNA *srna;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;PropertyRNA *prop;<br>
<br>
+ &nbsp; &nbsp; &nbsp; rna_def_action_channel(brna);<br>
+ &nbsp; &nbsp; &nbsp; rna_def_action_group(brna);<br>
+<br>
 &nbsp; &nbsp; &nbsp; &nbsp;srna= RNA_def_struct(brna, &quot;Action&quot;, &quot;ID&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;RNA_def_struct_sdna(srna, &quot;bAction&quot;);<br>
- &nbsp; &nbsp; &nbsp; RNA_def_struct_ui_text(srna, &quot;Action&quot;, &quot;DOC_BROKEN&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_struct_ui_text(srna, &quot;Action&quot;, &quot;A collection of Ipos for animation.&quot;);<br>
<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_channels&quot;, PROP_COLLECTION, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_collection_sdna(prop, NULL, &quot;chanbase&quot;, NULL);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_struct_type(prop, &quot;ActionChannel&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Action Channels&quot;, &quot;The individual animation channels that make up the Action.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_groups&quot;, PROP_COLLECTION, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_collection_sdna(prop, NULL, &quot;groups&quot;, NULL);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_struct_type(prop, &quot;ActionGroup&quot;);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Action Groups&quot;, &quot;Convenient groupings of Action Channels.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;timeline_markers&quot;, PROP_COLLECTION, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_collection_sdna(prop, NULL, &quot;markers&quot;, NULL);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_struct_type(prop, &quot;UnknownType&quot;); /* implement when timeline rna is wrapped */<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Timeline Markers&quot;, &quot;Markers specific to this Action, for labeling poses.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_show_sliders&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, SACTION_SLIDERS);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Show Sliders&quot;, &quot;Show Shape Key sliders.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_time_units&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, SACTION_DRAWTIME);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Time Units&quot;, &quot;Show seconds or frames in the timeline.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_show_all&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, SACTION_NOHIDE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Show All&quot;, &quot;Show all channels regardless of hidden status.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_kill_overlapping_keys&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, SACTION_NOTRANSKEYCULL);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Kill Overlapping Keys&quot;, &quot;Remove overlapping keys after a transform.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_key_cull_to_view&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, SACTION_HORIZOPTIMISEON);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Cull Keys to View&quot;, &quot;Only consider keys that are within the view.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_group_colors&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, SACTION_NODRAWGCOLORS);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Group Color&quot;, &quot;Use custom color grouping and instead of default color scheme.&quot;);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; prop= RNA_def_property(srna, &quot;action_current_frame_number&quot;, PROP_BOOLEAN, PROP_NONE);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_boolean_sdna(prop, NULL, &quot;flag&quot;, SACTION_NODRAWCFRANUM);<br>
+ &nbsp; &nbsp; &nbsp; RNA_def_property_ui_text(prop, &quot;Current Frame Number&quot;, &quot;Draw the frame number beside the current frame indicator.&quot;);<br>
+<br>
&nbsp;}<br>
<br>
&nbsp;#endif<br>
<br>
<br>
_______________________________________________<br>
Bf-blender-cvs mailing list<br>
<a href="mailto:Bf-blender-cvs@blender.org">Bf-blender-cvs@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-blender-cvs" target="_blank">http://lists.blender.org/mailman/listinfo/bf-blender-cvs</a><br>
</blockquote></div><br>