Reply To: Backhoe Contribution-spikeyxxx-Wheels/Axle

Forum Archive Backhoe Contribution-spikeyxxx-Wheels/Axle Reply To: Backhoe Contribution-spikeyxxx-Wheels/Axle

#57683
Shawn Blanch
Participant

    I made a linked copy of a subdivided Cube, with the Subsurf Modifier applied. The number of Vertices stays the same.

    @spikeyxxx
    So I think I can explain some of this only because I learned a little about this with Prefab upgrades to Unity last year and I think it relates to what you are seeing on your Link’d Dupes. A linked duplicate is referencing the object data of the original object. What you are doing is passing the information to another location but it is still the same information and is somewhat more tidy. You can scale that information and rotate it but it is still the original data. When you go into edit mode you end up editing everything that is linked. So it makes sense to me that the total vertex count with modifiers applied is no more than with 1 object.

    What is happening under the hood I really don’t know but I bet they are referencing a location in memory and reusing it in another part of the scene and making small changes to it on screen draw calls. I may be way off base here. But that is probably storing that linked data and then applying changes somewhere else in memory and storing both?

    But when I made a linked copy when the Modifier wasn’t applied, the amount of Vertices doubled………… It sort of makes sense, that linked copies can have different Modifiers (or does it?), but then I would expect 188 Vertices, because the ‘base’ vertices wouldn’t be ‘doubled’.

    According to your picture the original object has 98 verts (I presume that is with the modifier data being added on top of the original base mesh data). So the Sub-D modifier is being applied to the base mesh twice and being stored in memory after the sub-d calc. So 98 x 2 = 196

    I tried simplifying this to just a 4 sided plane with a sub-d modifier resulting in 9 vertices at 1 level of sub-d. When I link duplicate that object I can still go into edit mode and “edit”just the 4 verts. But the modifier is happening and shifting the data uniquely for each copy and then stores that result in memory. Thus my 9 vert duplicate linked object now contributes 9 verts as well due to the uniqueness being applied to the original data and then being stored in memory afterwards.

    In Unity they recently came up with a similar way to make Prefabs all reference a single object but you could add unique charateristics to each prefab in the scene and they would inherit the general properties of their base prefab model and then add with uniqueness. They are calling these unique duplicates Prefab-Variants. When you change something about the main Prefab then the unique prefab variants will all inherit that change by default. 

    I can explain by making an Avatar of Spikey. The original copy I make in blender and export as an FBX into Unity. I make him with 3 hair spikes coming out of his head. Then I load 3 prefab variants into my scene and they all look the same. But then I give the 1st blue hair, and the second I make really tall, and the 3rd I give him some green skin because, like Kermit the Frog says: “It ain’t easy being green!”

    I decide I like the Avatar better if he had 4 spikes of hair and a 3rd arm just for fun. I go back into blender and re-export to Unity and viola! All my prefab variants maintain their unique changes but they all magically inherit 3rd arm and extra hair spike!

    I think they call these terms Inheritance and Overriding in programming talk in my delves into C# land while pursuing my Unity learning. I also wonder if pointers are being used where you basically set memory aside for a pointer to point you to the actual data? This is pretty common in object oriented programming languages like python and C# if I remember correctly.

    Now why the file is getting drastically bigger and taking longer to render is beyond my expertize.

    Maybe my explanation and understanding about this is all wrong but I talked myself into it and I feel good about it at least for today lol.

    Since Kent is out with baby girl I wonder if @jlampel could give an assist since he knows blender data quite well?