[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18293] branches/blender2.5/blender/source /blender/blenloader/intern/readfile.c: 2.5

Nathan Letwory jesterking at letwory.net
Sun Jan 4 02:17:01 CET 2009


2009/1/4 joe <joeedh at gmail.com>:
> That doesn't look like it'll always give unique names.   IIRC all idblocks
> are supposed to always have unique names.
> Joe

True, here there are no unique names. Before this commit nodetrees for
these were *always* without a name, even without the NT identifier.

Because there was no content whatsoever, the RNA viewer (or rna access
code for refining ID pointers) always failed on nodetrees, thus
returning always just ID. Putting here *something* starting with
nodetree identifier (NT) ensures that nodetrees are properly
recognised. These nodetrees are saved in a different way (not as
proper ID blocks in that sense). What *is* saved as such are
nodegroups (ie. in Main).

So, as long as the NT bit is there, we should be fine for nodetrees
directly in Material, Scene and Texture.

Maybe this needs improved in the future, but the time is not now
(maybe soon, who knows, but not now).

/Nathan

>
> On Sat, Jan 3, 2009 at 11:43 AM, Nathan Letwory <jesterking at letwory.net>
> wrote:
>>
>> Revision: 18293
>>
>>  http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18293
>> Author:   jesterking
>> Date:     2009-01-03 19:43:11 +0100 (Sat, 03 Jan 2009)
>>
>> Log Message:
>> -----------
>> 2.5
>> - Make sure shader, composit and texture ntrees have an id.name. This is
>> to ensure
>>  that node trees in Material, Scene and Texture are properly identified
>> through RNA
>>
>> Modified Paths:
>> --------------
>>    branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
>>
>> Modified:
>> branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
>> ===================================================================
>> ---
>> branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
>> 2009-01-03 17:21:32 UTC (rev 18292)
>> +++
>> branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
>> 2009-01-03 18:43:11 UTC (rev 18293)
>> @@ -8436,9 +8436,30 @@
>>
>>        if (main->versionfile < 250) {
>>                bScreen *screen;
>> +               Material *ma;
>> +               Scene *sce;
>> +               Tex *tx;
>>
>>                for(screen= main->screen.first; screen; screen=
>> screen->id.next)
>>                        do_versions_windowmanager_2_50(screen);
>> +
>> +               /* shader, composit and texture node trees have id.name
>> empty, put something in
>> +                * to have them show in RNA viewer and accessible
>> otherwise.
>> +                */
>> +               for(ma= main->mat.first; ma; ma= ma->id.next) {
>> +                       if(ma->nodetree &&
>> strlen(ma->nodetree->id.name)==0)
>> +                               strcpy(ma->nodetree->id.name, "NTShader
>> Nodetree");
>> +               }
>> +               /* and composit trees */
>> +               for(sce= main->scene.first; sce; sce= sce->id.next) {
>> +                       if(sce->nodetree &&
>> strlen(sce->nodetree->id.name)==0)
>> +                               strcpy(sce->nodetree->id.name, "NTComposit
>> Nodetree");
>> +               }
>> +               /* and texture trees */
>> +               for(tx= main->tex.first; tx; tx= tx->id.next) {
>> +                       if(tx->nodetree &&
>> strlen(tx->nodetree->id.name)==0)
>> +                               strcpy(tx->nodetree->id.name, "NTTexture
>> Nodetree");
>> +               }
>>        }
>>
>>
>>
>>
>> _______________________________________________
>> Bf-blender-cvs mailing list
>> Bf-blender-cvs at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>
>


More information about the Bf-committers mailing list