Page 50 of 50 FirstFirst ... 40484950
Results 981 to 991 of 991
  1. #981

    Running proxy_fit in a frame handler

    Hello and thanks again, Manuel, for such amazing work! You have really changed my life with this add-on!

    My question involves using proxies on a set of multiple moving characters. I was very pleased to see the changes you made in v1.6 re: editing vs animating mode, but I am still quite inexperienced not only with MBL but also with Blender and even python (coming from a C++ background), and am having some problems accomplishing my goals here.

    My mission is to use MBL & Blender to render crowd animations using sets of BVH files that I have exported from my own application. I have successfully written a python script that reads actor positions from an XML file and puts a character and associated proxy (in my test case, a pair of pants) in each position, and then loads the corresponding BVH animation for each character.

    I am then using a frame handler (frame_change_post) to select each actor and associated proxy, and then call proxy_fit. This has worked for me a few times, but something appears to be unstable or just plain wrong in what I am doing, because other times I can't get the same code to function, and I have not been able to determine the difference.

    Here is an (admittedly terrible) video demonstrating my frame handler working as expected. (It was the very first output, sorry for the pants not fitting right, the characters running through the ground, and whatever the problem is that causes them to set themselves flat for a frame or two every now and then - those problems I can chase down on my own.)



    Here is my frame handler function. It works by reading a second xml file created during the import of the first xml file I mentioned. Sorry for the quote tags, I can't find a "code" formatting tool here. In my version the whitespace is correct.

    def mmHandler(scene):
    if doneLoading:
    lastActive = bpy.context.scene.objects.active # store the last active object, to set it back when we're done
    bpy.ops.object.select_all(action='DESELECT') # deselect everything

    #Load an xml file listing all proxies for each proxy-using actor.
    #<proxy_actors>
    # <actor mesh='afro_male_mesh.001'>
    # <proxy name='cargopants.001'/>
    # </actor>
    # ...
    xml_path = "F:/bvhWork/proxy_actors.xml"
    dom = parse(xml_path)
    actorGroup = dom.getElementsByTagName("proxy_actors")[0]
    actors = actorGroup.getElementsByTagName("actor")
    for actor in actors:
    meshName = actor.getAttribute("mesh")
    proxyGroup = actor.getElementsByTagName("proxy")
    bpy.data.objects[meshName].select = True
    bpy.context.scene.objects.active = bpy.data.objects[meshName]

    for proxy in proxyGroup:
    proxyName = proxy.getAttribute("name")
    bpy.data.objects[proxyName].select = True
    print("fitting proxy " + proxyName + " mesh " + meshName)
    bpy.ops.mbast.proxy_fit()
    bpy.data.objects[proxyName].select = False

    bpy.data.objects[meshName].select = False

    bpy.app.handlers.frame_change_post.append(mmHandle r)
    When it works, it works, but when it doesn't, it seems to call the function but nothing happens to my proxies. Just hoping someone will notice that I'm doing something flagrantly wrong here and straighten me out!

    Thanks again, Manuel, for all the tremendous work, and to everybody else here for being such a great community.

    EDIT: I should also mention the fact that in the process of getting this to work at all, I had to make a few changes to the MBLab code, because it was not possible to call proxy_fit from the script context - I kept getting messages about the context object not having any "selected_objects" member. The changes I made are as follows:

    In proxyengine.py, line 65 or so, I switched to bpy.context.scene.objects instead of selected_objects.

    #objs_selected = bpy.context.selected_objects
    objs_selected = [ o for o in bpy.context.scene.objects if o.select ]

    In algorithms.py, around line 729, I had to do the same thing:

    #for obj in bpy.context.selected_objects:
    objs_selected = [ o for o in bpy.context.scene.objects if o.select ]
    for obj in objs_selected:

    And then also in algorithms.py, around line 635, this one scared me a bit, but I was getting a crash on modifier_move_up not being available, so I polled it first. It seems that simply skipping this function probably isn't a good idea, but as you can see above it did work at least a few times.

    if (bpy.ops.object.modifier_move_up.poll()):
    bpy.ops.object.modifier_move_up(modifier=modifier_ name)

    Cheers, and thanks again.
    Last edited by Chris Calef; 13-Dec-17 at 10:55.



  2. #982
    Originally Posted by Daedalus_MDW View Post
    nope, not really. theres some good info on the last few pages.
    I tried to follow those instructions:

    Originally Posted by Åsmund View Post
    I found the settings for making the materials on the eyes show up in material mode. You need to set the shader to Mix shader
    Attachment 507041
    But they didn't really cut it for me. Could you guide me through it with a bit more details in the steps to take?



  3. #983
    Anyone using Unreal Engine 4 also having trouble with the fur material for the eyelashes?

    No matter what I do, the eyelashes show as completely white. The rest of the materials work fine. Anyone set up this material successfully in UE4?



  4. #984
    Originally Posted by philnguyen1994 View Post
    Anyone using Unreal Engine 4 also having trouble with the fur material for the eyelashes?

    No matter what I do, the eyelashes show as completely white. The rest of the materials work fine. Anyone set up this material successfully in UE4?
    mbl_furMat.jpg
    As for Material here is mine, but I still need to multiply that by a hair color.



  5. #985
    I am knew to blender and having a hard time trying to figure out how to create more than one character so far. I read through the documents section you have Manuel on your website, I click the finalize save and backup button. I have also tried to duplicate the same character and it will only do this to the skeleton. Anybody have a tutorial that explains more about this or have time to actually help me out? Looking forward to the newest update to this as well with the hair. I am currently just wanting to use this for a video game I am producing.



  6. #986
    Member Manuel's Avatar
    Join Date
    Mar 2002
    Location
    Italy
    Posts
    1,021
    Originally Posted by fiberopticscpu View Post
    I am knew to blender and having a hard time trying to figure out how to create more than one character so far. I read through the documents section you have Manuel on your website, I click the finalize save and backup button. I have also tried to duplicate the same character and it will only do this to the skeleton. Anybody have a tutorial that explains more about this or have time to actually help me out? Looking forward to the newest update to this as well with the hair. I am currently just wanting to use this for a video game I am producing.
    My suggestion is to create a .blend for each character and save it in your character folder. Then you can just append them into the main production scene (File -> Append, etc..). Also is a good practice to always save a copy of the character using the json format: http://www.manuelbastioni.com/guide_save_export.php
    My open source Blender addon to create 3D humans: www.manuelbastioni.com



  7. #987
    Member Manuel's Avatar
    Join Date
    Mar 2002
    Location
    Italy
    Posts
    1,021
    Originally Posted by Chris Calef View Post

    When it works, it works, but when it doesn't, it seems to call the function but nothing happens to my proxies. Just hoping someone will notice that I'm doing something flagrantly wrong here and straighten me out!
    When it doesn't work, have you checked if the proxy shapekeys are correctly created?

    Anyway, instead to call the proxy fitting for each frame, is better to follow this way:

    1) Use the proxy fitting only one time, to fit the proxy to the character in rest pose.
    2) Use the blender standard modifier "Data Transfer" to transfer the weights from body to proxy.
    3) Use the body skeleton for proxy too.


    EDIT: I should also mention the fact that in the process of getting this to work at all, I had to make a few changes to the MBLab code, because it was not possible to call proxy_fit from the script context - I kept getting messages about the context object not having any "selected_objects" member. The changes I made are as follows:
    Messages from the lab or from Blender API? The correct selection of objects is a key factor and can be a cause of the "nothing happens".


    And then also in algorithms.py, around line 635, this one scared me a bit, but I was getting a crash on modifier_move_up not being available, so I polled it first.
    Weird...the move_up should be always available, even when there is only one modifier. It should never crash, but just return {'CANCELLED'}. If you have time it would be good to report this to Blender developers, with a very short example to reproduce the crash.

    It seems that simply skipping this function probably isn't a good idea, but as you can see above it did work at least a few times.

    if (bpy.ops.object.modifier_move_up.poll()):
    bpy.ops.object.modifier_move_up(modifier=modifier_ name)
    Indeed, it can create some unexpected results, in particular if there are modifiers that change the number of vertices.
    Anyway, following the "Data Transfer" method, all problems should be solved.
    My open source Blender addon to create 3D humans: www.manuelbastioni.com



  8. #988
    Member Manuel's Avatar
    Join Date
    Mar 2002
    Location
    Italy
    Posts
    1,021
    An update of hair shaders and models that will be released with lab 1.6.1.
    My open source Blender addon to create 3D humans: www.manuelbastioni.com



  9. #989
    Originally Posted by Manuel View Post
    An update of hair shaders and models that will be released with lab 1.6.1.
    Looks excellent as always, Manuel. A few example hairs are just what the Lab needs right now. Any ETA for 1.6.1 (and for the funding/ donation option) ? - take as much time as you need of course!



  10. #990
    Member Safetyman's Avatar
    Join Date
    Mar 2010
    Location
    Maryland, USA
    Posts
    1,333
    Ooooooo -- that hair would be a nice Christmas present... or is it just wishful thinking?
    Quicksand has no sense of humor
    DeviantArt



  11. #991
    Member Manuel's Avatar
    Join Date
    Mar 2002
    Location
    Italy
    Posts
    1,021
    Originally Posted by philnguyen1994 View Post
    Looks excellent as always, Manuel. A few example hairs are just what the Lab needs right now. Any ETA for 1.6.1 (and for the funding/ donation option) ? - take as much time as you need of course!
    Hopefully 1.6.1 will be ready before the end of December. The funding system will require a couple of months, thank you!
    My open source Blender addon to create 3D humans: www.manuelbastioni.com



Page 50 of 50 FirstFirst ... 40484950

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •