Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create Null Object with custom dimensions with script?

Explorer ,
Jul 16, 2021 Jul 16, 2021

Is there any possibility to create a Null Object with a custom dimensions via a script?

 

I don't mean that it has been scaled down, but that the actual layer gets created with custom dimensions, like 62.5, 62.5

 

I hope this is possible.

TOPICS
Scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 16, 2021 Jul 16, 2021

Dimensions on a null are meaningless. The anchor point is at 0, 0, 0 and nulls don't render. Their size does not translate to other layers unless you add an expression that reads the height and width of the layer. I'm not sure what purpose setting a custom size for a null would have.

Translate
Community Expert ,
Jul 16, 2021 Jul 16, 2021

Dimensions on a null are meaningless. The anchor point is at 0, 0, 0 and nulls don't render. Their size does not translate to other layers unless you add an expression that reads the height and width of the layer. I'm not sure what purpose setting a custom size for a null would have.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 16, 2021 Jul 16, 2021

I actually wanted to use it as a spacer for a grid like layout.

But I just discoverd I can also do this with slider expression controls.

But thank you for your awnser anyway.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2021 Jul 16, 2021
LATEST

You can do it with a script, but you need to modify the null's source, and the width and height have to be integers. So you could do something like this:

 

var myComp = app.project.activeItem;
var myNull = myComp.layers.addNull(myComp.duration);
myNull.source.width = 63;
myNull.source.height = 63;
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines