aboutsummaryrefslogtreecommitdiff
path: root/docs/build/sections/tech_docs/utilities/general_utils.html
blob: d72439108e6c56dbc94508ba3ce9c349d70b555e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>General Utilities &mdash; ARTv2 2.0.1 documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script type="text/javascript" src="../../../_static/jquery.js"></script>
        <script type="text/javascript" src="../../../_static/underscore.js"></script>
        <script type="text/javascript" src="../../../_static/doctools.js"></script>
        <script type="text/javascript" src="../../../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />
    <link rel="next" title="Component Utilities" href="component_utils.html" />
    <link rel="prev" title="Utilities" href="utilities.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../../index.html" class="icon icon-home"> ARTv2
          

          
          </a>

          
            
            
              <div class="version">
                2.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../installing.html">Installing ARTv2</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../using_rigging_tools.html">Using the Rigging Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../using_anim_tools.html">Using the Animation Tools</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../technical_documentation.html">Technical Documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../useful_scripting_commands.html">Useful Scripting Commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="../components/components.html">Components</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="utilities.html">Utilities</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">General Utilities</a></li>
<li class="toctree-l3"><a class="reference internal" href="component_utils.html">Component Utilities</a></li>
<li class="toctree-l3"><a class="reference internal" href="error_utils.html">Error Utilities</a></li>
<li class="toctree-l3"><a class="reference internal" href="interface_utils.html">Interface Utilities</a></li>
<li class="toctree-l3"><a class="reference internal" href="joint_mover_utils.html">Joint Mover Utilities</a></li>
<li class="toctree-l3"><a class="reference internal" href="control_utilities.html">Control Utilities</a></li>
<li class="toctree-l3"><a class="reference internal" href="rigging_utilities.html">Rigging Utilities</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../rigging_tools/rigging_tools.html">Rigging Tools</a></li>
<li class="toctree-l2"><a class="reference internal" href="../running_tests.html">Running Tests</a></li>
</ul>
</li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../index.html">ARTv2</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../../../technical_documentation.html">Technical Documentation</a> &raquo;</li>
        
          <li><a href="utilities.html">Utilities</a> &raquo;</li>
        
      <li>General Utilities</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../../../_sources/sections/tech_docs/utilities/general_utils.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="general-utilities">
<h1>General Utilities<a class="headerlink" href="#general-utilities" title="Permalink to this headline"></a></h1>
<p>artv2.utilities.general_utilities</p>
<span class="target" id="module-artv2.utilities.general_utilities"></span><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">author:</th><td class="field-body">Jeremy Ernst</td>
</tr>
<tr class="field-even field"><th class="field-name">description:</th><td class="field-body">This module provides utilities usually for retrieving information, handling paths, building strings, saving and
loading data, etc.</td>
</tr>
</tbody>
</table>
<dl class="function">
<dt id="artv2.utilities.general_utilities.convert_to_pynodes">
<code class="descname">convert_to_pynodes</code><span class="sig-paren">(</span><em>nodes</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#convert_to_pynodes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.convert_to_pynodes" title="Permalink to this definition"></a></dt>
<dd><p>Converts the incoming nodes to PyNodes and returns them.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nodes</strong> – String list of nodes to convert.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">List of PyNodes</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.create_asset">
<code class="descname">create_asset</code><span class="sig-paren">(</span><em>asset_name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#create_asset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.create_asset" title="Permalink to this definition"></a></dt>
<dd><p>Create a container asset with the given asset name and return the created container.
:param asset_name: Name for container.
:return: pyNode of created asset.</p>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.create_clipboard">
<code class="descname">create_clipboard</code><span class="sig-paren">(</span><em>name</em>, <em>data</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#create_clipboard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.create_clipboard" title="Permalink to this definition"></a></dt>
<dd><p>Creates a clipboard with the given name writing the given data to the clipboard.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> – The name of the file. It will be added to the temp dir.</li>
<li><strong>data</strong> – The data to write to the file</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The clipboard file</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.create_trailing_number">
<code class="descname">create_trailing_number</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#create_trailing_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.create_trailing_number" title="Permalink to this definition"></a></dt>
<dd><p>Creates a trailing number string with a padded 0 if the number is less than or equal to 9. Example 08 or 18.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> – The value to crates a trailing number in string format for</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.delete_node">
<code class="descname">delete_node</code><span class="sig-paren">(</span><em>node</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#delete_node"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.delete_node" title="Permalink to this definition"></a></dt>
<dd><p>Deletes node, but first makes sure the node is not locked.
:param node: DAG node to delete
:type node: PyNode</p>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.filter_directory_contents">
<code class="descname">filter_directory_contents</code><span class="sig-paren">(</span><em>path</em>, <em>filters</em>, <em>ext_filters</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#filter_directory_contents"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.filter_directory_contents" title="Permalink to this definition"></a></dt>
<dd><p>Filter the contents from the incoming path using the provided filters and extension filters. This is only checking
for files.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>path</strong> – The path to list contents and the filter the contents.</li>
<li><strong>filters</strong> – The filters to look for before the file extension for exclusion.</li>
<li><strong>ext_filters</strong> – The file extensions to look for for exclusion.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">List of filtered contents.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.filter_nodes">
<code class="descname">filter_nodes</code><span class="sig-paren">(</span><em>nodes</em>, <em>filter_by='transform'</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#filter_nodes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.filter_nodes" title="Permalink to this definition"></a></dt>
<dd><p>Filters the given nodes by the given type and returns the filtered nodes as a list.
:param nodes: List of nodes to filter.
:param str filter_by: Types of nodes to return.
:return: List of filtered nodes.</p>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.frame_selected">
<code class="descname">frame_selected</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#frame_selected"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.frame_selected" title="Permalink to this definition"></a></dt>
<dd><p>Frame the camera up on the current selection.</p>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.generate_prefix_suffix">
<code class="descname">generate_prefix_suffix</code><span class="sig-paren">(</span><em>string</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#generate_prefix_suffix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.generate_prefix_suffix" title="Permalink to this definition"></a></dt>
<dd><p>Tries to generate a mirrored prefix or suffix given the input string.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>string</strong> – input string to try and create a mirrored version.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns a string with the prefix or suffix. If a match in the dict was found, it will return a mirrored</td>
</tr>
</tbody>
</table>
<p>version. Otherwise, it simply returns the input string. For example, given a component name of clavicle_joint_l,
where the prefix is clavicle and the suffix is l, passing clavicle into this function simply retruns clavicle.
Passing l into the function will return r. So, if a component passes its prefix and suffix to this function to try
and generate a mirrored version, you would get clavicle and r.</p>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.generate_unique_suffix">
<code class="descname">generate_unique_suffix</code><span class="sig-paren">(</span><em>existing</em>, <em>inst</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#generate_unique_suffix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.generate_unique_suffix" title="Permalink to this definition"></a></dt>
<dd><p>Generates a unique suffix to avoid naming conflicts when duplicating components.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>existing</strong> – Dict of existing components in the scene.</li>
<li><strong>inst</strong> – instance of component that is being duplicated.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns a string with the unique suffix.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.get_class_properties">
<code class="descname">get_class_properties</code><span class="sig-paren">(</span><em>cls</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#get_class_properties"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.get_class_properties" title="Permalink to this definition"></a></dt>
<dd><p>Given a class, retrieve the properties of the class (as indicated by the &#64;property decorator)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>cls</strong> – class instance</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">dict of property names and values</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.get_control_shapes">
<code class="descname">get_control_shapes</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#get_control_shapes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.get_control_shapes" title="Permalink to this definition"></a></dt>
<dd><p>Looks in the resources directory to find the control shapes and returns the name of the files without the extension.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Returns a list of the names of the files without the extension.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.get_control_shapes_as_enum">
<code class="descname">get_control_shapes_as_enum</code><span class="sig-paren">(</span><em>shapes_list</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#get_control_shapes_as_enum"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.get_control_shapes_as_enum" title="Permalink to this definition"></a></dt>
<dd><p>Takes in a list of control shapes (usually generated from get_control_shapes()), and builds an enum string.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>shapes_list</strong> – A list of strings.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A string that is build to be used as an enum for a Maya enum attribute (ex: circle:square:cube)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.get_joints_in_hierarchy">
<code class="descname">get_joints_in_hierarchy</code><span class="sig-paren">(</span><em>root=None</em>, <em>as_pynode=False</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#get_joints_in_hierarchy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.get_joints_in_hierarchy" title="Permalink to this definition"></a></dt>
<dd><p>Gets the joints in a hierarchy and returns them. If a root joint is given, it will search from there. If not,
it will select everything in the scene and find the joints that way instead.
:param root: (Optional) Name of joint at the top of the hierarchy you wish to search.
:param as_pynode: Bool as whether to return the list as PyNodes or strings.
:return: Returns either a list of PyNodes or strings of the joints in the hierarchy.</p>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.get_root_joint_of_component">
<code class="descname">get_root_joint_of_component</code><span class="sig-paren">(</span><em>joints</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#get_root_joint_of_component"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.get_root_joint_of_component" title="Permalink to this definition"></a></dt>
<dd><p>Finds and returns the top-most joint of a component.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>joints</strong> – List of Pynodes of joints from the component.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Pynode of top-most joint.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.import_file">
<code class="descname">import_file</code><span class="sig-paren">(</span><em>path</em>, <em>return_nodes=False</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#import_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.import_file" title="Permalink to this definition"></a></dt>
<dd><p>Imports the given file into Maya.
:param path: Path of file to import
:param return_nodes: Whether or not to return created nodes.
:return: list of imported nodes</p>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.launch_web_docs">
<code class="descname">launch_web_docs</code><span class="sig-paren">(</span><em>page</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#launch_web_docs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.launch_web_docs" title="Permalink to this definition"></a></dt>
<dd><p>Launches the given html file in a web browser.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>page</strong> – string file path of html file.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.load_from_file">
<code class="descname">load_from_file</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#load_from_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.load_from_file" title="Permalink to this definition"></a></dt>
<dd><p>Loads data (using JSON) for the given file and returns the data loaded.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> – The file path to load data from.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Data from the file.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.parent_object">
<code class="descname">parent_object</code><span class="sig-paren">(</span><em>child</em>, <em>parent</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#parent_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.parent_object" title="Permalink to this definition"></a></dt>
<dd><p>Parents the child to the parent object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>child</strong> (<em>str</em>) – Name of node to be parented.</li>
<li><strong>parent</strong> (<em>str</em>) – Name of node that will be the parent.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.path_join">
<code class="descname">path_join</code><span class="sig-paren">(</span><em>path_base</em>, <em>path_tail</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#path_join"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.path_join" title="Permalink to this definition"></a></dt>
<dd><p>Take the incoming path and file and use os.path.join to create a new file path. Then replace all
back slashes with forward slashes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>path_base</strong> (<em>str</em>) – First part of path to join.</li>
<li><strong>path_tail</strong> (<em>str</em>) – Second part of path to join.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Joined path with proper separators.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">str</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.path_unify">
<code class="descname">path_unify</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#path_unify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.path_unify" title="Permalink to this definition"></a></dt>
<dd><p>Take the incoming path and replace back slashes with forward slashes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> (<em>str</em>) – Incoming path to manipulate.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Corrected path with correct separators.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.read_clipboard">
<code class="descname">read_clipboard</code><span class="sig-paren">(</span><em>clipboard</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#read_clipboard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.read_clipboard" title="Permalink to this definition"></a></dt>
<dd><p>Given a clipboard file, read and return the data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>clipboard</strong> – File path of the clipboard file.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Data from file.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.rename_object">
<code class="descname">rename_object</code><span class="sig-paren">(</span><em>pynode</em>, <em>new_name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#rename_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.rename_object" title="Permalink to this definition"></a></dt>
<dd><p>Renames the incoming PyNode with the given new name.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>pynode</strong> (<em>pymel.core.PyNode</em>) – PyNode that represents the object to rename.</li>
<li><strong>new_name</strong> (<em>str</em>) – The new name for the node.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.retrieve_clipboard">
<code class="descname">retrieve_clipboard</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#retrieve_clipboard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.retrieve_clipboard" title="Permalink to this definition"></a></dt>
<dd><p>Return the file path to the clipboard with the given name</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> – the name of the clipboard file</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The full file path to the clipboard</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.return_settings">
<code class="descname">return_settings</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#return_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.return_settings" title="Permalink to this definition"></a></dt>
<dd><p>Returns ARTv2 settings for the paths to various needed directories.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Array of path names to directories needed by the tools.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">str, []</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.save_to_file">
<code class="descname">save_to_file</code><span class="sig-paren">(</span><em>path</em>, <em>data</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#save_to_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.save_to_file" title="Permalink to this definition"></a></dt>
<dd><p>Dumps the given data (using JSON) to the given path.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>path</strong> – Path to write data to on disk.</li>
<li><strong>data</strong> – Data to dump to file.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.set_attribute">
<code class="descname">set_attribute</code><span class="sig-paren">(</span><em>node</em>, <em>attr</em>, <em>value</em>, <em>attr_type=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#set_attribute"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.set_attribute" title="Permalink to this definition"></a></dt>
<dd><p>Sets an attribute on the given node to the given value. Ensures node and attribute is unlocked before doing so, and
re-locks them after.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>node</strong> (<em>pm.PyNode</em>) – Node to set attribute on.</li>
<li><strong>attr</strong> (<em>str</em>) – Attribute on node to set.</li>
<li><strong>value</strong> (<em>float</em><em>, </em><em>int</em><em>, </em><em>bool</em><em>, </em><em>string</em>) – Value to set attribute to.</li>
<li><strong>attr_type</strong> (<em>str</em>) – Whether or not a special type needs to be defined (string, bool, etc)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.strip_name">
<code class="descname">strip_name</code><span class="sig-paren">(</span><em>name_to_strip</em>, <em>prefix</em>, <em>base_name</em>, <em>suffix</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#strip_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.strip_name" title="Permalink to this definition"></a></dt>
<dd><p>Strip a name down to whatever is left after removing the prefix, base name, and suffix.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name_to_strip</strong> (<em>str</em>) – The name to tokenize.</li>
<li><strong>prefix</strong> (<em>str</em>) – The prefix to remove from the name.</li>
<li><strong>base_name</strong> (<em>str</em><em>, </em><em>None</em>) – The base name of the component to remove from the name.</li>
<li><strong>suffix</strong> (<em>str</em>) – The suffix to remove from the name.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The name with the prefix, suffix, and base name removed.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">str</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="artv2.utilities.general_utilities.validate_integer">
<code class="descname">validate_integer</code><span class="sig-paren">(</span><em>value</em>, <em>int_min</em>, <em>int_max</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/artv2/utilities/general_utilities.html#validate_integer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#artv2.utilities.general_utilities.validate_integer" title="Permalink to this definition"></a></dt>
<dd><p>Given a value, validate that it is a whole number that is greater than or equal to the minimum and less than or
equal to the maximum given values.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>value</strong> – The value to check</li>
<li><strong>int_min</strong> – The minimum the value can be</li>
<li><strong>int_max</strong> – The maximum the value can be</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">(bool) True if value is meets conditions. False otherwise.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="component_utils.html" class="btn btn-neutral float-right" title="Component Utilities" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="utilities.html" class="btn btn-neutral float-left" title="Utilities" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, Jeremy Ernst

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>