obsproject / obsproject/obs-studio

Lua scripting OBS_ALIGN_* constants return nil

Open
#8,936 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

29.1.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/B4wPbEJh7WVBPCL0

OBS Studio Crash Log URL

No response

Expected Behavior

The values for obs.OBS_ALIGN_LEFT and others should return their defined bitmask values.

Current Behavior

Currently they return nil forcing to define them yourself in the Lua script.

Steps to Reproduce
  1. Write a simple script with script_load
  2. Output the OBS_ALIGN_LEFT in the script log using obs.script_log
  3. The output should be nil
Anything else we should know?

This should either be defined for the Lua API or explicitly stated in the documentation that constants that were defined with macros and not enums can't be used as actual exported values. I assume the values would also be null for Python scripts as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Lua script_load and obs.script_log steps with obs.OBS_ALIGN_LEFT and the other OBS_ALIGN_* constants. Trace how the Lua API exposes constants defined as macros rather than enums, and check whether the same limitation applies to Python scripts. Done means the constants return their defined bitmask values or the API documentation explicitly states that they are unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.