• momorprods

    thanks a lot!

    posted in Pythonista read more
  • momorprods

    Greetings,

    I’m having an issue with the following
    code, it simply crashes my Pythonista since the latest update. Does it work on your devices ?

    Thanks!

    import console
    
    console.set_idle_timer_disabled(True) 
    

    posted in Pythonista read more
  • momorprods

    And it’s back again, even with some fixes!

    posted in Pythonista read more
  • momorprods

    @mikael thank a lot, I’m happy your daughter likes it.

    At the end of the hunt, the score is displayed - when you touch the screen at this point it should restart the hunt.

    posted in Pythonista read more
  • momorprods

    Hi, when creating your adventure you will be asked to set, for each hint, the question itself, 4 possible replies and the correct reply.

    Very basic ;-)

    posted in Pythonista read more
  • momorprods

    Hi,

    I have just released on Github a Treasure Hunt / Scavenger creator application. In a few words, the app allows you to create your own scavenger hunts, play them and share them with your friends.

    Source is here :

    https://github.com/momorprods/TreasureHunt

    This was my very first experiment in Pythonista, started a few years ago. I just thought I should update it a bit and release it to the community.

    Pythonista is really a mind-blowing app. Treasure Hunt was designed & coded using my iPhone, and nothing else, which is so cool.

    Please be indulgent with the design & the code though, this was my very first app started in 2014!

    Feel free to share, use, comment, and even upgrade it!

    posted in Pythonista read more
  • momorprods

    great job @cvp ! currently working onto loading collada files, might take most of my upcoming oversea flight! I’ll keep you posted.

    posted in Pythonista read more
  • momorprods

    ah sorry my bad, In my tests I tweaked badly my SCNVector3 using c_double instead of c_float. Fixed and working now.

    posted in Pythonista read more
  • momorprods

    @cvp I think there is still something weird, as the coordinates of the vertices really don’t match what’s expected. The triangle totally disappear if I just scale the Z value of the 1st vertice, which is not normal.

    And overall the size of the triangle is not what it should be (confirmed this by overlapping a cube box and also by estimating through the ARKit rendering).

    Since it shows the triangle, the indexing part of the code must be ok - it probably deals with the SCNVector3 array. Perhaps I’m wrong, but SCNVector3 looks like an ObjC class, not a C record?

    posted in Pythonista read more
  • momorprods

    guys you are genius. Not sure why the vertex order did change something, probably it needs to be defined clockwise or something like that.

    Thanks for all of your help, you are awesome!

    posted in Pythonista read more
  • momorprods

    @cvp @JonB thanks for your help, I am going to investigate that empty scene stuff.

    posted in Pythonista read more
  • momorprods

    Making some good progress thanks to your help. But I’m getting a last crash on the very last instruction - any idea?

    #triangle generation
    verts=[SCNVector3(0, 0, 0), SCNVector3(1, 0, 0), SCNVector3(0, 1, 0)]
    verts_array = (SCNVector3 * len(verts))(*verts)
    
    src = ObjCClass('SCNGeometrySource').geometrySourceWithVertices_count_(
        verts_array,len(verts),
        restype=c_void_p,
        argtypes=[POINTER(SCNVector3), c_ulong],)
        
    indexes=[0,1,2]
    indexes_array = (c_ulong*len(indexes))(*indexes)
    datIndexes = ObjCClass('NSData').dataWithBytes_length_(indexes_array,len(indexes_array))
     
    ele=ObjCClass('SCNGeometryElement').geometryElementWithData_primitiveType_primitiveCount_bytesPerIndex_(datIndexes,SCNGeometryPrimitiveTypeTriangles,1,4)
       
    # CRASH Here: 
    geo = ObjCClass('SCNGeometry').geometryWithSources_elements_(src,ele)

    posted in Pythonista read more
  • momorprods

    wooohoooo thanks!!

    posted in Pythonista read more
  • momorprods

    Made this, but still crashing. Am I making another noob mistake?

    verts=[0.0,0.0,0.0 , 1.0,0.0,0.0 , 0.0,1.0,0.0]
    arr = (ctypes.c_float * len(verts))(*verts)
    src = SCNGeometrySource.geometrySourceWithVertices_count_(byref(arr),3)

    posted in Pythonista read more
  • momorprods

    oh ok thanks, going to try that and keep you posted!

    posted in Pythonista read more
  • momorprods

    hehe yep made my day! Struggling now into loading SceneKit SCN file, did anyone had chance with this?

    posted in Pythonista read more
  • momorprods

    hey, digging out this old topic - did you have chance into the triangle mesh generation?

    I have started converting the Obj-c snippet above, but it crashes Pythonista at the geometrySourceWithVertices call. Probably my bad, but I’m clueless about how to fiw this:

    verts=[SCNVector3(0, 0, 0), SCNVector3(1, 0, 0), SCNVector3(0, 1, 0)]
    
    src = SCNGeometrySource.geometrySourceWithVertices_count_(POINTER(verts),3)

    posted in Pythonista read more
  • momorprods

    omg this works well. The cube scene generation example perfectly matches the local world - just set it up at (0,0,0).

    posted in Pythonista read more
  • momorprods

    Oh thanks for mentioning the ui.inbackground() stuff - that was the issue !

    Actually my code was reloading all the images from a @ui.inbackground section, which is bad design.

    Fixed it in order to ensure all is always loaded from the main thread, it works great now !

    Sorry for bothering, and thanks for the super fast reply.

    posted in Pythonista read more
  • momorprods

    Greetings,

    Long time no see, I've been playing around with the new Pythonista 3 and my old projects.

    One of them - basicaly an UI app which allows for upload of a few images from the camera roll and renders them into a UISceneView, litteraly makes Pythonista crash when my app gets the control back from the photo picker. At this part of the code, my app mostly unloads all previous images and reloads them. The crash happens randomly : most of the time it happens on the first try, sometimes it happens after 2,3 attempts.

    Ironicaly, this app was running perfectly on the older Pythonista. When I launch it as a standalone scene and make multiple load/unloads of the same images, everything is fine too.

    My initial guess is the UI module eats up a lot more memory than the previous version. I've tried to put a few gc.collect() in the code, with no luck.

    The code is quite big and refers to a few external files, so it's hard to share it there. But I'd really appreciate some insights on a strategy to help me fixing this - as I loose the console output upon each crash :-(

    Thanks !

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!