Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Import mp4 files as an object Using Python

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
1639 Views, 3 Replies

Import mp4 files as an object Using Python

Anonymous
Not applicable

Hey guys I have a question pertaining to mp4

 

From what I can see from tutorials and such there seems to be a way for Maya to import mp4 using the actual program itself (file->import etc.). I was wondering if it was possible to do the same thing but within a script. So far I've seen things like launch() but that just launches the video separate from maya. I wish to have it so that it creates an .mp4 object within the workspace if that makes sense

 

Thanks

Import mp4 files as an object Using Python

Hey guys I have a question pertaining to mp4

 

From what I can see from tutorials and such there seems to be a way for Maya to import mp4 using the actual program itself (file->import etc.). I was wondering if it was possible to do the same thing but within a script. So far I've seen things like launch() but that just launches the video separate from maya. I wish to have it so that it creates an .mp4 object within the workspace if that makes sense

 

Thanks

Tags (4)
Labels (3)
3 REPLIES 3
Message 2 of 4
stuzzz
in reply to: Anonymous

stuzzz
Collaborator
Collaborator

Here's a quick script for "importing" a video to a file node.

 

path = "PathToMyVideo"

filenode = cmds.createNode("file")
cmds.setAttr("%s.fileTextureName" % filenode, path, typ="string")

 

Here's a quick script for "importing" a video to a file node.

 

path = "PathToMyVideo"

filenode = cmds.createNode("file")
cmds.setAttr("%s.fileTextureName" % filenode, path, typ="string")

 

Message 3 of 4
Anonymous
in reply to: stuzzz

Anonymous
Not applicable

Hey, thanks for the reply,

 

I tried running your script but I don't see anything being created in the outliner (which I'm assuming is what is suppose to happen right?)

Screenshot_1.jpg

0 Likes

Hey, thanks for the reply,

 

I tried running your script but I don't see anything being created in the outliner (which I'm assuming is what is suppose to happen right?)

Screenshot_1.jpg

Message 4 of 4
stuzzz
in reply to: Anonymous

stuzzz
Collaborator
Collaborator
Accepted solution

Sorry buddy, I missed your notification.

 

By creating a file node, you are not supposed to see it in Outliner unless Display-> DagObjectsOnly is unticked. 

It's in your scene anyway. To name of your node in encapsulated in the "filenode" variable so to select it just type:

 

cmds.select(filenode, replace=True)

 

Sorry buddy, I missed your notification.

 

By creating a file node, you are not supposed to see it in Outliner unless Display-> DagObjectsOnly is unticked. 

It's in your scene anyway. To name of your node in encapsulated in the "filenode" variable so to select it just type:

 

cmds.select(filenode, replace=True)

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report