# Protecting custom transform node from optimize scene size

**URL:** https://forum.highend3d.com/t/protecting-custom-transform-node-from-optimize-scene-size/320
**Category:** Maya
**Tags:** mel
**Created:** [June 6, 2013, 10:05am UTC](https://forum.highend3d.com/t/protecting-custom-transform-node-from-optimize-scene-size/320 "2013-06-06T10:05:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![makenoise](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@makenoise](https://forum.highend3d.com/u/makenoise)
#### Post date: [June 6, 2013, 10:05am UTC](https://forum.highend3d.com/t/protecting-custom-transform-node-from-optimize-scene-size/320/1 "2013-06-06T10:05:39Z")

</div>

hi community  
I am working with some transform nodes with custom attributes.....  
created with the createNode command  
So the problem is that every time i run optimize scene size the nodes will be deleted.  
so my question is how can i protect the nodes?

or could i use another node type because the node has to be visible in outliner and has to have child objects....

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [June 6, 2013, 11:47am UTC](https://forum.highend3d.com/t/protecting-custom-transform-node-from-optimize-scene-size/320/2 "2013-06-06T11:47:13Z")

</div>

> > every time i run optimize scene size the nodes will be deleted.

That would be because everything not related to shape has no meaning to core maya. The real question is if you really need a custom workflow like this then why dont you make a new optimize command?

---

<div class="post-metadata">

### Author: ![makenoise](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@makenoise](https://forum.highend3d.com/u/makenoise)
#### Post date: [June 7, 2013, 5:08am UTC](https://forum.highend3d.com/t/protecting-custom-transform-node-from-optimize-scene-size/320/3 "2013-06-07T05:08:12Z")

</div>

Yeah I think building a new optimize command takes to much time...  
so I will work with locked nodes and unlock them if i need to...  
thx

---

<div class="post-metadata">

### Author: ![tokyopancake](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/t/48db29/32.png) [@tokyopancake](https://forum.highend3d.com/u/tokyopancake)
#### Post date: [June 7, 2013, 12:04pm UTC](https://forum.highend3d.com/t/protecting-custom-transform-node-from-optimize-scene-size/320/4 "2013-06-07T12:04:51Z")

</div>

You could always connect up the 'meaningless' transform nodes, with a message attribute to a more meaningfull object in the scene.

# in python:

import maya.cmds as mc

mc.addAttr('meaninglessNull', longName='myMessage', attributeType='message')  
mc.addAttr('meaningfullSphere', longName='myMessage', attributeType='message')  
mc.connectAttr('meaninglessNull.myMessage', 'meaningfullSphere.myMessage')  
=========

now when you optimize your scene, it will keep your meaninglessNull there. In the attrEditor in the extraAttributes dropdown you can see the meaninglessNull and the meaningfullSphere are now connected as friends.&nbsp;

---

<div class="post-metadata">

### Author: ![makenoise](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@makenoise](https://forum.highend3d.com/u/makenoise)
#### Post date: [June 10, 2013, 7:46am UTC](https://forum.highend3d.com/t/protecting-custom-transform-node-from-optimize-scene-size/320/5 "2013-06-10T07:46:42Z")

</div>

Hey thats nice! Because i am using a root node for the script, I could create this Root node as an hidden mesh and connect all child nodes to an attribute of the root node!  
That sounds perfect for my needs!  
Thx a lot!
