Write me some code, how much does it cost?

How does it go, by the line? by the project? What about modifying existing script? And how much?

I always got great ideas for fun scripts but to me the Python language is so complex in its composition that I decided to let the experts write code.

My first assignment I want to take face motion capture data and instead of applying it to shape keys I want to apply the data to bones instead and I can’t grasp all the intricacies of the language. So I need to work with someone not just ask how to do something.

I’d say it’s similar to CG projects, you can’t really ask how much does it cost to bring something in 3D, it really depend on the case. In the end it boils down to how many working days it will take to make it.
Exactly like in CG in some case it’s obvious, in other you need to study if it’s even possible to do something and how much time it could take. That alone can take time/money.

What you ask for for a starter isn’t as simple as it sound. A shape key goes from 0 to 1 and can be quite complex in term of motion (you may need to move several bones to get the same result) . So to make a 0->1 value match one or several bone transforms (loc/rot/scale) that’s doable but it remains quite specific to a rig.
Because a shape key ‘mouth open’ would always go from 0 to 1, but in some rigs it will be a bone location going from 0 to 0.5, or a rotation , you can’t really tell in advance.
Before starting to code, how would you solve this ?

Or it’s something you just need to make a project work and you don’t care if the code won’t work in another case ?

That alone makes a big difference in term of cost.

1 Like

It’s nothing more than a simple 1 to 1 conversion a shape key value from 0 to 1 but instead 0 to 1 y bone motion even the bones have the same name as the shape keys. It’s not to animate the bone in a rig it’s just a control panel just a bunch bones as control sliders. My problem is I can’t keyframe the motion data into shape keys as I have bones that use drivers for when ido animation and a driver output can be tweaked to the amount sent to the shape keys. I been trying for week to figure it out but no such luck. I’m sure for someone who know Python like the back of their hand they could write it as fast as I’m typing this sentence. And it doesn’t take more than 20 lines of code.

Ok thanks for the details,
Indeed it’s simpler, can you paste a sample of the mocap data ?
If you’re willing to pay for someone to do it, you can ask it in the paid work category, I suggest you add as much as relevant infos as you can and I’m sure someone could do something quite quickly,

1 Like
Timecode,BlendShapeCount,eyeBlinkRight,eyeLookDownRight,eyeLookInRight,eyeLookOutRight,eyeLookUpRight,eyeSquintRight,eyeWideRight,eyeBlinkLeft,eyeLookDownLeft,eyeLookInLeft,eyeLookOutLeft,eyeLookUpLeft,eyeSquintLeft,eyeWideLeft,jawForward,jawRight,jawLeft,jawOpen,mouthClose,mouthFunnel,mouthPucker,mouthRight,mouthLeft,mouthSmileRight,mouthSmileLeft,mouthFrownRight,mouthFrownLeft,mouthDimpleRight,mouthDimpleLeft,mouthStretchRight,mouthStretchLeft,mouthRollLower,mouthRollUpper,mouthShrugLower,mouthShrugUpper,mouthPressRight,mouthPressLeft,mouthLowerDownRight,mouthLowerDownLeft,mouthUpperUpRight,mouthUpperUpLeft,browDownRight,browDownLeft,browInnerUp,browOuterUpRight,browOuterUpLeft,cheekPuff,cheekSquintRight,cheekSquintLeft,noseSneerRight,noseSneerLeft,tongueOut,HeadYaw,HeadPitch,HeadRoll,LeftEyeYaw,LeftEyePitch,LeftEyeRoll,RightEyeYaw,RightEyePitch,RightEyeRoll
62:53:12:37.006,61,0.0038254452,0.0000000000,0.1141537726,0.0000000000,0.1121030822,0.7145567536,0.1047579870,0.0040954584,0.0000000000,0.0000000000,0.0076493639,0.1129931882,0.7144263983,0.1038799658,0.0218451358,0.0054703844,0.0003128086,0.0232388079,0.0352823287,0.1415321976,0.2783249319,0.0000009201,0.0094441799,0.0000197465,0.0060852813,0.0994004756,0.0328713655,0.0448998362,0.0461372286,0.2140853554,0.2000554800,0.1428411156,0.0647139996,0.1136871427,0.0496682189,0.0229504481,0.0210860930,0.0806388408,0.0848821178,0.0140275164,0.0170790628,0.1062886938,0.1063234955,0.1304191500,0.0000075585,0.0000081810,0.1296568215,0.0553273745,0.0569460094,0.1230981424,0.1301469654,0.0002140299,0.0339467451,-0.2846423984,0.0579877235,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000
62:53:12:38.006,61,0.0045552836,0.0000000000,0.1147334576,0.0000000000,0.1261096150,0.7352762222,0.1135740876,0.0048771584,0.0000000000,0.0000000000,0.0081078131,0.1270415187,0.7351591587,0.1130069345,0.0223178510,0.0057966919,0.0002878802,0.0236664098,0.0373653620,0.1862419248,0.3506298959,0.0000008468,0.0093634762,0.0000181728,0.0056017591,0.0954650491,0.0359293073,0.0449097492,0.0460928008,0.2342759967,0.2170172632,0.1566291451,0.0659807324,0.1184609458,0.0505686179,0.0233521722,0.0214929860,0.0817659423,0.0867322832,0.0141550489,0.0172717925,0.1280132830,0.1278558224,0.1301664412,0.0000069562,0.0000075291,0.1588735580,0.0572018251,0.0580299273,0.1253345162,0.1342534274,0.0002906183,0.0339467451,-0.2846423984,0.0579877235,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000

The data (above) the first row is used as the list of shape keys affected or in my case bones names affected. In this sample it’s just frame 1 and 2. The time stamp, number of shape keys, the values to all the shape keys separated by “,” in order of the first row.

Below is the script provided to read the data and apply to the shape keys.
I figured that I can just select the Armature and use a simple assign but the next problem there are no shape keys to count when you select the armature.
The line: shapekeys = ob.data.shape_keys.key_blocks will not work unless what is selected is the mesh. And I don’t know how an for/in command works or a if/in works. Everything from the comment is my addition that doesn’t work.

import bpy
import csv
import numpy as np
data_path = 'C:/Users/E/Desktop/example.csv'
ob = bpy.context.object
context = bpy.context
with open(data_path, 'r') as f:
    reader = csv.reader(f, delimiter=',')
    names = next(reader)
    data = np.array(list(reader))
shapekeys = ob.data.shape_keys.key_blocks
for i in range(data.shape[0]):
    if data[i][1] != '0':
        for shape in shapekeys:
            if shape.name in names:
                index = names.index(shape.name)
                shape.value=float(data[i][index])

#get this data  locY = shape.value
#get this data  boneName = shape.name
#get the current frame with variable i

                bpy.context.selected_objects
                pb = ob.pose.bones.get(boneName) 
                pb.location.y = locY /10
                pb.keyframe_insert("location",index=1,frame= i)

Ok, you can try this :

import bpy
import csv
import numpy as np
data_path = 'C:/Users/E/Desktop/example.csv'
context = bpy.context
ob = context.object
rig = bpy.data.objects["PutRigNameHere"] # <--- Rig name here
with open(data_path, 'r') as f:
    reader = csv.reader(f, delimiter=',')
    names = next(reader)
    data = np.array(list(reader))
shapekeys = ob.data.shape_keys.key_blocks
for i in range(data.shape[0]):
    if data[i][1] != '0':
        for shape in shapekeys:
            if shape.name in names:
                index = names.index(shape.name)
                val   = float(data[i][index])
                shape.value = val # comment this line if you dont need to set shape keys
                try :
                    bone = rig.pose.bones[shape.name]
                except :
                    print("can't find bone",shape.name)
                    bone = None
                    pass
                    
                if bone :
                    bone.location[1] = val
                    bone.keyframe_insert("location",index=1,frame= i)


2 Likes

Let me wake up and then I’ll give it a go.
Thank you for your time and effort, much appreciated.

1 Like

I dunno if it works, works, as in doing exactly what it is supposed to do but I see no keyframes on shape keys and seeing bones move up and down. Glorious! More tests needed. But I have a good feeling about this, now I have to leave the school dance and plop into my Delorean and get back to 1985! Kinda feel good. Thank you!

1 Like

Cool ! yes by default bones are animated and also shape keys, but as shape keys are driven the animation isn’t taken into account.

1 Like

Right Now I’m making all the custom object for all the bones and making all the shape keys for my character. When it’s done I’ll post here my results. I never been so productive today than I’ve been all week.

You done it Sozap! Here is a test sample I made. I only added the drivers for the eyebrows in this one. My rig matches the head included in the sample file.
Great Success! High Five!
How much do I owe you for doing this for me?
Thanks again!

1 Like

So, just as a general “I want to hire a programmer, what should I expect?” from a software developer.

Let’s start with an estimation. According to the Blender development fund, 100k EUR/month will pay for about 20 full time developers. So, that means that roughly 5,000 EUR are being given to each developer a month (maybe more, maybe less). Hypothetically if you have a project that should take a single developer a month to complete if they work on this full time, then expect to pay them about that amount.

There’s a few things that can drive up and down the cost of the project. For example, hiring an experienced developer is likely not going to be cheap, but the work will likely be high quality and possibly done pretty fast. Hiring a developer fresh out of school may be really cheap, but could take longer and may not be high quality. But, this is a generalization, and it’s possible you may find someone that has a year of programming experience that can build things on par with someone that has done it for 10.

One of the key things is to try to make your request as specific as possible. Let’s say you want to have something developed (like the motion capture -> bones that you requested). Possibly one of the best ways to request for something like this is to go through the process that you want automated and record step by step with as many details as you can. So, things like what are your expected results, what to do if you get something unexpected, what is your expected user experience, etc. The more details you can hand over to the developer, the faster they can produce something that matches your specific requirements. Also, this can help predict the cost. If you want something quick and hacky, someone may come along and give you something that’ll probably work in maybe an hour time, but if you want something that is polished, then that’ll likely cost money.

I hope this was helpful. Let me know if you have any questions about development in general and I’ll do my best to answer it.

2 Likes

What I want done is never more complicated than what I requested in this thread. I know how to simplify code to its essential but I lack the understanding of the syntax for some things. I hope to find examples that I can simply modify to my own ends but that is not always the case.

All I want is an ‘in case of code error, break glass’ kinda hire. Fix 10 lines tops type tuneups.

Ah, no worries. If that’s the case, then add long as all you need are snippets, then generally I see that intonation is handed out for free if the cost to the developer is pretty small.

My goal with my previous post was to give you information on what the costs may be for larger projects where you would likely hire a developer. I hope it didn’t come off as condescending.

1 Like

Not at all. I wrote the subject of this tread to be informed and you provided just that.