text:
How do I build an object using Python and predetermined coordinates?
I have been building a complex mathematical object in Blender by creating each individual vertex and then connecting the dots. There are 260 vertices. I'm currently on #38. Obviously this is not efficient. I know there is a way to import this data, or write the script, but I have no idea where to start. I'm a complete beginner on Blender, and know almost nothing about Python. The data I'm working from looks like this...
This is the entire file:
Dual Geodesic Icosahedron Pattern 6 [3,1]

C0  = 0.0278728483334650370381795124317
C1  = 0.0417605902707273450330202218460
C2  = 0.0482207631985655347048259575806
C3  = 0.0485271500913616902083332985770
C4  = 0.0931391956773255725056107681612
C5  = 0.0965573626835274272370348719303
C6  = 0.107547404625872186617181540007
C7  = 0.115790817646860551951256687036
C8  = 0.119783424089466474929919797595048
C9  = 0.145586591764509108593032943711
C10 = 0.1455928882670341471433303052049
C11 = 0.194113741855870798801366242288
C12 = 0.220431462018603598005258179308
C13 = 0.238188705049775063930022711304
C14 = 0.239202575383431558854091591763
C15 = 0.258249788916612246877163454031
C16 = 0.267154551763824439262804947967
C17 = 0.283287921016592357037529251132
C18 = 0.298950040243594377815031134048
C19 = 0.324717740377238927017176093829
C20 = 0.332341771060757131359702359924
C21 = 0.334746067733302491167057583234
C22 = 0.358695307225219637200425804924
C23 = 0.379845283700119784274564123062
C24 = 0.405175083258563434157399921336
C25 = 0.405192747827293817829885928720
C26 = 0.413270268840324805049177290081
C27 = 0.430496636473677061118504317477
C28 = 0.435184175960922907431325584883
C29 = 0.446935673529290779190420143182
C30 = 0.506357127147255998116896539729
C31 = 0.524958507348029909087319718931
C32 = 0.534514094024825642786011006694
C33 = 0.550779339591802926422918872431
C34 = 0.569503363526322938881495682523
C35 = 0.580381198695491106718671839452
C36 = 0.586729731159675194950822709919
C37 = 0.592528561796324926333750448387
C38 = 0.629297917816793706232691827171
C39 = 0.640749324994890461038576405968
C40 = 0.645287686083513420132210630583
C41 = 0.657059511437996058376878453752
C42 = 0.670748229742154172402305457529
C43 = 0.711755637544140100272223270381
C44 = 0.719275379833515862610638756106
C45 = 0.764606916063868244994059993760
C46 = 0.765242704206979552285561900711
C47 = 0.771377873753784688028391160270
C48 = 0.793115552540444589323741413143
C49 = 0.801179944373958283220464778439
C50 = 0.804894833221465672777834038542
C51 = 0.824918436209450258880845421223
C52 = 0.8429405346446856282534850002848
C53 = 0.849729379835397304237950006479
C54 = 0.8527912845429152959190249336546
C55 = 0.8911612978432511629583109578654
C56 = 0.912442237847337859395015578549
C57 = 0.9169707620208188351717214654752
C58 = 0.939076505920710743919097644376
C59 = 0.939706841852119460615896935414
C60 = 0.969698269985748550217336591577
C61 = 0.970005426460752347149386724411

V0   = (  C5,   C0,  1.0)
V1   = (  C5,  -C0, -1.0)
V2   = ( -C5,  -C0,  1.0)
V3   = ( -C5,   C0, -1.0)
V4   = ( 1.0,   C5,   C0)
V5   = ( 1.0,  -C5,  -C0)
V6   = (-1.0,  -C5,   C0)
V7   = (-1.0,   C5,  -C0)
V8   = (  C0,  1.0,   C5)
V9   = (  C0, -1.0,  -C5)
V10  = ( -C0, -1.0,   C5)
V11  = ( -C0,  1.0,  -C5)
V12  = ( C14,  -C6,  C61)
V13  = ( C14,   C6, -C61)
V14  = (-C14,   C6,  C61)
V15  = (-C14,  -C6, -C61)
V16  = ( C61, -C14,   C6)
V17  = ( C61,  C14,  -C6)
V18  = (-C61,  C14,   C6)
V19  = (-C61, -C14,  -C6)
V20  = (  C6, -C61,  C14)
V21  = (  C6,  C61, -C14)
V22  = ( -C6,  C61,  C14)
V23  = ( -C6, -C61, -C14)
V24  = (  C9,  C12,  C60)
V25  = (  C9, -C12, -C60)
V26  = ( -C9, -C12,  C60)
V27  = ( -C9,  C12, -C60)
V28  = ( C60,   C9,  C12)
V29  = ( C60,  -C9, -C12)
V30  = (-C60,  -C9,  C12)
V31  = (-C60,   C9, -C12)
V32  = ( C12,  C60,   C9)
V33  = ( C12, -C60,  -C9)
V34  = (-C12, -C60,   C9)
V35  = (-C12,  C60,  -C9)
V36  = ( C11, -C18,  C59)
V37  = ( C11,  C18, -C59)
V38  = (-C11,  C18,  C59)
V39  = (-C11, -C18, -C59)
V40  = ( C59, -C11,  C18)
V41  = ( C59,  C11, -C18)
V42  = (-C59,  C11,  C18)
V43  = (-C59, -C11, -C18)
V44  = ( C18, -C59,  C11)
V45  = ( C18,  C59, -C11)
V46  = (-C18,  C59,  C11)
V47  = (-C18, -C59, -C11)
V48  = ( 0.0,  C22,  C58)
V49  = ( 0.0,  C22, -C58)
V50  = ( 0.0, -C22,  C58)
V51  = ( 0.0, -C22, -C58)
V52  = ( C58,  0.0,  C22)
V53  = ( C58,  0.0, -C22)
V54  = (-C58,  0.0,  C22)
V55  = (-C58,  0.0, -C22)
V56  = ( C22,  C58,  0.0)
V57  = ( C22, -C58,  0.0)
V58  = (-C22,  C58,  0.0)
V59  = (-C22, -C58,  0.0)
V60  = ( C24,  -C2,  C57)
V61  = ( C24,   C2, -C57)
V62  = (-C24,   C2,  C57)
V63  = (-C24,  -C2, -C57)
V64  = ( C57, -C24,   C2)
V65  = ( C57,  C24,  -C2)
V66  = (-C57,  C24,   C2)
V67  = (-C57, -C24,  -C2)
V68  = (  C2, -C57,  C24)
V69  = (  C2,  C57, -C24)
V70  = ( -C2,  C57,  C24)
V71  = ( -C2, -C57, -C24)
V72  = ( C20,  C15,  C56)
V73  = ( C20, -C15, -C56)
V74  = (-C20, -C15,  C56)
V75  = (-C20,  C15, -C56)
V76  = ( C56,  C20,  C15)
V77  = ( C56, -C20, -C15)
V78  = (-C56, -C20,  C15)
V79  = (-C56,  C20, -C15)
V80  = ( C15,  C56,  C20)
V81  = ( C15, -C56, -C20)
V82  = (-C15, -C56,  C20)
V83  = (-C15,  C56, -C20)
V84  = ( C29,   C7,  C55)
V85  = ( C29,  -C7, -C55)
V86  = (-C29,  -C7,  C55)
V87  = (-C29,   C7, -C55)
V88  = ( C55,  C29,   C7)
V89  = ( C55, -C29,  -C7)
V90  = (-C55, -C29,   C7)
V91  = (-C55,  C29,  -C7)
V92  = (  C7,  C55,  C29)
V93  = (  C7, -C55, -C29)
V94  = ( -C7, -C55,  C29)
V95  = ( -C7,  C55, -C29)
V96  = ( C21, -C26,  C54)
V97  = ( C21,  C26, -C54)
V98  = (-C21,  C26,  C54)
V99  = (-C21, -C26, -C54)
V100 = ( C54, -C21,  C26)
V101 = ( C54,  C21, -C26)
V102 = (-C54,  C21,  C26)
V103 = (-C54, -C21, -C26)
V104 = ( C26, -C54,  C21)
V105 = ( C26,  C54, -C21)
V106 = (-C26,  C54,  C21)
V107 = (-C26, -C54, -C21)
V108 = (  C3,  C32,  C53)
V109 = (  C3, -C32, -C53)
V110 = ( -C3, -C32,  C53)
V111 = ( -C3,  C32, -C53)
V112 = ( C53,   C3,  C32)
V113 = ( C53,  -C3, -C32)
V114 = (-C53,  -C3,  C32)
V115 = (-C53,   C3, -C32)
V116 = ( C32,  C53,   C3)
V117 = ( C32, -C53,  -C3)
V118 = (-C32, -C53,   C3)
V119 = (-C32,  C53,  -C3)
V120 = ( C31, -C10,  C52)
V121 = ( C31,  C10, -C52)
V122 = (-C31,  C10,  C52)
V123 = (-C31, -C10, -C52)
V124 = ( C52, -C31,  C10)
V125 = ( C52,  C31, -C10)
V126 = (-C52,  C31,  C10)
V127 = (-C52, -C31, -C10)
V128 = ( C10, -C52,  C31)
V129 = ( C10,  C52, -C31)
V130 = (-C10,  C52,  C31)
V131 = (-C10, -C52, -C31)
V132 = ( C23,  C27,  C51)
V133 = ( C23, -C27, -C51)
V134 = (-C23, -C27,  C51)
V135 = (-C23,  C27, -C51)
V136 = ( C51,  C23,  C27)
V137 = ( C51, -C23, -C27)
V138 = (-C51, -C23,  C27)
V139 = (-C51,  C23, -C27)
V140 = ( C27,  C51,  C23)
V141 = ( C27, -C51, -C23)
V142 = (-C27, -C51,  C23)
V143 = (-C27,  C51, -C23)
V144 = ( C30, -C19,  C50)
V145 = ( C30,  C19, -C50)
V146 = (-C30,  C19,  C50)
V147 = (-C30, -C19, -C50)
V148 = ( C50, -C30,  C19)
V149 = ( C50,  C30, -C19)
V150 = (-C50,  C30,  C19)
V151 = (-C50, -C30, -C19)
V152 = ( C19, -C50,  C30)
V153 = ( C19,  C50, -C30)
V154 = (-C19,  C50,  C30)
V155 = (-C19, -C50, -C30)
V156 = ( C37,   C8,  C49)
V157 = ( C37,  -C8, -C49)
V158 = (-C37,  -C8,  C49)
V159 = (-C37,   C8, -C49)
V160 = ( C49,  C37,   C8)
V161 = ( C49, -C37,  -C8)
V162 = (-C49, -C37,   C8)
V163 = (-C49,  C37,  -C8)
V164 = (  C8,  C49,  C37)
V165 = (  C8, -C49, -C37)
V166 = ( -C8, -C49,  C37)
V167 = ( -C8,  C49, -C37)
V168 = ( C13,  C34,  C48)
V169 = ( C13, -C34, -C48)
V170 = (-C13, -C34,  C48)
V171 = (-C13,  C34, -C48)
V172 = ( C48,  C13,  C34)
V173 = ( C48, -C13, -C34)
V174 = (-C48, -C13,  C34)
V175 = (-C48,  C13, -C34)
V176 = ( C34,  C48,  C13)
V177 = ( C34, -C48, -C13)
V178 = (-C34, -C48,  C13)
V179 = (-C34,  C48, -C13)
V180 = ( C39,  -C1,  C47)
V181 = ( C39,   C1, -C47)
V182 = (-C39,   C1,  C47)
V183 = (-C39,  -C1, -C47)
V184 = ( C47, -C39,   C1)
V185 = ( C47,  C39,  -C1)
V186 = (-C47,  C39,   C1)
V187 = (-C47, -C39,  -C1)
V188 = (  C1, -C47,  C39)
V189 = (  C1,  C47, -C39)
V190 = ( -C1,  C47,  C39)
V191 = ( -C1, -C47, -C39)
V192 = ( C17, -C36,  C46)
V193 = ( C17,  C36, -C46)
V194 = (-C17,  C36,  C46)
V195 = (-C17, -C36, -C46)
V196 = ( C46, -C17,  C36)
V197 = ( C46,  C17, -C36)
V198 = (-C46,  C17,  C36)
V199 = (-C46, -C17, -C36)
V200 = ( C36, -C46,  C17)
V201 = ( C36,  C46, -C17)
V202 = (-C36,  C46,  C17)
V203 = (-C36, -C46, -C17)
V204 = (  C4, -C40,  C45)
V205 = (  C4,  C40, -C45)
V206 = ( -C4,  C40,  C45)
V207 = ( -C4, -C40, -C45)
V208 = ( C45,  -C4,  C40)
V209 = ( C45,   C4, -C40)
V210 = (-C45,   C4,  C40)
V211 = (-C45,  -C4, -C40)
V212 = ( C40, -C45,   C4)
V213 = ( C40,  C45,  -C4)
V214 = (-C40,  C45,   C4)
V215 = (-C40, -C45,  -C4)
V216 = ( C33,  C28,  C44)
V217 = ( C33, -C28, -C44)
V218 = (-C33, -C28,  C44)
V219 = (-C33,  C28, -C44)
V220 = ( C44,  C33,  C28)
V221 = ( C44, -C33, -C28)
V222 = (-C44, -C33,  C28)
V223 = (-C44,  C33, -C28)
V224 = ( C28,  C44,  C33)
V225 = ( C28, -C44, -C33)
V226 = (-C28, -C44,  C33)
V227 = (-C28,  C44, -C33)
V228 = ( C41,  C16,  C43)
V229 = ( C41, -C16, -C43)
V230 = (-C41, -C16,  C43)
V231 = (-C41,  C16, -C43)
V232 = ( C43,  C41,  C16)
V233 = ( C43, -C41, -C16)
V234 = (-C43, -C41,  C16)
V235 = (-C43,  C41, -C16)
V236 = ( C16,  C43,  C41)
V237 = ( C16, -C43, -C41)
V238 = (-C16, -C43,  C41)
V239 = (-C16,  C43, -C41)
V240 = ( C38, -C25,  C42)
V241 = ( C38,  C25, -C42)
V242 = (-C38,  C25,  C42)
V243 = (-C38, -C25, -C42)
V244 = ( C42, -C38,  C25)
V245 = ( C42,  C38, -C25)
V246 = (-C42,  C38,  C25)
V247 = (-C42, -C38, -C25)
V248 = ( C25, -C42,  C38)
V249 = ( C25,  C42, -C38)
V250 = (-C25,  C42,  C38)
V251 = (-C25, -C42, -C38)
V252 = ( C35,  C35,  C35)
V253 = ( C35,  C35, -C35)
V254 = ( C35, -C35,  C35)
V255 = ( C35, -C35, -C35)
V256 = (-C35,  C35,  C35)
V257 = (-C35,  C35, -C35)
V258 = (-C35, -C35,  C35)
V259 = (-C35, -C35, -C35)

Faces:
{  60, 120, 180, 156,  84 }
{  61, 121, 181, 157,  85 }
{  62, 122, 182, 158,  86 }
{  63, 123, 183, 159,  87 }
{  64, 124, 184, 161,  89 }
{  65, 125, 185, 160,  88 }
{  66, 126, 186, 163,  91 }
{  67, 127, 187, 162,  90 }
{  68, 128, 188, 166,  94 }
{  69, 129, 189, 167,  95 }
{  70, 130, 190, 164,  92 }
{  71, 131, 191, 165,  93 }
{  72,  24,   0,  12,  60,  84 }
{  73,  25,   1,  13,  61,  85 }
{  74,  26,   2,  14,  62,  86 }
{  75,  27,   3,  15,  63,  87 }
{  76,  28,   4,  17,  65,  88 }
{  77,  29,   5,  16,  64,  89 }
{  78,  30,   6,  19,  67,  90 }
{  79,  31,   7,  18,  66,  91 }
{  80,  32,   8,  22,  70,  92 }
{  81,  33,   9,  23,  71,  93 }
{  82,  34,  10,  20,  68,  94 }
{  83,  35,  11,  21,  69,  95 }
{  84, 156, 228, 216, 132,  72 }
{  85, 157, 229, 217, 133,  73 }
{  86, 158, 230, 218, 134,  74 }
{  87, 159, 231, 219, 135,  75 }
{  88, 160, 232, 220, 136,  76 }
{  89, 161, 233, 221, 137,  77 }
{  90, 162, 234, 222, 138,  78 }
{  91, 163, 235, 223, 139,  79 }
{  92, 164, 236, 224, 140,  80 }
{  93, 165, 237, 225, 141,  81 }
{  94, 166, 238, 226, 142,  82 }
{  95, 167, 239, 227, 143,  83 }
{  96, 144, 120,  60,  12,  36 }
{  97, 145, 121,  61,  13,  37 }
{  98, 146, 122,  62,  14,  38 }
{  99, 147, 123,  63,  15,  39 }
{ 100, 148, 124,  64,  16,  40 }
{ 101, 149, 125,  65,  17,  41 }
{ 102, 150, 126,  66,  18,  42 }
{ 103, 151, 127,  67,  19,  43 }
{ 104, 152, 128,  68,  20,  44 }
{ 105, 153, 129,  69,  21,  45 }
{ 106, 154, 130,  70,  22,  46 }
{ 107, 155, 131,  71,  23,  47 }
{ 108, 168, 236, 164, 190, 206 }
{ 109, 169, 237, 165, 191, 207 }
{ 110, 170, 238, 166, 188, 204 }
{ 111, 171, 239, 167, 189, 205 }
{ 112, 172, 228, 156, 180, 208 }
{ 113, 173, 229, 157, 181, 209 }
{ 114, 174, 230, 158, 182, 210 }
{ 115, 175, 231, 159, 183, 211 }
{ 116, 176, 232, 160, 185, 213 }
{ 117, 177, 233, 161, 184, 212 }
{ 118, 178, 234, 162, 187, 215 }
{ 119, 179, 235, 163, 186, 214 }
{ 120, 144, 240, 196, 208, 180 }
{ 121, 145, 241, 197, 209, 181 }
{ 122, 146, 242, 198, 210, 182 }
{ 123, 147, 243, 199, 211, 183 }
{ 124, 148, 244, 200, 212, 184 }
{ 125, 149, 245, 201, 213, 185 }
{ 126, 150, 246, 202, 214, 186 }
{ 127, 151, 247, 203, 215, 187 }
{ 128, 152, 248, 192, 204, 188 }
{ 129, 153, 249, 193, 205, 189 }
{ 130, 154, 250, 194, 206, 190 }
{ 131, 155, 251, 195, 207, 191 }
{  48,  24,  72, 132, 168, 108 }
{  48, 108, 206, 194,  98,  38 }
{  48,  38,  14,   2,   0,  24 }
{  49,  27,  75, 135, 171, 111 }
{  49, 111, 205, 193,  97,  37 }
{  49,  37,  13,   1,   3,  27 }
{  50,  26,  74, 134, 170, 110 }
{  50, 110, 204, 192,  96,  36 }
{  50,  36,  12,   0,   2,  26 }
{  51,  25,  73, 133, 169, 109 }
{  51, 109, 207, 195,  99,  39 }
{  51,  39,  15,   3,   1,  25 }
{  52,  28,  76, 136, 172, 112 }
{  52, 112, 208, 196, 100,  40 }
{  52,  40,  16,   5,   4,  28 }
{  53,  29,  77, 137, 173, 113 }
{  53, 113, 209, 197, 101,  41 }
{  53,  41,  17,   4,   5,  29 }
{  54,  30,  78, 138, 174, 114 }
{  54, 114, 210, 198, 102,  42 }
{  54,  42,  18,   7,   6,  30 }
{  55,  31,  79, 139, 175, 115 }
{  55, 115, 211, 199, 103,  43 }
{  55,  43,  19,   6,   7,  31 }
{  56,  32,  80, 140, 176, 116 }
{  56, 116, 213, 201, 105,  45 }
{  56,  45,  21,  11,   8,  32 }
{  57,  33,  81, 141, 177, 117 }
{  57, 117, 212, 200, 104,  44 }
{  57,  44,  20,  10,   9,  33 }
{  58,  35,  83, 143, 179, 119 }
{  58, 119, 214, 202, 106,  46 }
{  58,  46,  22,   8,  11,  35 }
{  59,  34,  82, 142, 178, 118 }
{  59, 118, 215, 203, 107,  47 }
{  59,  47,  23,   9,  10,  34 }
{ 252, 216, 228, 172, 136, 220 }
{ 252, 220, 232, 176, 140, 224 }
{ 252, 224, 236, 168, 132, 216 }
{ 253, 241, 145,  97, 193, 249 }
{ 253, 249, 153, 105, 201, 245 }
{ 253, 245, 149, 101, 197, 241 }
{ 254, 240, 144,  96, 192, 248 }
{ 254, 248, 152, 104, 200, 244 }
{ 254, 244, 148, 100, 196, 240 }
{ 255, 217, 229, 173, 137, 221 }
{ 255, 221, 233, 177, 141, 225 }
{ 255, 225, 237, 169, 133, 217 }
{ 256, 242, 146,  98, 194, 250 }
{ 256, 250, 154, 106, 202, 246 }
{ 256, 246, 150, 102, 198, 242 }
{ 257, 219, 231, 175, 139, 223 }
{ 257, 223, 235, 179, 143, 227 }
{ 257, 227, 239, 171, 135, 219 }
{ 258, 218, 230, 174, 138, 222 }
{ 258, 222, 234, 178, 142, 226 }
{ 258, 226, 238, 170, 134, 218 }
{ 259, 243, 147,  99, 195, 251 }
{ 259, 251, 155, 107, 203, 247 }
{ 259, 247, 151, 103, 199, 243 }

The data is in a file and listed this way? Would be easier to just read the file and build from the data, but need to know the exact format. Maybe post example file?

I added the complete file above.

The easy way - enable the Extra mesh objects addon and add a geodisic dome and adjust the operator options - either press F6 or look at the bottom of the toolshelf region.

You will also find other objects available like the XYZ Math Surface where you can input the calculations used to create the object.
Another option is sverchok that lets you use nodes to generate a mesh.
As for improving your script, instead of generating the values and adding the results to your script, put the calculations in your script and create the vertices as you calculate each location. As a beginner you may find the geodisic code a bit much as a starting point, so maybe first look at the gemstone code to get an idea of how to do it.

It looks awesome. I'll let you know how it goes. Thanks!

Thank you. This is very useful to know. It does not seem to solve my current problem. I need to make a class three poly dome. This appears to support only class one and two.

you should download and check this course in order to understand how this work, or this one

actually I did a template that can help you in your work download
the main part is:
edges = []

verts = [(1.0, 0.9999999403953552, -1.0), (1.0, -1.0, -1.0), (-1.0000001192092896, -0.9999998211860657, -1.0), (-0.9999996423721313, 1.0000003576278687, -1.0), (1.0000004768371582, 0.999999463558197, 1.0), (0.9999993443489075, -1.0000005960464478, 1.0), (-1.0000003576278687, -0.9999996423721313, 1.0), (-0.9999999403953552, 1.0, 1.0), (0.9999998807907104, -5.364418029785156e-07, 1.0), (2.384185791015625e-07, 0.9999997615814209, 1.0), (-5.364418029785156e-07, -1.0000001192092896, 1.0), (-1.0000001192092896, 1.7881393432617188e-07, 1.0), (-1.4901161193847656e-07, -1.7881393432617188e-07, 2.5804858207702637)]

faces = [(0, 1, 2, 3), (12, 11, 6, 10), (0, 4, 8, 5, 1), (1, 5, 10, 6, 2), (2, 6, 11, 7, 3), (4, 0, 3, 7, 9), (8, 12, 10, 5), (4, 9, 12, 8), (9, 7, 11, 12)]

You must change the coordinates of the vertices and express the faces that are connected
also you can do the same with or without the edges data.
Here I leave the same template working with your Dual Geodesic Icosahedron Pattern code:

bl_info = {
    "name": "new objects template",
    "author": "Diego Quevedo",
    "version": (1, 0),
    "blender": (2, 7, 3),
    "location": "View3D > Add > Mesh > New Objetc",
    "description": "template to add new Mesh Object",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Add Mesh"}

import bpy
from bpy.types import Operator
from bpy.props import FloatVectorProperty
from bpy_extras.object_utils import AddObjectHelper, object_data_add
from mathutils import Vector

def add_object(self, context):
    C0  = 0.0278728483334650370381795124317
    C1  = 0.0417605902707273450330202218460
    C2  = 0.0482207631985655347048259575806
    C3  = 0.0485271500913616902083332985770
    C4  = 0.0931391956773255725056107681612
    C5  = 0.0965573626835274272370348719303
    C6  = 0.107547404625872186617181540007
    C7  = 0.115790817646860551951256687036
    C8  = 0.119783424089466474929919797595048
    C9  = 0.145586591764509108593032943711
    C10 = 0.1455928882670341471433303052049
    C11 = 0.194113741855870798801366242288
    C12 = 0.220431462018603598005258179308
    C13 = 0.238188705049775063930022711304
    C14 = 0.239202575383431558854091591763
    C15 = 0.258249788916612246877163454031
    C16 = 0.267154551763824439262804947967
    C17 = 0.283287921016592357037529251132
    C18 = 0.298950040243594377815031134048
    C19 = 0.324717740377238927017176093829
    C20 = 0.332341771060757131359702359924
    C21 = 0.334746067733302491167057583234
    C22 = 0.358695307225219637200425804924
    C23 = 0.379845283700119784274564123062
    C24 = 0.405175083258563434157399921336
    C25 = 0.405192747827293817829885928720
    C26 = 0.413270268840324805049177290081
    C27 = 0.430496636473677061118504317477
    C28 = 0.435184175960922907431325584883
    C29 = 0.446935673529290779190420143182
    C30 = 0.506357127147255998116896539729
    C31 = 0.524958507348029909087319718931
    C32 = 0.534514094024825642786011006694
    C33 = 0.550779339591802926422918872431
    C34 = 0.569503363526322938881495682523
    C35 = 0.580381198695491106718671839452
    C36 = 0.586729731159675194950822709919
    C37 = 0.592528561796324926333750448387
    C38 = 0.629297917816793706232691827171
    C39 = 0.640749324994890461038576405968
    C40 = 0.645287686083513420132210630583
    C41 = 0.657059511437996058376878453752
    C42 = 0.670748229742154172402305457529
    C43 = 0.711755637544140100272223270381
    C44 = 0.719275379833515862610638756106
    C45 = 0.764606916063868244994059993760
    C46 = 0.765242704206979552285561900711
    C47 = 0.771377873753784688028391160270
    C48 = 0.793115552540444589323741413143
    C49 = 0.801179944373958283220464778439
    C50 = 0.804894833221465672777834038542
    C51 = 0.824918436209450258880845421223
    C52 = 0.8429405346446856282534850002848
    C53 = 0.849729379835397304237950006479
    C54 = 0.8527912845429152959190249336546
    C55 = 0.8911612978432511629583109578654
    C56 = 0.912442237847337859395015578549
    C57 = 0.9169707620208188351717214654752
    C58 = 0.939076505920710743919097644376
    C59 = 0.939706841852119460615896935414
    C60 = 0.969698269985748550217336591577
    C61 = 0.970005426460752347149386724411

    edges = []

    verts = [(C5,C0,1.0),
            (C5,-C0,-1.0),
            (-C5,-C0,1.0),
            (-C5,C0,-1.0),
            (1.0,C5,C0),
            (1.0,-C5,-C0),
            (-1.0,-C5,C0),
            (-1.0,C5,-C0),
            (C0,1.0,C5),
            (C0,-1.0,-C5),
            (-C0,-1.0,C5),
            (-C0,1.0,-C5),
            (C14,-C6,C61),
            (C14,C6,-C61),
            (-C14,C6,C61),
            (-C14,-C6,-C61),
            (C61,-C14,C6),
            (C61,C14,-C6),
            (-C61,C14,C6),
            (-C61,-C14,-C6),
            (C6,-C61,C14),
            (C6,C61,-C14),
            (-C6,C61,C14),
            (-C6,-C61,-C14),
            (C9,C12,C60),
            (C9,-C12,-C60),
            (-C9,-C12,C60),
            (-C9,C12,-C60),
            (C60,C9,C12),
            (C60,-C9,-C12),
            (-C60,-C9,C12),
            (-C60,C9,-C12),
            (C12,C60,C9),
            (C12,-C60,-C9),
            (-C12,-C60,C9),
            (-C12,C60,-C9),
            (C11,-C18,C59),
            (C11,C18,-C59),
            (-C11,C18,C59),
            (-C11,-C18,-C59),
            (C59,-C11,C18),
            (C59,C11,-C18),
            (-C59,C11,C18),
            (-C59,-C11,-C18),
            (C18,-C59,C11),
            (C18,C59,-C11),
            (-C18,C59,C11),
            (-C18,-C59,-C11),
            (0.0,C22,C58),
            (0.0,C22,-C58),
            (0.0,-C22,C58),
            (0.0,-C22,-C58),
            (C58,0.0,C22),
            (C58,0.0,-C22),
            (-C58,0.0,C22),
            (-C58,0.0,-C22),
            (C22,C58,0.0),
            (C22,-C58,0.0),
            (-C22,C58,0.0),
            (-C22,-C58,0.0),
            (C24,-C2,C57),
            (C24,C2,-C57),
            (-C24,C2,C57),
            (-C24,-C2,-C57),
            (C57,-C24,C2),
            (C57,C24,-C2),
            (-C57,C24,C2),
            (-C57,-C24,-C2),
            (C2,-C57,C24),
            (C2,C57,-C24),
            (-C2,C57,C24),
            (-C2,-C57,-C24),
            (C20,C15,C56),
            (C20,-C15,-C56),
            (-C20,-C15,C56),
            (-C20,C15,-C56),
            (C56,C20,C15),
            (C56,-C20,-C15),
            (-C56,-C20,C15),
            (-C56,C20,-C15),
            (C15,C56,C20),
            (C15,-C56,-C20),
            (-C15,-C56,C20),
            (-C15,C56,-C20),
            (C29,C7,C55),
            (C29,-C7,-C55),
            (-C29,-C7,C55),
            (-C29,C7,-C55),
            (C55,C29,C7),
            (C55,-C29,-C7),
            (-C55,-C29,C7),
            (-C55,C29,-C7),
            (C7,C55,C29),
            (C7,-C55,-C29),
            (-C7,-C55,C29),
            (-C7,C55,-C29),
            (C21,-C26,C54),
            (C21,C26,-C54),
            (-C21,C26,C54),
            (-C21,-C26,-C54),
            (C54,-C21,C26),
            (C54,C21,-C26),
            (-C54,C21,C26),
            (-C54,-C21,-C26),
            (C26,-C54,C21),
            (C26,C54,-C21),
            (-C26,C54,C21),
            (-C26,-C54,-C21),
            (C3,C32,C53),
            (C3,-C32,-C53),
            (-C3,-C32,C53),
            (-C3,C32,-C53),
            (C53,C3,C32),
            (C53,-C3,-C32),
            (-C53,-C3,C32),
            (-C53,C3,-C32),
            (C32,C53,C3),
            (C32,-C53,-C3),
            (-C32,-C53,C3),
            (-C32,C53,-C3),
            (C31,-C10,C52),
            (C31,C10,-C52),
            (-C31,C10,C52),
            (-C31,-C10,-C52),
            (C52,-C31,C10),
            (C52,C31,-C10),
            (-C52,C31,C10),
            (-C52,-C31,-C10),
            (C10,-C52,C31),
            (C10,C52,-C31),
            (-C10,C52,C31),
            (-C10,-C52,-C31),
            (C23,C27,C51),
            (C23,-C27,-C51),
            (-C23,-C27,C51),
            (-C23,C27,-C51),
            (C51,C23,C27),
            (C51,-C23,-C27),
            (-C51,-C23,C27),
            (-C51,C23,-C27),
            (C27,C51,C23),
            (C27,-C51,-C23),
            (-C27,-C51,C23),
            (-C27,C51,-C23),
            (C30,-C19,C50),
            (C30,C19,-C50),
            (-C30,C19,C50),
            (-C30,-C19,-C50),
            (C50,-C30,C19),
            (C50,C30,-C19),
            (-C50,C30,C19),
            (-C50,-C30,-C19),
            (C19,-C50,C30),
            (C19,C50,-C30),
            (-C19,C50,C30),
            (-C19,-C50,-C30),
            (C37,C8,C49),
            (C37,-C8,-C49),
            (-C37,-C8,C49),
            (-C37,C8,-C49),
            (C49,C37,C8),
            (C49,-C37,-C8),
            (-C49,-C37,C8),
            (-C49,C37,-C8),
            (C8,C49,C37),
            (C8,-C49,-C37),
            (-C8,-C49,C37),
            (-C8,C49,-C37),
            (C13,C34,C48),
            (C13,-C34,-C48),
            (-C13,-C34,C48),
            (-C13,C34,-C48),
            (C48,C13,C34),
            (C48,-C13,-C34),
            (-C48,-C13,C34),
            (-C48,C13,-C34),
            (C34,C48,C13),
            (C34,-C48,-C13),
            (-C34,-C48,C13),
            (-C34,C48,-C13),
            (C39,-C1,C47),
            (C39,C1,-C47),
            (-C39,C1,C47),
            (-C39,-C1,-C47),
            (C47,-C39,C1),
            (C47,C39,-C1),
            (-C47,C39,C1),
            (-C47,-C39,-C1),
            (C1,-C47,C39),
            (C1,C47,-C39),
            (-C1,C47,C39),
            (-C1,-C47,-C39),
            (C17,-C36,C46),
            (C17,C36,-C46),
            (-C17,C36,C46),
            (-C17,-C36,-C46),
            (C46,-C17,C36),
            (C46,C17,-C36),
            (-C46,C17,C36),
            (-C46,-C17,-C36),
            (C36,-C46,C17),
            (C36,C46,-C17),
            (-C36,C46,C17),
            (-C36,-C46,-C17),
            (C4,-C40,C45),
            (C4,C40,-C45),
            (-C4,C40,C45),
            (-C4,-C40,-C45),
            (C45,-C4,C40),
            (C45,C4,-C40),
            (-C45,C4,C40),
            (-C45,-C4,-C40),
            (C40,-C45,C4),
            (C40,C45,-C4),
            (-C40,C45,C4),
            (-C40,-C45,-C4),
            (C33,C28,C44),
            (C33,-C28,-C44),
            (-C33,-C28,C44),
            (-C33,C28,-C44),
            (C44,C33,C28),
            (C44,-C33,-C28),
            (-C44,-C33,C28),
            (-C44,C33,-C28),
            (C28,C44,C33),
            (C28,-C44,-C33),
            (-C28,-C44,C33),
            (-C28,C44,-C33),
            (C41,C16,C43),
            (C41,-C16,-C43),
            (-C41,-C16,C43),
            (-C41,C16,-C43),
            (C43,C41,C16),
            (C43,-C41,-C16),
            (-C43,-C41,C16),
            (-C43,C41,-C16),
            (C16,C43,C41),
            (C16,-C43,-C41),
            (-C16,-C43,C41),
            (-C16,C43,-C41),
            (C38,-C25,C42),
            (C38,C25,-C42),
            (-C38,C25,C42),
            (-C38,-C25,-C42),
            (C42,-C38,C25),
            (C42,C38,-C25),
            (-C42,C38,C25),
            (-C42,-C38,-C25),
            (C25,-C42,C38),
            (C25,C42,-C38),
            (-C25,C42,C38),
            (-C25,-C42,-C38),
            (C35,C35,C35),
            (C35,C35,-C35),
            (C35,-C35,C35),
            (C35,-C35,-C35),
            (-C35,C35,C35),
            (-C35,C35,-C35),
            (-C35,-C35,C35),
            (-C35,-C35,-C35)]
    faces = [(60, 120, 180, 156,84),
(61, 121, 181, 157,85),
(62, 122, 182, 158,86),
(63, 123, 183, 159,87),
(64, 124, 184, 161,89),
(65, 125, 185, 160,88),
(66, 126, 186, 163,91),
(67, 127, 187, 162,90),
(68, 128, 188, 166,94),
(69, 129, 189, 167,95),
(70, 130, 190, 164,92),
(71, 131, 191, 165,93),
(72,24,0,12,60,84),
(73,25,1,13,61,85),
(74,26,2,14,62,86),
(75,27,3,15,63,87),
(76,28,4,17,65,88),
(77,29,5,16,64,89),
(78,30,6,19,67,90),
(79,31,7,18,66,91),
(80,32,8,22,70,92),
(81,33,9,23,71,93),
(82,34,10,20,68,94),
(83,35,11,21,69,95),
(84, 156, 228, 216, 132,72),
(85, 157, 229, 217, 133,73),
(86, 158, 230, 218, 134,74),
(87, 159, 231, 219, 135,75),
(88, 160, 232, 220, 136,76),
(89, 161, 233, 221, 137,77),
(90, 162, 234, 222, 138,78),
(91, 163, 235, 223, 139,79),
(92, 164, 236, 224, 140,80),
(93, 165, 237, 225, 141,81),
(94, 166, 238, 226, 142,82),
(95, 167, 239, 227, 143,83),
(96, 144, 120,60,12,36),
(97, 145, 121,61,13,37),
(98, 146, 122,62,14,38),
(99, 147, 123,63,15,39),
(100, 148, 124,64,16,40),
(101, 149, 125,65,17,41),
(102, 150, 126,66,18,42),
(103, 151, 127,67,19,43),
(104, 152, 128,68,20,44),
(105, 153, 129,69,21,45),
(106, 154, 130,70,22,46),
(107, 155, 131,71,23,47),
(108, 168, 236, 164, 190, 206),
(109, 169, 237, 165, 191, 207),
(110, 170, 238, 166, 188, 204),
(111, 171, 239, 167, 189, 205),
(112, 172, 228, 156, 180, 208),
(113, 173, 229, 157, 181, 209),
(114, 174, 230, 158, 182, 210),
(115, 175, 231, 159, 183, 211),
(116, 176, 232, 160, 185, 213),
(117, 177, 233, 161, 184, 212),
(118, 178, 234, 162, 187, 215),
(119, 179, 235, 163, 186, 214),
(120, 144, 240, 196, 208, 180),
(121, 145, 241, 197, 209, 181),
(122, 146, 242, 198, 210, 182),
(123, 147, 243, 199, 211, 183),
(124, 148, 244, 200, 212, 184),
(125, 149, 245, 201, 213, 185),
(126, 150, 246, 202, 214, 186),
(127, 151, 247, 203, 215, 187),
(128, 152, 248, 192, 204, 188),
(129, 153, 249, 193, 205, 189),
(130, 154, 250, 194, 206, 190),
(131, 155, 251, 195, 207, 191),
(48,24,72, 132, 168, 108),
(48, 108, 206, 194,98,38),
(48,38,14,2,0,24),
(49,27,75, 135, 171, 111),
(49, 111, 205, 193,97,37),
(49,37,13,1,3,27),
(50,26,74, 134, 170, 110),
(50, 110, 204, 192,96,36),
(50,36,12,0,2,26),
(51,25,73, 133, 169, 109),
(51, 109, 207, 195,99,39),
(51,39,15,3,1,25),
(52,28,76, 136, 172, 112),
(52, 112, 208, 196, 100,40),
(52,40,16,5,4,28),
(53,29,77, 137, 173, 113),
(53, 113, 209, 197, 101,41),
(53,41,17,4,5,29),
(54,30,78, 138, 174, 114),
(54, 114, 210, 198, 102,42),
(54,42,18,7,6,30),
(55,31,79, 139, 175, 115),
(55, 115, 211, 199, 103,43),
(55,43,19,6,7,31),
(56,32,80, 140, 176, 116),
(56, 116, 213, 201, 105,45),
(56,45,21,11,8,32),
(57,33,81, 141, 177, 117),
(57, 117, 212, 200, 104,44),
(57,44,20,10,9,33),
(58,35,83, 143, 179, 119),
(58, 119, 214, 202, 106,46),
(58,46,22,8,11,35),
(59,34,82, 142, 178, 118),
(59, 118, 215, 203, 107,47),
(59,47,23,9,10,34),
(252, 216, 228, 172, 136, 220),
(252, 220, 232, 176, 140, 224),
(252, 224, 236, 168, 132, 216),
(253, 241, 145,97, 193, 249),
(253, 249, 153, 105, 201, 245),
(253, 245, 149, 101, 197, 241),
(254, 240, 144,96, 192, 248),
(254, 248, 152, 104, 200, 244),
(254, 244, 148, 100, 196, 240),
(255, 217, 229, 173, 137, 221),
(255, 221, 233, 177, 141, 225),
(255, 225, 237, 169, 133, 217),
(256, 242, 146,98, 194, 250),
(256, 250, 154, 106, 202, 246),
(256, 246, 150, 102, 198, 242),
(257, 219, 231, 175, 139, 223),
(257, 223, 235, 179, 143, 227),
(257, 227, 239, 171, 135, 219),
(258, 218, 230, 174, 138, 222),
(258, 222, 234, 178, 142, 226),
(258, 226, 238, 170, 134, 218),
(259, 243, 147,99, 195, 251),
(259, 251, 155, 107, 203, 247),
(259, 247, 151, 103, 199, 243)]

    try:

        mesh = bpy.data.meshes.new(name="New Object Mesh")
        mesh.from_pydata(verts, edges, faces)
        # useful for development when the mesh may be invalid.
        # mesh.validate(verbose=True)
        object_data_add(context, mesh, operator=self)
    except:
        print("select one symbol")

class OBJECT_OT_add_object(Operator, AddObjectHelper):
    """Create a new  Mesh Object"""
    bl_idname = "mesh.add_object"
    bl_label = "template Add new mesh Object"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):

        add_object(self, context)

        return {'FINISHED'}

# Registration

def add_object_button(self, context):
    self.layout.operator(
        OBJECT_OT_add_object.bl_idname,
        text="Add Object",
        icon='PLUGIN')

def menu_draw(self, context):
        self.layout.operator(OBJECT_OT_add_object.bl_idname)

def register():
    bpy.utils.register_module(__name__)
    bpy.types.INFO_MT_mesh_add.prepend(menu_draw)

def unregister():
    bpy.utils.unregister_module(__name__)
    bpy.types.INFO_MT_mesh_custom_add.remove(menu_draw)

if __name__ == "__main__":
    register()

This is very useful. Unfortunately I don't know how to get to the data blocks. I looked at the video you suggested but it starts in the middle of the process, and the console is different. I'm using 2.78.

I have manually, point by point, built part of the object. I want to open the data block, review it, and then copy and paste the remainder of the code, and make a few corrections.


text:
What can I do to speed up GPU rendering?
Having just run the BMW Benchmark, I got roughly the following:
GPU: Just over 17 minutes
CPU: Just over 3 minutes
Is this right? Surely not? That is a huge difference. Could it be that I have not configured things properly?

Hello.  Please change your title and question to be in line with this forum.  What follows is standard in this situation.  You may choose to rephrase your question to something like .... How can I make sure Blender is using my GPU?  or ... Does Blender Support NVidia and Radeon equally?   When you list your hardware in the title and question, it focuses on the hardware.   BSE focuses on the use of the software and less so on the hardware.  Most question that list hardware specs will be put on hold.  Just a normal event.  It happens once a week, loose estimate.

No problem - i'll edit it now

You may want to see ... https://www.blender.org/manual/render/cycles/features.html and https://www.blender.org/manual/render/cycles/gpu_rendering.html

Thank you - for the help in phrasing the question and for pointing me in the right direction. This is going to be a steep learning curve :-)

I'm voting to close this question as off-topic because it's a hardware question, and not about using Blender.

Thank you all - @atomicbezierslinger actually pointed me in the right direction and I have my answer. I do wonder why hardware related questions are so frowned upon. If I had phrased the question - "Why is my CPU rendering faster than my GPU" or "Why is my rendering slow" someone would have asked me to give details of my hardware, as that has a direct bearing on the software. Is there a place to ask questions that are likely to be related to hardware as well as software.

I have now changed the question and taken out all hardware related comments - of course the question now makes very little sense as it has no context, and would be much harder to answer.

OK - I understand having read the help center why the stringent rules are in place, but as someone only 2 weeks into blender, and this seeming to be the place to get answers, it is all a bit overwhelming. I can understand why hardware related questions can go over the top, but you can't seperate hardware and software when problem solving, as sometimes the problem might be hardware related, as it was in my case. Thank you atomicbezierslinger for guiding me and pointing me to where I can get answers instead of just placing the question on hold, and also @cegaton for offering help too.

What tile sizes did you use for your tests? GPUs do better with fewer large tiles, while CPUs like lots of small tiles

I tried various tile sizes but to no effect - from 64 to 512 @gandalf3  - as someone new to Blender it doesn't really matter as I am not doing the most complex stuff but it just annoys me that I have £2.5k worth of computer (that I bought for heavy photo editing which it is great at), but have since discovered Blender and I'd have been better with a PC at half the price. But you live and learn - I understand from here https://www.blender.org/manual/render/cycles/features.html why I am having this issue. Thanks all for your help.

@IanWatts It's true that openCL support is still quite new and only somewhat working (probably missing many optimizations), but I'm surprised it's so much slower..

Me too @gandalf3 - I'll keep playing and see what I can do - i'll run some tests today.

@IanWatts Come to think of it.. Have you tried using the split kernel?

Not sure what that is. Just off to bed so will check it out tomorrow. Cheers @gandalf3

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Cycles GPU Texture-duplicate memory Question
Lets say we have 1024x1024 PNG texture called Texture.png
I Have multiple materials using the same texture, on import the textures were automaticly renamed to .001 .002 .003 etc.
And Im out of GPU memory
Is Texture.png and Texture.001.png just a single texture in the GPU memory or they are occupiing new space with each instance?
EDIT: this works on console, but not in practice, images are still there...
import bpy

for img in bpy.data.images:
    print("%s" % img.name)
    if( ".0" in img.name):
        img.name=img.name[:-4]
        print("%s" % img.name)

they are occupying new space with each instance, you can also easily test it.

I tested it on a new scene, I duplicated one texture to other 24 instances, but I can still render the scene on GPU...

They are not the same. If I understand you correctly they are imported as different pngs and in that case they have to be loaded to gpu memory to be used. Why don't you reload one copy in node editor for all materials using this texture?
I set up a test scene with 3 cubes. Different materials for each but in the first screenshot the same texture used in the image texture node for each material. In the second screenshot there are copies of the same texture loaded and gpu memory load goes up...
Same texture in 3 different materials.

Different Textures (Copies) in each material.

Here is a screenshot of my node setup. Only one of the three different textures is in us. The other two are marked with no user by a 0 in front.

Ill try again, I uploaded screenshot of the problem...

I added an new image. In my first setup, there are 3 images loaded, but only the first ist actually used. The two others won't be loaded to cycles as it is indicated by the 0 in front of the texture. In your screenshot it seems to me that all textures are used as separate textures...
And that is the problem in my opinion. How many different materials are applied to your modell?

Many different materials are using the same texture, because on import, blender assigned them as .001 .002 .003 etc. Now im making a script to delete the last 4 letters if there is a [.] in the name, and use the original texture.

And there is the problem. In every material the texture is loaded again and this needs a lot of ram...

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
bpy remove duplicate images (.001 .002 .003 etc.)
I have this script, but its not working as expected
import bpy

for img in bpy.data.images:
    print("%s" % img.name)
    if( ".0" in img.name):
        img.name=img.name[:-4]
        print("%s" % img.name)

I want to have one texture on different materials, now i have something like this

Edit: Solved.
for mat in bpy.data.materials:
    if mat.node_tree:
        for n in mat.node_tree.nodes:
            if n.type == 'TEX_IMAGE':
                if n.image is none:
                    print(mat.name,'has an image node with no image')
                elif n.image.name[-3:].isdigit():
                    n.image = bpy.data.images[n.image.name[:-4]]

for imgs in bpy.data.images:
    if imgs.name[-3:].isdigit():
        print(imgs.name)
        imgs.user_clear()

Thanks to all who helped.

what are expecting ? you are just renaming the images ( they won't have the same name blender will add the numbers back )

I'm fairly new to python, but you should probably not try to rename the textures but to reload Tex.Generic_Spec.png if Image Texture File has a number in the materials.

PProbably this related topic gives you some idea how to do it: http://blender.stackexchange.com/questions/38052/how-can-i-make-a-script-to-make-cycles-load-a-new-texture-each-frame

img.name=img.name[:-4] is renaming the image to match the original image name, as this name already exists a numeric suffix is added to the other image with that name, which just undoes the change.
You need to go through your material nodes and get each image node to use the same image.
for mat in bpy.data.materials:
    if mat.node_tree:
        for n in mat.node_tree.nodes:
            if n.type == 'TEX_IMAGE':
                if n.image is None:
                    print(mat.name,'has an image node with no image')
                elif n.image.name[-3:].isdigit():
                    n.image = bpy.data.images[n.image.name[:-4]]

Note that the last line doesn't just change the name used, it changes the image data block that the image node is linked to.
Once you have removed the users of the duplicate images they will be removed after you save and re-open the file.

Is 'if n.type == 'TEX_IMAGE' and '.0' in n.image.name:' sufficent to find only the image textures mentioned?

That will find all image texture nodes that use an image with '.0' in the name, using the same example test from your code. if n.type == 'TEX_IMAGE' and n.image.name[-3:].isdigit() should be a more accurate test. It does assume that bpy.data.images[n.image.name[:-4]] actually exists.

It works! on the test scene i had, but not on my real scene, n.image.name[-3:] returns "NoneType"

if  n.image.name[-3:] returns NoneType then you don't have an image on that node.

Suggest adding a filepath test too, for the same image filename, different folder side case. (and for generated images?).  Making a lookup / replacement table from bpy.data.images to start with could be the go.

The solution posted above bugs out in several situations. always have to check if data exists before pulling it, also if the original image has digits then remove it.
# for material check for texture nodes
# if it has a digit check if the original exists
# if original has also digits remove

for mat in bpy.data.materials:
    if mat.node_tree:
        for n in mat.node_tree.nodes:
            if n.type == 'TEX_IMAGE':
                if n.image is None:
                    print(mat.name,'has an image node with no image')
                elif n.image.name[-3:].isdigit():
                    name = n.image.name[:-4]
                    exists = False
                    for img in bpy.data.images:
                        if img.name in name:
                            exists = True
                    if exists:
                        n.image = bpy.data.images[name]
                    else:
                        n.image.name = name

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How to select proportional editing options
Using Blender 2.76, I am trying to understand proportional editing options from https://www.blender.org/manual/editors/3dview/transform/transform_control/proportional_edit.html
How can I select enable or projected ?
At the moment, I can only select connected or disable.
EDIT:
I got it: selection is actually changing but I was expecting to see the selected option in the dropdown (like a blue background).

On the header at the bottom of the 3D view, there's a dropdown with the options.

Yes, that's the point ... when I select enable or connected in this dropdown, it selects connected.

Oh, ok; it wasn't clear from the question

This answer may help you: http://blender.stackexchange.com/questions/35213/any-shortcut-for-proportional-editing-mode-and-the-falloff-types


text:
Sappling Addon:- Leaves and Tree branches separated in Particle System
Aim: - I want to create a forest with Sapling add-on and particle
system.
Problem:-
          Leaves are separated from branches
Achievement: -
Without Particle System: - I am able to render all the trees with leaves in object mode + rendering.
With Particle System: - I had created some different trees with sapling add-on.
Steps followed:-

I had created the different trees with sapling addon.
Created Group for trees with leaves selected.
Add Particle system
3.1 selected Hair option, used tree Group as particle
I am able to distribute the different trees with random size.
But some trees leaves are separated from branches..

I had tried the different options, but didn't succeed.

Tried to combine the leaves and branch/base.. but..it's not good option..

Kindly help me to solve the above problem or suggest to follow the different steps..

Why isn't joining the leaves and branches a good solution for you? You can still use different materials, they will have separate UVs... And the grouping it all together should also avoid this issue.

I have the exact same problem: although the trunk and the leaves are in one group, the leaves appear some distance off the trunk. This may be a bug with the particle system and the sapling tree addon. A great pity. As suggested by TLousky, joining the trunk and the leaves into one mesh (not one group) is the solution.


text:
Automatic Weight Problem - Mesh moves down and armature stays
I'm kinda new with blender so I'm not very familiar with techniques. I just watch and do what they do in Youtube. But this error is something I haven't seen on Youtube yet and I cannot explain what the error is. But it's some thing like this  Originally, the mesh is already automatically weighed together with the armature. But, I realized something wrong with the joint positioning, so what I did is I started over by clearing the vertex groups. When I fixed that problem, and clicked "Automatic Weights", it went like that (in the picture). What do I do to fix this. Please help me. I have attached the file below (Thanks for the info.)

simply redo the parenting. But if there is a problem somewhere here (in the method, in the mesh or armature or other) that can not be seen clearly in this picture. You should add your blend file in your question using http://blend-exchange.giantcowfilms.com/

I have attached my file :)


text:
Spatial Audio Render
How can I export B Format ambisonic audio in a render. Blender uses OpenAL, which does allow for First Order Ambisonic (4 mono channels, WXYZ) rendering. My goal is to create a stereoscopic, 360 degree video with spatial audio (audio field rotates with head).

Here are the documentation links regarding audio in Blender (many of them just say TODO):
https://docs.blender.org/manual/en/dev/render/audio/introduction.html
https://docs.blender.org/manual/en/dev/preferences/system.html#prefs-system-sound
https://docs.blender.org/manual/en/dev/data_system/scenes/properties.html#data-scenes-audio

I assume that the 4 Channels format found in the scene properties context has much to do with spatial audio. Can someone elaborate on these options?

Demo .blend file to play with (you'll need to supply your own audio):

A very similar question has also been asked here. (Also upvoted, but without even a comment...)

Can use the mixdown operator to create an "audio render" of the scene.
Mixdown is next to the render animation button in the latest versions of Blender (There once was a mixdown button on the audio panel)
Otherwise go to the  python console and type in
bpy.ops.sound.mixdown('INVOKE_DEFAULT')

to call the operator as if a button was pressed.

Select a format that allows for the channels, wav is pretty foolproof.
I just added a simple mono wav file to your test file and selected basic old stereo.  Below is the result viewed in audacity.  Starts in left ear, moves to right as it rotates.

If I choose 4 channels I get a 4 channel wav file.

Which appears to be  Quadraphonic ears at (facing north) NE, SE, SW, and NW.  (Or speakers at Left Front, Right F, L Rear and RR) rather than W, X, Y, Z

Mixdown is next to the render animation button in the latest versions of Blender...

Does this mean that 4 track export of discreet audio (no bleeding of sound to other channels) must only be saved from 3D spatialized view via speakers? The VSE also allows 4 types of panning (-2,-1,+1,+2) per piece of media, but they end up mixed.


text:
A shape with Particle effects changes size after being temporarily masked in the Outliner
First I created a circle and applied a Particle System to create pine cone style vegetation.
Then I masked the Circle in the Outliner (using the Eye icon), to allow Blender to go faster, and created a little house with a smokey chimney (smoke made with Metaballs) to place in the scene. I converted the Metaballs to Mesh and applied a decimate to it.
Only, when I clicked on the Circle's Eye icon again in the outliner, the Circle was now huge and had undergone a transformation I didn't expect.

Looks small in material view, huge in rendered view. But it used to look small in rendered view too in the beginning.
The only modifier is the one on the smoke (displace), so I thought that was accidentally applied to the Circle, but I can't see this modifier listed when I select the Circle.
What happened to this Object, and how do I make it look "normal" again in Rendered view?

The only thing I can think of that would change the geometry in rendered view would be the experimental Cycles true displacement.

ok... thanks. There are no images or textures, only a particle system and simple diffuse or glas materials.

Your particles are huge.

Try using something like .01 for the root size (this value is in BU, at least when Scaling is set to 1).

Ok! That's the answer. For a strange reason, I feel that the info for "root size" got corrupted and changed when I made/modified the house or when I hid that object and unhid it... very strange. Thanks a lot!

(and thanks for saying my particles are huge)


text:
Using File Browser to Import CSV Data
I'm struggling to import CSV data into my file using the file dialog.
The code I've parsed together opens the file dialog and prints the file name. The problem is that inside of the testOpenFileBrowser operator, I am trying to establish CSVData as a variable that can be used in the main() def. When I try to use the variable in the main definition, it says name 'CSVData' is not defined.
Is there any way to use the CSVData outside of the operator class?
import bpy
import csv
import os

from bpy_extras.io_utils import ImportHelper
from bpy.props import StringProperty
from bpy.types import Operator

class testOpenFileBrowser(Operator, ImportHelper):
    bl_idname = "test.open_filebrowser"
    bl_label = "Open the file browser"

    filename_ext = ".csv"

    filter_glob: StringProperty(
        default= "*csv",
        options={'HIDDEN'},
        maxlen=255,
    )

    def execute(self, context):

        filename, extension = os.path.splitext(self.filepath)

        print('File name:', filename)
        f = open(self.filepath, 'r', encoding='utf-8')
        CSVdata = f.read()
        f.close()

        return {'FINISHED'}

def register():
    bpy.utils.register_class(testOpenFileBrowser)

def unregister():
    bpy.utils.unregister_class(testOpenFileBrowser)

def main():
    bpy.ops.test.open_filebrowser('INVOKE_DEFAULT')
    print(CSVData)

if __name__ == "__main__":
    main()

    # test call
```

You can call your main() function within the execute() method of the operator, see the template provided in the Text Editor for reference: Text Editor > Templates > Operator File Import (or just declare a new variable outside of the scope and assign the data in the execute() method). Does this help?

Maybe my code to import .csv files into blender will help:
https://github.com/simonbroggi/blender_spreadsheet_import/
What I do is create a new mesh and save all the csv data into mesh attributes.
The nice thing about this is that you can view the csv data in the spreadsheet view in blender.

Hello, I suggest you familiarize yourself with function scope and the global keyword in python. That's not really related to the blender API

I also wrote a free CSV import extension https://extensions.blender.org/add-ons/csv-importer/

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Problem with Uv editing , in edit mode shows correctly and on object mode , really different

i dont know why i cant upload more pictures than one on here but the problem is that it is restricted to that area, i have tried to mark seam on the bottom and top lip and didndt work and its just stretches everywhere , i have tried to desolve the edges at which the image stops , applied all transforms as well

are you using any modifier on the can?

i have Subdivision modifier on it , can it be the fact that i haven't applied it to the can before doing the shading ?

the reason can be very specific, can you share the can file? https://blend-exchange.com

sorry its a bit messy

you should use "file"-> external data-> pack resources before saving the files so we have your images as well

okay @chris give me  minute

@chris is this okay now ?\

i think the main problem, why UV Editor is having problems to make a good uv editing is because of your double edges. I have no idea how you made them, but if you select that edge loop here:

and press X and dissolve edges, you will see, it seems to be still there. If you check statistics, you will see: edge count goes down. So you have a lot of double edges there. If you clean up your topology, upload file again if the problem isn't solved.

thing is that comes from the fact i add the subdevision modifire , so if u see it without subdevision , that edge doesn't even exist, imma redo it from the begining , thank you for the help @chris


text:
Unable to solve rotating motion of object in Movie Clip Editor
I have been trying to solve the rotating motion of an object (see image. i.e. a lipstick) in the Blender Movie Clip Editor. I 3D printed a lipstick-Ersatz with tracking points to facilitate the tracking. I have eleven tracks which are partly interrupted, but there should be enough overlap. The solve error is very high. I was wondering how I could make this work. I shot the footage on a tripod at 50p in 4k. In Blender I used a png image sequence for tracking.
Any help would be greatly appreciated!


text:
Odd Reflective Surface Effect
Very new to Blender and I need some input on this weird effect I added by accident and I'm unsure how to reverse it. Or even what it the effect is called. Usually I would just Ctrl-Z to reverse but I didn't realize it was an issue till I got out of shading and went into layout.
One of my objects has an odd reflective effect to it. It completely takes away the detail.
Any ideas?

Hello, maybe try a right click > Shade Flat, also in the Data panel > Geometry Data > click on Clear Custom Split Normals Data?

if it still doesn't work please share your file: https://blend-exchange.com/

@moonboots Clearing the Custom Split Normals Data did the trick. Thank you very much!

It's a problem of shading, the splits normals determine the shading, to reset them go into the Data panel > Geometry Data > and click on Clear Custom Split Normals Data.


text:
Incomplete rotation from imported FBX
I'm trying to import an fbx to Blender, with one simple animation (exported from Moho).
When I export it from Moho, I can open it in tools such as FBX Converter and Windows 3D viewer, and the animation is correct:
But then, when I import it to Blender, the animation goes like this (incomplete):
I noticed that the rotation becomes incorrect when I export the rotation with more than 120º or so. I think that this must be related to gimbal lock, but I don't know how to fix it.
In Moho, I'm doing the whole rotation in one single keyframe rotating 360 degrees. When I do it in two keyframes with 180 degrees each to complete the whole turn, it will be correct in Blender.
I think I could fix it manually, but I don't want to have this work for all animations I would create.


text:
How to bake a simple material to a UV unwrapped texture
I am a beginner learner in blender and I have been learning about texturing and UV unwrapping.
In this Brackey's tutorial, he adds basic materials before UV unwrapping the model. Similarly, I have accomplished this. However, after unwrapping, he manages to make the materials that have already been added into a texture that can be exported to Photoshop, to add greater detail.
I want to do the same thing, but I am using a much newer version of Blender.
Here is a link to the video where he adds the materials (at around 5:30):
https://www.youtube.com/watch?v=qYKQwMc-WdE
Here is a link to the video where he starts unwrapping:
https://www.youtube.com/watch?v=jLEpjSFHl4o
Any help would be much appreciated! :)

In the second video you attached, at around 6 minutes he bakes the texture. You need to do the same thing, and export it as an image if you want to bring it into photoshop.
Since you said you use a newer version of Blender, I assume you use one of them up from 2.8. So you need to set the Render Engine to Cycles, then a Bake option will appear for you. And that is the place where you can bake any type of texture.

Just got it work. Thanks man! :)


text:
Use render layers in sequence editor
I rendered an animation with different layers (3), and safed every frame as exr.
If I render just one frame I can see the every single layer using the "Render layers" node.
But if I render the whole animation, and then open all the exrs as an image sequence in the sequence editor I just see one layer.
Is it possible to see and edit all layers of the frames in the sequence editor too, and if yes how can I do it?
Whatever I tried I just got one layer of the three.
So acutally its not possible to make a video out of the frames because just one layer is rendered... and all the information from the other layers is missing.
EDIT:
I also tried to render the image in exr multilayer.
But there I just got a black image... and was not able to found any of the layers..
EDIT 2:
The workflow I tried so far:

I have many exr files
Open Blender and switch to Compositing
Open the Node editor and the VSE
Cleared all nodes and added an image node.
Opened all my exr files in the node as an image sequence
Added the Composite / Viewer nodes and activated the backdrop
Then this is what I get:

Sadly I just get one layer like mentioned before.. But directly after the rendering I have a picture will all three layers.
Like here:

With the green box I marked the missing layers.
With the orange one you can see how I made the layers before rendering.
As you can see in the EXR just the second layer (glass) is displayed.
I think maybe it's because the Render Layers node needs the scene.
And when I just import the EXRs I don't have the scene.
But is there a way to get the other layers in the EXRs after the rendering, when I have all images rendered?
I want to do the same like in the second picture (add filters and so on to the single layers) just after the rendering.
Is that possible?

Load the EXR as an image sequence into the compositor of another scene. Route the layers that you want to the Compositor Output Node. Then load that scene as a strip into the VSE scene timeline. Do this for each layer of the EXR that you want to combine. Remember that in the VSE you will need to enable Linear to mix the EXR as they probably are not scene referred.
Make an EXR with multiple outputs:

Then import them into a compositor and route each layer to comp output using 1 scene per layer.

Then mix them as required in the VSE. The VSE isn't really ideal for this to be honest.

Thank you, but how can I root the layers to the output node? I already importet all the EXRs as an image sequence in the compositor. But from there I am not able to access the layers (I don't know how)... I just have the picture of one layer there... and if I insert the "render layer" node I can't choose the layers...

Are you sure that you saved the EXRs correctly? Have you seen any of the layers that you saved at all?

Yes I think so, but I'm not sure. If I stop during the rendering I can access the different layers of the last rendered image... but just of the last. So I can't use it for editing. Every single layer is rendered on its own. Is there a way to see if it's correctly saved? I tried to open it in Photoshop (without a plugin) and there I just see one layer too.

I have amended the answer, but I'm not sure why you would prefer to use the VSE for this task?

hmm maybe I made the layers wrong. I have an animation of a button with a light in it. So I made one layer which displays the button, and one that displays just the light... so that I can edit each of them separately after the rendering (in the VSE.. or is there a better option?). But to get the layers I used the tab right besides the rendering options...


text:
Vertex deform in mesh animation
I've made a gun model and decided to make a simple shoot animation for practice.
I set up the vertex groups and bones (I'm working with vertex groups). But when I move the bone in pose mode. I get weird deformation. Some vertex follow the bone better than the other ones.
Original state...

Now I move the bone...

Welcome to the site. Take a look at the MarkDown formatting guide. You will see that you can easily make a line brake with two spaces.


text:
When trying to render an animation, it doesn't work
So I recently downloaded an intro that I found that I liked, and decided to render it to see if it worked. Well, evidently it doesn't. When I click "render animation" it says "Can not open or start AVI movie file". I will be linking a screenshot just so you can see. If there are any questions that anyone has to learn more please do ask. The first picture is before I render it, and the second picture is after I render it. I try to render it as animation, and the error message appears at the top near the middle.

Along with what is alredy written in the answer you could try unchecking Sequencer in Properties Editor > Post-Processing > Sequencer checkbox.

It's likely to be one of two things:

Either the output path you are trying to use is invalid or trying to write the file to a protected non-writable path on your machine,
OR you are trying to use a video codec that your OS does not support.

Try switching up your output path and/or your video codec and see if the error goes away.
Bonus Tip: It's best to render your animation to a sequence of still images (PNG, JPG, etc), and then render the video from the images. Lots of reasons why this is better (some reasons include: in case animation render fails in the middle, it's easier to render video from images instead of raw render, etc).

I am very new to blender so could you help me more with this? I am sorry to make you go into detail, it is just necessary.

Either your output path "D:/Finished..." is not a valid location on your computer and Blender can't write the video file to that spot OR Blender is having trouble with the TYPE of video file you are trying to create (AVI JPEG). Try changing one or both of those settings and see if you get any better results.

The second solution didn't work, but after a little bit of tinkering, I was able to change the output of the file and it works now. Thank You!

authors: Виталий Переславцев


text:
Video editor audio clip length
I am importing a 16 bit PCM microsoft wave file into blender video sequence editor.
When I do so, the audio playback does not match the visual length of the audio clip in the sequence editor. When I play the audio clip will be completed, but the green position marker is only half way through the clip. I know there is no dead space at the end of the clip either.
So this essentially makes it impossible to edit audio into my video because I have no clue where audio clips end....
Changing the position of the marker results in all sorts of anomalous behavior. If I move the marker to 50% of the clip, it will play the audio position of maybe 40% of clip length. If I move the mark to 75% it might play position 45% of audio.
If I start from the beginning of the clip, the audio completes before it even gets to the 50% mark of the visual clip.
It seems like the visual representation of the audio clip and the actual audio clip are totally out of whack...
EDIT: This is not related to the common problem of importing a video clip with associated audio at different framerate. My video files and audio files are separate and imported separately. The video is confirmed to by 30fps and project is set accordingly.

Possible duplicate of Video editing. Audio and Video strip have different length

Related: http://blender.stackexchange.com/a/44060/2843


text:
Importing mp4 into blender
I am having trouble importing an mp4 into blender.
The mp4 was created using Android Debug Bridge screen record feature.
When I drag the video in, the first and most obvious problem, is that it says it is 300000 frames in length. The video is only 1 minute long though, so that doesn't make any sense.
When I play the video in blender, the frames do no move. Unless I zoom out massively, and skip greatly along the video and find a certain point where the actual video is.
So it is almost like the 1 min video is imported in a padded with like 200min worth of copies. of the first frame in front and behind of the video.
Edit: Apparently from this output of ffmpeg, the aource video is variable framerate. I wonder if blender does not support variable framerate video?
ffmpeg -i android_record1.mp4 -crf 0 ../corrected/output.mp4
ffmpeg version N-78598-g98a0053 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 18.100 / 55. 18.100
  libavcodec     57. 24.103 / 57. 24.103
  libavformat    57. 25.101 / 57. 25.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 34.100 /  6. 34.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'android_record1.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-02-24 20:17:38
  Duration: 00:00:33.54, start: 0.000000, bitrate: 921 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280x800, 918 kb/s, SAR 1:1 DAR 8:5, 12.94 fps, 90k tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2016-02-24 20:17:38
      handler_name    : VideoHandle
[libx264 @ 00000000039fea40] using SAR=1/1
[libx264 @ 00000000039fea40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 00000000039fea40] profile High 4:4:4 Predictive, level 3.2, 4:2:0 8-bit
[libx264 @ 00000000039fea40] 264 - core 148 r2665 a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=0 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=12 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, mp4, to '../corrected/output.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf57.25.101
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x800 [SAR 1:1 DAR 8:5], q=-1--1, 12.94 fps, 315k tbn, 12.94 tbc (default)
    Metadata:
      creation_time   : 2016-02-24 20:17:38
      handler_name    : VideoHandle
      encoder         : Lavc57.24.103 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
Past duration 0.725090 too large
Past duration 0.716301 too large
Past duration 0.818840 too large
Past duration 0.936516 too large   2196kB time=00:00:05.71 bitrate=3145.4kbits/s dup=66 drop=0 speed=9.91x
Past duration 0.644524 too large
Past duration 0.733879 too large
Past duration 0.888176 too large
Past duration 2.010735 too large
Past duration 0.915520 too large
Past duration 0.774406 too large   3675kB time=00:00:14.37 bitrate=2094.3kbits/s dup=149 drop=8 speed=  13x
Past duration 2.095695 too large
Past duration 1.697746 too large
Past duration 0.891594 too large
Past duration 2.141594 too large   4102kB time=00:00:22.02 bitrate=1525.6kbits/s dup=224 drop=18 speed=13.7x
frame=  436 fps=180 q=-1.0 Lsize=    4702kB time=00:00:33.69 bitrate=1143.2kbits/s dup=227 drop=225 speed=13.9x
video:4699kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.054633%
[libx264 @ 00000000039fea40] frame I:2     Avg QP: 0.00  size:316054
[libx264 @ 00000000039fea40] frame P:434   Avg QP: 0.00  size:  9630
[libx264 @ 00000000039fea40] mb I  I16..4..PCM: 53.7%  0.0% 46.3%  0.0%
[libx264 @ 00000000039fea40] mb P  I16..4..PCM:  1.3%  0.0%  0.4%  0.0%  P16..4:  3.5%  0.2%  0.1%  0.0%  0.0%    skip:94.6%
[libx264 @ 00000000039fea40] 8x8 transform intra:0.0% inter:25.9%
[libx264 @ 00000000039fea40] coded y,uvDC,uvAC intra: 52.8% 52.4% 51.4% inter: 2.1% 2.9% 2.9%
[libx264 @ 00000000039fea40] i16 v,h,dc,p: 50% 50%  0%  0%
[libx264 @ 00000000039fea40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 49%  6%  3%  3%  2%  2%  2%  3%
[libx264 @ 00000000039fea40] i8c dc,h,v,p: 21% 47% 32%  0%
[libx264 @ 00000000039fea40] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000000039fea40] ref P L0: 90.2%  1.2%  6.2%  2.4%
[libx264 @ 00000000039fea40] kb/s:1142.43

Related: http://blender.stackexchange.com/q/36883/2843

Try to use this workaround: http://blender.stackexchange.com/a/49219/2843

Related: http://blender.stackexchange.com/q/6268/2843

I've experienced the same issue today and spent ages trying to convert a large mp4 to mkv and it still had issues.
I managed to find a fix which worked inside Blender, and that was importing the mp4 and then clicking Add -> Effect -> Speed Control.

Making sure the multiply speed was set to 1, I then dragged the sound and video to the original length of video and everything matched up fine.

The attached Image shows the following:
On the Properties area, under the Dimensions Fly-out section, there is both a Frame Rate field, and a Time Remapping field.
Use these to both remap the percentage ratio, and attempt to match the orignal frame rate.
This may or may not be the answer, it is worth a shot to try and solve the problem without having to go outside of Blender.

I solved this issue by opening the MP4 in windows movie maker and then saving a new version.
I guess for whatever reason Blender does not like the subformat of mp4 that android spits out on screen record.

It sounds like a time mapping thing to me. If you look at the Windows properties of the video, how many frames does it have? Then do the time mapping in Blender (I would be very curious to see if this would straiten out). Glad you found a sufficient solution though.

How do I do the time mapping?

I'm adding this as an answer, to respond to this, as the comments don't allow for images.

Have you tried converting the MP4 to an AVI or another format? I've never actually tried importing an mp4 but this is the first thing I'd try if it happened to me.
If you don't have software to do it perhaps you could use an online one clip converter


text:
How to constrain the camera to look at an object in python script
The function i have created thus far:
def CameraLock(self):
    bpy.ops.object.select_pattern(pattern="Camera")
    bpy.ops.object.constraint_add(type='TRACK_TO')
    #c = bpy.data.objects["Camera"].constraints["Track to"]
    #c.target = bpy.data.objects["Cube"]
    #c.track_axis = "-Z"

The code firstly selects the camera to be the active object which allows me to add a constraint.However when i uncomment the next two lines to track the cube the code fails and blender closes.
i have been trying to read up other ways of adding the constraint but thus far have failed to find another solution.


text:
How to merge two characters imported from MakeHuman
I started Blender last week and I managed to create my characters in MakeHuman (V 1.0.2), import it to Blender (V 2.76b) and pose these two characters as I want.
Now I want to use them in another scene where they should show up as one object which I can place, rotate, scale, etc. This new object should show up just as the two characters in the original scene.
I tried to join them with Ctrl+J but this does not work - it even breaks the characters and give some weird structures. I think this is due to the internal structure of the imported characters from MakeHuman.
If I just take them as a copy (Ctrl+C & Ctrl+V) they stay as they are, but I have to position/scale them separately which is a lot of work.
Any ideas or hints for me? Please! Thank's in advance.
edit:  just figured out how to attach screen shots.... so here are the screen shots mentioned below in the comments: the first shows the two characters selected with two times [a] and the second after joining them with [ctrl] + [j]

Maybe the problem is, that I do not select the characters properly?

The details you should include in question are screenshots of what happens after joining objects, what modifiers are added (if any), and if possible upload a .blend file. There are too many possible problems to discuss as for now.

Thanks for the edit as well as for the response - I just prepared a sample blend-file (early stage in order to make it more clear). When I am trying  Ctrl+J the two characters merge together in one position - only the spines stay where they should.

Sorry but I could not upload the blend-file (even with compress it has 30.6 MB) so I try it with two screen shots and the file with only one character inside. I apologize too for the second edit, but the system reminded I have only 5 minutes...

sorry again - uploading is not as easy as I expected  ;-) => this should be the link:  and I was not able to upload the screen shots (seems only *.blend files are allowed).

You can parent ctrl + p one of the models to the other or both of them to an empty. And then the transformations should be applied to both of them.
https://www.blender.org/manual/editors/3dview/relationships/parents.html

Thanks - but I still can not work it out - I can select the first character without problems, but when I try to select the second, I always end up with one part of it (eg: body or proxy or something else).
Is there something like a "root" of the characters I have to select?

If your other character is composed of loose parts you probably first want to select them all and join them normally.

Sorry no - I did not, since I believed that this has alredy been done by the export/import filter (mhx2). Grouping was the solution also for this problem - as it turned out in this question http://blender.stackexchange.com/questions/46320/newbie-merge-characters-and-scenes-how-to-do-with-make-human-characters?noredirect=1#comment78621_46320

As described in my commend above my solution was to group the characters within the original file and append them by the group.

Hi were you able to get the solution?
Even I have been trying to join but final model is all mixed up with no proper form

This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question.


text:
Driver Expression Interpolation
I have an object that has a driver on the Y rotation. I want the driver to rotate the Y from 0 to 360 degrees in relation to another object's size from 0 to 1.
I usually do this in after effects using a linear() function. What would be the correct expression to make the scale values of the other objects (0 - 1) translate to 0 - 360 rotation on the other object.

Rotation as far as drivers are concerned are in the Radian Units not Degrees, even though on the interface, this is probably what you are used to seeing.
so for the scale (x/y/z) formula it would probably have to look something like the following:
var / (2.0 * 3.14157)

It's worth noting that drivers use Python's math module, so you can utilize the pi constant and methods like degrees() and radians().

@MichaelGlenMontague - Great point, I couldn't remember if pi was lower case or upper case, so I just got close with the numbers. Also you don't even need it, if you are using the radians conversion function. It would just look like: var / radians(360.00)

That was a brilliant answer. I wanted a way to map the 0 - 17 deg range of a bone's rotation to drive the 0 - 1 range of an influence slider on another bone. I just had to use the expression var / radians(17.00) and it worked perfect! Thank you Rick and Michael!


text:
How to cut strips and keep the keyframes in the VSE?
I have two strips, A and B, which I want to smoothly switch between from time to time, so I keyframed the opacity on both strips, like this:

This is what that looks like in the Graph Editor:

But after reviewing the footage I want to keep the transitions (ie. the keyframes) but remove some footage in the middle. So I select both of them and press K to cut:

As you can see, the strips on the right retain the keyframe information but the original (left) strips have lost the keyframes. Let's assume I have a lot of them and it would be a pain to put them back.
Is there a way of cutting a strip (or multiple strips) and have the keyframes retained on both sides of the cut?
I tried selecting all in the graph editor window prior to doing the cut, doing the cut, and then pasting, but pasting is grayed out after the cut.

Blender 3.1.0.

NOTE: It seems to work how I would expect using Blender 2.93.0 Beta, and in Blender 3.0.0. So, perhaps this is just a candidate for a bug report.

The Blender developers have confirmed this is a bug and have triaged it as high priority.

This was a bug. It has been fixed here:
https://developer.blender.org/rBe74420124f3a429ad8a1492e56a7e1561d86d6f7


text:
How to import Krita art into Blender?
I downloaded Krita to create a 2d portal for a project. Now I can't figure out how to import the portal into Blender, because none of Krita's file types match any of Blender's import ones. Is an add-on required to connect the two applications?

Just save as jpg or png and you can import, it all depends on what you want to do with these images

I'm using the portal as part of a 3d scene. Blender doesn't seem to have a .jpg import option.

Svg is the only compatible with Blender

See the import/export menus as for importing/exporting 3D data into/out of the scene. You won't find most videos/audio/imagesfile formats there, because it's not the primary way to get any of these in the scene.
The only real exceptions are SVG/PDF formats because it can be converted into mesh data. And you can enable the addon Import Images As Planes, which allows you to automatically create a mesh plane with an image texture on it.
To enable it, go in the menu Edit > Preferences, category Addon, search for it and check its checkbox:

Then you can use the menu File ‣ Import ‣ Images as Planes, select the image you need to import (or the sequence of images, or the video file), verify the import options in the sidebar, and validate.
If for any reason you want to "import" images manually, they are not imported from that menu at all. Images are most often "mapped" on 3D objects via their material. See moonboots' answer

It all depends on what you want to do, if you want to import a sequence of images for example, switch your 3D view to Rendered or Material Preview, activate the Node Wrangler addon, create a plane, give it a material, select the Principled BSDF and press Ctrl to get an Image Texture plugged into, click on its Open button and select your image sequence, the node will switch to Image Sequence mode, you now need to tweak the node a bit: enable the Auto Refresh option, Frames will determine the number of frames of your image sequence you want to play, Start Frame will determine when you want the play to begin in the Timeline, and you can Offset the beginning of the sequence with the Offset value. When you're good open the Timeline and press Spacebar to launch. you can keyframe all the node values of course.


text:
Blender GLB format exporting issue
I want to export my animation in glb format. In this animation there is an object that will appear and disappears at certain time. But when i export this animation, and view it online the object will stay appeared from the beginning.There is no appearing and disappear effect.
Can you guys please suggest any solution as it is urgent.

How is this animation realised? Apart from that, about the compatibility between softwares: .fbx export why there are no materials or textures? (I know the question asks about materials, but this applies to all kinds of software-exclusive materials, modifiers, tools etc.)

glTF can only animate LocRotScale and shape key weights. So if you're animating eg hide_render it won't work.


text:
Particle System is Static at the Origin Point (Bullets for a gun)

The particle system is bunching up at the origin point in the rendered image. The rectangular red glow to the left of the robot's gun is the issue I'm talking about.

did u parent the ps object to your gun? if not, pls provide blend file, because we have no idea how you set up your scene

All you have to do is create an emitter (plane), set emit from faces, particles/face to 1.
Adjust your number as you like it, give it some more velocity on normal, set field weights gravity to zero or low value.
Parent your emitter to your gun.

Thank you. Setting particles/face to 1 fixed the issue.


text:
How would I duplicate these animations?
Alright so I want to create a big battlefield within this scene. I used some mixamo animations with some characters to replicate a sword fight. I want to duplicate this sword fight so I can have many battles happening around the battle field. How would I do this? I have tried selecting all of the rigs, along with the objects that the rigs are attached to, and duplicating them, but there always seems to be something deformed. I don't want to manually fix every duplicated animations because I plan on adding a lot of "battles".

Hello, hard to say, maybe share the armature + mesh?

Thanks for the response. I'm not sure what you mean by "share the armature and mesh". I'll try to explain it further. I misspoke when I said that the armature/mesh was deforming when I duplicated it - it's not. The problem is that when I move the duplicated armature and mesh, some objects(like the sword and shield) move way faster than the main mesh(the body). If they moved at the same speed, I would be easily able to move all of the animations to a different location on the battlefield. Do you know what I can do to fix this?

@DylanEasley i think they mean share the blend file

Yea sorry I don't think I can. The file is super big

If anyone cares, I actually figured it out with a little research.
I made sure that every object and rig was inside one collection. After that, I pressed "Shift + A", and clicked 'Collection Instance". I then clicked the collection that I wanted to duplicate and for this case it was "Battle 1". This duplicated everything without deforming anything!


text:
How to make sub clumps for geometry nodes based hair
In nature, hair often forms in clumps, however, often these clumps are made up of other clumps, if you want to make convincing animal fur you need to replicate this behavior. However I can't seem to get the geometry nodes setup correct. Here is my current setup
 and you can see I modified the hair clump modifier (probably where I messed up) so that I can pass in the guide curves to use (which as you can see, it uses the closest curve from the low density interpolation as the guide curve)

However, this gives terrible results, the hair curves are overlapping, which, if it was working correctly, you'd expect to see a Voronoi shaped bald spots between the sub clumps.
I decided to investigate further by making a setup that allowed me to render only one sub clump at the time, and you can see that some of the hair curves aren't even on the surface! the most normal looking index is index 0, but as I increase the index number the sub clumps get more and more glitchy looking

If you'd like to see intended results, this video is a great reference https://www.youtube.com/watch?v=8kJj1W9gGrA

Why don't you use the asset nodes groups that come with Blender 3.5? There is a tutorial video from Blender and a demo file with examples of different fur types.

@Blunder I am, that's what the clump node is. but I need to make sub clumps that build up clumps, and to my knowledge none of the asset node groups can do that for me

@Blunder Oh, but you are right that demo file has my answer, apparently you can just pass a clump node into another clump node? i really have no clue why that works and it would be nice to be able to have more control over each clump (like shortening specific sub clumps and such)


text:
Displacement modifier breaks mesh
I am trying to add texture to a logo using the Displacement modifier and a Subsurf modifier as is being done in this tutorial at around 6:30.

The logo is made from a .svg curve to which I added extrude and depth effects before converting the curve to a mesh.

When I add the Displace modifier to the mesh, it instantly breaks.

Applying location and scale and rotation helps fix this but there are still large cuts and crevices in the result:

Is there any way that the mesh won't break?
I tried subdividing a few times, but this didn't really help.

I personally love the effect in your third image

@10Replies yeah it's pretty cool, I agree! I did play with animating this effect as well ;)

This is because your mesh is splitted into Flat parts (Probably because you used an Edge Split Modifier).
To combine it and have it not "Break" you can enter edit mode, select all vertices and press W then Remove Doubles.
Not related to the question:
I would recommend you remesh your object to get a better toplogy using the Remesh Modifier


text:
Adding an image in the image editor through python
I was trying to automate the process of adding an image in the image editor through python. Well i kind of succeeded, but only in changing the resolution and not the color/alpha values. I seem to be lost at this part, i want the alpha value of the image to be 0 and i cant seem to find a way to automate that through python.

How can i change the alpha value of the image im adding through python ?

Please post code as text.

Color is a parameter of bpy.ops.image.new():
bpy.ops.image.new(name="Untitled", width=1024, height=1024, color=(0.0, 0.0, 0.0, 1.0), alpha=True, generated_type='BLANK', float=False, gen_context='NONE', use_stereo_3d=False)

bpy.ops.image.new in API


text:
Refraction quality is lower in rendered image than in the viewport preview
I was playing around with Glass BSDF shader to see what it look like and how it interacts with its environment. Bellow, you can see a test scene.
Preview
Final
  The preview render on the sphere looks fine but when a final render was done the refraction of the checker-board was pixelated and distorted. The final render was done with 400 samples. Is that too little or am I missing something.
Is there a way to improve render quality of the refraction in the glass sphere?
File here :

Are you using flat shading on the sphere and suzanne? Can you upload the scene, e.g. on pasteall.org?

@B.Y.O.B. here is the url http://pasteall.org/blend/index.php?id=49181
Sorry, new to this and not sure what you mean by flat shading.

Select the sphere, go into edit mode (Tab), press W, click "Shade Smooth" and render again. @cegaton Good point.
edit: looking at the .blend, the subsurf modifier is set to 4 in viewport and 2 in render, that's why it looks ok in viewport (the high subdivision hides the flat shading)

@B.Y.O.B. thank you, it worked. I will edit the port with a permanent link.

The problem is that you are using flat shading on the mesh, as opposed to smooth shading that interpolates normals: https://docs.blender.org/manual/en/dev/modeling/meshes/editing/normals.html?highlight=smooth%20shading#shading
The reason why it looks ok in the viewport is that your subdivision surface modifier is set to 4 iterations for the viewport and 2 iterations for the final render. So the high subdivision in the viewport hides the flat shading.
Solution: Set viewport subdivisions equal or lower than final subdivisions, and enable smooth shading on the mesh (see above link).


text:
Doing a Green Screen composite renders black
I am a newbie to composite editing, and I followed this green screen tutorial
on youtube: Blender Video Editing - Part 13 (Green Screen compositing).
I have audio in the VSE synced up also. I have the start frame and end frame starting at a different place (other than frame 1) to cut out unwanted footage. Everything looks great in the Composite Viewer but for some reason it renders black.

I plugged the viewer into each node as well and everything looks as expected.

ok last guess (after this I would ask that you export a frame from your movie as a png use that as your footage and upload the blend) do you have more then one Composite node in your nodes?

Very cool! Thanks Cegaton! It was just because of having the sequencer checked in post processing. I rendered and all was fine.


text:
Change the Bone Rotation (Quaternions) of an Armature in text script
I am using Blender 2.49b. I have a hand model and I would like to set the bone rotation (in quaternions) to take values from text (Bone%i.txt); on each column of the text I have 4 values (W,X,Y,Z). My hand model consists of 25 bones, as can be seen in the following image.

So, I wrote the following script to do the job
from Blender import *
import math

# Path to data directory
dataDirectory = 'C:/Users/andarist/Desktop/Data'

# Number of frames to render
numFrames = 100

# Range of bones
handIndices = range(1,26)

# Bone file name patterns
bonePattern = 'Bone%i.txt'

# Hand object pattern
handObjectPattern = 'Bone.%03i'

# Global scale
scale = 1.0

# Global speed
speed = 1

def FrameChange():
    pass

def SetIpoForFrame(frame):
    frameIdx = (Get('curframe') - 1) * speed
    Set('curframe', frame)
    frameIdx = (frame - 1) * speed
    dataStore = Registry.GetKey('MoCapImporter')
    nanmap = { }

    # Move bones
    for handIdx in handIndices:
        handObj = Object.Get(handObjectPattern % handIdx)
        pos = dataStore['Bone'][handIdx-1][frameIdx]
        nanmap[handObjectPattern % handIdx] = False
        if(pos == None):
            nanmap[handObjectPattern % handIdx] = True
            pos = nanpos
        handObj.setRotation(scale*pos[0], scale*pos[1], scale*pos[2], scale*pos[3])
        handObj.insertIpoKey(Object.IpoKeyTypes.LOCROTSIZE)

    Scene.GetCurrent().update()

def LoadFile(pattern, index):
    fileName = dataDirectory + '/' + (pattern % index)
    file = open(fileName)
    lines = file.readlines()
    output = []
    for line in lines:
        c = line.split()
        if(c[1] == 'NaN'):
            output.append(None)
        else:
            output.append((float(c[0]), float(c[1]), float(c[2]), float(c[3])))
    file.close()
    print "Read %i lines from %s" % (len(output), fileName)
    return output

def Main():
    dataStore = { 'Bone': [] }
    # Attempt to load the data
    for handIdx in handIndices:
        data = LoadFile(bonePattern, handIdx)
        dataStore['Bone'].append(data)
    Registry.SetKey('MoCapImporter', dataStore, False)

    for i in range(1, numFrames+1):
        print "Frame %i/%i" % (i, numFrames)
        SetIpoForFrame(i)

if((event == 'FrameChanged') or (event == 'Render')):
    FrameChange()
elif(event == ''):
    Main()

However, it seems that the Object.Get function cannot find the bone.%3i from Armatures hand, and I get the following error

Thanks in advance for your help and consideration.
Best Wishes,
Andreas

2.49 .. From memory Blender.Object.Get(handObjectPattern % handIdx) returns a blender object, whereas you want to get a bone from the hand objects pose bone collection.  Is there a getPose() and or PoseBoneDictionary()...

Unfortunately I cannot find such a function as getPose() or PoseBoneDictionary().

Do you really need to stay with the 6 year old version of blender? Have you tried opening your models in a recent version? You will get more python help if you are using a more recent version.

getPose example on the Pose module page  https://www.blender.org/api/249PythonDoc/Pose-module.html, in particular pose = arm_ob.getPose() pbones = pose.bones.values()  Agree with @sambler if you are unfamiliar with 2.49 API why not start afresh and open in recent version.

Thanks everyone for your help. It is true that it is much easier in later versions of Blender (e.g.v2.76). The solution to the problem is given at this post: http://blender.stackexchange.com/questions/48488/

Thanks everyone for your help. The answer is given by Mutant Bob on a different threat: Set the Rotation (in Quaternion WXZY) of a bone using API 2.49
    arm_ob = scn.objects.active
    bones = arm_ob.pose.bones

    for handIdx in handIndices:
        print(handIdx)
        pos = dataStore['Bone'][handIdx - 1][frameIdx]
        bone = bones[handIdx - 1]
        bone.rotation_quaternion = pos
        arm_ob.keyframe_insert(data_path = ("pose.bones[\"%s\"].rotation_quaternion"%bone.name ) )
        #bone.insertIpoKey(Object.IpoKeyTypes.LOCROTSIZE)

    scn.update()

Might be hard finding someone that remembers how to use python in 2.49. The 2.49 api docs are still available here.
The second example on the armature page might be what you are looking for - while the docs list Get() as a function the example uses arm_ob.getData()
scn= Scene.GetCurrent()
arm_ob= scn.objects.active
arm_data= arm_ob.getData()
bones= arm_data.bones.values()

for bone in bones:
    # use bone here


text:
I have a project with multiple video files that I want to pack for a render farm how should I do this?
I have a project with over a dozen video files in it.  Now I know how to pack regular images into the into the .blend file, but it seems not to want to work so well with video.
How would I go about preparing this project for upload to sheep-it render farm so that I can get the end result in something less than the 42 DAYS it will take my machine to complete it?
The video files are all in their own folder and they are inserted into the node system as a regular image file would be.
This is the first time I have attempted to do something of this nature, so explicit instructions would be appreciated.

Can you render the videos out as frame sequences then import them as a  pack? Probably not but I know that you cannot pack videos. Perhaps its like a physics bake?

Sheep it likely won't work. If the videos you want to embed are greater than 500MB I wouldn't bet on sheepit to help you.

You can pack the videos into your blend file though. I have rendered random internet peoples videos over sheep it.

Blender doesn't pack videos nor image sequences. If you want that to be possible in the future, you can upvote this rightclickselect proposal I made. But know that it has little chance to happen.
However, Sheep it supports .zip files and linked datablocks. So I'm pretty confident videos should work this way.
Zacharias Reinhardt explains how to use linked assets with Sheep it in this tutorial (link goes to the appropriate timecode).

If you are able to use Amazon's EC2, simply organize an S3 bin and use it. No gesticulating required.