setAttr for selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
It's heavily searched and polluted topic.
I want to be able to make changed to the seleciton by code.
Why would it be, that the first procedure works and second does not (// Error: line 4: setAttr: No object matches name: pSphere2subdivisionsAxis //)?
string $array[] = `ls -sl`;
for ($item in $array)
{
setAttr ($item + ".scale") 2.0 2.0 2.0;
}
Edit:
Code breaks when trying to use with with flags (no idea where to squeeze them in);
string $array[] = `ls -sl`;
for ($item in $array)
{
setAttr ($item + ".scale -r") 1.05 1.05 1.05;
}
or on a sphere;
string $array[] = `ls -sl`;
for ($item in $array)
{
setAttr ($item + ".subdivisionsAxis") 24;
}
Also, such code breaks when put into -c "" 🤔
Does one need to source anything that is more than 1 command long, if wants to assign to a button/checkbox?
Cheers,
DS