Announcement

Collapse
No announcement yet.

[Plugin] Android Camera

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [Plugin] Android Camera

    Hi Forum,
    Some guy ask me for an plugin develop by me some time ago, about how to access the android camera and display as an texture, now with the new APL system we can develop our own plugins for android without modify the engine source, take it as a little tutorial instead as a plugin, because AFAIK that functionality comes with the new 4.13 or 4.14 (not sure, MR Chris Babcock told me), meanwhile you can use mine.

    I split the core functionality inside an UActorComponent with only 3 methods, one to call and open the camera, other for update, and finally one for shutdown. the code itself it´s easy, however if you have some question please post the thread

    EDIT: I add a full project inside my drive, for some reason I have unexpected pixel convertion in unreal 4.13 when use development mode, for now just deploy on shipping mode and will be work, ue 4.12 keep working on both develop and shipping

    flick fixed
    4.14.1 update link here: https://drive.google.com/file/d/0B8M...ew?usp=sharing

    4.13 Link here: https://drive.google.com/folderview?...GM&usp=sharing

    see the video:


    Click image for larger version

Name:	androidcameraBP.png
Views:	1
Size:	216.0 KB
ID:	1188198

    basic BP sample
    Last edited by ZkarmaKun; 01-04-2017, 10:18 PM.

    #2
    Great stuff! Gonna tinker with it soon

    Comment


      #3
      Awesome stuff! Thank you! Very useful for games like Pokemon GO
      Realtime Database Firebase | Ultimate Mobile Kit Firebase | Extended Facebook | Universal Mobile Ads | Google Analytics

      Comment


        #4
        Originally posted by gameDNA studio View Post
        Awesome stuff! Thank you! Very useful for games like Pokemon GO
        jajaja now everybody want to create their own pokemon go.
        Glad to help

        Cheers

        Comment


          #5
          I feel dumb for asking this, but how do you add the plugin to a project?

          Comment


            #6
            Hi PappySnail,
            There is lot of threads talking about the topic, anyway let me write a little step by step:

            1.-Create a new empty c++ project, once is open, just close for a while.
            2.-Copy the "Plugins" folder inside your new project here:

            Click image for larger version

Name:	image1.png
Views:	1
Size:	39.0 KB
ID:	1112683

            3.-Now you need regenerate your visual studio solution, or xcode because plugin works for both, right click on your project and hit Generate Visual Studio Project Files:

            Click image for larger version

Name:	image2.png
Views:	1
Size:	41.6 KB
ID:	1112684

            4.- Final step, open your visual studio solution or xcode project and compile, and enjoy!

            Note: once you compile the plugin, you don´t need re-compile everytime, just open your UE project in regular way

            Hope help

            Cheers!

            Comment


              #7
              Hi ZkarmaKun,
              It is great to have access to the android camera in such a straightforward plugin. I compiled it fine and got it activated and entered the basic blueprint code you included, but its not working. There are no errors in the logs. I am using a nexus 5x. Everything is good but the camera image never shows up, the dynamic texture is assigned to the geometry and my blueprint looks precisely like yours. I wonder if there is more in the construction script or material script that I need to do to make this work. I'm excited to try it.
              Thanks for sharing,
              O

              Comment


                #8
                MMM perhaps is my fault, I forget to mention something important, go ahead and open your project settings -> Android ->APK packaging->Target SDK version (9=Gingerbrid, 14 ice cream, 21= Lolipop) set to 14 or higher, the java camera code need it.
                I think is all, must be work

                Comment


                  #9
                  Yep works now, ZkarmaKun, thanks very much!! Great work. O

                  Comment


                    #10
                    Hi Zkarma, I've been trying to get this to work now for a bit but I seem to be having some issues. I've loaded it up with the blueprint and I can't seem to get the camera to actually turn on. I only see whatever the environment is around the cube. I have already checked the sdk target and set it to 21 in case that was the issue.
                    Here is what I've done thusfar :
                    http://i.imgur.com/o5UVDNR.jpg

                    Comment


                      #11
                      Hi MaxMendelsohn,
                      you can't debug in editor, deploy on your android

                      Comment


                        #12
                        Thanks a lot for your great work, ZkarmaKun.
                        However, I didn't get the idea of applying this masterpiece.
                        I've created an new actor and created a new blueprint based on it, and even created a blueprint of the gamemode, both of the two eventgraphs are exactly the same like yours, but what appeared on my Android device were just a floor and a cube.
                        Would you please tell me whether I missed some important process?
                        BTW sorry for my poor English, I'm Chinese, if my words is not that appropriate, please don't take offense.><

                        Comment


                          #13
                          Hi KAI_CHENG,
                          MaxMendelsohn have same trouble, on curiosity I just test right now, indeed we have a problem inside 4.13, I will fix that!, as soon as posible, meanwhile use for 4.12!, and don't worry my English is not perfect too

                          Cheers!

                          Comment


                            #14
                            So kind of you, ZkarmaKun!
                            I'm a beginner who have just started how to create a plugin for UE4. I aim to make a plugin of the functionalities like yours, so I start by take your work for a reference. Do you know any websites or online resources suitable for a UE4 plugin beginner? Or the official documentation is just a great start?https://docs.unrealengine.com/latest...mming/Plugins/

                            Comment


                              #15
                              mmm yeah the official paper is not the best, is the only place to start, but that doc is very old and almost useless, try to use the editor's plugin wizard and read all the structure inside the code at least is well comented. this weekend i'm busy but i will fix the plugin for 4.13 by next week

                              Comment

                              Working...
                              X