Skip to content

Commit 635d639

Browse files
author
Siew Yi Liang
committed
generated initial docset and fixed scripts
1 parent 25717d1 commit 635d639

20,352 files changed

Lines changed: 7178854 additions & 9 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/generate_database_entries.py

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ def write_entry_for_class(cur, class_name, path, docs_root, mudbox_version):
3636

3737
# Now start finding items within the class pages to add
3838
# additional entries for
39-
html = open(os.path.join(docs_root, path)).read()
39+
try:
40+
html = open(os.path.join(docs_root, path)).read()
41+
except:
42+
print('Failed to read file: {}'.format(path))
43+
return
44+
4045
soup = BeautifulSoup(html, 'html.parser')
4146

4247
for h2 in soup.find_all('h2', {'class': 'groupheader'}):
@@ -134,35 +139,63 @@ def write_entries(database_file_path, filenames, docs_root, mudbox_version='2018
134139
logger = logging.getLogger(__name__)
135140
conn = sqlite3.connect(database_file_path, timeout=timeout)
136141
cur = conn.cursor()
137-
hwRenderPrefix = 'class_m_h_w_render_1_1_'
142+
# NOTE: This is present in some of the HTML files for some weird reason.
143+
weird_substring = '_1_1_'
138144
for f in filenames:
139145
if os.path.splitext(f)[-1] == '.html':
140146
if '-members' in f:
141147
continue
142148

143-
if f.startswith(hwRenderPrefix):
144-
class_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(f)[0].split(hwRenderPrefix)[-1].split('_')])
149+
if weird_substring in f:
150+
sanitized_filename = f.replace(weird_substring, '_')
151+
else:
152+
sanitized_filename = f
153+
154+
if f.startswith('class_'):
155+
try: class_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(sanitized_filename)[0].split('class_')[-1].split('_')])
156+
except:
157+
print('error occurred trying to parse: {}'.format(f))
158+
continue
159+
print('class name determined as: {}'.format(class_name))
145160
write_entry_for_class(cur, class_name, f, docs_root, mudbox_version)
146161

147-
elif f.startswith('class_'):
148-
try: class_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(f)[0].split('class_')[-1].split('_')])
162+
elif f.startswith('classmudbox_'):
163+
try:
164+
class_name = 'mudbox::' + ''.join([a[0].upper() + a[1:] for a in os.path.splitext(sanitized_filename)[0].split('classmudbox_')[-1].split('_')])
149165
except:
150166
print('error occurred trying to parse: {}'.format(f))
151167
continue
168+
print('class name determined as: {}'.format(class_name))
152169
write_entry_for_class(cur, class_name, f, docs_root, mudbox_version)
153170

154171
elif f.startswith('struct_'):
155-
struct_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(f)[0].split('struct_')[-1].split('_') if a])
172+
struct_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(sanitized_filename)[0].split('struct_')[-1].split('_') if a])
173+
print('struct name determined as: {}'.format(struct_name))
174+
cur.execute('INSERT OR IGNORE INTO searchIndex(name, type, path)'
175+
' VALUES (\'{name}\', \'Struct\', \'{path}\')'.format(name=struct_name, path=f))
176+
177+
# NOTE: Again, because the documentation is inconsistent with the prefixes.
178+
elif f.startswith('structmudbox_'):
179+
struct_name = 'mudbox::' + ''.join([a[0].upper() + a[1:] for a in os.path.splitext(sanitized_filename)[0].split('structmudbox_')[-1].split('_')])
180+
print('struct name determined as: {}'.format(struct_name))
181+
cur.execute('INSERT OR IGNORE INTO searchIndex(name, type, path)'
182+
' VALUES (\'{name}\', \'Struct\', \'{path}\')'.format(name=struct_name, path=f))
183+
184+
elif f.startswith('structadsk_'):
185+
struct_name = 'adsk::' + ''.join([a[0].upper() + a[1:] for a in os.path.splitext(sanitized_filename)[0].split('structadsk_')[-1].split('_')])
186+
print('struct name determined as: {}'.format(struct_name))
156187
cur.execute('INSERT OR IGNORE INTO searchIndex(name, type, path)'
157188
' VALUES (\'{name}\', \'Struct\', \'{path}\')'.format(name=struct_name, path=f))
158189

159190
elif f.startswith('namespace'):
160-
namespace_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(f)[0].replace('namespace', '').split('_') if a])
191+
namespace_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(sanitized_filename)[0].replace('namespace', '').split('_') if a])
192+
print('namespace name determined as: {}'.format(namespace_name))
161193
cur.execute('INSERT OR IGNORE INTO searchIndex(name, type, path)'
162194
' VALUES (\'{name}\', \'Namespace\', \'{path}\')'.format(name=namespace_name, path=f))
163195

164196
elif '-example' in f:
165-
example_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(f)[0].split('-example')[0].split('_') if a]) + 'Example'
197+
example_name = ''.join([a[0].upper() + a[1:] for a in os.path.splitext(sanitized_filename)[0].split('-example')[0].split('_') if a]) + 'Example'
198+
print('example name determined as: {}'.format(example_name))
166199
cur.execute('INSERT OR IGNORE INTO searchIndex(name, type, path)'
167200
' VALUES (\'{name}\', \'Sample\', \'{path}\')'.format(name=example_name, path=f))
168201

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleIdentifier</key>
6+
<string>mudbox_2018_cpp_reference</string>
7+
<key>CFBundleName</key>
8+
<string>Mudbox 2018 C++ Reference</string>
9+
<key>DashDocSetFamily</key>
10+
<string>dashtoc</string>
11+
<key>DocSetPlatformFamily</key>
12+
<string>mudbox18</string>
13+
<key>isDashDocset</key>
14+
<true/>
15+
<key>isJavascriptEnabled</key>
16+
<true/>
17+
</dict>
18+
</plist>
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<!-- saved from url=(0024)http://docs.autodesk.com -->
2+
<html>
3+
<head><script src="../scripts/yepnope.1.5.4-min.js" type="text/javascript"></script><script src="../scripts/lib/jquery-1.11.1.min.js" type="text/javascript"></script><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta content="MOBPRO" name="product"/><meta content="2018" name="release"/><meta content="GeneralUser" name="book"/><meta content="2017-09-08" name="created"/><meta content="GUID-02FA7DD3-6C7A-4C6A-B7BC-824765AE1CB2" name="topicid"/><meta content="concept" name="topic-type"/>
4+
<title>AutoExtract/AutoExtract.cpp</title>
5+
</head>
6+
<body height="100%"><div class="body_content" id="body-content"><link href="../style/navtree.css" rel="stylesheet" type="text/css"/><link href="../style/doxygen.css" rel="stylesheet" type="text/css"/><link href="../style/tabs.css" rel="stylesheet" type="text/css"/><link href="../style/adsk.cpm.css" rel="stylesheet" type="text/css"/><script language="javascript">var index = 'index.html';</script><script>$(document).ready(function() { yepnope.injectJs("./scripts/ac_common.js"); });</script><script type="text/javascript">
7+
var tocSystemNeedsToBeLoaded = typeof(cpp_ref_adsk_ref_toc) == 'undefined';
8+
var weAreIn21 = $('div#main.view-active').length;
9+
var tocPrefix = '';
10+
if (weAreIn21)
11+
{ tocPrefix = 'cpp_ref/'; }
12+
function cpp_ref_initializeToc(forceTrigger) {
13+
cpp_ref_adsk_ref_toc.initResizable();
14+
cpp_ref_adsk_ref_toc.initNavTree('_auto_extract_2_auto_extract_8cpp-example.html', tocPrefix);
15+
dQuery(document).trigger('toc_initialized');
16+
}
17+
if (tocSystemNeedsToBeLoaded)
18+
{
19+
yepnope([{
20+
load:[tocPrefix + 'json3.min.js', tocPrefix + 'jquery.js', tocPrefix + 'ref-toc-controller.js', tocPrefix + 'dynsections.js'],
21+
complete: function() {
22+
if (typeof(dQuery) == 'undefined')
23+
{
24+
dQuery = jQuery.noConflict(true);
25+
}
26+
else { jQuery.noConflict(true); }
27+
$(document).ready(cpp_ref_initializeToc);
28+
}
29+
}])
30+
}
31+
if (!weAreIn21) { // if in AKN...
32+
$(window).load( function() {
33+
setTimeout( function() {
34+
var content = $('body > div').not('#body-content'); // take any divs under body that are not id=body-content
35+
content.each( function() {
36+
$(this).css( { 'padding-left': $(this).css('margin-left') } ); // and if they have any padding-left already, move it to margin-left.
37+
} );
38+
var width = cpp_ref_adsk_ref_toc.readFromStorage('width');
39+
content.css({marginLeft:parseInt(width)+6+"px"});
40+
}, 100);
41+
} );
42+
}
43+
</script><script>$("div#WidgetFloaterPanels,link[href*='microsofttranslator.com'],script[src*='microsofttranslator.com'],script[src*='bing.com']").remove();</script><script type="text/javascript">$("div#navigation,div#breadcrumbs,div#banner").attr("translate","no"); var mtLocation = ((location && location.href && location.href.indexOf('https') == 0)?'https://ssl.microsofttranslator.com':'http://www.microsofttranslator.com')+'/ajax/v3/WidgetV3.ashx?ctf=True&ui=true&settings=Manual&from=en&hidelanguages='; yepnope.injectJs(mtLocation, function() {}, { charset:'utf-8', type:'text/javascript' } );</script><script>
44+
if (!tocSystemNeedsToBeLoaded) { cpp_ref_initializeToc(); }
45+
</script><!-- begin MT -->
46+
<div class="Dark" id="MicrosoftTranslatorWidget" style="float:right;z-index:100;color:white;background-color:#bbbbbb;height:58px;overflow:hidden"></div>
47+
<div>
48+
<div class="head">
49+
<h1>AutoExtract/AutoExtract.cpp</h1>
50+
</div>
51+
<div id="top"><!-- Generated by Doxygen 1.8.10 -->
52+
<div class="tabs" id="navrow1">
53+
<ul class="tablist">
54+
<li><a href="./index.html"><span>Main Page</span></a></li>
55+
<li><a href="./pages.html"><span>Topics</span></a></li>
56+
<li><a href="./modules.html"><span>Modules</span></a></li>
57+
<li><a href="./namespaces.html"><span>Namespaces</span></a></li>
58+
<li><a href="./annotated.html"><span>Classes</span></a></li>
59+
<li><a href="./files.html"><span>Files</span></a></li>
60+
<li><a href="./examples.html"><span>Examples</span></a></li>
61+
</ul>
62+
</div>
63+
</div><!-- top -->
64+
<div class="ui-resizable side-nav-resizable" id="side-nav">
65+
<div id="nav-tree">
66+
<div id="nav-tree-contents">
67+
<div class="sync" id="nav-sync"></div>
68+
</div>
69+
</div>
70+
<div class="ui-resizable-handle" id="splitbar" style="-moz-user-select:none;">
71+
</div>
72+
</div>
73+
<div id="doc-content">
74+
<div class="header">
75+
<div class="headertitle">
76+
<div class="title">AutoExtract/AutoExtract.cpp</div> </div>
77+
</div><!--header-->
78+
<div class="contents">
79+
<div class="fragment"><div class="line"><span class="preprocessor">#include "AutoExtract.h"</span></div>
80+
<div class="line"></div>
81+
<div class="line"><span class="comment">// The single instance of this class will sit in the memory for the whole session, and watch for map extraction nodes.</span></div>
82+
<div class="line"><span class="comment">// When it finds a map extraction node with a specific name, it will execute it, then exit mudbox.</span></div>
83+
<div class="line">AutoExtract g_cInstance;</div>
84+
<div class="line"></div>
85+
<div class="line"><a name="a0"></a><a class="code" href="./node_8h.html#a1d51ad935ab5d26fe95dff62601b602c">IMPLEMENT_CLASS</a>( AutoExtract, Node, <span class="stringliteral">"autoextract"</span> );</div>
86+
<div class="line"></div>
87+
<div class="line">AutoExtract::AutoExtract( <span class="keywordtype">void</span> ) :</div>
88+
<div class="line"> FileEvent( this )</div>
89+
<div class="line">{</div>
90+
<div class="line"> <span class="comment">// The FileEvent attribute of this node is connected to Mudbox's main FileEvent node.</span></div>
91+
<div class="line"> <span class="comment">// When anything happens involving files, this node will be notified, and the OnNodeEvent</span></div>
92+
<div class="line"> <span class="comment">// method will be called.</span></div>
93+
<div class="line"> FileEvent.Connect( <a name="a1"></a><a class="code" href="./namespacemudbox.html#ae9df9ee935ec6744f98a1585d9db01df">Kernel</a>()-&gt;FileEvent );</div>
94+
<div class="line">};</div>
95+
<div class="line"></div>
96+
<div class="line"><span class="keywordtype">void</span> AutoExtract::OnNodeEvent( <span class="keyword">const</span> Attribute &amp;<a class="code" href="./_g_lee_8h.html#ac8729153468b5dcf13f971b21d84d4e5">a</a>, <a name="a2"></a><a class="code" href="./namespacemudbox.html#a8d88d2a841f889dace76ffcd8d6b06da">NodeEventType</a> <a class="code" href="./_g_lee_8h.html#a653819996e713edf9c01a5b564199189">t</a> )</div>
97+
<div class="line">{</div>
98+
<div class="line"> <span class="comment">// This method is called when any kind of event happens to any attribute of this node.</span></div>
99+
<div class="line"> <span class="comment">// So we need to check to make sure it is the right kind of event on the right</span></div>
100+
<div class="line"> <span class="comment">// attribute. We are interested in the "post-read" event, which is called after any kind of file</span></div>
101+
<div class="line"> <span class="comment">// is read into Mudbox. We look at the file name to be sure it is a scene (.mud) file, because</span></div>
102+
<div class="line"> <span class="comment">// this same event will be triggered when Mudbox reads image files, stamps, stencils, etc.</span></div>
103+
<div class="line"> <span class="keywordflow">if</span> ( t == <a name="a3"></a><a class="code" href="./namespacemudbox.html#a8d88d2a841f889dace76ffcd8d6b06daa274758890f9a27906be7336f4b8e4780">etValueChanged</a> &amp;&amp; a == FileEvent &amp;&amp; FileEvent.Value() )</div>
104+
<div class="line"> {</div>
105+
<div class="line"> <span class="keywordflow">if</span> ( FileEvent-&gt;m_eType == FileEventNotifier::typePostRead &amp;&amp; FileEvent-&gt;m_sFileName.right( 4 ) == <a name="a4"></a><a class="code" href="./i18n_8h.html#a1b7f65502ea5b58cca15f85d9e78ca06">NTRQ</a>( <span class="stringliteral">".mud"</span> ) )</div>
106+
<div class="line"> {</div>
107+
<div class="line"> <span class="comment">// We could go ahead here and do the extraction, but instead we are going to</span></div>
108+
<div class="line"> <span class="comment">// request a "deferred" event, just in case Mudbox is still in the middle of</span></div>
109+
<div class="line"> <span class="comment">// setting up the new scene. When you do this, the same event is sent back</span></div>
110+
<div class="line"> <span class="comment">// when Mudbox is idle, with "t" set to "etDeferred". This allows you to </span></div>
111+
<div class="line"> <span class="comment">// process the event when everything has settled down.</span></div>
112+
<div class="line"> <span class="comment">//</span></div>
113+
<div class="line"> RequestDeferredEvent( FileEvent );</div>
114+
<div class="line"> };</div>
115+
<div class="line"> };</div>
116+
<div class="line"></div>
117+
<div class="line"> <span class="comment">// If we have received the deferred event, it is time to extract the maps.</span></div>
118+
<div class="line"> <span class="keywordflow">if</span> ( t == <a name="a5"></a><a class="code" href="./namespacemudbox.html#a8d88d2a841f889dace76ffcd8d6b06daae018520c41749d40418c6d9dcd72fde9">etDeferred</a> &amp;&amp; a == FileEvent )</div>
119+
<div class="line"> {</div>
120+
<div class="line"> <span class="keywordtype">bool</span> bHadExtraction = <span class="keyword">false</span>;</div>
121+
<div class="line"></div>
122+
<div class="line"> <span class="comment">// Look at all the nodes in the mudbox scene, and find the map extraction nodes.</span></div>
123+
<div class="line"> <span class="comment">// (An "operation" in the UI is stored as a Node in the scene.)</span></div>
124+
<div class="line"> <span class="keywordflow">for</span> ( Node *pNode = Node::First(); pNode; pNode = pNode-&gt;Next() )</div>
125+
<div class="line"> {</div>
126+
<div class="line"> <span class="keywordflow">if</span> ( pNode-&gt;IsKindOf( MapExtractor::StaticClass() ) )</div>
127+
<div class="line"> {</div>
128+
<div class="line"> MapExtractor *pE = <span class="keyword">dynamic_cast&lt;</span>MapExtractor *<span class="keyword">&gt;</span>( pNode );</div>
129+
<div class="line"> <a name="a6"></a><a class="code" href="./mudbox_8h.html#a99d9d5b4fd434c7a38c2add8217e4c14">MB_SAFELY</a>( pE )</div>
130+
<div class="line"> {</div>
131+
<div class="line"> <span class="comment">// Look for the string "autoextract" in the node's name, and disregard</span></div>
132+
<div class="line"> <span class="comment">// any nodes that do not contain it.</span></div>
133+
<div class="line"> <a name="_a7"></a><a class="code" href="./class_q_string.html">QString</a> sName = pE-&gt;Name();</div>
134+
<div class="line"> <span class="keywordflow">if</span> ( sName.<a name="a8"></a><a class="code" href="./class_q_string.html#aaa6704aa527a375c50ac92dbb25b3a5a">indexOf</a>( <span class="stringliteral">"autoextract"</span> ) != -1 )</div>
135+
<div class="line"> {</div>
136+
<div class="line"> <span class="comment">// Execute the map extraction in silent mode, which means the UI will not be visible (but the progress bar will)</span></div>
137+
<div class="line"> <span class="comment">// and there will be no confirmation dialog boxes that could stop it from running.</span></div>
138+
<div class="line"> pE-&gt;Execute( <span class="keyword">false</span> );</div>
139+
<div class="line"></div>
140+
<div class="line"> bHadExtraction = <span class="keyword">true</span>;</div>
141+
<div class="line"> };</div>
142+
<div class="line"> };</div>
143+
<div class="line"> };</div>
144+
<div class="line"> };</div>
145+
<div class="line"></div>
146+
<div class="line"> <span class="comment">// If any extractions were done, quit mudbox.</span></div>
147+
<div class="line"> <span class="keywordflow">if</span> ( bHadExtraction )</div>
148+
<div class="line"> <a name="a9"></a><a class="code" href="./class_q_core_application.html#aaa27c80c06b25695d1038ef540fea485">QCoreApplication::exit</a>();</div>
149+
<div class="line"> };</div>
150+
<div class="line">};</div>
151+
</div><!-- fragment --> </div><!-- contents -->
152+
</div><!-- doc-content -->
153+
<div class="footer-block"><a class="comments-anchor" href="../html/ac.cmtdialog.htm" target="_blank"><span class="comments-link">Please send us your comment about this page</span></a></div></div>
154+
</div></body>
155+
</html>

0 commit comments

Comments
 (0)