Comments (3)
Hello,
Could you explain your problem?
And please include real python code to highlight the bug.
After checking, everything seems good:
class SetCurrentScene(base_classes.BaseRequest):
def __init__(self, scene_name):
base_classes.BaseRequest.__init__(self)
self.name = "SetCurrentScene"
self.datain["scene-name"] = scene_name
and original doc:
"SetCurrentScene"
Switch to the scene specified in "scene-name".
Request fields :
- "scene-name" (string) : name of the scene to switch to.
Response : always OK if scene exists, error if it doesn't. No additional fields
And this is one the functions I use in my samples, and seen no problem so far.
Regards,
Guillaume
from obs-websocket-py.
I was not able to set current scene using that version.
My code was:
`#!/usr/bin/env python
-- coding: utf-8 --
import sys
import time
import logging
logging.basicConfig(level=logging.INFO)
sys.path.append('../')
from obswebsocket import obsws, requests
print requests.file
host = "192.168.1.11"
port = 4444
password = "1234"
ws = obsws(host, port, password)
ws.connect()
try:
print ws.call(requests.GetVersion())
scenes = ws.call(requests.GetSceneList())
for s in scenes.getScenes():
print s
name = s['name']
print "Switching to %s"%(name)
print ws.call(requests.SetCurrentScene(name))
time.sleep(2)
print ws.call(requests.SetSourceRender(source='TXT1', render=True, scene_name='Scene2'))
print ws.call(requests.SetSourceRender(source='TXT2', render=True, scene_name="Scene2"))
time.sleep(2)
print ws.call(requests.SetSourceRender(source='TXT1', render=False, scene_name='Scene2'))
print ws.call(requests.SetSourceRender(source='TXT2', render=False, scene_name="Scene2"))
print "End of list"
except KeyboardInterrupt:
pass
ws.disconnect()
`
I had to change datain to dataout as here:
class SetCurrentScene(base_classes.BaseRequest):
def init(self, scene_name):
base_classes.BaseRequest.init(self)
self.name = "SetCurrentScene"
self.dataout["scene-name"] = scene_name
Same for SetSourceRender, there is a mismatch of datain/out too.
from obs-websocket-py.
Thanks for your help. I just have resolved the issue in master.
from obs-websocket-py.
Related Issues (20)
- MessageTimeout HOT 3
- No support for calling Virtual Camera on and off? HOT 1
- Refresh browers source, Control media audio mute and unmute, control filter visible, hide or show HOT 1
- Not able to connect to the websocket HOT 2
- Request: ExecuteBatch
- Handling error when OBS closes before script HOT 4
- Not working with OBS 28.0.0 (obs-websocket v5) HOT 2
- How to add image source in scene? HOT 2
- Do merge and update to websocket 5.0 HOT 2
- Remote Python2 compatiblity
- Getting KeyError: 'status' while trying to connect to OBS studio HOT 2
- Switch Scene v4 Sample HOT 5
- KeyError: 'status' with OBS 29 and obs-websocket-py 0.5.3 HOT 4
- SetSourceSettings expects one argument but 3 were given HOT 4
- Error not understood on scene change. HOT 4
- ConnectionRefusedError: Unable to make OBS and obs-websocket-py cooperate HOT 1
- requests.SetRecordDirectory takes 1 positional argument but 2 were given HOT 6
- How I can get the value of an call request? HOT 3
- Adding timeout to obsws_python.EventClient() causes timeout even when connection is ok HOT 2
- GetStreamStatus Inputdata and outputdata mix up
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obs-websocket-py.